Pipelines: a pass over the screen holds frames for its 10 s once in all, not every frame (map freeze, #3059) #3788

Closed
Lyrnc wants to merge 3 commits from upstream-pr/3788 into main
Lyrnc commented 2026-11-30 07:11:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-30T07:11:14Z.


Problem

Opening the in-game map freezes the game, with no crash (#3059 on v2026.11.29.03: RTX 5070 Ti + 9850X3D; "same" from a 5090 + 14900KF and from a third user). The logs are attachments and were not read. #3467 (zinixyt, RTX 3060, 32 GB, Series S, main 41adb551) measured the same screen in its text: "the map ran at about 10 seconds a frame", 42 quiet windows of over 5 s in 11 minutes, the six biggest 9.2 to 9.8 s. The line right after each window was:

INFO victory_gpu::pipeline::make: a pass over the screen was waited for (VICTORY_SCREEN_WAIT_MS=0: dropped pa[sses])

and the card was idle behind the CPU. #2822 (RTX 4090, 64 GB) lists "map stalls" with system commit exhaustion and memory-guard deferrals, gone with a larger page file.

Root cause

Read from the code and #3467's log line (#3059's logs were not read, so this is the likely cause, not a measured one). What the map does differently: it draws passes over the screen (full-screen graphics passes, Pending::screen) that the world has not drawn, so their pipelines are not made yet, and it draws them every frame while it is open.

crates/victory-gpu/src/pipeline/make.rs:

  • ready → wait(p, frame): a draw whose pipeline is not made waits for it. A pass over the screen gets screen_budget() (VICTORY_SCREEN_WAIT_MS, 10 s) per frame, others 500 ms per frame (wait_budget).
  • Nothing limits how many frames a pass waits its 10 s. One whose pipeline does not come within 10 s holds the next frame for 10 s again, and the next, for as long as it is not made. The code's own measurement (doc of screen_wait_once): "every screen wait that reached the 10 s budget ended without the pipeline (55 waits, 550 s) and 34 of the 43 waits after such a one ran out again". The only way out, VICTORY_SCREEN_WAIT_ONCE=1 (#1743), is off by default.
  • Why the pipeline may not come in 10 s, any of: the compile memory gate holds the worker (compilemem::begin: a pipeline worker waits up to 10 s to be let start, then the compile is put off), the memory guard puts it off (Pending::defer, retried 1 s later and put off again while commit stays low), or a long driver compile or a long queue.
  • The wait loop also does not end when the build it waits for is put off. make_with notifies DONE after defer(), the waiter wakes, sees made unset, and waits out the rest of its 10 s for a pipeline nothing will make during its pause.

So on the map every frame can take the screen's whole 10 s, which the player sees as a freeze. The title's 30 s watchdog does not end it (each frame is under 30 s, and it is told to quit).

Fix

wait (now wait_within(p, frame, screen_budget, draw_budget) so tests can pass small budgets):

  • A pass over the screen is waited for up to the screen's budget in all, over every frame that draws it, not in every frame. Pending::screen_waited_us counts what draws waited for it as a pass over the screen. A wait gets at most what is left of that allowance. Once it is used up and the pipeline is still not made, the pass waits as other draws do, within the frame's shared 500 ms, until it is made. Its first 10 s are unchanged, so a loading screen or a pass the title draws once still gets them. A line says when a pass has used its allowance (formats, shaders).
  • The wait ends when its build is put off (p.retry_waits() in the loop condition).
  • VICTORY_SCREEN_WAIT_EVERY_FRAME=1 gives back the old wait (the whole budget every frame). VICTORY_SCREEN_WAIT_ONCE=1 still drops such a pass at once.

With this, a map pass not made in time costs at most 10 s of waiting in all, then frames of 500 ms at most until it is made, instead of 10 s each.

Verification

Windows 11 26200, rustc 1.98.1 (the pinned toolchain), Ryzen 7 9800X3D. On 700a84fd:

  • cargo check -j 6 --locked -p victory-gpu --all-targets: passes (victory-gpu's existing warnings only).
  • cargo test -j 6 --locked -p victory-gpu --lib pipeline::make::tests::: 32 passed, 0 failed. The two new ones:
    • a_pass_over_the_screen_holds_frames_for_its_budget_once_in_all: a pass over the screen that is never made, with budgets of 300 ms (screen) and 20 ms (others) in place of 10 s and 500 ms. The first frame waits at least 290 ms. The next four frames each return in under 150 ms (they wait as other draws do).
    • a_wait_ends_when_its_build_is_put_off: a screen draw waits with a 5 s budget on another thread. 50 ms later the build is put off for memory through make_with (the gate's own refuse_compile). The waiter returns in under 2 s, the pipeline is not recorded as refused, and only the time actually waited is charged to the pass.
    • The existing a_pipeline_whose_compile_was_put_off_for_memory_is_made_later and the other wait tests pass unchanged.
  • cargo clippy -j 6 --locked -p victory-gpu --all-targets: finishes with warnings only. None is on a line this adds (checked against git diff -U0 41adb551 700a84fd). The one in make.rs is main's (pop never used, l.1367).

NOT tested

  • No game run (T09's rules for this task: no runs). The map was not opened, before or after.
  • Which reason holds the map's pipelines is not known, because the logs are attachments that were not read. If #3059's waits end with made=true after 9 s each, for a different pass each time (many new passes, each a slow compile), this change does nothing for them: each new pass still gets its first 10 s. #2580's compile grace and #3474's short screen wait while starved are aimed at that.
  • The time draws wait on a ran-out pass now moves into the shared 500 ms a frame, so other draws of that frame may get less of it.

Diagnostic to pin it (needs Selim's OK to read the attached play log of #3059, and of #3467 if zinixyt agrees):

  1. grep "a pass over the screen was waited for": for each line, ms, made, formats, shaders. The same shaders again and again with made=false is the case this fixes. A new shaders each time with made=true is the slow-compile case (#2580).
  2. grep "memory guard: a compile is put off\|host pipeline not made: the PC is short of memory\|compile memory:" around those times: put-offs point at #2188 / #3474 (and #2886), and a larger page file as the workaround (#2822).
  3. In game (later, on our 5080, once runs are allowed): load a save on main, open the map, wait 60 s, then the same with this branch. Record the frame times from the log and the lines above. The same with VICTORY_COMMIT_FLOOR_MB=60000 to force the memory guard to put compiles off (it refuses every compile while free commit is under 60 GB), which reproduces the put-off case on any PC.

Exact repro steps for the reporters: start the game, load into the world, open the pause menu and the map, wait 60 s. Before: frames of 9 to 10 s (the title bar's fps goes to 0.1), the log line above every 10 s. After: at most one 10 s frame for each map pass, then the map moves again, possibly with a part of it missing until its pipeline is made, and a line "a pass over the screen waited for its whole budget in all".

Overlap

gh pr list --state open --search for "screen wait", "pass over the screen", "SCREEN_WAIT", "screen passes", "held frame" (2026-11-30). git merge-tree of this branch with each PR head: all four below merge cleanly with main alone, and each conflicts with this branch in make.rs's wait:

  • #2188 (Ondra97, "Stop waiting for deferred pipeline compiles"): the same loop condition (!p.retry_waits()), in a helper wait_for_pipeline, and it keeps VICTORY_SCREEN_WAIT_ONCE from firing after a put-off. 3 conflict hunks. Whichever lands second drops its copy of the condition. This branch adds the per-pass allowance, which #2188 does not have.
  • #3474 (nyxctura, memory guard bundle): cuts every screen wait to 50 ms while compiles are being put off (compilemem::starved()), ends waits on a put-off, and backs off retries 1 to 8 s. 2 conflict hunks. It covers the starved case harder than this. This branch also covers the cases where nothing is put off (a long compile, a long queue).
  • #2580 (Kajcsi, "Stop long freezes on pipeline compiles"): a draw stops waiting once its build reaches the driver's compiler, and passes over the screen wait at most VICTORY_PIPELINE_COMPILE_GRACE_MS (50) into a compile. It also ends waits on a put-off. 4 conflict hunks. It is the one that covers many new passes with a slow compile each (each one's first 10 s), which this does not. 597 lines over 8 files.
  • #3677 (CDworks-Design, diagnostics): adds outcome and pipeline_key to the "a pass over the screen was waited for" line. 1 conflict hunk (the same log call). It would make the diagnostic above one grep.
  • Merged and kept: #1743 (VICTORY_SCREEN_WAIT_ONCE=1), #1744 (VICTORY_SCREEN_EARLY=1), #1124 (VICTORY_HELD_FRAME_MS), #1734 (the dropped-pass log). Closed: #497 (the same idea for draws that are not passes over the screen).

AI use

Claude Code (Claude Opus 5.5) read the issues' text (no attachments) and the pipeline code, wrote the change and its tests, ran the checks listed above, and wrote this note. Nothing was run in game.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5560741244 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-30T07:11:14Z. --- ## Problem Opening the in-game map freezes the game, with no crash (#3059 on v2026.11.29.03: RTX 5070 Ti + 9850X3D; "same" from a 5090 + 14900KF and from a third user). The logs are attachments and were not read. #3467 (zinixyt, RTX 3060, 32 GB, Series S, main 41adb551) measured the same screen in its text: "the map ran at about 10 seconds a frame", 42 quiet windows of over 5 s in 11 minutes, the six biggest 9.2 to 9.8 s. The line right after each window was: ``` INFO victory_gpu::pipeline::make: a pass over the screen was waited for (VICTORY_SCREEN_WAIT_MS=0: dropped pa[sses]) ``` and the card was idle behind the CPU. #2822 (RTX 4090, 64 GB) lists "map stalls" with system commit exhaustion and memory-guard deferrals, gone with a larger page file. ## Root cause Read from the code and #3467's log line (#3059's logs were not read, so this is the likely cause, not a measured one). What the map does differently: it draws passes over the screen (full-screen graphics passes, `Pending::screen`) that the world has not drawn, so their pipelines are not made yet, and it draws them every frame while it is open. `crates/victory-gpu/src/pipeline/make.rs`: - `ready` → `wait(p, frame)`: a draw whose pipeline is not made waits for it. A pass over the screen gets `screen_budget()` (`VICTORY_SCREEN_WAIT_MS`, 10 s) **per frame**, others 500 ms per frame (`wait_budget`). - Nothing limits how many frames a pass waits its 10 s. One whose pipeline does not come within 10 s holds the next frame for 10 s again, and the next, for as long as it is not made. The code's own measurement (doc of `screen_wait_once`): "every screen wait that reached the 10 s budget ended without the pipeline (55 waits, 550 s) and 34 of the 43 waits after such a one ran out again". The only way out, `VICTORY_SCREEN_WAIT_ONCE=1` (#1743), is off by default. - Why the pipeline may not come in 10 s, any of: the compile memory gate holds the worker (`compilemem::begin`: a pipeline worker waits up to 10 s to be let start, then the compile is put off), the memory guard puts it off (`Pending::defer`, retried 1 s later and put off again while commit stays low), or a long driver compile or a long queue. - The wait loop also does not end when the build it waits for is put off. `make_with` notifies `DONE` after `defer()`, the waiter wakes, sees `made` unset, and waits out the rest of its 10 s for a pipeline nothing will make during its pause. So on the map every frame can take the screen's whole 10 s, which the player sees as a freeze. The title's 30 s watchdog does not end it (each frame is under 30 s, and it is told to quit). ## Fix `wait` (now `wait_within(p, frame, screen_budget, draw_budget)` so tests can pass small budgets): - **A pass over the screen is waited for up to the screen's budget in all, over every frame that draws it, not in every frame.** `Pending::screen_waited_us` counts what draws waited for it as a pass over the screen. A wait gets at most what is left of that allowance. Once it is used up and the pipeline is still not made, the pass waits as other draws do, within the frame's shared 500 ms, until it is made. Its first 10 s are unchanged, so a loading screen or a pass the title draws once still gets them. A line says when a pass has used its allowance (formats, shaders). - **The wait ends when its build is put off** (`p.retry_waits()` in the loop condition). - `VICTORY_SCREEN_WAIT_EVERY_FRAME=1` gives back the old wait (the whole budget every frame). `VICTORY_SCREEN_WAIT_ONCE=1` still drops such a pass at once. With this, a map pass not made in time costs at most 10 s of waiting in all, then frames of 500 ms at most until it is made, instead of 10 s each. ## Verification Windows 11 26200, rustc 1.98.1 (the pinned toolchain), Ryzen 7 9800X3D. On 700a84fd: - `cargo check -j 6 --locked -p victory-gpu --all-targets`: passes (victory-gpu's existing warnings only). - `cargo test -j 6 --locked -p victory-gpu --lib pipeline::make::tests::`: **32 passed, 0 failed.** The two new ones: - `a_pass_over_the_screen_holds_frames_for_its_budget_once_in_all`: a pass over the screen that is never made, with budgets of 300 ms (screen) and 20 ms (others) in place of 10 s and 500 ms. The first frame waits at least 290 ms. The next four frames each return in under 150 ms (they wait as other draws do). - `a_wait_ends_when_its_build_is_put_off`: a screen draw waits with a 5 s budget on another thread. 50 ms later the build is put off for memory through `make_with` (the gate's own `refuse_compile`). The waiter returns in under 2 s, the pipeline is not recorded as refused, and only the time actually waited is charged to the pass. - The existing `a_pipeline_whose_compile_was_put_off_for_memory_is_made_later` and the other wait tests pass unchanged. - `cargo clippy -j 6 --locked -p victory-gpu --all-targets`: finishes with warnings only. **None is on a line this adds** (checked against `git diff -U0 41adb551 700a84fd`). The one in `make.rs` is main's (`pop` never used, l.1367). ## NOT tested - **No game run** (T09's rules for this task: no runs). The map was not opened, before or after. - **Which reason holds the map's pipelines is not known**, because the logs are attachments that were not read. If #3059's waits end with `made=true` after 9 s each, for a different pass each time (many new passes, each a slow compile), this change does nothing for them: each new pass still gets its first 10 s. #2580's compile grace and #3474's short screen wait while starved are aimed at that. - The time draws wait on a ran-out pass now moves into the shared 500 ms a frame, so other draws of that frame may get less of it. Diagnostic to pin it (needs Selim's OK to read the attached play log of #3059, and of #3467 if zinixyt agrees): 1. `grep "a pass over the screen was waited for"`: for each line, `ms`, `made`, `formats`, `shaders`. The same `shaders` again and again with `made=false` is the case this fixes. A new `shaders` each time with `made=true` is the slow-compile case (#2580). 2. `grep "memory guard: a compile is put off\|host pipeline not made: the PC is short of memory\|compile memory:"` around those times: put-offs point at #2188 / #3474 (and #2886), and a larger page file as the workaround (#2822). 3. In game (later, on our 5080, once runs are allowed): load a save on main, open the map, wait 60 s, then the same with this branch. Record the frame times from the log and the lines above. The same with `VICTORY_COMMIT_FLOOR_MB=60000` to force the memory guard to put compiles off (it refuses every compile while free commit is under 60 GB), which reproduces the put-off case on any PC. Exact repro steps for the reporters: start the game, load into the world, open the pause menu and the map, wait 60 s. Before: frames of 9 to 10 s (the title bar's fps goes to 0.1), the log line above every 10 s. After: at most one 10 s frame for each map pass, then the map moves again, possibly with a part of it missing until its pipeline is made, and a line "a pass over the screen waited for its whole budget in all". ## Overlap `gh pr list --state open --search` for "screen wait", "pass over the screen", "SCREEN_WAIT", "screen passes", "held frame" (2026-11-30). `git merge-tree` of this branch with each PR head: all four below merge cleanly with main alone, and each conflicts with this branch in `make.rs`'s `wait`: - **#2188** (Ondra97, "Stop waiting for deferred pipeline compiles"): the same loop condition (`!p.retry_waits()`), in a helper `wait_for_pipeline`, and it keeps `VICTORY_SCREEN_WAIT_ONCE` from firing after a put-off. 3 conflict hunks. Whichever lands second drops its copy of the condition. This branch adds the per-pass allowance, which #2188 does not have. - **#3474** (nyxctura, memory guard bundle): cuts every screen wait to 50 ms while compiles are being put off (`compilemem::starved()`), ends waits on a put-off, and backs off retries 1 to 8 s. 2 conflict hunks. It covers the starved case harder than this. This branch also covers the cases where nothing is put off (a long compile, a long queue). - **#2580** (Kajcsi, "Stop long freezes on pipeline compiles"): a draw stops waiting once its build reaches the driver's compiler, and passes over the screen wait at most `VICTORY_PIPELINE_COMPILE_GRACE_MS` (50) into a compile. It also ends waits on a put-off. 4 conflict hunks. It is the one that covers many new passes with a slow compile each (each one's first 10 s), which this does not. 597 lines over 8 files. - **#3677** (CDworks-Design, diagnostics): adds `outcome` and `pipeline_key` to the "a pass over the screen was waited for" line. 1 conflict hunk (the same log call). It would make the diagnostic above one grep. - Merged and kept: #1743 (`VICTORY_SCREEN_WAIT_ONCE=1`), #1744 (`VICTORY_SCREEN_EARLY=1`), #1124 (`VICTORY_HELD_FRAME_MS`), #1734 (the dropped-pass log). Closed: #497 (the same idea for draws that are not passes over the screen). ## AI use Claude Code (Claude Opus 5.5) read the issues' text (no attachments) and the pipeline code, wrote the change and its tests, ran the checks listed above, and wrote this note. Nothing was run in game. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tyr0nsur commented 2026-11-30 07:23:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T07:23:07Z.


I found a race in the per-pass allowance on 700a84f. wait_within reads screen_waited_us before taking the frame-budget mutex, and charges the pass after waiting. Two concurrent draws of the same pending pass can each book the last 100 ms, even with VICTORY_PIPELINE_WAIT_SHARED=1, when the shared frame budget has room for both.

The regression test starts with 400 ms charged against 500 ms, then holds the first caller at DONE after it books time. On this PR's head the second caller also enters the wait. With the follow-up, it returns immediately and the pass is charged exactly 500 ms total. The patch books per-pass time under the existing frame-budget lock and releases any unused reservation when the wait ends, including on memory deferral.

Cherry-pickable commit 1d2f2cc. All 33 pipeline::make::tests passed on Windows with 1 and 4 test threads (SCREEN_WAIT_EVERY_FRAME=0, SCREEN_WAIT_ONCE=0, PIPELINE_WAIT_SHARED=1, all with the VICTORY_ prefix). cargo xtask policy --staged passed. This exercises the wait loop in unit tests. Game impact remains unmeasured. Codex implemented and tested the change, with Claude Code assisting in the review of adjacent deferral behavior.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7271671808 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7271671808). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-11-30T07:23:07Z. --- I found a race in the per-pass allowance on `700a84f`. `wait_within` reads `screen_waited_us` before taking the frame-budget mutex, and charges the pass after waiting. Two concurrent draws of the same pending pass can each book the last 100 ms, even with `VICTORY_PIPELINE_WAIT_SHARED=1`, when the shared frame budget has room for both. The regression test starts with 400 ms charged against 500 ms, then holds the first caller at `DONE` after it books time. On this PR's head the second caller also enters the wait. With the follow-up, it returns immediately and the pass is charged exactly 500 ms total. The patch books per-pass time under the existing frame-budget lock and releases any unused reservation when the wait ends, including on memory deferral. [Cherry-pickable commit `1d2f2cc`](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/1d2f2cc794cb0ef4407e59e3eec36953e12b9935). All 33 `pipeline::make::tests` passed on Windows with 1 and 4 test threads (`SCREEN_WAIT_EVERY_FRAME=0`, `SCREEN_WAIT_ONCE=0`, `PIPELINE_WAIT_SHARED=1`, all with the `VICTORY_` prefix). `cargo xtask policy --staged` passed. This exercises the wait loop in unit tests. Game impact remains unmeasured. Codex implemented and tested the change, with Claude Code assisting in the review of adjacent deferral behavior.
dyshay commented 2026-11-30 08:55:49 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T08:55:49Z.


Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched code pass. A run on an RTX 4090 is queued. Frame times will follow here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7273519427 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7273519427). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T08:55:49Z. --- Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched code pass. A run on an RTX 4090 is queued. Frame times will follow here.
andrewpozdnakov7-jpg commented 2026-11-30 13:14:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-11-30T13:14:52Z.


The same repeated screen wait appears during launch and world entry on v2026.11.29.05.

Reporter and adapter Screen waits with made=false Most frequent shader-set repeats
#3940, RTX 5070 Ti 58 29 each for two sets
#3953, RTX 5080 110 29 each for two sets
#3956, RTX 3060 19 19 for one set

The recorded wait durations were 10,000 ms in 186 of the events and 9,998 ms in one. Every waited-on shader set in those logs matches an earlier E_OUTOFMEMORY refusal key in its own run. The diagnostic groups pipeline variants by shader hashes. The repeated-wait fix lets later frames advance while the pipeline is missing. The underlying driver refusals remain a separate issue.

I cherry-picked 700a84f then @tyr0nsur's 1d2f2cc onto release main 41adb551. Both applied cleanly. A native Windows test called the actual wait path for one pending screen pass on three successive frames, scaling the screen/draw budgets to 300/20 ms.

Build and setting Measured wall time per frame, ms
Release main, default policy 304, 310, 310
Release main, VICTORY_SCREEN_WAIT_ONCE=1 304, 0, 0
#3788, default policy 307, 31, 30
#3788, VICTORY_SCREEN_WAIT_EVERY_FRAME=1 303, 311, 309
#3788 + review commit, default policy 309, 30, 31

The reviewer's unchanged concurrent-booking test failed on 700a84f with "two waits booked the same remaining time". It passed with 1d2f2cc, including the assertion that 400 ms already charged plus the single 100 ms grant totals exactly 500 ms. The pipeline unit suite passed 30/30 on main, 32/32 on the PR, and 33/33 with the review commit with both one and four test threads. The review commit also checks release of the unused reservation on memory deferral.

Please include 1d2f2cc with its original Git author when updating this PR. The current Windows CI run stops at the existing victory-loader::unwind_copy unused-function lint before reaching the tests.

Integration follow-up. #3474 changes the same wait loop. I verified a combined review branch that keeps the short wait and early exit on memory deferral together with the screen allowance and reservation. All 75 targeted tests passed. Details and the author-preserving stack.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7279567441 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7279567441). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-30T13:14:52Z. --- The same repeated screen wait appears during launch and world entry on `v2026.11.29.05`. | Reporter and adapter | Screen waits with `made=false` | Most frequent shader-set repeats | | --- | ---: | --- | | [#3940, RTX 5070 Ti](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3940#issuecomment-7278983256) | 58 | 29 each for two sets | | [#3953, RTX 5080](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3953#issuecomment-7279405168) | 110 | 29 each for two sets | | [#3956, RTX 3060](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3956#issuecomment-7279407788) | 19 | 19 for one set | The recorded wait durations were 10,000 ms in 186 of the events and 9,998 ms in one. Every waited-on shader set in those logs matches an earlier `E_OUTOFMEMORY` refusal key in its own run. The diagnostic groups pipeline variants by shader hashes. The repeated-wait fix lets later frames advance while the pipeline is missing. The underlying driver refusals remain a separate issue. I cherry-picked `700a84f` then @tyr0nsur's [`1d2f2cc`](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/1d2f2cc794cb0ef4407e59e3eec36953e12b9935) onto release main `41adb551`. Both applied cleanly. A native Windows test called the actual wait path for one pending screen pass on three successive frames, scaling the screen/draw budgets to 300/20 ms. | Build and setting | Measured wall time per frame, ms | | --- | --- | | Release main, default policy | 304, 310, 310 | | Release main, `VICTORY_SCREEN_WAIT_ONCE=1` | 304, 0, 0 | | #3788, default policy | 307, 31, 30 | | #3788, `VICTORY_SCREEN_WAIT_EVERY_FRAME=1` | 303, 311, 309 | | #3788 + review commit, default policy | 309, 30, 31 | The reviewer's unchanged concurrent-booking test failed on `700a84f` with "two waits booked the same remaining time". It passed with `1d2f2cc`, including the assertion that 400 ms already charged plus the single 100 ms grant totals exactly 500 ms. The pipeline unit suite passed 30/30 on main, 32/32 on the PR, and 33/33 with the review commit with both one and four test threads. The review commit also checks release of the unused reservation on memory deferral. Please include `1d2f2cc` with its original Git author when updating this PR. [The current Windows CI run](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46371812069/job/141690140252) stops at the existing `victory-loader::unwind_copy` unused-function lint before reaching the tests. Integration follow-up. #3474 changes the same wait loop. I verified a [combined review branch](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/tree/review/3474-3788-compatible-waits) that keeps the short wait and early exit on memory deferral together with the screen allowance and reservation. All 75 targeted tests passed. [Details and the author-preserving stack](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7279967738).
SmallDevBigNothing commented 2026-11-30 18:28:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SmallDevBigNothing on 2026-11-30T18:28:21Z.


I can confirm the repeat on another RTX 3060 12 GB / 32 GB system. A VILauncher log recorded fifteen 10,000 ms waits for the same unmade pipeline across fifteen frames. A separate run on 84bd61e2 with Series S, 540p internal, DLSS Performance and frame generation off hit a 10.08 s median across 18 frames with 500+ draws. That run's log filter omitted wait events, so the direct attribution comes from the older capture.

I rebased 700a84f while preserving main's monotonic frame budgets and driver-retry cutoff. Forty focused release tests passed on the initial adaptation. I've added @tyr0nsur's 1d2f2cc reservation fix on top and isolated the wait tests from one another's frame counters. I'm building the combination on e1251c31 for a same-build comparison using VICTORY_SCREEN_WAIT_EVERY_FRAME=1 as the control.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7287899264 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7287899264). Originally posted by [SmallDevBigNothing](https://github.com/SmallDevBigNothing) on 2026-11-30T18:28:21Z. --- I can confirm the repeat on another RTX 3060 12 GB / 32 GB system. A VILauncher log recorded fifteen 10,000 ms waits for the same unmade pipeline across fifteen frames. A separate run on `84bd61e2` with Series S, 540p internal, DLSS Performance and frame generation off hit a 10.08 s median across 18 frames with 500+ draws. That run's log filter omitted wait events, so the direct attribution comes from the older capture. I rebased `700a84f` while preserving main's monotonic frame budgets and driver-retry cutoff. Forty focused release tests passed on the initial adaptation. I've added @tyr0nsur's `1d2f2cc` reservation fix on top and isolated the wait tests from one another's frame counters. I'm building the combination on `e1251c31` for a same-build comparison using `VICTORY_SCREEN_WAIT_EVERY_FRAME=1` as the control.
SmallDevBigNothing commented 2026-11-30 18:52:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SmallDevBigNothing on 2026-11-30T18:52:26Z.


The test branch rebased onto e1251c31 includes this PR and @tyr0nsur’s reservation fix. All 41 focused tests passed in three single-threaded and three four-threaded runs. The locked release build and staged asset check passed.

On the RTX 3060, the integrated build exhausted the long allowance once for each of 14 different shader sets. Across the first 100 consecutive scene frames, the p95 was still 10.05 s. A later run explicitly preloaded 1,331 unique driver pipelines and set VICTORY_HELD_FRAME_MS=100. Starting 30 seconds after scene entry, it averaged 17.68 rendered FPS over 126 seconds with a 109 ms p95. Frame generation was disabled. The cache and wait cap both changed between these runs. This supports the per-pipeline fix for repeated waits and shows the remaining cost when several distinct pending pipelines are encountered.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288495563 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7288495563). Originally posted by [SmallDevBigNothing](https://github.com/SmallDevBigNothing) on 2026-11-30T18:52:26Z. --- The [test branch rebased onto e1251c31](https://github.com/SmallDevBigNothing/VIctory-NVIDIA/tree/codex/pipeline-stall-repro) includes this PR and @tyr0nsur’s reservation fix. All 41 focused tests passed in three single-threaded and three four-threaded runs. The locked release build and staged asset check passed. On the RTX 3060, the integrated build exhausted the long allowance once for each of 14 different shader sets. Across the first 100 consecutive scene frames, the p95 was still 10.05 s. A later run explicitly preloaded 1,331 unique driver pipelines and set `VICTORY_HELD_FRAME_MS=100`. Starting 30 seconds after scene entry, it averaged 17.68 rendered FPS over 126 seconds with a 109 ms p95. Frame generation was disabled. The cache and wait cap both changed between these runs. This supports the per-pipeline fix for repeated waits and shows the remaining cost when several distinct pending pipelines are encountered.
Lyrnc commented 2026-11-30 18:59:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-30T18:59:05Z.


@tyr0nsur, thanks, the race is real. wait_within read the allowance before taking the frame-budget lock and charged the pass only after the wait, so two draws of the same pass could each book the last 100 ms. Your 1d2f2cc is now in this branch with you as its author.

@andrewpozdnakov7-jpg, thanks for the log tally and the timing table. I did what you asked and kept the original author.

The branch is rebased onto main 84bd61e2 (v2026.11.30.02) and force-pushed. Three commits, now ending at bf49b9da:

  1. 9cd9219f: the per-pass allowance. Main's #2188 (v2026.11.30.01) already ends a wait when the build is put off for memory (wait_for_pipeline, retry_waits()), so that half of this PR now comes from main, and the commit message no longer claims it. The allowance goes in as a limit on the room passed to main's reserve_wait.
  2. 169a6e6a: tyr0nsur's commit, ported onto reserve_wait. What is left of the allowance, minus what waiting draws have booked, is the room the booking gets. Booking, charging and releasing the unused part all happen under the frame-budget lock, as in 1d2f2cc. The commit message says where it was cherry-picked from.
  3. bf49b9da (new): the screen wait tests take turns and use fresh frames. Main's frame budgets now give no wait to a frame older than their own (time_for_frame, ebff7087), and the tests share those budgets. So a test that ran after one with later frames had nothing to wait for: the put-off test passed without waiting, and the concurrent-booking test would stop at "a test thread did not reach its wait". wait_turn gives each test frames later than any used before and runs the tests one at a time. The put-off test now also checks that it really waited.

Checks on bf49b9da (Windows 11, rustc 1.98.1, its own target dir): cargo check -p victory-gpu passes, with only main's one warning (Shadow::ranged never used). cargo test -p victory-gpu --lib -- pipeline::make: 41 passed, 0 failed, among them concurrent_screen_draws_do_not_book_the_same_allowance, a_wait_ends_when_its_build_is_put_off and a_pass_over_the_screen_holds_frames_for_its_budget_once_in_all. Nothing was run in game.

Two things changed on main since this was opened:

  • VICTORY_PIPELINE_WAIT_ALL (66124155, on by default in .30.02) makes every graphics draw wait as a pass over the screen, 10 s a frame, with a held frame capped at 20 s. With this PR, each such pipeline gets 10 s in all. After that, its draws are dropped once the frame's 500 ms is spent, as every draw was before WAIT_ALL, until the pipeline is made. That trades WAIT_ALL's "a hitch once" for frames that move, with something missing. VICTORY_SCREEN_WAIT_EVERY_FRAME=1 brings back main's behaviour. Maintainers, your call.
  • victory play no longer sets VICTORY_COMPILE_MEMORY=0 (78978f86), so the compile memory gate is again one reason a pipeline can miss its 10 s.

#3474: I haven't folded the combined stack in here, to keep this PR to the allowance. Main now has #2188's exit on a put-off. Whichever of the two lands second can be rebased onto the other's wait.

@dyshay, the head changed, so janus-prs needs the new one.

AI use: Claude Code (Claude Opus 5.5) did the rebase, ported the review commit, wrote the test commit, ran the tests and wrote this reply.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288664135 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7288664135). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-30T18:59:05Z. --- @tyr0nsur, thanks, the race is real. `wait_within` read the allowance before taking the frame-budget lock and charged the pass only after the wait, so two draws of the same pass could each book the last 100 ms. Your `1d2f2cc` is now in this branch with you as its author. @andrewpozdnakov7-jpg, thanks for the log tally and the timing table. I did what you asked and kept the original author. The branch is rebased onto main 84bd61e2 (v2026.11.30.02) and force-pushed. Three commits, now ending at `bf49b9da`: 1. `9cd9219f`: the per-pass allowance. Main's #2188 (v2026.11.30.01) already ends a wait when the build is put off for memory (`wait_for_pipeline`, `retry_waits()`), so that half of this PR now comes from main, and the commit message no longer claims it. The allowance goes in as a limit on the `room` passed to main's `reserve_wait`. 2. `169a6e6a`: tyr0nsur's commit, ported onto `reserve_wait`. What is left of the allowance, minus what waiting draws have booked, is the `room` the booking gets. Booking, charging and releasing the unused part all happen under the frame-budget lock, as in `1d2f2cc`. The commit message says where it was cherry-picked from. 3. `bf49b9da` (new): the screen wait tests take turns and use fresh frames. Main's frame budgets now give no wait to a frame older than their own (`time_for_frame`, ebff7087), and the tests share those budgets. So a test that ran after one with later frames had nothing to wait for: the put-off test passed without waiting, and the concurrent-booking test would stop at "a test thread did not reach its wait". `wait_turn` gives each test frames later than any used before and runs the tests one at a time. The put-off test now also checks that it really waited. Checks on bf49b9da (Windows 11, rustc 1.98.1, its own target dir): `cargo check -p victory-gpu` passes, with only main's one warning (`Shadow::ranged` never used). `cargo test -p victory-gpu --lib -- pipeline::make`: 41 passed, 0 failed, among them `concurrent_screen_draws_do_not_book_the_same_allowance`, `a_wait_ends_when_its_build_is_put_off` and `a_pass_over_the_screen_holds_frames_for_its_budget_once_in_all`. Nothing was run in game. Two things changed on main since this was opened: - `VICTORY_PIPELINE_WAIT_ALL` (66124155, on by default in .30.02) makes every graphics draw wait as a pass over the screen, 10 s a frame, with a held frame capped at 20 s. With this PR, each such pipeline gets 10 s in all. After that, its draws are dropped once the frame's 500 ms is spent, as every draw was before WAIT_ALL, until the pipeline is made. That trades WAIT_ALL's "a hitch once" for frames that move, with something missing. `VICTORY_SCREEN_WAIT_EVERY_FRAME=1` brings back main's behaviour. Maintainers, your call. - `victory play` no longer sets `VICTORY_COMPILE_MEMORY=0` (78978f86), so the compile memory gate is again one reason a pipeline can miss its 10 s. #3474: I haven't folded the combined stack in here, to keep this PR to the allowance. Main now has #2188's exit on a put-off. Whichever of the two lands second can be rebased onto the other's wait. @dyshay, the head changed, so janus-prs needs the new one. AI use: Claude Code (Claude Opus 5.5) did the rebase, ported the review commit, wrote the test commit, ran the tests and wrote this reply.
trustno1-coder commented 2026-12-01 18:48:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:48:44Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321591683 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7321591683). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:48:44Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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!3788
No description provided.