Indirect test: the two groups charge the budget in either order (the test failed 5 runs in 6) #849

Open
github-bot wants to merge 1 commit from github-bot/gh-849 into main AGit
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 10:37 UTC · original
MamaLeVrai:indirect-test-race → main · +12 −1 · 1 files · 1 commits · open

indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields fails most of the time on main (f85101b) on this machine (Windows 11, RX 6950 XT, Rust 1.98.1): 5 of 6 runs of the test alone, and 4 of 15 runs of cargo test -p victory-gpu --lib, with

panicked at crates\victory-gpu\src\indirect.rs:1539:17:
the first two real draws fit the budget

Why. The test has 128 records, two groups of 64. Each group charges the list's budget once, and takes its records in lane order (the comment in the clamp shader says so). Which of the two groups charges first is up to the card, or up to WARP's threads here. If the second group goes first, the draws that fit are records 64 and 65, not 1 and 2, and the test's assert!(i == 1 || i == 2) fails.

The change. The test now collects the kept records and asserts they are [1, 2] or [64, 65] (the first two real draws of the group that charged first), then runs the rest of its checks as before (two kept, the others zeroed, the fields untouched, the budget saturated at 2^27 without wrapping). Only the test changes.

Checks. The test alone, 25 runs with this change: 0 failures (before: 5 of 6 failed). I did not run the whole suite again with this change; it touches the one test. I could not tell which of the two outcomes WARP gives in a run, only that the old assertion fails often.

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

🤖 Generated with Claude Code

