Skip to content

GPU: a page a copy holds in part is taken after its marked copy-back - #2272

Open
denkencar-sketch wants to merge 1 commit into
Marvisak:mainfrom
denkencar-sketch:fix/shadow-004
Open

denkencar-sketch wants to merge 1 commit into
Marvisak:mainfrom
denkencar-sketch:fix/shadow-004

Conversation

@denkencar-sketch

Copy link
Copy Markdown
Contributor

Summary

A page that a copy holds only in part was not taken after its marked copy-back (only whole pages were), so the page stayed changed and unguarded and the next submission's marked writes to it were dropped.

Testing

Test a_partly_held_page_is_taken_after_its_marked_copy_back fails on main and passes with this change. cargo test --workspace --locked passes apart from the known flakes: modules::dstorage::tests::a_page_list_filled_after_its_request_starts fails now and then on main too, and so does a parallel-run flake in victory-gpu's lib tests (watch:: and descriptor::host:: tests, 2 of 40 runs on pristine main).

Not tried: real submissions, and a run in the game.

AI-assisted.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A page a copy holds in part is taken after its marked copy-back (drops the from==page && to==page+PAGE condition). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Pairs with #2271 (shadow.rs freshness cluster).

@welisonzika14-jpg

Copy link
Copy Markdown

First run on NVIDIA hardware here, as far as I can see (the reviews above are static or WARP). RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head b4bc9b9 merged onto main 940d32f, cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.

The PR's test shadow::tests::a_partly_held_page_is_taken_after_its_marked_copy_back passes on this card. The rest is the same as main on this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests in victory-gpu, 3 in victory-shader), nothing new.

One run, unit tests only, title not run.

Written with AI help (Claude/Kiro); the numbers are from runs on my machine.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. The rebase resolved the shadow.rs conflict, and it merges cleanly now. In Shadow::copy_back_marked (crates/victory-gpu/src/shadow.rs), the page is now taken after the copy-back even when the copy holds it only in part. On main, such a page stayed changed and unguarded, so the next submission's marked copy-back saw changed with no saved bytes and dropped the shaders' writes. I checked that this is consistent:

  • After the copy-back, the copy equals title memory on [from, to). Either the copy's bytes are written to the title, or merge_writeback gives the copy the title's bytes.
  • The Tracked is the copy's own, and Tracked::take already treats a page whose tracked part is fully in range as whole.
  • copy_back_page already takes partial pages unconditionally.

The new test a_partly_held_page_is_taken_after_its_marked_copy_back covers the second submission, and a tester ran it on NVIDIA hardware.

CI: passing (check).

Recommending a look, not approving.


Generated by Claude Code

Only whole pages were; the page stayed changed and unguarded, so the next
submission's marked writes to it were dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants