Debug layer: a card-side title buffer is read as a root SRV while still promoted to COPY_DEST (id 538) #350
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#350
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@MamaLeVrai on GitHub · 2026-11-26 21:32 UTC · original
What
With the D3D12 debug layer on (
VICTORY_D3D12_DEBUG=1, diag build ofa-publiercd8dfc0, defaultscripts\play.ps1settings), the layer reports this error four times in the first minute of a run (three at 20:55:42 and one at 20:55:51, id 538, severity 1):So a copy into a card-side host copy of a title buffer promoted it to
COPY_DEST, and a later compute root SRV read it in the same list, or in a later list of the sameExecuteCommandLists, with no transition in between. A promoted write state does not decay until the call ends.Where it may come from (not pinned down)
Two places record such copies with no transition of the destination afterwards. I have not found out which one this run hit:
HostList::place_copy(host/place.rs, copies at their place,VICTORY_COPIES_IN_PLACEon by default):CopyBufferRegion(&to.buffer, ...)is followed only bywait_for_all(a global barrier, or an aliasing + UAV barrier). Neither movesto.bufferout ofCOPY_DEST. Thento.gpu_writes(...), and the rest of the list may bind it as a root view.VICTORY_GPU_TIMING, a submission's preludes and runs go to the queue in oneExecuteCommandLists(group)(host.rs, thegroups = [(&lists[..], ())]path). So a prelude's promotion toCOPY_DESTis still in force when the run's root SRV uses the buffer.A transition
COPY_DEST -> COMMONof the destination after such copies would let the later root view promote again. Doing that only where the buffer was not already in a read state in that list needs the list's state tracking, so I have not made a PR.Relevance
On AMD the global barrier probably makes the copy's bytes visible anyway, so this may not change what the shaders read. In this run it is also not what lost the device: the loss (
0x887A0007, nothing of ours on the card, #329) came 3.6 s after the last of these errors, and the layer reported nothing else at the loss butKernel memory failure(id 834). I am filing it because it is a real spec violation the layer can see, and it gets in the way of finding real errors with the layer.Host: RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300.
AI-assisted (Claude Code); no game data.
github-bot referenced this issue2026-11-27 00:59:47 +00:00
@ANDREANIADS on GitHub · 2026-11-26 21:43 UTC · original
I traced the two proposed paths at
cd8dfc06. The card-shadow refresh that copies the title buffers submits its own command list at line 4618. The batched per-list preludes are built byHostList::preludefor texture uploads and texture transitions. This narrows where to trace the buffer named in the validation message. Shadow refresh and submission · Per-list preludeHostList::place_copyis still a candidate. Its destination receives a buffer copy followed bywait_for_all. The same-shadow case also uses the original buffer as a source before writing it back through an intermediate. Logging the physical source/destination and command-list identity there, then at the next root SRV bind, would distinguish the paths before choosing a resource-specific transition. Placed copiesI ran a positive control on a physical RTX 3070: start in COMMON, copy four words, transition
COPY_DEST → NON_PIXEL_SHADER_RESOURCE, then dispatch a compute shader with a root SRV and read back. All four words matched in both layouts: one direct command list, and two direct lists in a singleExecuteCommandListscall. The local debug-layer component is missing (0x887A002D), so the original ID 538 and in-game device loss remain unverified here. Tested with Codex.dxgi-buffer-state-control.zip
@BE29ZZ on GitHub · 2026-11-27 00:53 UTC · original
Opened #424 to fix this.
It adds per-
HostListdirect buffer state tracking (crates/victory-gpu/src/host/buffers.rs) wired intoplace_copy/place_source,indirectclamps,drawdirect buffer bindings,HostList::preludecross-list handoffs, andplan.check:place_copydestination (COPY_DEST -> COMMON) and source buffers (including same-bufferCOPY_SOURCE -> COPY_DEST -> COMMON) with exact pre-transitionStateBeforewhen a buffer was already promoted earlier in the list or in an earlier list of the sameExecuteCommandListsbatch.cargo clippypasses clean,cargo test -p victory-gpu --lib --locked -- --test-threads=1(402 passed, 0 failed) including new unit and GPU tests, andcargo test -p xtask --locked(9 passed).