GPU: a screen pass's own pool never waits longer than the frame budget (fixes #2433) #2582

Open
github-bot wants to merge 3 commits from github-bot/gh-2582 into main AGit
Owner

@⁠kais7654 on GitHub · 2026-11-25 16:11 UTC · original
kais7654:gpu/screen-pass-workers → main · +144 −27 · 2 files · 3 commits · open

Takes #2435 by @⁠pushkarreddyy (adapted from @⁠Belobug's tree) onto current main,
authorship preserved in the first commit, and addresses its triage's two
points.

What stays: the screen-pass classification (no vertex input, no depth or
stencil, triangle topology — GraphicsState::screen_pass), and two
pipeline kinds with their own queues, workers and per-frame budget
accounting: the ordinary pool (2..=8 workers) and two dedicated screen
workers. The lighting-table fills of #2433 (PS_IntegrateEnvBRDF*,
PS_AreaLightIlluminance, drawn once at world entry) are no longer stuck
behind a world's worth of pipelines, and a world's waits can no longer
spend a screen pass's budget.

What changes from #2435: no 20 s budget. A screen-classified pass is
nearly every full-screen draw the title runs, so a cold one could hold
the frame for seconds — the stall the budget exists to prevent. Both
kinds now share the same half-second budget; a misclassified pass can
only move pools, never wait longer than the ordinary pool allowed. The
screen workers make the one-off fills within moments, so a longer wait
is not needed for them.

