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
felicerosella wants to merge 1 commit from upstream-pr/342 into main
felicerosella commented 2026-11-26 17:46:07 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by felicerosella on 2026-11-26T17:46:07Z.


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)

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5514758381 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/342). Originally posted by [felicerosella](https://github.com/felicerosella) on 2026-11-26T17:46:07Z. --- `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)
kilolimaVI commented 2026-11-26 19:31:27 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by kilolimaVI on 2026-11-26T19:31:27Z.


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.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7201682181 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/342#issuecomment-7201682181). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-26T19:31:27Z. --- 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.
felicerosella commented 2026-11-26 20:11:14 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by felicerosella on 2026-11-26T20:11:14Z.


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.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7202393001 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/342#issuecomment-7202393001). Originally posted by [felicerosella](https://github.com/felicerosella) on 2026-11-26T20:11:14Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!342
No description provided.