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

Open
github-bot wants to merge 1 commit from github-bot/gh-179 into main AGit
Owner

@⁠a-to-z on GitHub · 2026-11-26 10:33 UTC · original
a-to-z:fix/rdna4-shader-opt → main · +59 −14 · 2 files · 1 commits · open

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

**@⁠a-to-z** on GitHub · 2026-11-26 10:33 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/179) `a-to-z:fix/rdna4-shader-opt` → `main` · +59 −14 · 2 files · 1 commits · open 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)
On an RX 9070 XT (amdxc64.dll 32.0.32029.2010) the driver's compiler
faults reading address 8 (amdxc64.dll+0x861b9f) on the title's compute
program 052a2316a03b9ba1, bound during Game Init: every run, with or
without one pipeline call at a time. It compiles with any two of the
dead-code, constant and reuse passes, and with VICTORY_SHADER_OPT=0, 3, 5,
6, 56, 59 or 62; it faults with 7 and the default 63.

The default of VICTORY_SHADER_OPT is now the host's: the default set,
less REUSE on an RDNA4 adapter (PCI 1002:7550, 7551, 7590). The variable
still wins when set, and the shader cache keys on the passes in use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:21:50 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/179/head:github-bot/gh-179'
git switch 'github-bot/gh-179'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-179'
git switch 'github-bot/gh-179'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-179'
git switch 'github-bot/gh-179'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-179'
git switch 'main'
git merge --squash 'github-bot/gh-179'
git switch 'main'
git merge --ff-only 'github-bot/gh-179'
git switch 'main'
git merge 'github-bot/gh-179'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.