card_steps tests: the shared-scratch bench counts fills and refusals as ranges #4981

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

@⁠Tan7rex on GitHub · 2026-12-01 16:18 UTC · original
Tan7rex:tests/shared-scratch-count-ranges → main · +16 −2 · 1 files · 1 commits · open

Refs #2741

What it changes

host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end asserts exact per-round counts: 1 refusal per round with VICTORY_SCRATCH_SHARED=0, 2 card fills per round with it on. In Host::card_steps a round is only refused or filled on the card while the round before is still in flight when it is submitted (line().blocking() non-empty). When the test's thread is slowed, by the rest of the suite running beside it or by a small runner's cores, the card can finish first, nothing blocks, and that round counts neither. That's the failure in #2741 (expected 2 GPU fills per round, 12 of 16 on the runner) and the one here (expected 1 refusal per round, refused=7 in 8 rounds).

This takes option 2 of #2741:

  • upload mode: 1 to ROUNDS refusals, and still no fills
  • shared mode: 1 to 2 * ROUNDS fills, and still exactly 0 refusals and 0 µs of WHY_READ wait

What doesn't depend on timing stays exact, and every round's bytes are still checked. "At least one" keeps the test proving each mode took its path at all.

#3385 makes the same change to the upload-mode refusal count, inside a larger CI cleanup that now conflicts with main. It leaves the shared-mode fill count exact, which is #2741's original failure. This pull request is that test change alone, so it can land on its own; if #3385 lands first, this one only adds the fill range.

How it was tested

Windows 11 Pro (build 26100), RTX 4090. Release test binary of victory-gpu --lib (cargo test --release --locked --no-run -p victory-gpu --lib), run with default parallel threads. Game not run: this is a test-only change.

  • GPU and profile: not applicable (test-only change)
  • Before (main 5fabb46e): the test failed in 14 of 60 whole-library runs, and 0 of 20 on its own (--exact)
  • After (this branch): 0 of 60 whole-library runs, and 0 of 10 on its own
  • For shader changes, the wave sizes tested: not applicable
  • cargo test passed for the crates it touches: this test, yes. In the 60 runs after the change, other tests failed: host_list_uav_pool_lifecycle_retire_trim_and_info_queue (19, fixed by #3902), a_late_fault_leaves_the_guard_taken_since (2, #4705), and once each a_pipeline_made_ready_is_the_one_the_title_gets, our_section_view_is_unmapped_with_its_last_holder and refresh_front_zero_arc_matches_and_runs_due. This change touches none of them.
  • cargo xtask policy: 464 files ok
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, with and without --all-features: fails with the same 5 errors on main 5fabb46e (font.rs:213, font.rs:260, menu.rs:667, panel.rs:602, panel.rs:668), which #4680 and #4708 fix. None are in card_steps.rs.

Not tested: a 2-4 core runner, where #2741 first failed. If such a runner finishes every round before the next one is submitted, the "at least one" lower bounds could still fail there.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3385 (the same upload-mode range, see above), #3061 (skips this test on a software adapter), #3902 (other card_steps tests). Of the 30 open pull requests that touch card_steps.rs, only #3385 and #3061 change this test.

🤖 Generated with Claude Code

**@⁠Tan7rex** on GitHub · 2026-12-01 16:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4980) `Tan7rex:tests/shared-scratch-count-ranges` → `main` · +16 −2 · 1 files · 1 commits · open Refs #2741 ## What it changes `host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end` asserts exact per-round counts: 1 refusal per round with `VICTORY_SCRATCH_SHARED=0`, 2 card fills per round with it on. In `Host::card_steps` a round is only refused or filled on the card while the round before is still in flight when it is submitted (`line().blocking()` non-empty). When the test's thread is slowed, by the rest of the suite running beside it or by a small runner's cores, the card can finish first, nothing blocks, and that round counts neither. That's the failure in #2741 (`expected 2 GPU fills per round`, 12 of 16 on the runner) and the one here (`expected 1 refusal per round`, `refused=7` in 8 rounds). This takes option 2 of #2741: - upload mode: 1 to `ROUNDS` refusals, and still no fills - shared mode: 1 to `2 * ROUNDS` fills, and still exactly 0 refusals and 0 µs of `WHY_READ` wait What doesn't depend on timing stays exact, and every round's bytes are still checked. "At least one" keeps the test proving each mode took its path at all. [#3385](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3385) makes the same change to the upload-mode refusal count, inside a larger CI cleanup that now conflicts with `main`. It leaves the shared-mode fill count exact, which is #2741's original failure. This pull request is that test change alone, so it can land on its own; if #3385 lands first, this one only adds the fill range. ## How it was tested Windows 11 Pro (build 26100), RTX 4090. Release test binary of `victory-gpu --lib` (`cargo test --release --locked --no-run -p victory-gpu --lib`), run with default parallel threads. Game not run: this is a test-only change. - GPU and profile: not applicable (test-only change) - Before (`main` 5fabb46e): the test failed in **14 of 60** whole-library runs, and 0 of 20 on its own (`--exact`) - After (this branch): **0 of 60** whole-library runs, and 0 of 10 on its own - For shader changes, the wave sizes tested: not applicable - `cargo test` passed for the crates it touches: this test, yes. In the 60 runs after the change, other tests failed: `host_list_uav_pool_lifecycle_retire_trim_and_info_queue` (19, fixed by #3902), `a_late_fault_leaves_the_guard_taken_since` (2, #4705), and once each `a_pipeline_made_ready_is_the_one_the_title_gets`, `our_section_view_is_unmapped_with_its_last_holder` and `refresh_front_zero_arc_matches_and_runs_due`. This change touches none of them. - `cargo xtask policy`: 464 files ok - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`, with and without `--all-features`: fails with the same 5 errors on `main` 5fabb46e (font.rs:213, font.rs:260, menu.rs:667, panel.rs:602, panel.rs:668), which #4680 and #4708 fix. None are in `card_steps.rs`. Not tested: a 2-4 core runner, where #2741 first failed. If such a runner finishes every round before the next one is submitted, the "at least one" lower bounds could still fail there. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3385 (the same upload-mode range, see above), #3061 (skips this test on a software adapter), #3902 (other `card_steps` tests). Of the 30 open pull requests that touch `card_steps.rs`, only #3385 and #3061 change this test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A round is filled on the card, or refused, only while the round before is
still in flight when it is submitted. With the test's thread slowed by the
rest of the suite (or a runner's few cores) the card finishes first and
that round counts neither, so the exact per-round counts failed 14 of 60
parallel runs of victory-gpu's tests on an RTX 4090 (0 of 20 alone).

The upload mode now asks for 1 to ROUNDS refusals, the shared mode for 1
to 2 * ROUNDS fills. What holds whatever the timing stays exact: no
refusals and no WHY_READ wait with shared scratch, no fills without it,
and every round's bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 16:23:29 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/4981/head:github-bot/gh-4980'
git switch 'github-bot/gh-4980'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4980'
git switch 'github-bot/gh-4980'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4980'
git switch 'github-bot/gh-4980'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4980'
git switch 'main'
git merge --squash 'github-bot/gh-4980'
git switch 'main'
git merge --ff-only 'github-bot/gh-4980'
git switch 'main'
git merge 'github-bot/gh-4980'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4981
No description provided.