Shaders: a size query is not reused (AMD's compiler crashes on 29 compute pipelines on RDNA4) #324
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/Belobug--VIctory-Belobug-AMD!324
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-324"
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-11-26 20:19 UTC · original
alexdeliu:fix/rdna4-getdimensions-reuse→a-publier· +30 −1 · 2 files · 1 commits · merged 2026-11-26 22:30 UTCFixes the 29
the driver's compiler crashed making a pipelineerrors from #298 on an RX 9070 (RDNA4, the 9070 XT's family). All of them are compute pipelines, all crash at the same instruction ofamdxc64.dll(32.0.32029.2010), and the runtime leaves them out.What it is
translate --list: all of them areped_*:CS_RaytracingResolve(13 ped material variants).VICTORY_TRANSLATE_ONLY=<hash> victory translate --pipelinesreproduces it in seconds, one pipeline per process.VICTORY_SHADER_OPTnarrows it to one clean-up pass: 4 (REUSE) alone crashes, and 59 (everything but REUSE) doesn't.dx.op.getDimensionsout makes all 29 pipelines. So the driver crashes when onegetDimensionsserves the uses of an equal one below it.The change
opt.rs: REUSE givesdx.op.getDimensionsno key, so each size query stays where the lowering put it. There are 7 such calls in a resolve program, so the cost is nothing measurable.TRANSLATOR_VERSIONgoes 1 → 2 (victory shadersasked for it).a_size_query_is_not_reused. It fails without the change (left: [[Inst(3), Inst(3)]], the query merged) and passes with it.Tested (Windows 11, RX 9070 driver 32.0.32029.2010, Ryzen 7 7700 iGPU driver 32.0.21045.29003, 31 GB RAM)
a-publiercd8dfc0translate --validate --pipelinesof the 29 programs, RX 9070cargo test -p victory-shader --lib, RX 9070VICTORY_D3D12_ADAPTER="Radeon(TM)")cargo clippy -p victory-shader -p victory-gpu --all-targetsThe 5 WARP failures are on the base too (
ds_min_max_f32...,v_permlane16...,whole_wave_f64..., twowave64_tests).Not fixed here
bvh_skinning:CSComputeSkinningTreeAnim*,CSComputeTreeAnim) also crash amdxc64 on the RX 9070 offline. They crash even withVICTORY_SHADER_OPT=0, so that is a different trigger; I'm looking at it separately.🤖 Generated with Claude Code
@luisaugustz on GitHub · 2026-11-26 20:47 UTC · original
Early result from an RX 9070 XT (driver 32.0.32029.2010, Ryzen 7 5800X, 32 GB): with this PR alone, one compute pipeline still crashes the compiler here.
Build:
cd8dfc06plus #235, #325, #252 and this PR, diagnostics, ray tracing on,VICTORY_SIZE_OWN_HANDLE=0so that #252's change is off. Shaders prebuilt withvictory shaders.compute f16876929fa64f9f,rip=0x7ffb3f861b9f(it ends in1b9f, as in #298), about a minute into the first launch.cd8dfc06withVICTORY_SIZE_OWN_HANDLE=1and without this PR.translate --pipelines.So on this card #252 may still be needed beside this one. I can run more if it helps.
@MamaLeVrai on GitHub · 2026-11-26 22:31 UTC · original
Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at
f962387:cargo test --release -p victory-shader --lib303 passed, 0 failed, 4 ignored.AI-assisted (Claude Code); no game data.
@ligmaSec on GitHub · 2026-11-26 23:03 UTC · original
Thanks for isolating the size-query optimization on the RX 9070. I ported alexdeliu’s original commit with attribution to
ligmaSec/victory-royaleand compared it against our current main using Series X 1.0.2.1. Across 141 character-resolve programs, one changed on our tree. Both revisions created that pipeline on a 32-lane software device. The separate RX 9070 XT case reported above emitted identical bytecode before and after this change.If anyone here has the affected native Windows driver and time for one offline comparison, our PR has the exact revisions, a local archive selector, and the commands. A one-line result for each build, even if both succeed, would help us decide whether the port belongs in main. No gameplay session or file upload is needed. Test instructions on the port
@adrianmjim on GitHub · 2026-11-27 06:25 UTC · original
Follow-up on the merged change, offline: RX 7900 XT (RDNA3), driver 32.0.32029.2010 (the same driver as your RX 9070), Windows 11 build 26300. Release builds of
cd8dfc0(before) and4eb6cfd(a-publier with this PR merged),VICTORY_TRANSLATE_ONLY=<hashes> victory translate --validate --pipelines.cd8dfc0doesn't crash amdxc64 on RDNA3. All 141ped_*:CS_RaytracingResolveprograms (47 materials x 3, so your 29 are among them) validate and make pipelines, all in one process. I ran it twice. The second time I used a renamed copy of the exe, which the driver caches separately, so the driver's cache could not serve those pipelines. Same result both times. So with this driver the crash does not reproduce on RDNA3: it compiles the form where onegetDimensionsserves another.4eb6cfd: the same 141 make pipelines. 66 of them (25 materials) emit different DXIL than oncd8dfc0.translate --validate --list, default wave): 312 programs change fromcd8dfc0to4eb6cfd, the same count as yours: 207 PS, 99 CS, 3 VS, 3 MS. All 312 come from this PR, sinced18b9aa(the merge's first parent) emits the same ascd8dfc0. No program loses validation. The 99 CS are 85CS_RaytracingResolve(66ped_*, 19standard_uber_*), 13InstanceCullingbatch-cull kernels andwater_micro_geom_renderer:CS_SurfacePrimitives. All 312 make pipelines on the 7900 XT, on both revisions.f16876929fa64f9f) isbvh_skinning:CSComputeSkinningTreeAnimVelocity, one of the tree-animation programs under "Not fixed here". On the 7900 XT all sixbvh_skinningtree and wind programs make pipelines on both revisions, one per process.Not tested: in game; RDNA4.