Shaders: a buffer's size is asked through a non-uniform handle of its own (AMD's compiler crash at amdxc64.dll+0x861b9f) #1210

Open
IxMxAMAR wants to merge 1 commit from upstream-pr/1213 into main
IxMxAMAR commented 2026-11-26 00:15:06 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by IxMxAMAR on 2026-11-26T00:15:06Z.


Fixes the AMD shader-compiler crash at amdxc64.dll+0x861b9f (a null read) for the title's compute programs that read a buffer's size from its descriptor. Reports of that offset: #120, #145, #505, #881 here; Marvisak/VIctory#1783, #1785 and #2517 upstream.

Cause

  • AMD's compiler crashes compiling a buffer's getDimensions through the uniform heap handle that the buffer's loads use, and the process ends.
  • Five of the title's compute programs did this on main 32b31f7, each made alone with victory translate --pipelines (RX 9070 XT, driver 32.0.32029.2010):
    • f16876929fa64f9f bvh_skinning:CSComputeSkinningTreeAnimVelocity
    • 878933b499cfa14d bvh_skinning:CSComputeSkinningTreeAnim
    • a567b9ef845fb680 bvh_skinning:CSComputeTreeAnim
    • c1eee35dbc50a9ef GpuParticleUpdate:CS_UpdateSkinnedAttachMeshTreeParticles
    • 27ce027e7188bed3 ped_standard_lod_muv_emissive:CS_RaytracingResolve
  • With every clean-up pass off (VICTORY_SHADER_OPT=0), the first and the fourth still crashed.

Change

  • descriptor_data makes a heap handle of its own for a buffer's size, marked non-uniform (Shader::size_handle). It isn't counted in nonuniform_handles, since its index is the same in every lane.
  • A descriptor loaded per lane keeps its handle, which is already non-uniform.
  • With this, all five compile.
  • The idea, and the test's program, are those of #452 (MalfoyDraco99, credited as co-author), rebased onto main.

Relation to #984

  • #984 keeps one index clamp per heap handle through the clean-up. On this card that rescues three of the five (878933b499cfa14d, a567b9ef845fb680, 27ce027e7188bed3); the other two still crash.
  • This change alone fixes all five. The two don't conflict.

