Repository navigation
Conversation
…ll, not every frame A draw of a pass over the screen whose pipeline is not made waits up to VICTORY_SCREEN_WAIT_MS (10 s) for it, in every frame, for as long as it is not made. A screen the title draws every frame (the pause menu's map) whose pipeline did not come within 10 s (the compile memory gate holding the worker, the memory guard putting the build off, a long compile or queue) held every frame for the 10 s again: about 10 s a frame on the map, seen as a freeze (trustno1-coder#3059; trustno1-coder#3467 measured it on main 41adb55, each 9 to 10 s gap followed by "a pass over the screen was waited for"). Now each pass has the screen's budget once in all (screen_waited_us); after that it waits as other draws do, within the frame's shared 500 ms, until it is made. Its first 10 s are as before. The wait also ends when the memory guard puts its build off (nothing makes it during the pause); it waited out the rest of its budget before. VICTORY_SCREEN_WAIT_EVERY_FRAME=1: the whole budget every frame, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I found a race in the per-pass allowance on The regression test starts with 400 ms charged against 500 ms, then holds the first caller at Cherry-pickable commit |
|
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch |
|
The same repeated screen wait appears during launch and world entry on
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 I cherry-picked
The reviewer's unchanged concurrent-booking test failed on Please include |
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 41adb55) 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:
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 getsscreen_budget()(VICTORY_SCREEN_WAIT_MS, 10 s) per frame, others 500 ms per frame (wait_budget).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(Pipelines: VICTORY_SCREEN_WAIT_ONCE=1 stops waiting for a pass over the screen whose wait ran out, until it is made (off by default) #1743), is off by default.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.make_withnotifiesDONEafterdefer(), the waiter wakes, seesmadeunset, 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(nowwait_within(p, frame, screen_budget, draw_budget)so tests can pass small budgets):Pending::screen_waited_uscounts 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).p.retry_waits()in the loop condition).VICTORY_SCREEN_WAIT_EVERY_FRAME=1gives back the old wait (the whole budget every frame).VICTORY_SCREEN_WAIT_ONCE=1still 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 700a84f:
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 throughmake_with(the gate's ownrefuse_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.a_pipeline_whose_compile_was_put_off_for_memory_is_made_laterand 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 againstgit diff -U0 41adb551 700a84fd). The one inmake.rsis main's (popnever used, l.1367).NOT tested
made=trueafter 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. Stop long freezes on pipeline compiles #2580's compile grace and Memory guard: no black screen at 0.2 fps on 32 GB PCs (one compile at a time under the commit floor, refused pipelines made again, no 10 s screen waits) #3474's short screen wait while starved are aimed at that.Diagnostic to pin it (needs Selim's OK to read the attached play log of #3059, and of #3467 if zinixyt agrees):
grep "a pass over the screen was waited for": for each line,ms,made,formats,shaders. The sameshadersagain and again withmade=falseis the case this fixes. A newshaderseach time withmade=trueis the slow-compile case (Stop long freezes on pipeline compiles #2580).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 Stop waiting for deferred pipeline compiles #2188 / Memory guard: no black screen at 0.2 fps on 32 GB PCs (one compile at a time under the commit floor, refused pipelines made again, no 10 s screen waits) #3474 (and Memory guard: a pipeline put off again and again is made on a lower commit floor #2886), and a larger page file as the workaround (v2026.11.29.01 – System commit exhaustion, pipeline OOM errors, map stalls and runtime crashes mitigated by increasing pagefile #2822).VICTORY_COMMIT_FLOOR_MB=60000to 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 --searchfor "screen wait", "pass over the screen", "SCREEN_WAIT", "screen passes", "held frame" (2026-11-30).git merge-treeof this branch with each PR head: all four below merge cleanly with main alone, and each conflicts with this branch inmake.rs'swait:!p.retry_waits()), in a helperwait_for_pipeline, and it keepsVICTORY_SCREEN_WAIT_ONCEfrom 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 Stop waiting for deferred pipeline compiles #2188 does not have.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).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.outcomeandpipeline_keyto 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.VICTORY_SCREEN_WAIT_ONCE=1), Pipelines: VICTORY_SCREEN_EARLY=1 queues a pass over the screen in the screen list when it is created, ahead of the slow list (off by default) #1744 (VICTORY_SCREEN_EARLY=1), Pipelines: VICTORY_HELD_FRAME_MS=<ms> stops pipeline waits once a frame has gone that long without a present, so a cold library never holds it to the title's 30 s watchdog #1124 (VICTORY_HELD_FRAME_MS), GPU: passes over the screen log their formats and whether a dropped one is drawn again #1734 (the dropped-pass log). Closed: pipeline: avoid repeating per-frame waits for slow in-flight pipelines #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