Fix two crashes on AMD: stray stores of the batch culling programs, and sampler records made in a heap of views #24
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/ReTerryDavis--ReVIctory!24
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-24"
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?
@staticman256 on GitHub · 2026-12-03 06:57 UTC · original
staticman256:crash-fixes→main· +263 −2 · 4 files · 1 commits · merged 2026-12-04 01:53 UTCFix two crashes on AMD: stray stores of the batch culling programs, and sampler records made in a heap of views
Two independent fixes for the two crashes that ended most play sessions on the test machine. Together they were 24 of the 36 crashed runs in its
crashes.log. Both are small, and the first has an off switch.title+0x4e9b54a,+0x4e9b4b2,+0x4e9b578,+0x1884fbamdxc64.dll+0x361d9460x887A0001)+0x1377f6)Test machine
diagbuild,scripts\play.ps1with its defaults plus-Fsr4K performance -FsrVersion 4 -FrameGen, frame rate uncapped, no ray tracingThe statistics are from one
crashes.log: 2026-11-29 21:21 to 2026-12-02 13:43 UTC, about 64 hours of wall-clock time on commit9a70c8c(later with diagnostic patches on top), 36 crashedvictory.exeprocesses. All diagnosis was done on9a70c8c. The fixes were then carried to5ccd6e4.Crash 1: the title crashes in its own code
What was seen
An access violation inside the title, almost always at
title+0x4e9b54a(10 runs), also+0x4e9b4b2(3),+0x4e9b578(1) and+0x1884fb(2). The comment oncopy_backinshadow.rsalready names the first address. It came 16 times in two and a half days, at no particular place in the game.The faulting read is always through a pointer that looks almost right. In one dump, a pointer that should have been
0x0000000d0418ee68had0x00000ca7in its upper half, and the values0x0c9a,0x0ca7and0x14b4sat at a 20-byte stride across the memory around it.What happens
The 20-byte stride is the signature of the title's four batch culling compute programs:
17af15c4015cb4b6CS_Prop_BatchCull55679a0547649d0bCS_Tree_BatchCull89d08e561897d4e5CS_Tree_BatchCull_ImposterOnlyfdd56d97a806bccaCS_Prop_BatchNoCullEach dispatch gets one raw unordered-access view of the title's whole 174 MB heap, loaded from byte 5920 of its bindless table. It writes all its output through that view at byte addresses it computes from job records. The instance counts are
InterlockedAdd(uav[X + 4 + i * 20], 1), whereXcomes from dword 9 of the job record.Every few minutes a burst of those adds lands at the very start of the heap instead of where the record says. The start of that heap holds the host's descriptor slot records (
VIEW_TAG) and the title's frame allocator, including its list nodes. A count added into a list node's pointer is the pointer the title then follows and faults on.What was measured
An instrumented build checked every culling dispatch at submission for 37 minutes:
X. The sane values lay 90 to 115 MB into the heap.+0xec7,+0x140).A second run of 13 minutes with
VICTORY_SEND_STAGEandVICTORY_JOIN_SENDoff saw 5 more bursts. Every stray store seen lay within the first 262 KiB.So the job records are right in title memory and right in the host's copies, and the stray addresses arise somewhere between there and the program running on the card. That root cause was not found. The crash happened with port 1 on and with it off, so port 1 is not the cause. It only decides how the stray bytes arrive: with port 1 on, the card writes title memory in place, so nothing on the CPU side can see or filter them.
The fix
The four programs are translated with a floor under their stores. A raw store or atomic through the view from table byte 5920 is skipped, per lane, when its byte address is below the floor. Everything else the programs do is unchanged.
VICTORY_CULL_FLOOR_MB: the floor in MiB. Default 16,0turns the guard off.VICTORY_CULL_FLOOR_MBline per program with the number of guarded stores, or a warning if no store was found.Its limits
9209777e8face9dd,1c4b3c0547e3e6fa) and are not guarded. Every stray seen had the culling programs' 20-byte stride.Crash 2: the AMD driver crashes
What was seen
An access violation inside the driver at
amdxc64.dll+0x361d946, a read of0xffffffffffffffff, called fromCopyDescriptorsSimpleon avictory-viewsthread. Several threads usually fault within seconds of each other, so the 8 crashed runs left 17 entries in the log.What happens
The title's heap of views lies in its frame allocator's memory, and a slot of it can hold the record of a sampler (
View::SamplerorView::ConsoleSampler). Whether that is left over from an earlier use of the memory or put there by the title is not known. Nothing tells a record's kind from its heap's kind, andmake_twinnedcallsCreateSamplerat whatever slot it is given.D3D12 allows
CreateSampleronly at a slot of a sampler heap. In a crash dump, the CPU handle of a heap the card does not see pointed at a 32-byte driver entry that begins with the address of the descriptor's bytes. One entry held0180000008000800 8000000028f00000between sound neighbours, which reads as sampler state, not as an address. The nextCopyDescriptorsSimplefollowed its first 8 bytes as a pointer and faulted. This is read from the dump, not from the driver's source.The fix
A sampler's record is not made in a heap of views. The slot gets a null view, the same as for a view the host cannot make. A sampler is never read through a slot of a heap of views, so nothing drawn changes. The check sits at the four places that make a view slot from a record (
texture_views_remade,make_at,make_listed,mirror_inner_locked), and a warning is logged when it acts:a sampler's record in a heap of views: a null view there instead.What changes
Four files, 264 lines added, 2 removed, most of it comments.
crates/victory-shader/src/emit/mod.rs:with_store_floor, a scoped setting for one translation.crates/victory-shader/src/emit/lower.rs: the floor in the buffer access lowering.crates/victory-gpu/src/shader_cache.rs: the four programs andVICTORY_CULL_FLOOR_MBinhost_shader.crates/victory-gpu/src/descriptor/host.rs:sampler_in_viewsand its four checks.Testing
On
9a70c8c, where both fixes were developed:On
5ccd6e4(translator version 15):diagand run. The log has the four guard lines with 10, 70, 70 and 80 guarded stores, the same counts as on9a70c8c, so the guard still finds its stores with the new translator.Not in this pull request
0x887A0001).Diagnosis, fixes and this description were built with Claude Fable 5.2 (Extra effort).
@staticman256 on GitHub · 2026-12-03 06:57 UTC · original
cc: @SovietBearz0r
092a07762dto992208b909992208b909tofc04f04a9cfc04f04a9ctoc8e29fa7e2