Tests: one submission at a time across the suite (no_write_is_lost_with_port_7 failed beside refreshed_ranges_hold_title_memory) #342

Closed
github-bot wants to merge 1 commit from github-bot/gh-342 into main AGit
Owner

@⁠felicerosella on GitHub · 2026-11-26 17:46 UTC · original
felicerosella:fix/one-submission-in-tests → main · +14 −3 · 2 files · 1 commits · closed without merging

watch::port7_tests::no_write_is_lost_with_port_7 (new with renderer port 7) fails now and then in the parallel victory-gpu suite, with round N, page P: X is not after X from its submission thread. It is another test's doing, not port 7's.

Cause. ask_once ends whatever asking stands, as it should with the runtime's one submission thread. The tests that play the submission each kept to that in their own way, or not at all:

  • host::refresh_tests::submission: a mutex of its own (static ONE)
  • host::refresh_tests::unchanged_ranges_are_known: a retry "if a submission of another test ended it"
  • the port-7 test's submission thread, and watch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own: nothing

So refreshed_ranges_hold_title_memory's ask_once ended the port-7 test's asking mid-round, and that test then read a page's write with a number it had already seen.

Fix (test code only). watch::submission_in_test() is one lock for all of them:

  • the host helper's mutex becomes this lock;
  • unchanged_ranges_are_known's look and the_rest_of_the_one_asking_has_a_number_of_its_own hold it;
  • the port-7 test's submission thread holds it for each round. Its writers and askers still run alongside, which is what that test is about.

I left unchanged_ranges_are_known's retry loop in place to keep the change small. It should no longer be needed.

How it was found. RTX 4070 SUPER, Ryzen 7 7800X3D, Windows 11 26200, main at c9c932c; 2de9980 only changes the README.

  • The test alone: 0/100 failed.
  • The test alone in 8 processes at once: 0/200 failed. So it is not a race inside port 7.
  • Halving the other 414 tests, 20 runs at each step, left one test: refreshed_ranges_hold_title_memory.
before after
port-7 test + refreshed_ranges_hold_title_memory (--exact) 20/20 failed 0/20 failed
cargo test -p victory-gpu --lib, clean runs 15/20 19/20
no_write_is_lost_with_port_7 failures in the suite 7/40 (with #328's runs) 0/20
unchanged_ranges_are_known failures in the suite 2/40 0/20

The one failure left after the fix is watch::tests::what_is_left_alone_is_no_known_hole (1/20), a guard-state test of #321's kind, unrelated to the submission.

cargo clippy -p victory-gpu --all-targets -- -D warnings is clean apart from main's own unnecessary_mut_passed in title_memory_remapped (#324), so CI will show that until #324 or an equivalent lands.

Part of #321 (unchanged_ranges_are_known's submission interference). Independent of #328, #277 and #315.

AI-assisted: yes (Claude Code)

**@⁠felicerosella** on GitHub · 2026-11-26 17:46 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/342) `felicerosella:fix/one-submission-in-tests` → `main` · +14 −3 · 2 files · 1 commits · closed without merging `watch::port7_tests::no_write_is_lost_with_port_7` (new with renderer port 7) fails now and then in the parallel `victory-gpu` suite, with `round N, page P: X is not after X` from its submission thread. It is another test's doing, not port 7's. **Cause.** `ask_once` ends whatever asking stands, as it should with the runtime's one submission thread. The tests that play the submission each kept to that in their own way, or not at all: - `host::refresh_tests::submission`: a mutex of its own (`static ONE`) - `host::refresh_tests::unchanged_ranges_are_known`: a retry "if a submission of another test ended it" - the port-7 test's submission thread, and `watch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own`: nothing So `refreshed_ranges_hold_title_memory`'s `ask_once` ended the port-7 test's asking mid-round, and that test then read a page's write with a number it had already seen. **Fix (test code only).** `watch::submission_in_test()` is one lock for all of them: - the host helper's mutex becomes this lock; - `unchanged_ranges_are_known`'s `look` and `the_rest_of_the_one_asking_has_a_number_of_its_own` hold it; - the port-7 test's submission thread holds it for each round. Its writers and askers still run alongside, which is what that test is about. I left `unchanged_ranges_are_known`'s retry loop in place to keep the change small. It should no longer be needed. **How it was found.** RTX 4070 SUPER, Ryzen 7 7800X3D, Windows 11 26200, `main` at `c9c932c`; `2de9980` only changes the README. - The test alone: 0/100 failed. - The test alone in 8 processes at once: 0/200 failed. So it is not a race inside port 7. - Halving the other 414 tests, 20 runs at each step, left one test: `refreshed_ranges_hold_title_memory`. | | before | after | |---|---|---| | port-7 test + `refreshed_ranges_hold_title_memory` (`--exact`) | 20/20 failed | 0/20 failed | | `cargo test -p victory-gpu --lib`, clean runs | 15/20 | 19/20 | | `no_write_is_lost_with_port_7` failures in the suite | 7/40 (with #328's runs) | 0/20 | | `unchanged_ranges_are_known` failures in the suite | 2/40 | 0/20 | The one failure left after the fix is `watch::tests::what_is_left_alone_is_no_known_hole` (1/20), a guard-state test of #321's kind, unrelated to the submission. `cargo clippy -p victory-gpu --all-targets -- -D warnings` is clean apart from `main`'s own `unnecessary_mut_passed` in `title_memory_remapped` (#324), so CI will show that until #324 or an equivalent lands. Part of #321 (`unchanged_ranges_are_known`'s submission interference). Independent of #328, #277 and #315. AI-assisted: yes (Claude Code)
ask_once ends whatever asking stands, as the runtime's one submission
thread may. Tests that play the submission each had their own way of
keeping to that: host::refresh_tests::submission a mutex of its own,
unchanged_ranges_are_known a retry "if a submission of another test
ended it", the port-7 test and the_rest_of_the_one_asking_has_a_number_of_its_own
nothing. Run together, one test's ask_once ended another's asking in the
middle, and the port-7 test read a page's write with the number it had
already seen ("round N, page P: X is not after X").

