Tests that stand a submission's asking take one shared lock (#534) #539

Open
github-bot wants to merge 1 commit from github-bot/gh-539 into a-publier AGit
Owner

@⁠jptorres96 on GitHub · 2026-11-27 10:30 UTC · original
jptorres96:fix-standing-asking-tests → a-publier · +14 −3 · 2 files · 1 commits · open

Fixes #534.

The journal's standing asking (ask_once … ask_once_end) is process-wide. Only one thread submits in the runtime, but cargo test runs tests side by side, so one test's ask_once_end could end another's asking mid-round.

watch::STANDING_IN_TEST (test-only) is now taken by no_write_is_lost_with_port_7, the_rest_of_the_one_asking_has_a_number_of_its_own, unchanged_ranges_are_known, and the refresh tests' submission() helper, which had a lock of its own that only it took. No runtime code changes.

cargo test -p victory-gpu --lib, RTX 4080 SUPER / Ryzen 5 5600X:

  • before: 2 of 15 runs failed (no_write_is_lost_with_port_7, unchanged_ranges_are_known)
  • after: those two tests passed in all 40 runs

Separate, not addressed here: in those 40 runs, two view/guard tests failed once each: a_block_just_written_rests (watch.rs:4812) and a_write_told_at_one_view_is_reported_at_the_others (watch.rs:4735). They look like another shared-state interaction, around mappings and views. I can open an issue for them.

**@⁠jptorres96** on GitHub · 2026-11-27 10:30 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/539) `jptorres96:fix-standing-asking-tests` → `a-publier` · +14 −3 · 2 files · 1 commits · open Fixes #534. The journal's standing asking (`ask_once` … `ask_once_end`) is process-wide. Only one thread submits in the runtime, but `cargo test` runs tests side by side, so one test's `ask_once_end` could end another's asking mid-round. `watch::STANDING_IN_TEST` (test-only) is now taken by `no_write_is_lost_with_port_7`, `the_rest_of_the_one_asking_has_a_number_of_its_own`, `unchanged_ranges_are_known`, and the refresh tests' `submission()` helper, which had a lock of its own that only it took. No runtime code changes. `cargo test -p victory-gpu --lib`, RTX 4080 SUPER / Ryzen 5 5600X: - before: 2 of 15 runs failed (`no_write_is_lost_with_port_7`, `unchanged_ranges_are_known`) - after: those two tests passed in all 40 runs Separate, not addressed here: in those 40 runs, two view/guard tests failed once each: `a_block_just_written_rests` (watch.rs:4812) and `a_write_told_at_one_view_is_reported_at_the_others` (watch.rs:4735). They look like another shared-state interaction, around mappings and views. I can open an issue for them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:41:19 +00:00
Author
Owner

@⁠lvndrpup on GitHub · 2026-11-27 11:17 UTC · original · reviewed

Tested on an RTX 3060 Ti (Windows 11, debug build), base 4eb6cfd against head 355608b.

Each run put the tests that take the lock beside the tests in the GPU modules that submit work, to see whether the ones left unlocked get in the way (filter host::refresh_tests port7_tests the_rest_of_the_one_asking resource::tests indirect::tests texture::ahead pipeline::host host::card_steps, 55 tests run):