Also, a draw whose pipeline was not made within its kind's budget is now
logged once by key ("a draw's pipeline is not made within the frame's
budget; the draw is skipped") — the drop the triage asked to see, so a
run that loses a once-drawn pass shows it and testers (thanks to the
readback protocol of #2435's thread) can turn it into the missing
evidence on the hardware where the drop happens.

Local check: clippy --workspace --all-targets with and without
--all-features, -D warnings clean; victory-gpu tests pass on a capped
RTX heap except the two failures that #1943's not-yet-merged fix owns.

Merge note (from #2435's review): #2250's VICTORY_PIPELINE_THREADS env
adds worker count control where queue() starts its pool — when it
lands, its env should apply to the ordinary kind only.

**@⁠kais7654** on GitHub · 2026-11-25 16:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/2582) `kais7654:gpu/screen-pass-workers` → `main` · +144 −27 · 2 files · 3 commits · open Takes #2435 by @⁠pushkarreddyy (adapted from @⁠Belobug's tree) onto current main, authorship preserved in the first commit, and addresses its triage's two points. What stays: the screen-pass classification (no vertex input, no depth or stencil, triangle topology — `GraphicsState::screen_pass`), and two pipeline kinds with their own queues, workers and per-frame budget accounting: the ordinary pool (2..=8 workers) and two dedicated screen workers. The lighting-table fills of #2433 (`PS_IntegrateEnvBRDF*`, `PS_AreaLightIlluminance`, drawn once at world entry) are no longer stuck behind a world's worth of pipelines, and a world's waits can no longer spend a screen pass's budget. What changes from #2435: no 20 s budget. A screen-classified pass is nearly every full-screen draw the title runs, so a cold one could hold the frame for seconds — the stall the budget exists to prevent. Both kinds now share the same half-second budget; a misclassified pass can only move pools, never wait longer than the ordinary pool allowed. The screen workers make the one-off fills within moments, so a longer wait is not needed for them. Also, a draw whose pipeline was not made within its kind's budget is now logged once by key ("a draw's pipeline is not made within the frame's budget; the draw is skipped") — the drop the triage asked to see, so a run that loses a once-drawn pass shows it and testers (thanks to the readback protocol of #2435's thread) can turn it into the missing evidence on the hardware where the drop happens. Local check: clippy --workspace --all-targets with and without --all-features, -D warnings clean; victory-gpu tests pass on a capped RTX heap except the two failures that #1943's not-yet-merged fix owns. Merge note (from #2435's review): #2250's `VICTORY_PIPELINE_THREADS` env adds worker count control where `queue()` starts its pool — when it lands, its env should apply to the ordinary kind only.
Following the triage of #2435 (pushkarreddyy's cherry-pick above, adapted
from Belobug's work): the proposal gave a screen-classified pass a 20 s
per-frame wait, but such a pass is nearly every full-screen draw the title
runs, so a cold one could hold the title's frame for seconds. The two
kinds keep their own queues, workers and budget accounting, and both
budgets are the same half a second: a world's pipelines cannot spend a
screen pass's budget away (the lighting-table fills are made within
moments by the two screen workers), and a misclassified pass can only
move pools, never wait longer than the ordinary pool allowed.

A draw whose pipeline was not made within the budget is now logged once
by key, so a run losing a once-drawn pass shows it.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
From oni-swr's verification of #2582: the dropped warning said "the draw
is skipped" where the budget only costs the pipeline's draw this frame —
the message now says so, and names the pass drawn only once, which the
skip loses outright. The routing to the screen pool itself had no test:
a screen-classified pipeline now goes through `ready` in a test, so both
worker pools' spawn paths run under test.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:09:45 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 16:33 UTC · original

oni-swr verification — head 44d4ade12bab84d01f78ac9ede603b3c0f19e715 (merge base da82e44, two commits behind main), origin/main 67e8ae1401df112248aed36d0024483181b718b7

Environment: Windows 11 Pro (26200), rustc 1.98.1, WARP only (VICTORY_D3D12_WARP=1 with --features diagnostics, which is what makes the host device the software adapter; Windows SDK 10.0.26100.0 dxil.dll on PATH). No hardware GPU use in the reported runs, no game files, no retail data. Merge check: git merge-tree --write-tree origin/main <head> is clean. Tested both the PR head and the merge with origin/main (7d523f8).

Commands / results

  • Focused cargo test --locked -p victory-gpu --features diagnostics --lib -- screen_pass pipeline::: head 17 passed, merged 17 passed, 0 failed, 0 ignored (includes the new screen_pass_requires_triangle_without_inputs_or_depth)
  • cargo test --locked -p victory-gpu --features diagnostics (lib 199 passed, 1 ignored): merged 3/3 runs green; head 2/3 green, 1 run failed only memory::tests::a_submission_that_missed_leaves_the_copies_at_once — a pre-existing WARP flake I also measured on origin/main (9/60 runs), unrelated to this diff.
  • cargo clippy --locked -p victory-gpu --features diagnostics --all-targets -- -D warnings (merged tree): clean.

Review: The classification and the two-kind queue/budget bookkeeping look correct (per-kind FRAME/WAITED_US arrays, per-kind QUEUES/WORKERS, workers named per kind; start early-start path uses the same queues). Both kinds keep the 500 ms budget, so a misclassified pass cannot wait longer than before, a reasonable replacement for #2435's 20 s. Small notes, none blocking: (1) the dropped warning fires when a draw merely missed this frame's budget, and that pipeline can still be made later, so "the draw is skipped" is true for that frame only; (2) the new behaviour is only unit-tested via the classifier, and the dedicated-worker/budget separation has no test (needs timing, so understandable); (3) a draw is warned about once per key for the process lifetime (small HashSet<String>, bounded by pipeline count).

Overlap: this is the same fix as open #2435 (also "fixes #2433", the original by @⁠pushkarreddyy): #2582 states it supersedes it with different budget semantics, so only one of the two should land. #2250's VICTORY_PIPELINE_THREADS (mentioned in the description) is not open in the list I checked. #2556 and #2471 touch pipeline/make.rs / pipeline/host.rs and merge cleanly with this PR.

AI disclosure: this review and verification were done by Claude Code (Claude Sonnet 5.5), not a human reviewer. Comment-only; no code changed.

**@⁠oni-swr** on GitHub · 2026-11-25 16:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2582#issuecomment-7168180208) **oni-swr verification** — head `44d4ade12bab84d01f78ac9ede603b3c0f19e715` (merge base `da82e44`, two commits behind main), `origin/main` `67e8ae1401df112248aed36d0024483181b718b7` **Environment:** Windows 11 Pro (26200), rustc 1.98.1, **WARP only** (`VICTORY_D3D12_WARP=1` with `--features diagnostics`, which is what makes the host device the software adapter; Windows SDK 10.0.26100.0 `dxil.dll` on PATH). No hardware GPU use in the reported runs, no game files, no retail data. Merge check: `git merge-tree --write-tree origin/main <head>` is clean. Tested both the PR head and the merge with `origin/main` (`7d523f8`). **Commands / results** - Focused `cargo test --locked -p victory-gpu --features diagnostics --lib -- screen_pass pipeline::`: head 17 passed, merged 17 passed, 0 failed, 0 ignored (includes the new `screen_pass_requires_triangle_without_inputs_or_depth`) - `cargo test --locked -p victory-gpu --features diagnostics` (lib 199 passed, 1 ignored): merged 3/3 runs green; head 2/3 green, 1 run failed only `memory::tests::a_submission_that_missed_leaves_the_copies_at_once` — a pre-existing WARP flake I also measured on `origin/main` (9/60 runs), unrelated to this diff. - `cargo clippy --locked -p victory-gpu --features diagnostics --all-targets -- -D warnings` (merged tree): clean. **Review:** The classification and the two-kind queue/budget bookkeeping look correct (per-kind `FRAME`/`WAITED_US` arrays, per-kind `QUEUES`/`WORKERS`, workers named per kind; `start` early-start path uses the same queues). Both kinds keep the 500 ms budget, so a misclassified pass cannot wait longer than before, a reasonable replacement for #2435's 20 s. Small notes, none blocking: (1) the `dropped` warning fires when a draw merely missed this frame's budget, and that pipeline can still be made later, so "the draw is skipped" is true for that frame only; (2) the new behaviour is only unit-tested via the classifier, and the dedicated-worker/budget separation has no test (needs timing, so understandable); (3) a draw is warned about once per key for the process lifetime (small `HashSet<String>`, bounded by pipeline count). **Overlap:** this is the same fix as open #2435 (also "fixes #2433", the original by @⁠pushkarreddyy): #2582 states it supersedes it with different budget semantics, so only one of the two should land. #2250's `VICTORY_PIPELINE_THREADS` (mentioned in the description) is not open in the list I checked. #2556 and #2471 touch `pipeline/make.rs` / `pipeline/host.rs` and merge cleanly with this PR. AI disclosure: this review and verification were done by Claude Code (Claude Sonnet 5.5), not a human reviewer. Comment-only; no code changed.
Author
Owner

@⁠kais7654 on GitHub · 2026-11-25 16:45 UTC · original

oni-swr verification — head 44d4ade12bab84d01f78ac9ede603b3c0f19e715 (merge base da82e44, two commits behind main), origin/main 67e8ae1401df112248aed36d0024483181b718b7

Environment: Windows 11 Pro (26200), rustc 1.98.1, WARP only (VICTORY_D3D12_WARP=1 with --features diagnostics, which is what makes the host device the software adapter; Windows SDK 10.0.26100.0 dxil.dll on PATH). No hardware GPU use in the reported runs, no game files, no retail data. Merge check: git merge-tree --write-tree origin/main <head> is clean. Tested both the PR head and the merge with origin/main (7d523f8).

Commands / results

  • Focused cargo test --locked -p victory-gpu --features diagnostics --lib -- screen_pass pipeline::: head 17 passed, merged 17 passed, 0 failed, 0 ignored (includes the new screen_pass_requires_triangle_without_inputs_or_depth)
  • cargo test --locked -p victory-gpu --features diagnostics (lib 199 passed, 1 ignored): merged 3/3 runs green; head 2/3 green, 1 run failed only memory::tests::a_submission_that_missed_leaves_the_copies_at_once — a pre-existing WARP flake I also measured on origin/main (9/60 runs), unrelated to this diff.
  • cargo clippy --locked -p victory-gpu --features diagnostics --all-targets -- -D warnings (merged tree): clean.

Review: The classification and the two-kind queue/budget bookkeeping look correct (per-kind FRAME/WAITED_US arrays, per-kind QUEUES/WORKERS, workers named per kind; start early-start path uses the same queues). Both kinds keep the 500 ms budget, so a misclassified pass cannot wait longer than before, a reasonable replacement for #2435's 20 s. Small notes, none blocking: (1) the dropped warning fires when a draw merely missed this frame's budget, and that pipeline can still be made later, so "the draw is skipped" is true for that frame only; (2) the new behaviour is only unit-tested via the classifier, and the dedicated-worker/budget separation has no test (needs timing, so understandable); (3) a draw is warned about once per key for the process lifetime (small HashSet<String>, bounded by pipeline count).

Overlap: this is the same fix as open #2435 (also "fixes #2433", the original by @⁠pushkarreddyy): #2582 states it supersedes it with different budget semantics, so only one of the two should land. #2250's VICTORY_PIPELINE_THREADS (mentioned in the description) is not open in the list I checked. #2556 and #2471 touch pipeline/make.rs / pipeline/host.rs and merge cleanly with this PR.

AI disclosure: this review and verification were done by Claude Code (Claude Sonnet 5.5), not a human reviewer. Comment-only; no code changed.

@⁠oni-swr Thanks for the verification @⁠oni-swr — points 1 and 2 are addressed in fd872f4:

  1. The dropped warning now says "its draw is skipped this frame — a pass
    drawn only once is lost", which is exact under both classifications.
  2. The routing has a test: a_screen_pass_is_made_by_its_own_workers
    runs a screen-classified pipeline through ready, so both worker
    pools' spawn paths are exercised (the ordinary kind was the only one
    covered before). Timing behavior itself stays untested, as you said —
    that needs a real run, which the logged drop should make reportable.

