GPU: RDNA4 hosts leave the reuse clean-up pass out by default (amdxc64.dll fault at startup) #179

Open
a-to-z wants to merge 1 commit from upstream-pr/179 into main
a-to-z commented 2026-11-26 10:33:19 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by a-to-z on 2026-11-26T10:33:19Z.


Replaces #167, whose diagnosis (a race between compile threads) did not hold.

Problem

On an RX 9070 XT (RDNA4, PCI 1002:7550, driver 32.0.32029.2010) the title crashes during Game Init, every run:

unhandled exception 0xc0000005 at amdxc64.dll+0x861b9f (read 0x8: nothing mapped there)
  ... amdxc64.dll -> D3D12Core.dll -> victory.exe (pipeline creation)

It happens on the first compile of one compute program, 052a2316a03b9ba1 (8332 bytes; about 4,250 lines of DXIL with 717 FMad, 588 selects and 60 phis), with or without VICTORY_LIBRARY_LOCK=1.

What triggers it

Bisected with VICTORY_SHADER_OPT (2-3 minute runs each):

Passes Result
63 (default), 7 fault at the same address
0, 1, 2, 4, 3, 5, 6, 56 runs (to frames 1,600-3,600)
59 (no REUSE), 62 (no DEAD) runs

Only DEAD + FOLD + REUSE together produce a module the RDNA4 compiler faults on.

Change

  • emit::shader_opt(): unset, VICTORY_SHADER_OPT now gives the host's default (set_host_shader_opt) instead of a fixed 63. Set, it wins as before. The parser returns None for unset or unreadable values. The shader cache already keys on shader_opt(), so nothing translated under the old set is reused.
  • host.rs: on an AMD RDNA4 adapter (Navi 48 0x7550/0x7551, Navi 44 0x7590) the default is DEFAULT & !REUSE (59), with a log line. Every other host, the 7900 XTX included, is unchanged.
  • emit::passes re-exports the pass bits.

Testing

  • RX 9070 XT, Series X profile, scripts/play.ps1 defaults: before, a fault at frame 51 every run; after, it reaches the intro cutscene and runs 3-4 minutes with no fault, with 052a2316a03b9ba1 translated and compiled.
  • cargo test -p victory-shader --lib the_clean_up_switch, cargo clippy -p victory-gpu -p victory-shader -- -D warnings.
  • Not measured: the frame-time cost of dropping REUSE on RDNA4. The driver does its own value numbering; that run was memory-bound on a 32 GB machine, so it says nothing about speed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6624711490 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/179). Originally posted by [a-to-z](https://github.com/a-to-z) on 2026-11-26T10:33:19Z. --- Replaces #167, whose diagnosis (a race between compile threads) did not hold. ## Problem On an RX 9070 XT (RDNA4, PCI `1002:7550`, driver 32.0.32029.2010) the title crashes during Game Init, every run: ``` unhandled exception 0xc0000005 at amdxc64.dll+0x861b9f (read 0x8: nothing mapped there) ... amdxc64.dll -> D3D12Core.dll -> victory.exe (pipeline creation) ``` It happens on the first compile of one compute program, `052a2316a03b9ba1` (8332 bytes; about 4,250 lines of DXIL with 717 `FMad`, 588 selects and 60 phis), with or without `VICTORY_LIBRARY_LOCK=1`. ## What triggers it Bisected with `VICTORY_SHADER_OPT` (2-3 minute runs each): | Passes | Result | |---|---| | 63 (default), 7 | fault at the same address | | 0, 1, 2, 4, 3, 5, 6, 56 | runs (to frames 1,600-3,600) | | 59 (no REUSE), 62 (no DEAD) | runs | Only DEAD + FOLD + REUSE together produce a module the RDNA4 compiler faults on. ## Change - `emit::shader_opt()`: unset, `VICTORY_SHADER_OPT` now gives the host's default (`set_host_shader_opt`) instead of a fixed 63. Set, it wins as before. The parser returns `None` for unset or unreadable values. The shader cache already keys on `shader_opt()`, so nothing translated under the old set is reused. - `host.rs`: on an AMD RDNA4 adapter (Navi 48 `0x7550`/`0x7551`, Navi 44 `0x7590`) the default is `DEFAULT & !REUSE` (59), with a log line. Every other host, the 7900 XTX included, is unchanged. - `emit::passes` re-exports the pass bits. ## Testing - RX 9070 XT, Series X profile, `scripts/play.ps1` defaults: before, a fault at frame 51 every run; after, it reaches the intro cutscene and runs 3-4 minutes with no fault, with `052a2316a03b9ba1` translated and compiled. - `cargo test -p victory-shader --lib the_clean_up_switch`, `cargo clippy -p victory-gpu -p victory-shader -- -D warnings`. - Not measured: the frame-time cost of dropping REUSE on RDNA4. The driver does its own value numbering; that run was memory-bound on a 32 GB machine, so it says nothing about speed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/179:upstream-pr/179'
git switch 'upstream-pr/179'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/179'
git switch 'upstream-pr/179'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/179'
git switch 'upstream-pr/179'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/179'
git switch 'main'
git merge --squash 'upstream-pr/179'
git switch 'main'
git merge --ff-only 'upstream-pr/179'
git switch 'main'
git merge 'upstream-pr/179'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!179
No description provided.