Test that a probe round reaches every blank texture when others leave after the wrap #399

Merged
m0rff merged 1 commit from upstream-pr/399 into main 2026-11-28 01:34:20 +00:00
m0rff commented 2026-11-27 16:49:19 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T16:49:19Z.


Refs #344

Cause of the flake. #349 (already merged) changed a_texture_blank_for_thousands_of_submissions_is_still_probed to hold the title lock and check the write with no probe deadline. That was not the cause: the test still failed with no deadline, now at the new assertion. A diagnostic on that assertion showed the test's texture still blank and still in blank_keys after the submission. In that same round the list went from 204 to 203 entries, because another test running in parallel had written its own blank texture.

Before #252, probe_round removed a leaving key with swap_remove, which moves the list's last key into its slot. After the round had wrapped, that key had often been probed already. Probing it again used up the round's last step, so the key just before the round's start was not probed in that submission. #252's wrapped removal, merged after this issue's measurements, keeps removals inside the unvisited part of the list and fixes this. So this PR changes no code. It adds a test for that behaviour and a note in docs/native-host.md.

Test. a_blank_texture_leaving_after_the_wrap_does_not_skip_another puts only four blank textures in blank_keys, starts the round at the last one, and writes:

  • textures 1 and 2: the key swapped in was probed already;
  • textures 0, 1 and 2: the second removal swaps in a key not yet probed.

Each case expects every written texture to be uploaded at that submission. Results, 20 runs each:

  • main: passes 20/20;
  • main with #252's wrapped removal turned off: fails 20/20 ([1, 2, 1, 1] for the first case on the old code);
  • a fix that only moves the cursor past the swapped-in key: fails the second case ([2, 2, 1, 1]).

Stress results (texture_tests module, 8 threads, 4 CPU burners, as in #308):

Tree Runs Failures of this test Other failures
base before #252 (60baf130) 400 3 1 (a_missed_write_not_followed_by_another_backs_off_whole_reads, line 256)
main 4cf84c83 + this test 500 0 0

a_missed_write_not_followed_by_another_backs_off_whole_reads failed on the old base in two ways. Its blank-write assertion (left: 1, right: 2) looks like the same skip. Its "missed-sample write uploaded" assertion is a different mechanism: it drops the title lock between with_title blocks. Neither failure showed in the 500 runs on main, but this PR does not change that test.

Checks: the CI test set (native arm64), Windows clippy with -D warnings, and cargo xtask policy all pass.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5530180581 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/399). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-27T16:49:19Z. --- Refs #344 **Cause of the flake.** #349 (already merged) changed `a_texture_blank_for_thousands_of_submissions_is_still_probed` to hold the title lock and check the write with no probe deadline. That was not the cause: the test still failed with no deadline, now at the new assertion. A diagnostic on that assertion showed the test's texture still blank and still in `blank_keys` after the submission. In that same round the list went from 204 to 203 entries, because another test running in parallel had written its own blank texture. Before #252, `probe_round` removed a leaving key with `swap_remove`, which moves the list's last key into its slot. After the round had wrapped, that key had often been probed already. Probing it again used up the round's last step, so the key just before the round's start was not probed in that submission. #252's wrapped removal, merged after this issue's measurements, keeps removals inside the unvisited part of the list and fixes this. So this PR changes no code. It adds a test for that behaviour and a note in `docs/native-host.md`. **Test.** `a_blank_texture_leaving_after_the_wrap_does_not_skip_another` puts only four blank textures in `blank_keys`, starts the round at the last one, and writes: - textures 1 and 2: the key swapped in was probed already; - textures 0, 1 and 2: the second removal swaps in a key not yet probed. Each case expects every written texture to be uploaded at that submission. Results, 20 runs each: - main: passes 20/20; - main with #252's wrapped removal turned off: fails 20/20 (`[1, 2, 1, 1]` for the first case on the old code); - a fix that only moves the cursor past the swapped-in key: fails the second case (`[2, 2, 1, 1]`). **Stress results** (`texture_tests` module, 8 threads, 4 CPU burners, as in #308): | Tree | Runs | Failures of this test | Other failures | |---|---|---|---| | base before #252 (`60baf130`) | 400 | 3 | 1 (`a_missed_write_not_followed_by_another_backs_off_whole_reads`, line 256) | | main `4cf84c83` + this test | 500 | 0 | 0 | `a_missed_write_not_followed_by_another_backs_off_whole_reads` failed on the old base in two ways. Its blank-write assertion (`left: 1, right: 2`) looks like the same skip. Its "missed-sample write uploaded" assertion is a different mechanism: it drops the title lock between `with_title` blocks. Neither failure showed in the 500 runs on main, but this PR does not change that test. Checks: the CI test set (native arm64), Windows clippy with `-D warnings`, and `cargo xtask policy` all pass.
Olima34 commented 2026-11-28 01:34:16 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:34:16Z.

Review: APPROVED


Check report (helping the maintainer clear the queue):

  • CI: check and macos-scripts green on the current head.
  • Read: the whole diff (test and docs only). The test pins the wrapped-removal fix in the blank-texture probe round, with two cases that the docs say fail without it.
  • Local check: current main (226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#397 #399 #422 #467 #471 #475 #479 #481 #486 #489 #494 #498 #505 #511). On it, the victory-gpu (arm64), victory-shader, victory-backend, victory-metal and victory tests pass, as do the macOS script tests (rustup-path.sh, run-summary-compare.sh, run-summary.sh --self-test), Windows clippy (-D warnings) and cargo xtask policy. One victory-gpu run in four failed main's own multi_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately. That test also flakes on main alone, so it isn't from this batch.
  • Not checked: no game run (the maintainer asked us to work on GitHub only).

Thanks @m0rff!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6094918051 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/399#pullrequestreview-6094918051). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T01:34:16Z. **Review:** APPROVED --- Check report (helping the maintainer clear the queue): - **CI:** `check` and `macos-scripts` green on the current head. - **Read:** the whole diff (test and docs only). The test pins the wrapped-removal fix in the blank-texture probe round, with two cases that the docs say fail without it. - **Local check:** current main (226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#397 #399 #422 #467 #471 #475 #479 #481 #486 #489 #494 #498 #505 #511). On it, the `victory-gpu` (arm64), `victory-shader`, `victory-backend`, `victory-metal` and `victory` tests pass, as do the macOS script tests (`rustup-path.sh`, `run-summary-compare.sh`, `run-summary.sh --self-test`), Windows clippy (`-D warnings`) and `cargo xtask policy`. One `victory-gpu` run in four failed main's own `multi_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately`. That test also flakes on main alone, so it isn't from this batch. - **Not checked:** no game run (the maintainer asked us to work on GitHub only). Thanks @m0rff!
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
LakshanSivakumar/Native-Victory-macOS!399
No description provided.