Tests

  • New dims_tests: the program's pipeline compiles on the hardware GPU and on WARP. On the RX 9070 XT without the change, the test process ends inside amdxc64.dll.
  • cargo test -p victory-shader -p victory-gpu --all-features on 32b31f7: victory-shader 217 passed. victory-gpu 202 passed and 1 failed: indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which fails the same way here without this change (3 of 3 runs each way).
  • Clippy: nothing new.
  • victory translate shaders.rpf --pipelines over the whole archive with this change: every emitted program got its host pipeline (14,199 vertex/pixel, 2,675 compute, 8,762 mesh), and nothing crashed. Without it, each of the five above ends the process.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6616503786 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1213). Originally posted by [IxMxAMAR](https://github.com/IxMxAMAR) on 2026-11-26T00:15:06Z. --- Fixes the AMD shader-compiler crash at `amdxc64.dll+0x861b9f` (a null read) for the title's compute programs that read a buffer's size from its descriptor. Reports of that offset: #120, #145, #505, #881 here; Marvisak/VIctory#1783, #1785 and #2517 upstream. **Cause** - AMD's compiler crashes compiling a buffer's `getDimensions` through the **uniform** heap handle that the buffer's loads use, and the process ends. - Five of the title's compute programs did this on `main` 32b31f7, each made alone with `victory translate --pipelines` (RX 9070 XT, driver 32.0.32029.2010): - `f16876929fa64f9f` `bvh_skinning:CSComputeSkinningTreeAnimVelocity` - `878933b499cfa14d` `bvh_skinning:CSComputeSkinningTreeAnim` - `a567b9ef845fb680` `bvh_skinning:CSComputeTreeAnim` - `c1eee35dbc50a9ef` `GpuParticleUpdate:CS_UpdateSkinnedAttachMeshTreeParticles` - `27ce027e7188bed3` `ped_standard_lod_muv_emissive:CS_RaytracingResolve` - With every clean-up pass off (`VICTORY_SHADER_OPT=0`), the first and the fourth still crashed. **Change** - `descriptor_data` makes a heap handle of its own for a buffer's size, marked non-uniform (`Shader::size_handle`). It isn't counted in `nonuniform_handles`, since its index is the same in every lane. - A descriptor loaded per lane keeps its handle, which is already non-uniform. - With this, all five compile. - The idea, and the test's program, are those of #452 (MalfoyDraco99, credited as co-author), rebased onto `main`. **Relation to #984** - #984 keeps one index clamp per heap handle through the clean-up. On this card that rescues three of the five (`878933b499cfa14d`, `a567b9ef845fb680`, `27ce027e7188bed3`); the other two still crash. - This change alone fixes all five. The two don't conflict. **Tests** - New `dims_tests`: the program's pipeline compiles on the hardware GPU and on WARP. On the RX 9070 XT without the change, the test process ends inside `amdxc64.dll`. - `cargo test -p victory-shader -p victory-gpu --all-features` on `32b31f7`: victory-shader 217 passed. victory-gpu 202 passed and 1 failed: `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields`, which fails the same way here without this change (3 of 3 runs each way). - Clippy: nothing new. - `victory translate shaders.rpf --pipelines` over the whole archive with this change: every emitted program got its host pipeline (14,199 vertex/pixel, 2,675 compute, 8,762 mesh), and nothing crashed. Without it, each of the five above ends the process.
IxMxAMAR commented 2026-11-26 02:08:44 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by IxMxAMAR on 2026-11-26T01:49:32Z.


In game on an RX 9070 XT (driver 32.0.32029.2010), 32b31f7 + this PR + #1195, only 42683eebec081520 skipped: the save we load uses f16876929fa64f9f (bvh_skinning:CSComputeSkinningTreeAnimVelocity). Run 23, without this PR, ended in amdxc64.dll+0x861b9f on it. With it, runs 24 and 25 (17 and 22 minutes, into the next mission) had no compiler crash.

jmehru/victory-amd-rx9070#5 hit the same four programs on an RX 9070 with the same driver and builds them with #195 + #452. This PR alone builds all five on 32b31f7.

Upstream, Marvisak/VIctory#1785 bisects the end of the same fault to 850b66f ("one handle per descriptor at a fixed address, and per join").

<!-- greyfinch-sync:fxceless/victory-fork:comment:7180173339 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1213#issuecomment-7180173339). Originally posted by [IxMxAMAR](https://github.com/IxMxAMAR) on 2026-11-26T01:49:32Z. --- In game on an RX 9070 XT (driver 32.0.32029.2010), 32b31f7 + this PR + #1195, only `42683eebec081520` skipped: the save we load uses `f16876929fa64f9f` (`bvh_skinning:CSComputeSkinningTreeAnimVelocity`). Run 23, without this PR, ended in `amdxc64.dll+0x861b9f` on it. With it, runs 24 and 25 (17 and 22 minutes, into the next mission) had no compiler crash. jmehru/victory-amd-rx9070#5 hit the same four programs on an RX 9070 with the same driver and builds them with #195 + #452. This PR alone builds all five on 32b31f7. Upstream, Marvisak/VIctory#1785 bisects the end of the same fault to 850b66f ("one handle per descriptor at a fixed address, and per join").
KingKaom commented 2026-11-26 15:04:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by KingKaom on 2026-11-26T14:55:37Z.


Confirmed on our side: merged #1213 into current tip 58de9bf (merge head 9dcdf08), release build, run on RX 9070 XT (RDNA4), driver 32.0.32029.2010.

  • On the base tip the fault reproduced exactly as in #1252/#1259 (0xc0000005 read of 0x8 at amdxc64.dll+0x861b9f); with the merge: zero first-chance and zero unhandled exceptions for the whole session.
  • Boot ran through 2212 shader translations and held a steady 30.0 fps (33 ms/frame) on the account picker for 10.5 minutes (killed by us); card ~4% busy at the picker, 13 draws/frame.
  • Keyboard stand-in (Enter, 2 s holds, foreground-verified) is ignored at the picker — the same controller-only gate every fork reports, not compiler-related.

This is the furthest this fork has come on our card. Thanks for the diagnosis.

Tested on RX 9070 XT (RDNA4), measured
AI-assisted (Hermes Agent)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7195532782 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1213#issuecomment-7195532782). Originally posted by [KingKaom](https://github.com/KingKaom) on 2026-11-26T14:55:37Z. --- Confirmed on our side: merged `#1213` into current tip `58de9bf` (merge head `9dcdf08`), release build, run on RX 9070 XT (RDNA4), driver 32.0.32029.2010. - On the base tip the fault reproduced exactly as in #1252/#1259 (`0xc0000005` read of `0x8` at `amdxc64.dll+0x861b9f`); with the merge: **zero first-chance and zero unhandled exceptions** for the whole session. - Boot ran through 2212 shader translations and held a steady **30.0 fps (33 ms/frame)** on the account picker for 10.5 minutes (killed by us); card ~4% busy at the picker, 13 draws/frame. - Keyboard stand-in (Enter, 2 s holds, foreground-verified) is ignored at the picker — the same controller-only gate every fork reports, not compiler-related. This is the furthest this fork has come on our card. Thanks for the diagnosis. Tested on RX 9070 XT (RDNA4), measured <sub>AI-assisted (Hermes Agent)</sub>
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/1213:upstream-pr/1213'
git switch 'upstream-pr/1213'

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/1213'
git switch 'upstream-pr/1213'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1213'
git switch 'upstream-pr/1213'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1213'
git switch 'main'
git merge --squash 'upstream-pr/1213'
git switch 'main'
git merge --ff-only 'upstream-pr/1213'
git switch 'main'
git merge 'upstream-pr/1213'
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
fxceless/victory-fork!1210
No description provided.