Repository navigation
Conversation
…missions Run in parallel, victory-gpu's shadow and watch tests failed now and then (about one run in three), each passing alone: - A test can leave a tracker of its pool behind (a host copy or a texture's staging something global still holds) and then free the pool. Its pages stay in the guard set, and a pool another test got at the same addresses counts as guarded already: its writes never fault, so nothing is seen changed or saved (armed_ranges_keep_..., the partial-refresh tests). watch::tests::free now decommits the pool and keeps its addresses reserved, so no allocation lands there again. - copy_back_marks takes every mark set in the bitmaps, and a test submitting alongside took the marks a mark test had just set (marked_pages_go_back_..., marks_of_shaders_using_title_memory_...). Those tests now hold the submission lock while they run, as the read-mark tests do (host::tests::no_submissions).
partial_refresh_under_marked_range_updates_saved_bytes failed now and then in parallel: page 0 came back whole from the copy over the title's later writes, or the copy's writes did not come back at all, as if a submission of a test running alongside had worked through the copy first. It does no submission of its own, so it holds the submission lock.
Dukestar69
left a comment
There was a problem hiding this comment.
Verified on RTX 5090 & WARP against origin/main (63bcca4):
cargo test -p victory-gpu --lib shadow:: -- --test-threads=1: 11/11 passed on RTX 5090 and WARP (includingheld_mark_preserves_an_ordinary_write_in_a_shared_page).cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed on RTX 5090.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Cleanly ensures ordinary writes on shared pages are copied back before retaking them under a held mark.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. Verdict: needs work. CI In The reordering also changes the case where the same copy and page carry both a held mark (memory bitmap) and an ordinary mark. On main that page is retaken first and its copy-back skipped. With this PR, What it needs:
With that, this looks ready for review for merge. Generated by Claude Code |
fuzeofficlal
left a comment
There was a problem hiding this comment.
The production fix in crates/victory-gpu/src/shadow.rs::copy_back_marks (75a6a31c) looks solid:
heldis populated from a single bitmap scan in ascending word/bit order (trailing_zeros()), soheld.binary_search(n)is valid.- Filtering
markedagainstheldprevents a(copy, page)marked in both bitmaps from leaking withheld writes into title memory, while allowing distinct host copies covering the same title page to copy back their ordinary writes beforedrop_withheld(page, PAGE)retakes the page across all copies. - Checking
marked.is_empty() && held.is_empty()ensures held-only submissions still rundrop_withheld.
Root cause of the CI failure (reproduced locally on Windows 11 + WARP)
Running shadow:: locally shows why check failed on 75a6a31c:
cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features) andcargo xtask policy: clean.- Serial WARP (
cargo test -p victory-gpu --lib --features diagnostics -- shadow:: --test-threads=1): 12/12 passed. - Default parallel WARP (
cargo test -p victory-gpu --lib --features diagnostics -- shadow::): failed immediately (10 passed, 2 failed):shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed:both writers' bytes, page 1: left (0, 17), right (187, 17)shadow::tests::marks_of_shaders_using_title_memory_are_held_back:page 1 held back: left (170, 187), right (170, 0)
Both new regression tests call host.execute(&[&list]) inside shadow::tests. Because the pre-existing direct-bitmap tests (marked_pages_go_back_by_the_bytes_the_gpu_changed and marks_of_shaders_using_title_memory_are_held_back) mutate the global mark bitmaps and call copy_back_marks without holding host.submitted (tracked in #3085), executing submissions concurrently from the new tests steals/clears their bitmap bits under parallel cargo test.
To make CI green reliably without waiting on #3085, please either:
- synchronize the direct-bitmap tests in
shadow::testsagainst submissions (holdinghost.submitted, matching#3085), or - drive
copy_back_marksdirectly in the new tests underhost.submitted(or rebase once#3085merges). Also note that callingcrate::watch::tests::free(p)(MEM_RELEASEonmain) can reuse addresses with leaked trackers under parallel runs until#3085lands.
fuzeofficlal
left a comment
There was a problem hiding this comment.
Re-reviewed at 4f231225. Merging the #3085 test-isolation fix resolves the parallel WARP bitmap race cleanly, and the production logic in crates/victory-gpu/src/shadow.rs::copy_back_marks remains solid (ordinary marked copy-backs run before drop_withheld retakes shared pages, while pages marked in both bitmaps for the same copy are filtered out via held.binary_search and stay withheld).
Verified locally on Windows 11 (RTX 5090 + WARP + D3D12 Debug Layer):
cargo clippy --workspace --all-targets -- -D warnings: cleancargo clippy --workspace --all-targets --all-features -- -D warnings: cleancargo xtask policy:191 files ok- RTX 5090 default-parallel
cargo test -p victory-gpu --lib shadow::: 10/10 runs passed (12/12 tests per run) - WARP (
--features diagnostics,VICTORY_D3D12_WARP=1) default-parallelshadow::: 10/10 runs passed - RTX 5090 +
VICTORY_D3D12_DEBUG=1:shadow::12/12 passed,watch::15/15 passed
LGTM.
A submission with a missed list can lose a valid GPU write when two distinct host buffer copies cover the same 64 KiB title page. One copy has a held title-memory mark. The other has an ordinary mark for a write to a different byte. Processing the held mark first calls
drop_withheld, which immediately retakes the shared page across copies on a missed submission. The ordinary write then fails to reach title memory.Move the held-page drops after the ordinary marked copy-backs in
copy_back_marks. The regression test executes a missed list with both bitmaps and checks both bytes. The withheld byte must stay at 0x11 and the valid write must change 0x22 to 0xbb.Verified on Windows with a GeForce RTX 5070 Ti, driver 621.14. On main at 63bcca4 the fixture returned (0x11, 0x22). With this patch it returned (0x11, 0xbb). The Windows diagnostics victory-gpu suite, run serially, went from 244 passed / 3 failed / 1 ignored (main plus the regression test) to 245 / 2 / 1. The two failures in both runs were
dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views.Related to #3089 and #3099. This reproduces directly on main and is independent of the optimization to reduce the number of dropped pages. #1998 addresses an overlapping withheld interval within a copy. This fixture uses two distinct copies of the same page. No title files are needed. No rendering or performance improvement was measured.
AI-assisted with Codex.