**@⁠MamaLeVrai** on GitHub · 2026-11-25 10:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/849) `MamaLeVrai:indirect-test-race` → `main` · +12 −1 · 1 files · 1 commits · open `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields` fails most of the time on `main` (`f85101b`) on this machine (Windows 11, RX 6950 XT, Rust 1.98.1): 5 of 6 runs of the test alone, and 4 of 15 runs of `cargo test -p victory-gpu --lib`, with ``` panicked at crates\victory-gpu\src\indirect.rs:1539:17: the first two real draws fit the budget ``` **Why.** The test has 128 records, two groups of 64. Each group charges the list's budget once, and takes its records in lane order (the comment in the clamp shader says so). Which of the two groups charges first is up to the card, or up to WARP's threads here. If the second group goes first, the draws that fit are records 64 and 65, not 1 and 2, and the test's `assert!(i == 1 || i == 2)` fails. **The change.** The test now collects the kept records and asserts they are `[1, 2]` or `[64, 65]` (the first two real draws of the group that charged first), then runs the rest of its checks as before (two kept, the others zeroed, the fields untouched, the budget saturated at 2^27 without wrapping). Only the test changes. **Checks.** The test alone, 25 runs with this change: 0 failures (before: 5 of 6 failed). I did not run the whole suite again with this change; it touches the one test. I could not tell which of the two outcomes WARP gives in a run, only that the old assertion fails often. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
warp_budget_saturates_without_wraparound_and_preserves_draw_fields has 128 records, two groups
of 64. Each group charges the list's budget once, taking its records in lane order, but which
group charges first is up to the card (or WARP's threads): the two draws that fit are records
1 and 2 or records 64 and 65. The test asserted records 1 and 2 only, and failed about 5 runs
in 6 on an RX 6950 XT's host.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:52:31 +00:00
Author
Owner

@⁠eazyves on GitHub · 2026-11-25 10:51 UTC · original

Confirmed on a Windows 11 / RX 9070 XT machine: the test alone fails 100 of 100 times on main f85101b and passes 100 of 100 times with this PR (8971052, same base).

victory-gpu lib test binary main f85101b this PR
this test alone, 100 runs: failures 100 0
whole binary, default threads, 100 runs: this test failed 60 0

The whole-binary runs also have failures this PR doesn't touch: inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset in 4 of 100 runs of main and 7 of 100 here, and three watch::tests tests once each in this PR's 100 runs.

Driver 32.0.32029.2010, Ryzen 7 5800X3D, Windows 11 26200, run from a service session. No game data. AI-assisted (Claude Code); run on my machine.

**@⁠eazyves** on GitHub · 2026-11-25 10:51 UTC · [original](https://github.com/fxceless/victory-fork/pull/849#issuecomment-7160267129) **Confirmed on a Windows 11 / RX 9070 XT machine: the test alone fails 100 of 100 times on `main` f85101b and passes 100 of 100 times with this PR (8971052, same base).** | `victory-gpu` lib test binary | `main` f85101b | this PR | |---|---|---| | this test alone, 100 runs: failures | 100 | 0 | | whole binary, default threads, 100 runs: this test failed | 60 | 0 | The whole-binary runs also have failures this PR doesn't touch: `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset` in 4 of 100 runs of `main` and 7 of 100 here, and three `watch::tests` tests once each in this PR's 100 runs. Driver 32.0.32029.2010, Ryzen 7 5800X3D, Windows 11 26200, run from a service session. No game data. AI-assisted (Claude Code); run on my machine.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 11:26 UTC · original

Thank you for the 100-run confirmation on a different card and a different Windows build: on my RX 6950 XT the test alone failed 5 of 6 times on main, so the two machines agree that the assertion is what fails.

On the other failures you list: I saw inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset fail once in two runs of another PR's tree (#520) on my machine too, so it looks like a failure of main and not of a PR. I will look at that one next.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-25 11:26 UTC · [original](https://github.com/fxceless/victory-fork/pull/849#issuecomment-7161052949) Thank you for the 100-run confirmation on a different card and a different Windows build: on my RX 6950 XT the test alone failed 5 of 6 times on `main`, so the two machines agree that the assertion is what fails. On the other failures you list: I saw `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset` fail once in two runs of another PR's tree (#520) on my machine too, so it looks like a failure of `main` and not of a PR. I will look at that one next. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠tikD1337 on GitHub · 2026-11-25 13:18 UTC · original

Reproduced and confirmed on a different machine: Windows 11, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Ryzen 5 7600, Rust 1.98.1.

  • main @ a253706, cargo test --release -p victory-gpu --lib warp_budget_saturates -- --test-threads=1, 10 runs: 4 failed (indirect.rs:1539, "the first two real draws fit the budget").
  • The same command with this PR merged on a253706, 10 runs: 0 failed.
  • cargo test --release -p victory-gpu --lib -- --test-threads=1 with this PR: 169 passed, 0 failed, 5 ignored.

The test runs on WARP, so the GPU should not matter; it fails on this NVIDIA / Ryzen machine too, not only on the RX 6950 XT.

**@⁠tikD1337** on GitHub · 2026-11-25 13:18 UTC · [original](https://github.com/fxceless/victory-fork/pull/849#issuecomment-7163598637) Reproduced and confirmed on a different machine: Windows 11, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Ryzen 5 7600, Rust 1.98.1. - `main` @ `a253706`, `cargo test --release -p victory-gpu --lib warp_budget_saturates -- --test-threads=1`, 10 runs: **4 failed** (`indirect.rs:1539`, "the first two real draws fit the budget"). - The same command with this PR merged on `a253706`, 10 runs: **0 failed**. - `cargo test --release -p victory-gpu --lib -- --test-threads=1` with this PR: 169 passed, 0 failed, 5 ignored. The test runs on WARP, so the GPU should not matter; it fails on this NVIDIA / Ryzen machine too, not only on the RX 6950 XT.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 13:41 UTC · original

Thank you for running it on an NVIDIA / Ryzen machine: 4 of 10 on main and 0 of 10 with this PR agrees with what I saw on the RX 6950 XT, and it fits the test running on WARP.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-25 13:41 UTC · [original](https://github.com/fxceless/victory-fork/pull/849#issuecomment-7164135432) Thank you for running it on an NVIDIA / Ryzen machine: 4 of 10 on `main` and 0 of 10 with this PR agrees with what I saw on the RX 6950 XT, and it fits the test running on WARP. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠HailLucifer666 on GitHub · 2026-11-25 14:05 UTC · original

Evidence from a fourth machine (Windows, WARP, this repo's own suite), and one thing your two PRs between them have established that neither body says: this is a regression, not a missing nicety.

main already had an order-independent version of this test — (kept, zeroed) == (2, 126), naming no indices — from 578d459c. f85101b6 (Frame rate, second night) changed that block back to assert!(i == 1 || i == 2, ...), so every branch built on it inherits the failure.

Measured: full suite, four processes at a time, twelve runs on f85101b6 without the patch — 2 of 12 failed with panicked at indirect.rs:1611: the first two real draws fit the budget. With the patch applied, 0 of 12. Idle and serial runs never reproduce it (34 runs clean), which is why it looked machine-specific.

I have opened #970 taking MamaLeVrai's #849 verbatim so the branches under review have it; if #847 lands instead it is equivalent and #970 can be closed unmerged. Credit for the diagnosis is entirely yours — two people on two machines reaching the same cause is stronger evidence than either measurement alone.

**@⁠HailLucifer666** on GitHub · 2026-11-25 14:05 UTC · [original](https://github.com/fxceless/victory-fork/pull/849#issuecomment-7164734935) Evidence from a fourth machine (Windows, WARP, this repo's own suite), and one thing your two PRs between them have established that neither body says: **this is a regression, not a missing nicety.** `main` already had an order-independent version of this test — `(kept, zeroed) == (2, 126)`, naming no indices — from `578d459c`. `f85101b6` (*Frame rate, second night*) changed that block back to `assert!(i == 1 || i == 2, ...)`, so every branch built on it inherits the failure. Measured: full suite, four processes at a time, twelve runs on `f85101b6` without the patch — 2 of 12 failed with `panicked at indirect.rs:1611: the first two real draws fit the budget`. With the patch applied, 0 of 12. Idle and serial runs never reproduce it (34 runs clean), which is why it looked machine-specific. I have opened #970 taking `MamaLeVrai`'s #849 verbatim so the branches under review have it; if #847 lands instead it is equivalent and #970 can be closed unmerged. Credit for the diagnosis is entirely yours — two people on two machines reaching the same cause is stronger evidence than either measurement alone.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/indirect.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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