watch: a_late_fault_leaves_the_guard_taken_since holds the guards' lock while its entry is unsettled #4704
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4704"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-12-01T02:35:15Z.
What it changes
watch::tests::a_late_fault_leaves_the_guard_taken_sincefails now and then when the wholevictory-gpusuite runs in parallel and passes on its own. #3920, #3474 and #3723 each report it that way. The cause is the test, not the code it checks.The test pushes an
Openedentry onto the globalOPENEDqueue and then asserts that both blocks are unsettled. But any thread that takesguards()runssettlefirst, so another test's thread taking the guards' lock between the push and the assertion settles the entry:assertion failed: unsettled(block(one), block(one) + 1). It also didn't takeone_view_test(), though it maps views of its own.Now it takes
one_view_test(), and holdsguards()from before the push until those three assertions. The next block, which takesguards()to settle the entry, is unchanged; whoever settles it, the assertions that follow hold the same. Only the test changes.How it was tested
CPU only: Ryzen 9 5950X (16 cores), Windows 11,
cargo test -p victory-gpu --lib --locked, the whole library suite with default parallel threads, 20 runs each:7d93ee07(+ #4619, which touches two other tests)f5c3d243+ the change)The two mains differ by two commits, neither in
watch.rs,host.rsorshadow.rs.Other failures in those runs, not touched here:
host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue: 5 and 7 of 20 runs (also seen in #4206).host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end: once, on this branch.cargo testpassed for the crates it touches: yes, apart from the flakes above.Checked for overlap
Tested with the help of Claude Code (Claude Opus 5.5).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-12-01T12:06:02Z.
Review: APPROVED
Reviewed crates/victory-gpu/src/watch.rs: taking one_view_test() and holding guards() across the unsettled-entry check in _late_fault_leaves_the_guard_taken_since prevents concurrent tests from settling the queue before the assertion runs. Verified on Windows: cargo test -p victory-gpu --lib watch::tests::a_late_fault_leaves_the_guard_taken_since -- --test-threads=1 (1 passed, 0 failed).
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Tan7rex on 2026-12-01T15:51:19Z.
Tested on Windows 11 Pro (build 26100), RTX 4090: this PR's change (
e03346cc) applied ontomain5fabb46e(it applies cleanly). Release test binary ofvictory-gpu --lib,watch::filter, 500 runs each with default parallel threads.main5fabb46emain+ this PRwatch::tests::a_late_fault_leaves_the_guard_taken_sincewatch::tests::ask_rest_falls_back_per_piece_when_touching_unwatched_neighbour(#4619's)watch::many_askers_tests::no_write_is_lost_when_faults_take_no_lockThe test this PR fixes failed only 2 times in 500 on
mainhere, so 0 with the PR fits the fix but doesn't prove it. In 60 runs of the wholevictory-gpulibrary onmainit failed once. The oneno_write_is_lost_when_faults_take_no_lockfailure looks unrelated: this PR only changesa_late_fault_leaves_the_guard_taken_since, and that test also failed once in 300 runs with #3603 applied.Not tested: the game (test-only change).
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.