Card steps: a read of memory a texture copy-back writes can be done on the card from a buffer's host copy that never gets the texels #320
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#320
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?
@Coderlord on GitHub · 2026-11-26 16:22 UTC · original
What.
crates/victory-gpu/src/host/card_steps.rs,writers()lists what the flights in the air write: their declared shader writes (flight.back, each with the host copy it goes through), their read-backs (deferred().backs, no host copy) and the copies card steps did. It does not list the texture copy-backs (Flight::texture_back_ranges, fromcrate::texback), althoughlatecounts them as written (line.writtentakes them in).So
take_steps()sees a copy or fill out of such a range as asked for (copy_blocked/read_blockedreadline.written), butholder()finds no writer there and falls back tocrate::shadow::find. Where a title buffer's host copy spans that memory, the step is then done on the card out of that host copy, which never receives the texels: they reach title memory on the CPU when the flight lands. Without card steps the submission waited for the flight, and the CPU copy read the texels.When.
VICTORY_CARD_STEPS=1or2(scripts/play.ps1sets 2) with texture copy-back on, which it is by default.Fix. List them as writers without a host copy, so
holder()refuses the step and the submission waits as before:(Here we also gave such writers their own refusal reason, "a texture copied back is written there", to count them, and a unit test:
holderrefuses a range a texture writer meets.)Evidence. Code reading (checked against
c9c932c) and the unit test above. In 8 minutes of the first gameplay scene on an RTX 5080 (card steps at 2: about 2,700 fills and 6 buffer copies a frame done on the card), the new reason never showed up among the five longest waits of the per-frame reports, so that scene does not hit it. I can't tell whether it plays a part in #13 or #124 (wrong meshes or black geometry with card steps on).Found while porting your card steps (
cc03ecb,007fe55,3e64a64) onto a tree with fxceless'sfill_ahead. Thank you for them.Found, written and tested with Claude Code.
@battledogegames-design on GitHub · 2026-11-26 18:54 UTC · original
@Coderlord, thanks for identifying the missing texture copy-back writer. I independently reproduced the source-selection failure on Windows at
2de998014dc85ad68cd6422a250400c7084ace57. An isolated harness compiled the productionwriters(),meet()andholder()functions with a synthetic flight and Shadow lookup. With a texture write pending at[104,112), baseline selected a Shadow containing0x11223344for that exact read. The existing no-host-copy refusal test still passed.With your no-Shadow writer rule, the same harness passed 3/3 serially and 3/3 under the default parallel runner. Across all 528 nonempty intervals in a 32-byte Shadow, baseline refused zero. The correction refused exactly the 308 intersections and accepted all 220 disjoint intervals, including both touching boundaries. A copy destination checked by the same selector can therefore cause a conservative refusal even when its source is clear. These are selector decisions; GPU wait frequency and duration remain unmeasured.
The target-crate and WARP runs were blocked obtaining locked
zlib-rs 0.6.8. No GPU corruption or rendering effect was observed. #339 changes in-place eligibility later inholder(); it leaves the missing writer unaddressed.Synthetic harness, raw Windows logs, and reproduction commands: issue320-evidence.zip
AI-assisted with Astra 6.2.
@rafaconvaitis on GitHub · 2026-11-26 20:00 UTC · original
I confirmed the same missing writer in Cool Fox
c3e5c375and tested a port of your guard on Windows. The regression test passed. It exercises a pending texture destination against an intersecting Stage 1 upload fill, an intersecting Stage 2 buffer copy, and adjacent or disjoint reads. The adjacent and disjoint reads remain eligible for the card path.At the boat bridge on an RTX 4070, my earlier Stage 1 diagnostics measured a 13.8 ms median flight wait and repeatedly named a buffer copy as the reason the plan was refused. I am checking Stage 2 with the overlap guard in place. That timing measures the separate Stage 1 refusal. It does not establish how often this texture-readback overlap occurs in the boat scene.