Buffer record counts from the host's table, not a size query (AMD RDNA 4 compiler crash) #55
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!55
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-55"
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?
@tightfall on GitHub · 2026-11-26 00:35 UTC · original
tightfall:rdna4-slot-counts→main· +286 −24 · 6 files · 2 commits · openOn RDNA 4 the AMD driver's shader compiler crashes inside
CreateComputePipelineState(amdxc64.dll, an access violation reading address0x8) on translated compute programs that ask for the size of a raw buffer (getDimensionsof aByteAddressBuffer) picked from the view heap or from a descriptor table. The run ends there. On an RX 9070 this happened every few minutes in the world:CS_RaytracingResolvevariants,bvh_skinning:CSComputeSkinningTreeAnimVelocity, and in a street chase. Belobug found the same for heap structured buffers (Belobug/VIctory-Belobug-AMD@1503444b); this is that idea on this tree, extended to descriptor tables.What it does
SLOT_STRIDES) gets a second half: fromSLOT_COUNTS_ATon, dwordiis the record count of the buffer view at heap slotias the console's descriptor holds it (elements of a structured or typed view, bytes of a raw one).note_bufferwrites it next to the stride (view_records).descriptor_datareads the count there instead of emitting a size query, for views that come from the heap or a table. Root views keep the query.VICTORY_SLOT_COUNTS=0gives the old size query. It is part of the shader cache key (host_settings), so switching it does not reuse stale translations.waterfall_tests::slot_table). The two record-count tests set the console's count, since their host view is raw.Tested
RX 9070 (RDNA 4), Windows 11, Adrenalin 26.11.2.
translate --pipelines, one shader at a time): the two programs that crashed the compiler every time now build and validate. Before: a segfault inamdxc64.dlleach time.the_record_count_of_a_structured_buffer_read_by_indexcrashed the test process on this GPU on unmodifiedmain, the same compiler fault. With this change, all 8size_testspass on the hardware adapter and on WARP.cargo test -p victory-shader --lib(278 passed) andcargo test -p victory-gpu --lib(326 passed).cargo xtask policyok.translate --validateover the whole shader pack: the same totals with and without the change (14220 VS/PS, 2677 CS, 8673 mesh validated).scripts/play.ps1settings and nothing skipped: 27 minutes and still running, through the street chase where it had crashed before, no compiler crash. Before, four runs in a row ended in this crash after 1 to 10 minutes (the last two already skipping theCS_RaytracingResolveprograms).Not tested on RDNA 3 or other vendors. The change only replaces a size query with a table read, so it should not matter there, but I have no such card to check.
This change was made with AI assistance (Claude Code).
🤖 Generated with Claude Code
@FrozenGuy7 on GitHub · 2026-11-26 01:43 UTC · original
Tested on an RX 9070 XT: no compiler crash at all, and no skip list needed.
Host: RX 9070 XT 16 GB (RDNA 4), Adrenalin 26.11.2 (32.0.32029.2010), Ryzen 7 9800X3D, 32 GB, Windows 11 26300. Diagnostics build of
0a43566+ this PR (ae39f3c) + #24 + #53, merged cleanly. DefaultVICTORY_SHADER_OPT.Offline, one shader per process: I have 70 compute containers that faulted
amdxc64.dll+0x861b9fon0a43566in my game runs, kept locally (method on #52). Results, as faults out of 70:0a435660a43566,VICTORY_SHADER_OPT=590a43566+ this PR (+ #24, #53)VICTORY_SHADER_OPT=59So this covers both triggers on this tree. The 4 that
=59leaves are BrokeAsh's self-sized loads (PastiiJay/klbf-lab#2). The 66 others are the shaders=59fixes by turning the clean-up pass off.Whole recorded set:
victory warmover the 88,576 pipelines my runs recorded (VICTORY_PIPELINE_BOOK=1), cold AMDDxcCache: 88,507 made in 490 s, and 9 child processes ended. Retried alone, those 9 plus the 60 that had faulted on0a43566were all made, with 0 faults. So I read the 9 as collateral from a shared process, not as new faults.In game:
play.ps1 -Safewith #53's FSR and Frame Generation 4.0.2, nothing inVICTORY_SKIP_PIPELINES. 36 min through the prologue into free roam (the first time this machine got there), 3,358 host pipelines made in the run, 0amdxc64faults, and #53's compiler guard never triggered. Before this PR, every run on this machine ended in this fault, between 9 s and 12 min.cargo test -p victory-shader --lib: 278 passed on the merged tree.AI-assisted: the tests and this text were done with Claude Code; the hardware and runs are mine.
@Toons29 on GitHub · 2026-11-26 03:09 UTC · original
Tested on a plain RX 9070 (non-XT) at the newest
main: no compiler crash, into the first mission. Without this PR the same setup crashes atamdxc64.dll+0x861b9fin the opening cutscene.e2a28ec+ this PR (ae39f3c), merged cleanly;cargo +stable build --locked --profile diag -p victory --features diagnostics(Rust 1.100.0)scripts\play.ps1settings, normal mode (no-Safe), Series X profile, title 1.0.2.1, nowarm/shadersbeforehand, no skip liste2a28ecalonee2a28ec+ #55amdxc64.dll+0x861b9f(read 0x8) about 50 s into the opening cutscene, 6:11 incrashes.logSeen in play (not checked against the PR's base without it, since that build never got this far):
These match what #13 describes for
VICTORY_CARD_STEPS, so they are probably not from this PR.Log warnings in the #55 run: 29× "a pipeline creation method that is not implemented: the title goes without this pipeline", 200× "a texture picked by index changed after its upload", 15× "placed unordered texture view not mirrored". No device removal, no TDR, no PC reset.
AI use: Claude Code (Claude Opus 5.5) built and merged the test build, read the logs and wrote and posted this comment on my behalf with my go-ahead. I played the game myself.
@whiteblackonezero on GitHub · 2026-11-26 03:03 UTC · original · approved these changes
@Jrjy3 on GitHub · 2026-11-26 05:10 UTC · original
Tested on an AMD Radeon AI PRO R9700 (RDNA 4, 32 GB), driver 32.0.32015.2008, an older build than the 32.0.32029 used above. Same compiler fault, and this PR fixes it.
Windows 11 26300, diag build of
b0cfe2b+ this PR (ae39f3c), merged cleanly.scripts\play.ps1settings, no skip list.amdxc64.dll+0x85f80f(read0x8,rcx 0, the same registers as the reports here; the offset moves with the driver build), insideCreateComputePipelineState. 5 compute programs crashed it across 4 runs:3fa1fda35402c93f,52ab310c43b9f99c,501f0865fdf45dfd,a1266cc7391ae0d6,a73284b60aa303ed. All are near-identical wave32 programs of about 48k lines of DXIL, in which one raw-buffer heap handle feeds agetDimensionsand 9-35rawBufferLoads. Clearing the driver's DXC cache did not change it.size_testson hardware:the_record_count_of_a_structured_buffer_read_by_indexkills the test process on this card on unmodifiedb0cfe2b. With this PR all 8 pass, andcargo test -p victory-shader --libpasses (278).VICTORY_SHADER_OPT=59works around above). With the handle kept out of that pass it also got past the load in game, but the hardware test above still crashed with it. This PR's table read is the more complete fix.AI-assisted (Claude Code).
@mavis140 on GitHub · 2026-11-26 07:29 UTC · original
Test report: RX 9070 XT (RDNA 4), 38 minutes, no compiler crash
Hardware: Radeon RX 9070 XT 16 GB, driver 32.0.32029.2010 · Ryzen 7 9800X3D · 32 GB DDR5 · Windows 11 build 26200.
Build: this PR's head
ae39f3c,cargo build --locked --profile diag -p victory --features diagnostics, Series X profile.One thing that differs from a clean checkout: the build also carried the crash guard from Belobug's tree
(
0d2f6a6,95e935d: a pipeline whose creation crashes the driver's compiler is recorded incrashed.txtand left out). So "no crash" below means the guard caught nothing, not that a crash was hidden.Before (main
e2a28ec+ the same guard, same card): 37 pipelines ended up incrashed.txtover the runs of oneevening; without the guard the process died about 3 minutes in at
amdxc64.dll+0x861b9f.With this PR, starting from a copy of the cache with
crashed.txtremoved:crashed.txtscripts\play.ps1defaultsscripts\play.ps1 -SafeWorld frame rate in run 1: about 18 fps (55 ms a frame, 45 ms of it "preparing"); 17 of 438 five-second reports
were under 8 fps, at moments when pipelines were being made for the first time (up to 526 ms waited in a frame).
Not tested: a build of this PR without the guard; other RDNA 4 cards; Linux. The title was read from a hard disk in
these runs, which slows streaming but should not bear on the compiler.
Report written with Claude Code (Claude Fable 5.2) from the run logs; the runs were made on the hardware above.
@avatarmanz on GitHub · 2026-11-26 07:33 UTC · original
Left open: conflicts with main (descriptor/host.rs, emit/mod.rs, emit/shader.rs) and changes translation on every AMD card by default; needs a rebase and an in-game check.
@Jrjy3 on GitHub · 2026-11-26 08:06 UTC · original
A rebase onto main
39031cb, in case it saves a step:Jrjy3:fix/slot-counts-on-main, one commit (e4cd768), author kept. The three conflicts are one collision, and the cache key needs a fix besides:VIEW_ADDRESSES(8 bytes per slot after the strides) took the place this PR used forSLOT_COUNTS_AT, so taking either side alone writes one table over the other. In the rebase the counts follow the addresses:SLOT_COUNTS_AT = (VIEW_ADDRESSES + 8 * SLOT_STRIDES_COUNT) / 4,SLOT_STRIDES_BYTEScovers all three,note_bufferwrites the stride, the count and the address.view_addresses_follow_the_stridestakes the address slice to its end and failed with that layout; it now bounds the slice and checks that the counts are left alone.1162d38). The cache is now keyed byTRANSLATOR_VERSIONandhost_settings, not by the translator's source. WithVICTORY_SLOT_COUNTSon (the default) this PR'shost_settingsword equals main's, so a build with this PR and one without it share entries at version 1. Whichever translated first serves the other, and an RDNA 4 card can be handed main's size queries, which is the crash again. In the rebase "on" sets a bit of its own (1 << 30; "off" keeps1 << 31). BumpingTRANSLATOR_VERSIONon merge would do the same job.run's doc comment inwaterfall_tests.rshad ended up above the newthread_local!(clippyunused_doc_comments, which CI denies). It is back onrun.Checked on the R9700 (RDNA 4, driver 32.0.32015.2008), Windows 11, with the rebased code:
cargo test -p victory-shader --lib286 passed, includingthe_record_count_of_a_structured_buffer_read_by_indexon hardware (that test kills the process on this card without the PR).cargo test -p victory-gpu --lib338 passed. Clippy shows nothing in the changed files.cargo xtask policyok. In game, a release build of the same code with two more local commits (Belobug's rx9070xt fixes, #147),scripts\play.ps1settings: all 25,790 shaders translated ahead, then idle on the water in the first boat mission, 61.3 ms (16.3 fps) at about 3,900 draws, 2 minutes steady, no compiler crash. That was one session, not the hour the earlier reports here ran.AI-assisted (Claude Code).
@towade on GitHub · 2026-11-26 10:06 UTC · original
In-game check of the rebased code on an RX 9070 XT (RDNA 4), 64 GB, Intel CPU: past the point where main crashes, no compiler crash.
Hardware: Radeon RX 9070 XT 16 GB, driver 32.0.32029.2010 · Core i7-14700K (UHD 770 present) · 64 GB · Windows 11 26300.
I rebased independently onto
39031cbbefore seeing @Jrjy3's branch and ended up with the same table layout (counts afterVIEW_ADDRESSES,SLOT_COUNTS_AT = (VIEW_ADDRESSES + 8 * SLOT_STRIDES_COUNT) / 4), plus aTRANSLATOR_VERSIONbump instead of the separatehost_settingsbit. Jrjy3's branch is the more complete one (it also fixes the clippy doc comment), so this is only a test report for that layout.cargo test -p victory-shader -p victory-gpuon the rebase: 286 + 338 passed. On plain main39031cbthevictory-shadertest process dies with0xc0000005insize_tests::the_record_count_of_a_structured_buffer_read_by_index(reproduced with--test-threads=1), same as on the R9700.TRANSLATOR_VERSION = 1,victory shadersreported 22,517 of 25,790 cached translations as different from what main had cached. So without the bump or the extra bit, a cache shared with a main build hands RDNA 4 the old size queries.scripts\play.ps1 -Safe, freshvictory shadersrun first, no extra commits. Plain main (f249fe0) had crashed for me inamdxc64.dll+0x861b9f(CreateComputePipelineState) about 9 minutes after start, right after the intro (sound but no picture, then the crash), after ~380 host pipelines. With the rebase: 16 minutes, about 14 of them in the world, no crash; 2,806 host pipelines made; I ended the session myself by closing the window, the game was still running. Frame rate in the world: median 11.6 fps, range 0.8–27.9, up to ~12,800 draws per frame.AI-assisted (Claude Code).
@SpositoDouglas on GitHub · 2026-11-26 14:59 UTC · original
Tested on an RX 9060 XT (RDNA 4, Navi 44) on current
mainwith the renderer patches: the street-chase crash is gone, 20 minutes with no compiler fault.Host: Radeon RX 9060 XT 16 GB, Adrenalin 26.11.2 (32.0.32029.2010) · Ryzen 7 5800XT · 32 GB + 48 GB page file · Windows 11 26300.
Build:
c9c932c+ @Jrjy3's rebase (e4cd768), cherry-picked. One conflict, thepub use shader::{…}list inemit/mod.rs: kept both sides (SLOT_COUNTS_ATandconstants_raw).cargo build --locked --profile diag -p victory --features diagnostics. Shaders translated again with this exe (victory shaders) before the run.Settings:
play.ps1(not-Safe) +VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1+VICTORY_SHADER_OPT=59, Series S, the same save restored before each run, the title left standing.size_tests, on the hardware adapter:c9c932c: the test process dies with0xc0000005(STATUS_ACCESS_VIOLATION) after the first two tests.In game:
c9c932c(3 runs)c9c932c+ this changeamdxc64.dll+0x861b9f(read 0x8) at 13 min 24 s, 13 min 42 s and 14 min 49 scompute f16876929fa64f9f, every timef16876929fa64f9ff16876929fa64f9fis the second crasher @0xmp3 found in #44. Here it comes at the change from the street chase to the cutscene that follows it. Frame rate and memory look the same as without the change (5.8 fps median at 3,740 draws a frame; private memory about 39 GB at the end).Not tested: the same run without
VICTORY_SHADER_OPT=59. Kept it on so the runs before and after differ only by this change.Written with Claude Code (Claude Opus 5.5); the runs are mine, on the PC above.
@Jrjy3 on GitHub · 2026-11-26 18:23 UTC · original
With this PR, faces stop animating: mouths, faces and blend shapes (hair, eyelashes and beards still move, and a heavy character's head is the slim default). Fix:
bca6fe1on top of the rebase inJrjy3:fix/slot-counts-on-main.Cause. The record counts in the slot table are written only by
note_buffer, which runs for title slots mirrored into the host heap. A draw's descriptor tables are made in dynamic slots (HostHeap::make_at,make_listed,make_nullfromdraw.rs). A shader reads a table view's count at that dynamic slot (SLOT_COUNTS_AT + slot), and that slot's count was never written, so it read 0 or the count of the view that held the slot before. The face network (compute_graph_ops:*→ped_standard_head_cs:CS_Blendshape*, see fxceless #927) sizes its tensors this way and computed nothing. The PR's description says tables are covered. They are for slots taken from the heap, but not for a draw's own table slots.Fix.
make_atandmake_listedwrite the slot's count, andmake_nullwrites 0.make_listedkeeps the count with its cached descriptor, so it is worked out once per recording, not once per draw. New testa_dynamic_slots_record_count_is_written_where_shaders_read_it: without the fix it reads(0, 0)where it expects(64, 256)(a typed and a raw view).Checked on an AMD Radeon AI PRO R9700 (RDNA 4), driver 32.0.32015.2008, in the opening cutscenes, three runs:
c9c932c+ this PRVICTORY_SLOT_COUNTS=0(the size query again)amdxc64.dll, which is why this PR is neededbca6fe1cargo test -p victory-gpu --lib: 339 passed (watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_viewfailed once in the full run and passed 5 of 5 alone). Clippy shows nothing indescriptor/host.rs.AI-assisted (Claude Code).
@SpositoDouglas on GitHub · 2026-11-26 18:25 UTC · original
Correction to my report above: the runs were on the Series X profile (the runtime's default, no
--consolepassed), not Series S as I wrote. Everything else in it stands.@lorddie on GitHub · 2026-11-26 18:50 UTC · original
Test report on RX 9070 XT (RDNA 4) + Ryzen 5 5600X + 32 GB: Jrjy3's rebase (
e4cd768) on top of Belobug'srx9070xtbranch (cd8dfc06, which carries his compiler crash guard), diag build, with the defaultVICTORY_SHADER_OPTand no compiler skip list (only39f0e9aeb156a61c,CS_ScreenProbes_ActivateRays, left out because it does nothing without rays). Three runs, about 40 minutes in all (Series S, Series S with the title's own upscaler, and Series X with PC FSR 4.1.2): noamdxc64.dllfault, and the guard recorded nothing. Without this change the same card neededVICTORY_SHADER_OPT=59and two skipped programs. I have now addedbca6fe13(record counts for a draw's table slots) and will report whether faces move.@lorddie on GitHub · 2026-11-26 20:00 UTC · original
Follow-up: with
bca6fe13added, faces and mouths move in dialogue (I hadn't checked before it, so I can't say whether they were still on this card). Also, withVICTORY_BVH_BUILDER=1theCS_RaytracingResolveprograms, which used to crash this card's compiler, now build without a fault (8 minutes, Series S, the title's own upscaler). Here it costs a lot (4.6 vs 14.1 fps at 6-9k draws), and shaders read pages that have no copy (title memory by address: shaders touched pages that had no copy, 210 pages), which stretches an animated character's geometry. That warning does not appear with the builder off.@WHOISJARDAS on GitHub · 2026-11-26 20:35 UTC · original
Tested on an RX 9070 XT (RDNA 4, Adrenalin 32.0.32029.2010), Ryzen 7 9800X3D, Windows 11 26200, with this pull request rebased onto main
0ce46d5:amdxc64.dll+0x861b9fon unmodified main (translate --validate --pipelines, one program at a time): 70 of 70 build and validate with it.cargo test -p victory-shader --lib: 301 passed, 0 failed (your 8size_testsincluded, on the hardware adapter and on WARP).The branch no longer applies to main, though:
027e367gave the strides buffer's second table to the views' title addresses (VIEW_ADDRESSES, two dwords per slot), which is where this puts the record counts. The resolution I used puts the counts after the addresses:with the strides buffer allocated as
SLOT_STRIDES_BYTES(32 MiB a heap instead of 24), andnote_bufferwriting the stride, the record count and the address. Since the shader cache is now keyed byTRANSLATOR_VERSION(1162d38), that also needs to go from 1 to 2, or caches made before keep serving the size queries.For comparison, keeping the size query but giving it a handle of its own, bounded one slot below the handle of the reads (through
raw_twinfor the twin views), also builds the same 70; I can open that as a separate pull request if a smaller change is preferred.Testing and this comment were done with Claude Code (Claude Opus 5.5).
ae39f3c5e7toc7b3853ed8@tightfall on GitHub · 2026-11-26 21:28 UTC · original
Rebased onto main
126acb3(head nowc7b3853), so it applies again. Thanks to everyone who tested this on RDNA 4 cards.The branch now has two commits:
e4cd768). Main'sVIEW_ADDRESSESnow uses the space after the strides, so the record counts follow the addresses:SLOT_COUNTS_AT = (VIEW_ADDRESSES + 8 * SLOT_STRIDES_COUNT) / 4. The only conflict left on126acb3was thepub use shader::{…}list inemit/mod.rs; I kept both sides (SLOT_COUNTS_ATandconstants_raw).bca6fe1, authorship kept. The record counts were written only for title slots mirrored into the host heap. A draw's descriptor tables live in dynamic slots, which read a count of 0, so faces and blend shapes stood still. Dynamic slots now write their counts too. That was my bug; thanks for finding it.About the concern that this changes translation on every AMD card: the change only replaces a size query (
GetDimensions) of raw/structured buffers picked from the heap or a descriptor table with a count from the host's table. The counts come from the same title view records the host already reads, so the result should be the same on every vendor.VICTORY_SLOT_COUNTS=0brings back the old size query, and it is part of the shader cache key.Tested on this branch (
c7b3853) on an RX 9070, Windows 11, Adrenalin 26.11.2:cargo test -p victory-shader --lib302 passed;cargo test -p victory-gpu384 passed, 1 failed (watch::tests::a_refresh_leaves_open_what_the_kernel_is_writing, which this change does not touch; it passes alone, so it was timing under load).rustfmt --checkflags the touched files, but main's own versions of them fail it the same way, so I left formatting alone to keep the diff small. The in-game checks are the reports above (RX 9070, 9070 XT, 9060 XT, R9700), and lorddie confirmed faces withbca6fe1.This PR was made with AI assistance (Claude Code).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.