build runs failed
base 4eb6cfd 40 7, all no_write_is_lost_with_port_7 (watch.rs:5917, "… is not after …", as in #534)
head 355608b 40 0

So it fixes what #534 reports on this card as well.

Three things to know before merging:

  • It makes the same change as #382 and #462. Both of those put a test-only lock in the same four tests (refresh_tests::submission, unchanged_ranges_are_known, the port 7 test, the_rest_of_the_one_asking_has_a_number_of_its_own). This PR conflicts with #382 in host.rs and watch.rs and with #462 in host.rs, so only one of the three can go in as it is. It merges cleanly with #450. One difference: here the lock is held for the whole port 7 test, askers included, where #382 and #462 hold it only around the submission thread's asking. Both work, since nothing inside takes it again.
  • Host::submit still takes no lock. It calls ask_once (host.rs:5840, on by default) and ask_once_end (host.rs:5898), and every test that calls host.execute goes through it: the ones in resource, indirect, pipeline::host, texture::ahead and host::card_steps. #534 suggests taking the lock there under cfg(test); none of the three PRs does. Those tests ran in the same process in all 80 runs above and caused no failure, so I can only say the path is open, not that it matters. (On #462 I named only the card_steps test; it is all of these.)
  • The other failures you saw. a_write_told_at_one_view_is_reported_at_the_others is one of the tests #450 lists: an address freed during a change of mapping goes to another test's view. One full --lib run on this head failed here in other_memory_at_a_guarded_address_keeps_its_protection, which MamaLeVrai traced to the same cause on #450, and in a_block_guarded_before_we_were_told_of_its_view_can_be_written. I don't know about a_block_just_written_rests or that last one. It may be worth checking against #450 before opening an issue (#450 is mine).
**@⁠lvndrpup** on GitHub · 2026-11-27 11:17 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/539#pullrequestreview-6087334511) · **reviewed** Tested on an RTX 3060 Ti (Windows 11, debug build), base `4eb6cfd` against head `355608b`. Each run put the tests that take the lock beside the tests in the GPU modules that submit work, to see whether the ones left unlocked get in the way (filter `host::refresh_tests port7_tests the_rest_of_the_one_asking resource::tests indirect::tests texture::ahead pipeline::host host::card_steps`, 55 tests run): | build | runs | failed | |---|---|---| | base `4eb6cfd` | 40 | 7, all `no_write_is_lost_with_port_7` (`watch.rs:5917`, "… is not after …", as in #534) | | head `355608b` | 40 | 0 | So it fixes what #534 reports on this card as well. Three things to know before merging: - **It makes the same change as #382 and #462.** Both of those put a test-only lock in the same four tests (`refresh_tests::submission`, `unchanged_ranges_are_known`, the port 7 test, `the_rest_of_the_one_asking_has_a_number_of_its_own`). This PR conflicts with #382 in `host.rs` and `watch.rs` and with #462 in `host.rs`, so only one of the three can go in as it is. It merges cleanly with #450. One difference: here the lock is held for the whole port 7 test, askers included, where #382 and #462 hold it only around the submission thread's asking. Both work, since nothing inside takes it again. - **`Host::submit` still takes no lock.** It calls `ask_once` (`host.rs:5840`, on by default) and `ask_once_end` (`host.rs:5898`), and every test that calls `host.execute` goes through it: the ones in `resource`, `indirect`, `pipeline::host`, `texture::ahead` and `host::card_steps`. #534 suggests taking the lock there under `cfg(test)`; none of the three PRs does. Those tests ran in the same process in all 80 runs above and caused no failure, so I can only say the path is open, not that it matters. (On #462 I named only the `card_steps` test; it is all of these.) - **The other failures you saw.** `a_write_told_at_one_view_is_reported_at_the_others` is one of the tests #450 lists: an address freed during a change of mapping goes to another test's view. One full `--lib` run on this head failed here in `other_memory_at_a_guarded_address_keeps_its_protection`, which MamaLeVrai traced to the same cause on #450, and in `a_block_guarded_before_we_were_told_of_its_view_can_be_written`. I don't know about `a_block_just_written_rests` or that last one. It may be worth checking against #450 before opening an issue (#450 is mine).
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 15:56 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At 355608b: victory-gpu 396 passed, 0 failed, 34 ignored.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-27 15:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/539#issuecomment-7222671142) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `355608b`: `victory-gpu` 396 passed, 0 failed, 34 ignored. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠jptorres96 on GitHub · 2026-11-27 16:19 UTC · original

Thanks @⁠lvndrpup and @⁠MamaLeVrai for running it. I missed #382 and #462 before opening this; they make the same change, so only one of the three should go in. I'm happy to close this one in favour of whichever the maintainer prefers. For the record, the numbers from my RTX 4080 SUPER (Ryzen 5 5600X, Windows build 26300): base 2 of 15 full victory-gpu --lib runs failed on the two locked tests, head 0 of 40.

The view/guard failures I listed belong to #450, so I won't open a separate issue for them.

**@⁠jptorres96** on GitHub · 2026-11-27 16:19 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/539#issuecomment-7223117015) Thanks @⁠lvndrpup and @⁠MamaLeVrai for running it. I missed #382 and #462 before opening this; they make the same change, so only one of the three should go in. I'm happy to close this one in favour of whichever the maintainer prefers. For the record, the numbers from my RTX 4080 SUPER (Ryzen 5 5600X, Windows build 26300): base 2 of 15 full `victory-gpu --lib` runs failed on the two locked tests, head 0 of 40. The view/guard failures I listed belong to #450, so I won't open a separate issue for them.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/539/head:github-bot/gh-539'
git switch 'github-bot/gh-539'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-539'
git switch 'github-bot/gh-539'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-539'
git switch 'github-bot/gh-539'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-539'
git switch 'a-publier'
git merge --squash 'github-bot/gh-539'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-539'
git switch 'a-publier'
git merge 'github-bot/gh-539'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.