Skip to content

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
IxMxAMAR wants to merge 1 commit into
fxceless:mainfrom
IxMxAMAR:shaders/amd-compiler-crash
Open

IxMxAMAR wants to merge 1 commit into
fxceless:mainfrom
IxMxAMAR:shaders/amd-compiler-crash

Conversation

@IxMxAMAR

Copy link
Copy Markdown

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 Shaders: mark buffer getDimensions heap handles non-uniform for AMD #452 (MalfoyDraco99, credited as co-author), rebased onto main.

Relation to #984

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.

…handle of its own, marked non-uniform (AMD's compiler crash)

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 fxceless#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 <171201207+MalfoyDraco99@users.noreply.github.com>
@IxMxAMAR

Copy link
Copy Markdown
Author

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

MrToucann pushed a commit to MrToucann/VIctory that referenced this pull request Nov 26, 2026
…ess/victory-fork#1213 does

The four size-read programs crash because the size query and the buffer's
loads use the same uniform heap handle. fxceless/victory-fork#1213
(IxMxAMAR) asks the size through a handle of its own, marked non-uniform and
not counted in nonuniform_handles. On the RX 9060 XT that clears all four
here too, without a digest list. It replaces the groupshared hoist and the
Module helpers it needed.

The nine programs that need one clean-up pass keep it by digest.

All 13 programs validate and create their pipelines on the RX 9060 XT;
cargo test -p victory-shader: 240 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
MrToucann pushed a commit to MrToucann/victory-fork that referenced this pull request Nov 26, 2026
…ram clean-up passes

fxceless#1213 asks a buffer's size through a non-uniform handle of its own. On the
RX 9060 XT that clears the size-read programs on its own, without a digest
list, so the groupshared hoist and the Module helpers it needed go. What
remains is what fxceless#1213 does not target. The constant-folding pass runs for
indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays, which ends the
process without it. The FACTS pass runs for the eight glints pixel programs.

This branch with fxceless#1213: all 13 programs validate and create their
pipelines. Alone, the two tree programs still fail, as they do without
fxceless#1213. cargo test -p victory-shader: 218 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
@KingKaom

Copy link
Copy Markdown

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.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants