Shaders: fix the AMD RDNA 4 compiler crash: a buffer's size through a non-uniform handle of its own (DexNom PR 62) #559

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

@⁠BackseatDrivers-Unbound on GitHub · 2026-11-28 00:54 UTC · original
BackseatDrivers-Unbound:rdna4-size-handle → main · +40 −1 · 2 files · 1 commits · open

The shader fix from #504, as you asked: nothing else in this PR (2 files, +40/-1).

What it fixes. On AMD RDNA 4, the driver's shader compiler crashes the whole game (amdxc64.dll+0x861b9f) on 10 of the title's compute shaders: tree/particle culling f16876929fa64f9f, 878933b499cfa14d, a567b9ef845fb680, c1eee35dbc50a9ef, and ray-tracing resolve a4df980a1c65fdbe, d0130073bb6f7a7d, 7b956e1f6d56609f, 0ae69044bfd15035, d2c52fcd936985b4, 1e4947eada3d9ee3. Probably also #239 (RX 9060 XT).

How. In descriptor_data, the buffer size query now gets a heap handle of its own (the loads' raw twin index included), marked non-uniform and not counted in nonuniform_handles, instead of sharing the uniform handle the loads use (crates/victory-shader/src/emit/lower/amd.rs, called from lower.rs). The approach is IxMxAMAR's (fxceless/victory-fork#1213); Toucann turned it into DexNom/VIctory PR 62; this is the size-query part of that, ported unchanged.

Tested on an RX 9070 XT (driver 32.0.32029.2010) on top of 64d4931b:

  • compiling those shaders on their own in a child process: all 10 crash without it, none with it (plus a control shader that builds either way);
  • cargo test -p victory-shader -- --test-threads=1: passes (one test, size_tests::the_record_count_of_a_structured_buffer_read_by_index, crashes the test process on 29d8dbf7 too, before this change, so it was skipped);
  • play sessions on the Series X profile with no crashes: on 64d4931b five sessions with ray tracing off; on 29d8dbf7 (same fix) ray tracing off and on.
    Not tested on NVIDIA cards. It only changes how the size query's handle is made; DexNom's evaluation of PR 62 found its other outputs byte-identical and the changed shaders computing the same values.

No version to bump: the shader cache keys on the BLAKE3 of victory-shader's sources, so older cached translations aren't served.

🤖 Generated with Claude Code

**@⁠BackseatDrivers-Unbound** on GitHub · 2026-11-28 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/559) `BackseatDrivers-Unbound:rdna4-size-handle` → `main` · +40 −1 · 2 files · 1 commits · open The shader fix from #504, as you asked: nothing else in this PR (2 files, +40/-1). **What it fixes.** On AMD RDNA 4, the driver's shader compiler crashes the whole game (`amdxc64.dll+0x861b9f`) on 10 of the title's compute shaders: tree/particle culling `f16876929fa64f9f`, `878933b499cfa14d`, `a567b9ef845fb680`, `c1eee35dbc50a9ef`, and ray-tracing resolve `a4df980a1c65fdbe`, `d0130073bb6f7a7d`, `7b956e1f6d56609f`, `0ae69044bfd15035`, `d2c52fcd936985b4`, `1e4947eada3d9ee3`. Probably also #239 (RX 9060 XT). **How.** In `descriptor_data`, the buffer size query now gets a heap handle of its own (the loads' raw twin index included), marked non-uniform and not counted in `nonuniform_handles`, instead of sharing the uniform handle the loads use (`crates/victory-shader/src/emit/lower/amd.rs`, called from `lower.rs`). The approach is IxMxAMAR's (fxceless/victory-fork#1213); Toucann turned it into DexNom/VIctory PR 62; this is the size-query part of that, ported unchanged. **Tested** on an RX 9070 XT (driver 32.0.32029.2010) on top of `64d4931b`: - compiling those shaders on their own in a child process: all 10 crash without it, none with it (plus a control shader that builds either way); - `cargo test -p victory-shader -- --test-threads=1`: passes (one test, `size_tests::the_record_count_of_a_structured_buffer_read_by_index`, crashes the test process on `29d8dbf7` too, before this change, so it was skipped); - play sessions on the Series X profile with no crashes: on `64d4931b` five sessions with ray tracing off; on `29d8dbf7` (same fix) ray tracing off and on. Not tested on NVIDIA cards. It only changes how the size query's handle is made; DexNom's evaluation of PR 62 found its other outputs byte-identical and the changed shaders computing the same values. No version to bump: the shader cache keys on the BLAKE3 of victory-shader's sources, so older cached translations aren't served. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AMD's compiler (amdxc64.dll+0x861b9f, RX 9070 XT, driver 32.0.32029.2010) crashes building
pipelines whose buffer size query shares the uniform heap handle the loads use. The size now
gets a heap handle of its own (the loads' raw twin index included), marked non-uniform and not
counted in nonuniform_handles. Ported from Belobug's 1e35ff55 (original 2152e55b, size-query
part only). The approach is IxMxAMAR's (fxceless/victory-fork#1213);
the fix is Toucann's (DexNom/VIctory PR 62).

No version to bump here: the shader cache keys on the BLAKE3 of victory-shader's sources
(victory-gpu build.rs), so translations cached before this are not served.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 00:55:38 +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/559/head:github-bot/gh-559'
git switch 'github-bot/gh-559'

Merge

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