GPU tests: assert a missed submission through readback #2803
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2805"
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?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T21:03:45Z.
The missed-submission test read a host word and then checked the tracked copy's clean flag. If another submission refreshed the copy between those two observations, the test could combine the old word
0x33and the new clean flag with actual contents0x11. The test now checks title memory and the next GPU readback, which verify the behavior the caller sees.On
13f91ca, four serial diagnostics runs passed and one of four eight-thread runs failed the old assertion. A second parallel run hit the existing frame-timer failure. I forced a refresh between the two observations using the same synthetic test data. The old assertion then failed deterministically after the producer, refresh and final host-word controls passed. The same refresh sequence passed with the patch.On the exact patch, the serial diagnostics run and all eight eight-thread runs passed with 198 tests and one ignored each. A separate control temporarily suppressed the retake: the retained GPU readback assertion failed with
0x33instead of0x11. Tests ran on app-local WARP. Strict GPU Clippy passed in both feature configurations, as did staged asset policy. Coordination claimPlease retain the Git author on cherry-pick or rebase. If you fold this change into another commit, please include
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T21:13:37Z.
Review: COMMENTED
Right call —
copy.clean()/its bytes are global shared state, and a concurrent test's submission legitimately refreshes the copy before this assert reads it. The kept asserts still cover the actual contract (nothing goes back before the next submission; the retake then reads title memory's bytes). LGTM.Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T21:19:56Z.
Independent WARP/CPU verification of head
cc0c89293313dc95b6a94ceb4fdfd77387102f38, merged ontoorigin/main13f91caee25f2fdf2c062be5f7a27f058e51cbca(clean merge).Environment: Windows 11 Pro 26200, WARP only (
VICTORY_D3D12_WARP=1with--features diagnostics,VICTORY_WARP=1), Windows SDK 10.0.26100.0 x64dxil.dll1.8.2502.11.cargo test -j 4 -p victory-gpu --features diagnostics: 198 passed, 0 failed, 1 ignored. The baseline onorigin/mainwas the same: 198/0/1.--test-threads=8: each 198/0/1.drop_withheld(if false && SUBMISSION_MISSED…).a_submission_that_missed_leaves_the_copies_at_oncethen failed at the kept readback assertion withleft: 51(0x33),right: 17(0x11). So the readback still catches a missing retake now that the racy clean-flag check is gone.cargo clippy -p victory-gpu --all-targets -- -D warningswas clean, with and without--all-features.cargo fmt --all --check: 891 hunks, the same as the baseline (no new hunks).Diff review: no findings. The assertion that is dropped combined two observations that a concurrent refresh could separate. The
title()andread()checks are what the caller sees, and they cover the behaviour. The change is test only, with no data files.Not tested: physical GPU, retail title.
AI use: Claude Code (Claude Opus 5.5)
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T21:23:34Z.
Reviewed and verified
cc0c8929on Windows 11 (RTX 5090 + WARP) againstmain(13f91ca).copy.read_host/copy.clean()race check with title-memory + subsequent GPU dispatch readback assertions cleanly eliminates the TOCTOU flake.VICTORY_D3D12_WARP=1,--features diagnostics):memory::tests(--test-threads=1) 3/3 consecutive runs5/5 passed(includinga_submission_that_missed_leaves_the_copies_at_once); full suite 3/3 runs196/196 passed(excluding the 2 pre-existing heap-cap tests).--features diagnostics):memory::tests3/3 runs4/4 passed(excluding the pre-existing RTX 5090lists_sharebaseline).cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default &diagnostics): 0 warnings;cargo xtask policy: 184 files ok; cleangit merge-treevs13f91ca.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:25:10Z.
Automated triage for the maintainers.
In
a_submission_that_missed_leaves_the_copies_at_once(crates/victory-gpu/src/memory.rs) the check that readscopy.read_hostand thencopy.clean()is removed. Those two observations can be split by a refresh from another submission, which makes the test flaky. The test keeps the title-memory check and the next GPU readback, and an independent negative control in the thread shows the readback still fails when the immediate retake is disabled.mainnow serialises the memory tests withgpu_test_lock(#1865), but submissions from other modules can still refresh the copy, so the change still helps. CI (check) passes.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T02:47:38Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):cargo test -p victory-gpu --lib memory::tests -- --skip lists_share_a_table_and_copies_keep_their_views: 7 passed, 0 failed (skipped pre-existing#1744NVIDIA 1M view-heap cap test).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T12:07:24Z.
Review: APPROVED
Reviewed and verified at head
cc0c8929and merged ontoorigin/main(63bcca43) on Windows 11 (RTX 5090 + WARP,VICTORY_D3D12_DEBUG=1):copy.read_host+!copy.clean() || held == 0x11check ina_submission_that_missed_leaves_the_copies_at_once(crates/victory-gpu/src/memory.rs:883-887) eliminates a genuine TOCTOU race where a concurrent submission from another test module (not covered bymemory::tests::gpu_test_lock()) refreshes the dirty shadow copy between the two reads. The retained assertions (assert_eq!(title(), 0x11)andassert_eq!(read(), 0x11)) still verify both sides of the contract—withholding writes from title memory and retaking title bytes on the next GPU dispatch.git merge-treeagainstorigin/main(63bcca43);cargo xtask policy(184 files ok);cargo clippy -p victory-gpu --all-targets -- -D warningsclean with default features and--all-features(both atcc0c8929and merged onto63bcca43).cc0c8929withVICTORY_D3D12_DEBUG=1: RTX 5090memory::tests4/4 passed (skipping pre-existing 1M heap-caplists_share), WARPmemory::tests5/5 passed.origin/main(63bcca43), 3 consecutive 8-thread parallel multi-module stress runs (memory::tests+draw::tests,--test-threads=8,--features diagnostics,VICTORY_D3D12_DEBUG=1): 3/3 passed on RTX 5090 (27/27 each, skipping pre-existing 1M heap-caplists_share) and 3/3 passed on WARP (28/28 each) with zero flakes or debug-layer errors.LGTM.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.