Descriptor slots are rewritten while lists in the air read them (relay); whole copies don't tear on RDNA 2 #545
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#545
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-27 10:49 UTC · original
What
With flights in the air (
VICTORY_RELAY=2, the default: up to 256 lists submitted and not finished), shader-visible descriptor slots are rewritten while lists that may read them are still on the card. All paths below are incrates/victory-gpu/src/descriptor/host.rsona-publier:texture_slot_show_ahead(~2392) queuesFlip { after: 0 }, so the slot is rewritten as soon as the upload job runs, whatever is in the air;flip(~2416):afteris the submission that recorded it, but lists sent after that one still read the slot whenput(~2481) rewrites it;show_new_later(~3384): the same gap for lists sent after the texture was made;show_later(~2370) writes the neutral texture at once, while earlier lists still read the old view;put/copy_tocopy straight into the shader-visible heap, andtexture_slots_fliponly checksf.after <= finished(~2438).DESCRIPTORS_VOLATILE(one-view tables,pipeline/host.rs~546) does not make this legal. It lets descriptors change until a list executes, not while it is submitted and unfinished. The directly indexed heap has no such flag.Proof
Test
descriptor::host::tests::a_slot_flipped_ahead_changes_under_a_list_in_the_air, ignored because it fails on the current code:github.com/MamaLeVrai/VIctory-Belobug-AMD@13b68ee(branchdesc-in-flight). The test:Flip { after: 0 }thattexture_slot_show_aheadqueues, and runstexture_slots_flip.The list reads
[4, 4]instead of[1, 1], so the slot changed under it. The device was not removed. On an RX 6950 XT (RDNA 2), driver 32.0.21045.29003.Does it tear on RDNA 2?
indirect::tests::descriptors_written_under_readers(ignored;VICTORY_BENCH_S=5) on the same RX 6950 XT:So on RDNA 2, as on the RX 7900 XTX measured in
02f36e4, whole copies don't tear. A rewrite in flight shows the other texture to lists still running (a picture glitch, pop-in or a wrong mip). It is not a read of garbage, so it is probably not a cause of the RDNA 2 device resets (#376, #329).Fix?
None proposed. Because the heap is directly indexed, any list sent before the write may read the slot. Re-arming the flip with a later
afteronly narrows the window. Writing only when nothing is in the air stalls flips with 256 lists out. A real fix needs fresh slots, or two heaps used in turn. That is an architectural choice for the maintainer.AI-assisted (Claude Code); no game data.
@rpmaster2 on GitHub · 2026-11-27 14:00 UTC · original
In-game confirmation of this on RDNA4, with the symptom pair and a switch that removes both.
Host: Radeon RX 9070 XT 16 GB, Adrenalin 26.11.2 (32.0.32029.2010), Ryzen 5 5600, 32 GB, Windows 11 10.0.26100.9974. Fork
a-publierat4eb6cfd,--console series-s, diagnostics build, the same save for every run. Recipe otherwise:VICTORY_TEXTURE_STORE=1 VICTORY_WARM_BAD=0 VICTORY_CARD_STEPS=2 VICTORY_THIN=1 VICTORY_UPSCALER=6.Two symptoms, both intermittent, in the same place in the scene:
VICTORY_LATE_WAIT=0removes both. Two consecutive 4-minute runs with everything else identical: no lines, no missing skin, in either. The cost is what one would expect from switching the flights off:VICTORY_LATE_WAIT=0(relay off)So on this card the glitch you describe is not only a synthetic one: it reaches gameplay as black lines and as a whole material losing its texture, and it disappears exactly when lists are no longer allowed to run past a slot rewrite. Your
show_laterwrites the neutral texture at once, which would be consistent with a skin slot showing "nothing" rather than the previous texture — that part is my guess, not measured.If a bisect helps: with
VICTORY_LATE_WAIT=1(both stages wait for everything) I have not run the game yet; I can do that next and say whether 1 also clears it, which would separate "stage 2's partial wait" from "any flight at all".AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; counts and versions only, no game files.
@adrianmjim on GitHub · 2026-11-27 14:44 UTC · original
Same results on RDNA 3: RX 7900 XT, Windows 11,
desc-in-flightat 13b68ee (ona-publier4eb6cfd), test profile, with other builds running on the machine.a_slot_flipped_ahead_changes_under_a_list_in_the_air: failed 5 times out of 5, each time reading[4, 4]instead of[1, 1], with the flip done while the list was in the air. The device was not removed.descriptors_written_under_readerswithVICTORY_BENCH_S=5:So on RDNA 3 as well, whole copies don't tear, and a rewrite in flight shows the other texture to a list that is still running. The test shows the hazard on every run here, not only now and then.
Not tested: in-game with
VICTORY_LATE_WAIT=0on this card.@MamaLeVrai on GitHub · 2026-11-27 15:16 UTC · original
Thanks @rpmaster2 and @adrianmjim, this closes the question I left open: the rewrite hazard reaches gameplay.
VICTORY_LATE_WAIT=0removing both symptoms on an RX 9070 XT fits the mechanism (a slot rewritten while a list in the air reads it), and so does adrianmjim's 5-of-5 reproduction on an RX 7900 XT.For whoever tries a fix:
VICTORY_LATE_WAIT=1(both stages wait for everything) is the useful bisect. If it clears the symptoms, the stage-2 partial wait is what lets the rewrite overtake a flight; if not, any flight is enough. The slots that matter are the onestexture_slot_show_aheadandshow_laterrewrite withafter: 0(descriptor/host.rs ~2370-2392). A narrower fix than fresh slots or two heaps may exist for just those two paths: queue their writes behind the last submission begun when they are queued (not the one that recorded the slot), and write them only once that one has finished. The cost would be a delayed texture, not a stall. I have not tried it.AI-assisted (Claude Code); no game data.
@MamaLeVrai on GitHub · 2026-11-27 15:37 UTC · original
A first fix for the ahead-flip path is up as #636: the flip no longer rewrites a slot under lists already sent, it waits for the submissions begun when it was queued. The #545 test fails without it (
[4, 4]instead of[1, 1]) and passes with it. @rpmaster2, @adrianmjim: if you can, a run of #636 against your base with the default relay would show whether the black lines and the missing near-LOD skin are gone. Not done there:show_later's neutral write and the title's own mirrored descriptor writes (reasons on the PR).AI-assisted (Claude Code); no game data.