Shaders: a buffer's size query through a heap handle of its own (AMD's compiler crashes on RDNA 4) #355
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!355
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-355"
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 17:36 UTC · original
alexdeliu:fix/rdna4-size-query-handle→main· +40 −1 · 2 files · 72 commits · closed without mergingOn an RX 9070, AMD's D3D12 compiler crashes making the pipelines of 33 of the title's compute programs (
amdxc64.dll+0x861b9f, read at 0x8, driver 32.0.32029.2010): 29 ray-tracing resolve programs and 4 tree-animation skinning and particle programs. In the players' logs below, the tree-animation one takes the whole game down on RX 9070 XT and RX 9060 XT cards.What it changes
The crash happens when a buffer's size (
getDimensions) is asked through the same uniform heap handle the buffer's loads use. The size query now 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.This is a port, applied unchanged, 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). Two files:
emit/lower/amd.rs(new, 36 lines) and one call plus the module line inemit/lower.rs. No version bump: the shader cache keys on the translator's sources.Tested
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>.main94c3c5fcargo test --locked -p victory-shader --lib:main94c3c5fVICTORY_ADAPTER=9070), without the test belowVICTORY_ADAPTER=Radeon(TM))VICTORY_WARP=1,--test-threads=1), without the test belowsize_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. #559 reported the same. It passes on the iGPU and on WARP with both. DoubleGhosty/cool_fox#174 is written for that test's case (a raw buffer's size, then a load from it in the same block). On this card #174 makes the 4 tree-animation programs but not the 29 ray-tracing resolve ones, so it is not a replacement for this PR. It could go on top.maintoo:ds_min_max_f32_order_floats_and_return_the_old_value,host_forms_give_what_the_spelled_out_ones_give,v_permlane16_and_x16_read_the_lanes_their_selectors_pick,whole_wave_f64_sum_and_cvt_f32_f64,wave64_tests::a_lane_mask_joined_with_a_number_is_read_as_the_number_it_is. With several test threads WARP sometimes takes the process down, onmainand on this PR alike; one thread at a time it doesn't.cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: clean onmainand on this PR.Related issues: #264 (the crash at start after
f16876929fa64f9f, one of the 4 tree-animation programs), #129, #127, #328, #184 (RX 9070 XT and RX 9060 XT crashes that players work around withLEAVE_OUT=...f16876929fa64f9f). The pipeline that takes the game down in those logs is made with this PR. I haven't confirmed in game, so this says Refs, not Fixes.Not tested: in game (the programs make their pipelines now; I have not played with it yet), and NVIDIA cards (the change only touches how the size query's handle is made; #559 reports that DexNom's evaluation of PR 62 found the other output byte-identical).
Program 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
Tree animation (4): f16876929fa64f9f 878933b499cfa14d a567b9ef845fb680 c1eee35dbc50a9ef
Controls: f753697c1c03772b 5da83868971acee9
🤖 Generated with Claude Code
@Aniseto on GitHub · 2026-12-01 17:55 UTC · original
Ran the full
victory-shaderlibrary suite at47b8bb0on an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.The suite passes here. This adds an NVIDIA data point: the description says NVIDIA cards were not tested (the change is about how the buffer's size-query handle is made, for AMD's RDNA 4 compiler). The 5 WARP-only failures and the RX 9070
size_tests::the_record_count_of_a_structured_buffer_read_by_indexcrash reported in the description did not occur on this adapter; the 4 ignored tests are the usual ones. No title was run.Not tested: a retail title, the RDNA 4 / WARP configurations from the description, Wine, AMD adapters, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the suite, wrote this report; the worktree was not modified; no game data was used.
@readmet3xt-lab on GitHub · 2026-12-01 21:09 UTC · original
Thank you. An alternative that applies only on AMD cards was taken first. If your approach still helps where that one doesn't apply, please show the case here.
Pull request closed