Run the view-guard tests one at a time #246

Manually merged
github merged 1 commit from gh-pr/246/head into gh-pr/246/base 2026-11-27 12:11:24 +00:00
Owner

@⁠hamdanpor-ctrl on GitHub · 2026-11-27 12:00 UTC · original
hamdanpor-ctrl:fix/flaky-block-just-written-rests → main · +26 −3 · 1 files · 1 commits · merged 2026-11-27 12:10 UTC

cargo test -p victory-gpu fails now and then on my laptop. The view-guard tests in watch.rs share the global guards and ran beside each other: a view one test maps can land beside another test's guarded block, and that block is then told as written again, so a range the test expects clean comes back with its page (left: Some([page]), right: Some([])).

This makes the 21 tests that guard views of their own hold one_asking_test(), as the ask_once tests already do, and says so in its comment. Tests only; nothing outside #[cfg(test)] changes.

cargo test -p victory-gpu --locked Runs Failed
main at 573eff0 11 2 (both a_block_just_written_rests)
a_block_just_written_rests alone, on main 30 0
only a_block_just_written_rests holding the lock 30 2 (a_range_that_begins_in_an_unmapped_block_is_guarded, a_write_through_another_view_is_reported_at_the_guarded_one)
this branch 30 0 (471 passed each, about 25 s as before)

Clippy with and without --all-features is clean. cargo test --workspace --all-features -- --test-threads=1 passed on main as well, which runs the tests one at a time.

  • PC: RTX 3050 Laptop GPU 4 GB (driver 32.0.16.1742) with Intel Iris Xe, i7-12700H, 16 GB, Windows 11 Pro
  • Toolchain: Rust 1.98.1, VS 2022 Build Tools

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 12:00 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/246) `hamdanpor-ctrl:fix/flaky-block-just-written-rests` → `main` · +26 −3 · 1 files · 1 commits · merged 2026-11-27 12:10 UTC `cargo test -p victory-gpu` fails now and then on my laptop. The view-guard tests in `watch.rs` share the global guards and ran beside each other: a view one test maps can land beside another test's guarded block, and that block is then told as written again, so a range the test expects clean comes back with its page (`left: Some([page])`, `right: Some([])`). This makes the 21 tests that guard views of their own hold `one_asking_test()`, as the `ask_once` tests already do, and says so in its comment. Tests only; nothing outside `#[cfg(test)]` changes. | `cargo test -p victory-gpu --locked` | Runs | Failed | |---|---:|---:| | `main` at `573eff0` | 11 | 2 (both `a_block_just_written_rests`) | | `a_block_just_written_rests` alone, on `main` | 30 | 0 | | only `a_block_just_written_rests` holding the lock | 30 | 2 (`a_range_that_begins_in_an_unmapped_block_is_guarded`, `a_write_through_another_view_is_reported_at_the_guarded_one`) | | this branch | 30 | 0 (471 passed each, about 25 s as before) | Clippy with and without `--all-features` is clean. `cargo test --workspace --all-features -- --test-threads=1` passed on `main` as well, which runs the tests one at a time. - PC: RTX 3050 Laptop GPU 4 GB (driver 32.0.16.1742) with Intel Iris Xe, i7-12700H, 16 GB, Windows 11 Pro - Toolchain: Rust 1.98.1, VS 2022 Build Tools AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The guards are global, and the tests that guard views of their own ran
beside each other. A view one test maps can land beside another test's
guarded block, which makes that block be told as written again, so a
range the test expects clean comes back with its page in it.

On an RTX 3050 Laptop GPU (i7-12700H, Windows 11), `cargo test -p
victory-gpu` on main 573eff0 failed 2 of 11 runs, both at
a_block_just_written_rests ("left: Some([page]) right: Some([])"); alone
that test failed 0 of 30. With only it holding one_asking_test, 2 of 30
runs failed the same way at two other view-guard tests. With all 21
holding it: 0 of 30 runs, 471 passed each, about 25 s as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 12:11:22 +00:00
github manually merged commit 7ed5904d35 into gh-pr/246/base 2026-11-27 12:11:23 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 12:03 UTC · original

@⁠hamdanpor-ctrl The repeated run where serialising just one test moved the failure to other view tests makes the shared guard state the useful clue. I’ll check that the 21 tests take the same lock as the existing ask_once cases and run the parallel Windows suite at this head.

**@⁠TaynanGT** on GitHub · 2026-11-27 12:03 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/246#issuecomment-7217790560) @⁠hamdanpor-ctrl The repeated run where serialising just one test moved the failure to other view tests makes the shared guard state the useful clue. I’ll check that the 21 tests take the same lock as the existing `ask_once` cases and run the parallel Windows suite at this head.
Author
Owner

@⁠hamdanpor-ctrl on GitHub · 2026-11-27 16:23 UTC · original

Rebased onto main at 6b3a266 and added the lock to six more tests that map views of their own (what_is_put_in_beside_the_guards_is_told_at_every_view, which came to main after this branch, bits_go_at_every_view, holes_are_known_until_the_runtime_tells, no_mapping_is_lost_between_askers, no_write_through_another_view_is_lost_between_askers, nothing_is_guarded_between_our_forgetting_it_and_its_unmapping).

While testing #245, #238 and #247 on top of 6b3a266 here, view-guard tests failed now and then as before (a_write_is_reported_at_every_checked_view, what_is_put_in_beside_the_guards_is_told_at_every_view, what_the_kernel_writes_through_is_not_guarded_for_another_view, a_block_just_written_rests, a_view_being_split_leaves_its_pages_unguarded_elsewhere).

With this branch: cargo test -p victory-gpu --locked failed 0 of 30 runs (473 passed each); clippy on victory-gpu is clean. Same laptop: RTX 3050 Laptop 4 GB, i7-12700H, 16 GB, Windows 11 Pro.

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 16:23 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/246#issuecomment-7223206615) Rebased onto `main` at `6b3a266` and added the lock to six more tests that map views of their own (`what_is_put_in_beside_the_guards_is_told_at_every_view`, which came to `main` after this branch, `bits_go_at_every_view`, `holes_are_known_until_the_runtime_tells`, `no_mapping_is_lost_between_askers`, `no_write_through_another_view_is_lost_between_askers`, `nothing_is_guarded_between_our_forgetting_it_and_its_unmapping`). While testing #245, #238 and #247 on top of `6b3a266` here, view-guard tests failed now and then as before (`a_write_is_reported_at_every_checked_view`, `what_is_put_in_beside_the_guards_is_told_at_every_view`, `what_the_kernel_writes_through_is_not_guarded_for_another_view`, `a_block_just_written_rests`, `a_view_being_split_leaves_its_pages_unguarded_elsewhere`). With this branch: `cargo test -p victory-gpu --locked` failed 0 of 30 runs (473 passed each); clippy on `victory-gpu` is clean. Same laptop: RTX 3050 Laptop 4 GB, i7-12700H, 16 GB, Windows 11 Pro.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 16:25 UTC · original

@⁠hamdanpor-ctrl Zero failures in 30 runs makes the six view tests a good follow-up. #246 is already in main, so a small PR from the current tip with just the extra lock coverage will let the CI result isolate that change.

**@⁠TaynanGT** on GitHub · 2026-11-27 16:25 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/246#issuecomment-7223243936) @⁠hamdanpor-ctrl Zero failures in 30 runs makes the six view tests a good follow-up. #246 is already in main, so a small PR from the current tip with just the extra lock coverage will let the CI result isolate that change.
This discussion has been locked. Commenting is limited to contributors.
No description provided.