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

Open
felicerosella wants to merge 1 commit from upstream-pr/382 into a-publier
felicerosella commented 2026-11-26 22:58:54 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by felicerosella on 2026-11-26T22:58:54Z.


watch::port7_tests::no_write_is_lost_with_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.

Results on a-publier at 4eb6cfd, RTX 4070 SUPER, Ryzen 7 7800X3D, Windows 11 26200:

before after
no_write_is_lost_with_port_7 + refreshed_ranges_hold_title_memory (--exact), 20 runs 20/20 failed 0/20 failed
full cargo test -p victory-gpu --lib, 10 runs 10/10 clean 10/10 clean

In the full suite it only shows up now and then. It came up once in 4 full runs on this machine while I was testing something else. cargo clippy -p victory-gpu --all-targets -- -D warnings is clean.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:5518283164 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/382). Originally posted by [felicerosella](https://github.com/felicerosella) on 2026-11-26T22:58:54Z. --- `watch::port7_tests::no_write_is_lost_with_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. **Results** on `a-publier` at `4eb6cfd`, RTX 4070 SUPER, Ryzen 7 7800X3D, Windows 11 26200: | | before | after | |---|---|---| | `no_write_is_lost_with_port_7` + `refreshed_ranges_hold_title_memory` (`--exact`), 20 runs | 20/20 failed | 0/20 failed | | full `cargo test -p victory-gpu --lib`, 10 runs | 10/10 clean | 10/10 clean | In the full suite it only shows up now and then. It came up once in 4 full runs on this machine while I was testing something else. `cargo clippy -p victory-gpu --all-targets -- -D warnings` is clean. AI-assisted: yes (Claude Code)
MamaLeVrai commented 2026-11-27 00:22:24 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by MamaLeVrai on 2026-11-27T00:22:24Z.


Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at 3ed1953: cargo test --release -p victory-gpu --lib 396 passed, 0 failed, 34 ignored.

AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7206405571 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/382#issuecomment-7206405571). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-27T00:22:24Z. --- Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `3ed1953`: `cargo test --release -p victory-gpu --lib` 396 passed, 0 failed, 34 ignored. AI-assisted (Claude Code); no game data.
lvndrpup commented 2026-11-27 03:31:51 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by lvndrpup on 2026-11-27T03:31:51Z.

Review: COMMENTED


Tested on an RTX 3060 Ti 8 GB, Ryzen 5 5600X, 32 GB, Windows 11 build 26300, Rust 1.98.1, debug. On 4eb6cfd, no_write_is_lost_with_port_7 beside refreshed_ranges_hold_title_memory failed in 10 of 10 runs; with 3ed1953, in 0 of 10. It merges cleanly with #446 and #450, and cargo test -p victory-gpu --lib -- watch:: host::refresh_tests failed in 0 of 30 runs with #450, and in 0 of 30 with #446 and #450.

One more caller: host::card_steps::tests::the_card_copies_what_is_recorded is not ignored and submits through host.execute (card_steps.rs:1202). HostQueue::submit then calls watch::ask_once (host.rs:5840) and ask_once_end (host.rs:5898) without submission_in_test(), so it can still end the asking of a test that holds the guard. A throwaway eprintln! in ask_once showed one call per run on this card. I have not seen a failure from it, since the window is one call a run. Taking the guard at the top of that test (let _one = crate::watch::submission_in_test();) would close it. submit never takes the guard, so this cannot deadlock. I tried that one line on top of this PR, #446 and #450, and cargo test -p victory-gpu --lib -- host::card_steps watch::port7_tests host::refresh_tests passed in 5 of 5 runs (17 tests each).

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review:6083088317 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/382#pullrequestreview-6083088317). Originally posted by [lvndrpup](https://github.com/lvndrpup) on 2026-11-27T03:31:51Z. **Review:** COMMENTED --- Tested on an RTX 3060 Ti 8 GB, Ryzen 5 5600X, 32 GB, Windows 11 build 26300, Rust 1.98.1, debug. On `4eb6cfd`, `no_write_is_lost_with_port_7` beside `refreshed_ranges_hold_title_memory` failed in 10 of 10 runs; with `3ed1953`, in 0 of 10. It merges cleanly with #446 and #450, and `cargo test -p victory-gpu --lib -- watch:: host::refresh_tests` failed in 0 of 30 runs with #450, and in 0 of 30 with #446 and #450. One more caller: `host::card_steps::tests::the_card_copies_what_is_recorded` is not ignored and submits through `host.execute` (`card_steps.rs:1202`). `HostQueue::submit` then calls `watch::ask_once` (`host.rs:5840`) and `ask_once_end` (`host.rs:5898`) without `submission_in_test()`, so it can still end the asking of a test that holds the guard. A throwaway `eprintln!` in `ask_once` showed one call per run on this card. I have not seen a failure from it, since the window is one call a run. Taking the guard at the top of that test (`let _one = crate::watch::submission_in_test();`) would close it. `submit` never takes the guard, so this cannot deadlock. I tried that one line on top of this PR, #446 and #450, and `cargo test -p victory-gpu --lib -- host::card_steps watch::port7_tests host::refresh_tests` passed in 5 of 5 runs (17 tests each).
lvndrpup commented 2026-11-27 04:14:54 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by lvndrpup on 2026-11-27T04:14:54Z.


More data, from the whole victory-gpu lib test binary run directly with default test threads, which is where these failures show. RTX 3060 Ti 8 GB, Windows 11 build 26300, Rust 1.98.1, debug, 30 runs each, alternating:

tree failed runs failing tests
a-publier 4eb6cfd 5 of 30 host::refresh_tests::unchanged_ranges_are_known (3), watch::port7_tests::no_write_is_lost_with_port_7 (3), both in one run
4eb6cfd + this PR + #446 + #450 0 of 30

So with this PR, unchanged_ranges_are_known is covered too. #446 lists it as still failing now and then: its look closure is one of the places that now takes submission_in_test(). descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes, the other one #446 names, did not fail in any of these 60 runs.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7209643107 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/382#issuecomment-7209643107). Originally posted by [lvndrpup](https://github.com/lvndrpup) on 2026-11-27T04:14:54Z. --- More data, from the whole `victory-gpu` lib test binary run directly with default test threads, which is where these failures show. RTX 3060 Ti 8 GB, Windows 11 build 26300, Rust 1.98.1, debug, 30 runs each, alternating: | tree | failed runs | failing tests | |---|---|---| | `a-publier` `4eb6cfd` | 5 of 30 | `host::refresh_tests::unchanged_ranges_are_known` (3), `watch::port7_tests::no_write_is_lost_with_port_7` (3), both in one run | | `4eb6cfd` + this PR + #446 + #450 | 0 of 30 | | So with this PR, `unchanged_ranges_are_known` is covered too. #446 lists it as still failing now and then: its `look` closure is one of the places that now takes `submission_in_test()`. `descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes`, the other one #446 names, did not fail in any of these 60 runs.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/382:upstream-pr/382'
git switch 'upstream-pr/382'

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.

git switch 'a-publier'
git merge --no-ff 'upstream-pr/382'
git switch 'upstream-pr/382'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'upstream-pr/382'
git switch 'upstream-pr/382'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'upstream-pr/382'
git switch 'a-publier'
git merge --squash 'upstream-pr/382'
git switch 'a-publier'
git merge --ff-only 'upstream-pr/382'
git switch 'a-publier'
git merge 'upstream-pr/382'
git push origin 'a-publier'
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
Belobug/VIctory-Belobug-AMD!382
No description provided.