Hold the test lock in the other view-mapping tests #324

Manually merged
github merged 1 commit from github-bot/gh-324 into gh-pr/324/base 2026-11-27 17:36:42 +00:00 AGit
Owner

@⁠hamdanpor-ctrl on GitHub · 2026-11-27 16:42 UTC · original
hamdanpor-ctrl:test/lock-remaining-view-tests → main · +6 −0 · 1 files · 1 commits · merged 2026-11-27 17:31 UTC

Follow-up to #246, as suggested there: six more tests in watch.rs map views of their own and now hold one_asking_test() as well (what_is_put_in_beside_the_guards_is_told_at_every_view, 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). Tests only.

On main at f948c70 with this change: cargo test -p victory-gpu --locked failed 0 of 10 runs (496 passed each); clippy on victory-gpu is clean. Earlier, on 6b3a266 with #246 and these six: 0 of 30 runs. RTX 3050 Laptop GPU 4 GB, i7-12700H, 16 GB, Windows 11 Pro.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 16:42 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/324) `hamdanpor-ctrl:test/lock-remaining-view-tests` → `main` · +6 −0 · 1 files · 1 commits · merged 2026-11-27 17:31 UTC Follow-up to #246, as suggested there: six more tests in `watch.rs` map views of their own and now hold `one_asking_test()` as well (`what_is_put_in_beside_the_guards_is_told_at_every_view`, `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`). Tests only. On `main` at `f948c70` with this change: `cargo test -p victory-gpu --locked` failed 0 of 10 runs (496 passed each); clippy on `victory-gpu` is clean. Earlier, on `6b3a266` with #246 and these six: 0 of 30 runs. RTX 3050 Laptop GPU 4 GB, i7-12700H, 16 GB, Windows 11 Pro. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Six more tests in watch.rs map views of their own without holding
one_asking_test, among them what_is_put_in_beside_the_guards_is_told_at_every_view,
which came to main after this branch began. Testing PRs #245 and #238 on
top of main 6b3a266, view-guard tests failed now and then as before.

With all of them holding the lock, on main 6b3a266: cargo test -p
victory-gpu 0 of 30 runs failed, 473 passed each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 16:44:39 +00:00
Author
Owner

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

The two failing checks come from one test this PR does not touch: host::retire_batch_tests::batched_retirement_preserves_resource_lifetime_until_bury_on_gpu (from #295), drop-flushed resource leaked after bury, left 2, right 1, in the diagnostics job (--all-features --test-threads=1). This PR only adds one_asking_test() to six tests in watch.rs.

On my laptop (RTX 3050 Laptop 4 GB, i7-12700H, Windows 11) that test with --all-features --exact --test-threads=1:

Tree When Failed
5160663 (this PR's head) while another GPU-heavy job ran on the same card 20 of 20
f948c70 (its base) same time 0 of 1
5160663 later, card idle 0 of 10
5160663 later, all cores busy 0 of 10
retire_batch_tests on 151b7db, and on 151b7db + this PR card idle 0 of 20 each

So it looks timing-dependent rather than caused by this change. Could you re-run the failed jobs?

One possible cause, not proven: the test reads the references right after std::thread::scope returns, and the drop path depends on the second thread's BATCH thread-local being dropped; the scope's own wait may end before a thread's thread-locals are dropped. The mixed retirement test joins its worker explicitly and has not failed here. A branch that joins the threads explicitly is at https://github.com/hamdanpor-ctrl/Vice-Tay/tree/fix/retire-tests-join-threads (0 of 20 failures, clippy clean, the full victory-gpu diagnostics suite passes), but since I can no longer reproduce the failure I can't show it fixes it, so I'm not opening it as a PR.

AI-assisted (Claude Code).

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 17:17 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/324#issuecomment-7224242888) The two failing checks come from one test this PR does not touch: `host::retire_batch_tests::batched_retirement_preserves_resource_lifetime_until_bury_on_gpu` (from #295), `drop-flushed resource leaked after bury`, left 2, right 1, in the diagnostics job (`--all-features --test-threads=1`). This PR only adds `one_asking_test()` to six tests in `watch.rs`. On my laptop (RTX 3050 Laptop 4 GB, i7-12700H, Windows 11) that test with `--all-features --exact --test-threads=1`: | Tree | When | Failed | |---|---|---:| | `5160663` (this PR's head) | while another GPU-heavy job ran on the same card | 20 of 20 | | `f948c70` (its base) | same time | 0 of 1 | | `5160663` | later, card idle | 0 of 10 | | `5160663` | later, all cores busy | 0 of 10 | | `retire_batch_tests` on `151b7db`, and on `151b7db` + this PR | card idle | 0 of 20 each | So it looks timing-dependent rather than caused by this change. Could you re-run the failed jobs? One possible cause, not proven: the test reads the references right after `std::thread::scope` returns, and the drop path depends on the second thread's `BATCH` thread-local being dropped; the scope's own wait may end before a thread's thread-locals are dropped. The mixed retirement test joins its worker explicitly and has not failed here. A branch that joins the threads explicitly is at https://github.com/hamdanpor-ctrl/Vice-Tay/tree/fix/retire-tests-join-threads (0 of 20 failures, clippy clean, the full `victory-gpu` diagnostics suite passes), but since I can no longer reproduce the failure I can't show it fixes it, so I'm not opening it as a PR. AI-assisted (Claude Code).
github-bot changed target branch from main to gh-pr/324/base 2026-11-27 17:36:40 +00:00
github manually merged commit 516066337b into gh-pr/324/base 2026-11-27 17:36:42 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 17:26 UTC · original

@⁠hamdanpor-ctrl I reproduced the ordering on Windows by holding a thread-local destructor open. The scope returned while the batch was still alive, and an explicit join waited for it. I requested the failed-job rerun on 5160663 and opened #336 with your two test changes and attribution.

**@⁠TaynanGT** on GitHub · 2026-11-27 17:26 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/324#issuecomment-7224401444) @⁠hamdanpor-ctrl I reproduced the ordering on Windows by holding a thread-local destructor open. The scope returned while the batch was still alive, and an explicit join waited for it. I requested the failed-job rerun on `5160663` and opened #336 with your two test changes and attribution.
This discussion has been locked. Commenting is limited to contributors.
No description provided.