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

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

@⁠IxMxAMAR on GitHub · 2026-11-26 00:15 UTC · original
IxMxAMAR:shaders/amd-compiler-crash → main · +155 −2 · 4 files · 1 commits · open

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** on GitHub · 2026-11-26 00:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/1213) `IxMxAMAR:shaders/amd-compiler-crash` → `main` · +155 −2 · 4 files · 1 commits · open 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.
AMD's compiler (amdxc64.dll+0x861b9f; RX 9070 XT, driver 32.0.32029.2010) reads a null pointer
compiling a buffer's getDimensions through the uniform heap handle the buffer's loads use, and the
process ends. Five of the title's compute programs did so on main 32b31f7, each made alone with
`victory translate --pipelines`: f16876929fa64f9f (bvh_skinning:CSComputeSkinningTreeAnimVelocity),
878933b499cfa14d (CSComputeSkinningTreeAnim), a567b9ef845fb680 (CSComputeTreeAnim), c1eee35dbc50a9ef
(GpuParticleUpdate:CS_UpdateSkinnedAttachMeshTreeParticles) and 27ce027e7188bed3
(ped_standard_lod_muv_emissive:CS_RaytracingResolve). With every clean-up pass off
(VICTORY_SHADER_OPT=0) the first and the fourth still did.

descriptor_data now makes a heap handle of its own for a buffer's size, marked non-uniform
(Shader::size_handle; not counted in nonuniform_handles, its index being the same in every lane);
a descriptor loaded per lane keeps its handle, non-uniform already. All five compile. The idea,
and the test's program, are those of pull request #452, rebased onto main.

Test (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.

Co-authored-by: MalfoyDraco99 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:37 +00:00
Author
Owner

@⁠IxMxAMAR on GitHub · 2026-11-26 01:49 UTC · original

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").

**@⁠IxMxAMAR** on GitHub · 2026-11-26 01:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/1213#issuecomment-7180173339) 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").
Author
Owner

@⁠KingKaom on GitHub · 2026-11-26 14:55 UTC · original

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)

**@⁠KingKaom** on GitHub · 2026-11-26 14:55 UTC · [original](https://github.com/fxceless/victory-fork/pull/1213#issuecomment-7195532782) 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 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/1213/head:github-bot/gh-1213'
git switch 'github-bot/gh-1213'

Merge

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