watch::submission_in_test is one lock for all of them: the host
helper's mutex becomes it, unchanged_ranges_are_known's look and
the_rest_of_the_one_asking_has_a_number_of_its_own hold it, and the
port-7 test's submission thread holds it for each round (its other
threads still ask and write meanwhile). Test code only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:59:36 +00:00
Author
Owner

@⁠kilolimaVI on GitHub · 2026-11-26 19:31 UTC · original

Reproduced and confirmed on Windows 11 (Ryzen 7 8845HS / Radeon 780M, pinned toolchain 1.98.1).

Filter: cargo test -p victory-gpu --lib --locked -- no_write_is_lost_with_port_7 refreshed_ranges_hold_title_memory unchanged_ranges_are_known the_rest_of_the_one_asking, 20 runs each:

failures
main, the four together 18/20
main, no_write_is_lost_with_port_7 alone 0/20
this PR, the four together 0/20

On main the failure is the one described: no_write_is_lost_with_port_7 panics at watch.rs:5917 ("round N, page P: X is not after X"), and only when run beside the others. With this PR it's gone.

At 18/20 on an 8-core laptop this likely also makes main's "Default tests" job flaky, so it may be worth merging early.

**@⁠kilolimaVI** on GitHub · 2026-11-26 19:31 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/342#issuecomment-7201682181) Reproduced and confirmed on Windows 11 (Ryzen 7 8845HS / Radeon 780M, pinned toolchain 1.98.1). Filter: `cargo test -p victory-gpu --lib --locked -- no_write_is_lost_with_port_7 refreshed_ranges_hold_title_memory unchanged_ranges_are_known the_rest_of_the_one_asking`, 20 runs each: | | failures | |---|---| | main, the four together | 18/20 | | main, `no_write_is_lost_with_port_7` alone | 0/20 | | this PR, the four together | 0/20 | On main the failure is the one described: `no_write_is_lost_with_port_7` panics at `watch.rs:5917` ("round N, page P: X is not after X"), and only when run beside the others. With this PR it's gone. At 18/20 on an 8-core laptop this likely also makes main's "Default tests" job flaky, so it may be worth merging early.
github-bot closed this pull request 2026-11-26 20:12:19 +00:00
Author
Owner

@⁠felicerosella on GitHub · 2026-11-26 20:11 UTC · original

Closing in favour of #347, which includes the same shared lock for the tests that play the submission (and conflicts with this PR in host.rs). Thanks @⁠kilolimaVI for the independent confirmation. Happy to reopen if #347 doesn't go in.

**@⁠felicerosella** on GitHub · 2026-11-26 20:11 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/342#issuecomment-7202393001) Closing in favour of #347, which includes the same shared lock for the tests that play the submission (and conflicts with this PR in `host.rs`). Thanks @⁠kilolimaVI for the independent confirmation. Happy to reopen if #347 doesn't go in.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.