Shaders: a buffer's size query through a heap handle of its own (RDNA 4 compiler crash on four tree-animation programs) #117
No reviewers
Labels
No labels
accessibility
bug
crash
documentation
duplicate
enhancement
good first issue
graphics
help wanted
invalid
needs logs
performance
question
rdna2
rdna3
rdna4
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/eikkapine--victory-amd!117
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-117"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@alexdeliu on GitHub · 2026-12-01 18:00 UTC · original
alexdeliu:fix/rdna4-size-query-handle→main· +50 −2 · 4 files · 23 commits · closed without mergingRefs #111, #49, #113. This fixes #111's four pipelines that always crash. I haven't tested the eight it says only crash when warmed in parallel, so #111 stays open.
What
On RDNA 4, AMD's D3D12 compiler (
amdxc64.dll+0x861b9f, read at 0x8, driver 32.0.32029.2010) crashes making the pipelines of four compute programs:f16876929fa64f9f,878933b499cfa14d,a567b9ef845fb680andc1eee35dbc50a9ef. These are the four in #111, and the tree-animation skinning and particle programs. #49 shows the first of them hanging the compiler for up to 17 minutes in play until the device is removed.It happens when a buffer's size (
getDimensions) is asked through the same uniform heap handle the buffer's loads use. With this change the size query gets a heap handle of its own (the loads' raw twin index included), marked non-uniform and not counted innonuniform_handles. What the programs compute does not change.VICTORY_SIZE_OWN_HANDLE(on unless0;0behaves as before). It's in the shader cache key with the other translator switches.TRANSLATOR_VERSION4 → 5, so caches rebuild once.emit/lower/amd.rs(new), one call and the module line inemit/lower.rs, the key entry inshader_cache.rs, and the version.This is a port of trustno1-coder/VIctory-NVIDIA#559 (BackseatDrivers-Unbound), which is the size-query part of DexNom/VIctory PR 62 (MrToucann). The approach is IxMxAMAR's (fxceless/victory-fork#1213). The switch and the cache key entry are new here. The same port went to readmet3xt-lab/foxhound#355.
Measured
Windows 11, RX 9070 (driver 32.0.32029.2010), Ryzen 7 7700 iGPU (RDNA 2, gfx1036), 31 GB RAM.
Each program on its own, one process each:
VICTORY_TRANSLATE_ONLY=<hash> victory translate --validate --pipelines <shaders.rpf>,VICTORY_D3D12_ADAPTER="RX 9070".main5d91fdeVICTORY_SIZE_OWN_HANDLE=0mainalready)Checks,
mainand this PR:main5d91fdecargo build --release --locked -p victorycargo test --locked -p victory-shader --lib, RX 9070, without the test belowVICTORY_D3D12_ADAPTER=Radeon(TM))VICTORY_WARP=1,--test-threads=1)cargo clippy --locked -p victory-shader --all-targets -- -D warningscargo xtask policysize_tests::the_record_count_of_a_structured_buffer_read_by_indextakes the test process down on the RX 9070 (0xc0000005) onmainand with this PR alike. It passes on the iGPU and on WARP. It's a different case from the four programs, and this PR doesn't change it.maintoo:wave64_tests::a_lane_mask_joined_with_a_number_is_read_as_the_number_it_is.mainand this PR alike, nothing to do with this change:victory-gpu(#72 fixes them);cargo test -p xtask:switches::documented_switches_are_read(#72 fixes that too).victory-gpusuite, as CONTRIBUTING asks.Not measured: in game (fps, frames over 100 ms). I haven't played with it yet. The four programs make their pipelines now, so the warm step and play no longer lose them. Not tested on NVIDIA.
Hashes (container hashes, as the runtime logs them)
Ray-tracing resolve (29): 072f5fe96efd27e1 077869cd9b1456ee 0ae69044bfd15035 1c02f8131c508c75 1e4947eada3d9ee3 203f78efece5bbdf 231d2daa66789312 27ce027e7188bed3 2e28ea6fb9dad3c2 3a6594961b9247e7 3fa1fda35402c93f 4e69dc8770bf27fc 501f0865fdf45dfd 52ab310c43b9f99c 61d7c3333b73892d 7b956e1f6d56609f 7fb216a0c6dee3a9 842de0c32bc8dcc5 8a13d3da7f64b8d1 a1266cc7391ae0d6 a2d880ad5dea1f45 a4df980a1c65fdbe a73284b60aa303ed b7a7fb5ba5934a89 d0130073bb6f7a7d d2c52fcd936985b4 dbba7e080e26ec20 efdb8133aabc37fe f018c205b5199d39
Controls: f753697c1c03772b 5da83868971acee9
Related: #72 also touches
emit/lower.rsandTRANSLATOR_VERSION(4 → 6). If it lands first, I'll rebase and move the version on.🤖 Generated with Claude Code
Pull request closed