Repository navigation
Conversation
A marked copy-back puts the shaders' bytes into title memory and lets the
copy take the title's others. A declared range over the same page keeps its
snapshot from before the submission, so a later copy-back compares the copy
against those older bytes, takes the title's own writes for the GPU's and
puts the copy's older values back over them — the failure `copy_back`'s
comment warns about ("putting back the copy's older bytes there broke the
title's own records").
The bytes a marked copy-back writes into title memory now go into the
overlapping part of every declared range's snapshot as well, which is what
`update_busy` does for the copy.
The new test is Marvisak#2436's scenario: a shader byte, a title write during the
submission, the marked copy-back, then the title writes both bytes again —
they stay. Before the change it fails at the first of the two (the shader's
byte goes back over the title's).
|
Verification (Windows 11, WARP/CPU only) — head Tested: the PR head =
Side by side with #2437 (head
WARP only; the throwaway test was not committed. Synthetic data only. AI use: Claude Code (Claude Sonnet 5.5). |
|
Automated triage for the maintainers. Proposed close as a duplicate of the earlier open #2437, which fixes the same issue (#2436) in the same place, Generated by Claude Code |
|
Closing in favour of #2437, as the triage proposes: it is the earlier PR for the same issue (#2436), and its No objection from me to #2437 going in. |
Fixes #2436.
The failure, reproduced
copy_back_markedmerges the page (the shaders' bytes into title memory, the copy taking the title's others) and marks the page taken — but the snapshot a declared range over that page keeps (Shadow::before, taken before the submission) is left alone. A latercopy_backover the page then compares the copy against those older bytes, finds the title's own writes differ, takes them for the GPU's and puts the copy's older values back over them — the failurecopy_back's comment warns about.The test added here is the scenario from the issue: a shader byte at 10, the title's write at 40 during the submission, the marked copy-back, then the title writes both again. Before this change it fails at the first:
What the change does
The bytes a marked copy-back writes into title memory go into the overlapping part of every declared range's snapshot as well — the same thing
update_busydoes for the copy ("the same bytes go into the snapshot, so copy-back neither takes them for the GPU's nor puts them back over a later title write"). The segments hold offsets in the copy, so the overlap is computed in that space.Verification
a_marked_copy_back_keeps_a_declared_ranges_snapshot_in_stepfails before, passes after.cargo test -p victory-gpu --features diagnostics --libon Windows 10 19045 / RX 7800 XT: 146 passed, 2 ignored, plus the known placed-view failure on a runtime withoutID3D12Device10(GPU tests: placed R32_UINT -> R9G9B9E5 view does not share its host texture (Windows 10, RX 7800 XT) #1999, identical onmain); clippy-D warningsclean.copy_back_marksand the declared copy-backs), so a title-side repro is unlikely to be visible — the synthetic test is the check.The overlapping-declared-ranges case from #261 (a copy-back not advancing its own snapshot) is untouched.