On 3, agreed — that is the shape I went for: one warning per key for the
process lifetime, bounded by the pipeline count.

On the overlap: #2582 supersedes #2435's 20 s budget — happy for
@⁠pushkarreddyy to test/review this one, and if the maintainers prefer
landing the cherry-pick + budget revision as updates to #2435 itself, I
am fine with that too: same two-pool design either way, and only one
should land.

**@⁠kais7654** on GitHub · 2026-11-25 16:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/2582#issuecomment-7168480390) > **oni-swr verification** — head `44d4ade12bab84d01f78ac9ede603b3c0f19e715` (merge base `da82e44`, two commits behind main), `origin/main` `67e8ae1401df112248aed36d0024483181b718b7` > > **Environment:** Windows 11 Pro (26200), rustc 1.98.1, **WARP only** (`VICTORY_D3D12_WARP=1` with `--features diagnostics`, which is what makes the host device the software adapter; Windows SDK 10.0.26100.0 `dxil.dll` on PATH). No hardware GPU use in the reported runs, no game files, no retail data. Merge check: `git merge-tree --write-tree origin/main <head>` is clean. Tested both the PR head and the merge with `origin/main` (`7d523f8`). > > **Commands / results** > > * Focused `cargo test --locked -p victory-gpu --features diagnostics --lib -- screen_pass pipeline::`: head 17 passed, merged 17 passed, 0 failed, 0 ignored (includes the new `screen_pass_requires_triangle_without_inputs_or_depth`) > * `cargo test --locked -p victory-gpu --features diagnostics` (lib 199 passed, 1 ignored): merged 3/3 runs green; head 2/3 green, 1 run failed only `memory::tests::a_submission_that_missed_leaves_the_copies_at_once` — a pre-existing WARP flake I also measured on `origin/main` (9/60 runs), unrelated to this diff. > * `cargo clippy --locked -p victory-gpu --features diagnostics --all-targets -- -D warnings` (merged tree): clean. > > **Review:** The classification and the two-kind queue/budget bookkeeping look correct (per-kind `FRAME`/`WAITED_US` arrays, per-kind `QUEUES`/`WORKERS`, workers named per kind; `start` early-start path uses the same queues). Both kinds keep the 500 ms budget, so a misclassified pass cannot wait longer than before, a reasonable replacement for #2435's 20 s. Small notes, none blocking: (1) the `dropped` warning fires when a draw merely missed this frame's budget, and that pipeline can still be made later, so "the draw is skipped" is true for that frame only; (2) the new behaviour is only unit-tested via the classifier, and the dedicated-worker/budget separation has no test (needs timing, so understandable); (3) a draw is warned about once per key for the process lifetime (small `HashSet<String>`, bounded by pipeline count). > > **Overlap:** this is the same fix as open #2435 (also "fixes #2433", the original by @⁠pushkarreddyy): #2582 states it supersedes it with different budget semantics, so only one of the two should land. #2250's `VICTORY_PIPELINE_THREADS` (mentioned in the description) is not open in the list I checked. #2556 and #2471 touch `pipeline/make.rs` / `pipeline/host.rs` and merge cleanly with this PR. > > AI disclosure: this review and verification were done by Claude Code (Claude Sonnet 5.5), not a human reviewer. Comment-only; no code changed. @⁠oni-swr Thanks for the verification @⁠oni-swr — points 1 and 2 are addressed in fd872f4: 1. The dropped warning now says "its draw is skipped this frame — a pass drawn only once is lost", which is exact under both classifications. 2. The routing has a test: `a_screen_pass_is_made_by_its_own_workers` runs a screen-classified pipeline through `ready`, so both worker pools' spawn paths are exercised (the ordinary kind was the only one covered before). Timing behavior itself stays untested, as you said — that needs a real run, which the logged drop should make reportable. On 3, agreed — that is the shape I went for: one warning per key for the process lifetime, bounded by the pipeline count. On the overlap: #2582 supersedes #2435's 20 s budget — happy for @⁠pushkarreddyy to test/review this one, and if the maintainers prefer landing the cherry-pick + budget revision as updates to #2435 itself, I am fine with that too: same two-pool design either way, and only one should land.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:14 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main: it conflicts in crates/victory-gpu/src/pipeline/make.rs. No content review was done this time; it will be reviewed once it is rebased onto current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/2582#issuecomment-7176123034) <!-- victory-triage v1 head=fd872f4396c9ab864a32cc6708feb8d58c35e249 verdict=needs-rebase at=2026-11-25T22:14:51Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main`: it conflicts in `crates/victory-gpu/src/pipeline/make.rs`. No content review was done this time; it will be reviewed once it is rebased onto current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/make.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/2582/head:github-bot/gh-2582'
git switch 'github-bot/gh-2582'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2582'
git switch 'github-bot/gh-2582'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2582'
git switch 'github-bot/gh-2582'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2582'
git switch 'main'
git merge --squash 'github-bot/gh-2582'
git switch 'main'
git merge --ff-only 'github-bot/gh-2582'
git switch 'main'
git merge 'github-bot/gh-2582'
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/Marvisak--VIctory!2582
No description provided.