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

Open
Tan7rex wants to merge 1 commit from upstream-pr/4980 into main
Tan7rex commented 2026-12-01 16:18:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Tan7rex on 2026-12-01T16:18:39Z.


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, #4704), 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 #4679 and #4707 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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5589739355 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4980). Originally posted by [Tan7rex](https://github.com/Tan7rex) on 2026-12-01T16:18:39Z. --- 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://github.com/trustno1-coder/VIctory-NVIDIA/pull/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, #4704), 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 #4679 and #4707 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)
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/4980:upstream-pr/4980'
git switch 'upstream-pr/4980'

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 'main'
git merge --no-ff 'upstream-pr/4980'
git switch 'upstream-pr/4980'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4980'
git switch 'upstream-pr/4980'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4980'
git switch 'main'
git merge --squash 'upstream-pr/4980'
git switch 'main'
git merge --ff-only 'upstream-pr/4980'
git switch 'main'
git merge 'upstream-pr/4980'
git push origin 'main'
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
trustno1-coder/VIctory-NVIDIA!4980
No description provided.