Repository navigation
Host pipelines: a draw's wait ends when the memory guard puts the compile off (500 ms held every second at the commit limit) - #3398
Conversation
…pile off (500 ms held in every second at the commit limit)
A pipeline whose compile the memory guard put off is paused for a second
and not waited for meanwhile. When the pause ran out, the next draw queued
it again and waited; a worker took it, was refused within the millisecond
and put it off again, which wakes the waiters. But the wait looked only at
whether the pipeline was made, so the draw stood there for the rest of its
500 ms budget, once a second, for as long as memory stayed short.
Seen on an RTX 4070 Ti SUPER with the PC at its commit limit (75.1 of
75.9 GB): frame times of 38 ms median with one of about 500 ms in every
second ("p99 506.2"), and "draws dropped for pipelines not made yet" for
the same key each second. With this the same scene has no such frame.
The wait now ends as well when the compile is put off. The test waits
508 ms without the change and returns with the refusal with it.
The test of a pipeline made ready takes a key of its own: it shared the
process's list of used keys with the tests that ask for a pipeline of no
shaders, on other threads, and passed or failed by their order.
Carried ahead of upstream, each behind its own switch or strictly local: - trustno1-coder#3379 the commit floor scales to the PC's RAM, so a 16 GB PC still admits driver compiles (without it every PSO compile is put off, and the scene draws nothing); - trustno1-coder#3398 a draw's wait ends when the memory guard puts the compile off, so a drawing thread does not sit 500 ms at the commit limit; - trustno1-coder#3065 the ambient depth table is bound by the resolve only, and frame generation is asked again once DLSS-G allows more frames; - trustno1-coder#3067 the ray test misses inverted boxes, as the console's does (VICTORY_BVH_MISS; the authors measure +57 % with ray tracing); - trustno1-coder#3063 the BVH rehydration stops at 32 rounds and the builder's memory is coherent only where it asks (VICTORY_BVH_REHYDRATE_MAX, VICTORY_BVH_COHERENT_GLC; the authors measure +15 %); - trustno1-coder#3406 VRAM is checked before the first streamed textures are allocated; - trustno1-coder#3128 sampled texture eviction is on by default through 10 GB of VRAM; - trustno1-coder#3413 the relay fence context survives a GPU device loss. Left for a hand rebase, because they sit in the paths our parallel submit and DLSS work rewrote: trustno1-coder#1978 (keep the DLSS frame generation inputs through presentation) and trustno1-coder#3411 (the RTX 5060 Ti bundle).
Carried ahead of upstream, each behind its own switch or strictly local: - trustno1-coder#3379 the commit floor scales to the PC's RAM, so a 16 GB PC still admits driver compiles (without it every PSO compile is put off, and the scene draws nothing); - trustno1-coder#3398 a draw's wait ends when the memory guard puts the compile off, so a drawing thread does not sit 500 ms at the commit limit; - trustno1-coder#3065 the ambient depth table is bound by the resolve only, and frame generation is asked again once DLSS-G allows more frames; - trustno1-coder#3067 the ray test misses inverted boxes, as the console's does (VICTORY_BVH_MISS; the authors measure +57 % with ray tracing); - trustno1-coder#3063 the BVH rehydration stops at 32 rounds and the builder's memory is coherent only where it asks (VICTORY_BVH_REHYDRATE_MAX, VICTORY_BVH_COHERENT_GLC; the authors measure +15 %); - trustno1-coder#3406 VRAM is checked before the first streamed textures are allocated; - trustno1-coder#3128 sampled texture eviction is on by default through 10 GB of VRAM; - trustno1-coder#3413 the relay fence context survives a GPU device loss. Left for a hand rebase, because they sit in the paths our parallel submit and DLSS work rewrote: trustno1-coder#1978 (keep the DLSS frame generation inputs through presentation) and trustno1-coder#3411 (the RTX 5060 Ti bundle).
…ends when the memory guard puts the compile off (500 ms held every second at the commit limit) trustno1-coder#3398 by Revono, head a22a26d. Conflict: tests only; kept both.
…compiles trustno1-coder#2580, head c9ffe60. Conflicts in pipeline/make.rs: kept the memory guard's starved floor and take_out_of_memory (trustno1-coder#3398 and main) with the PR's Building guard; wait_loop and compute_left from the PR (it already ends on retry_waits and boosts the maker). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Confirmed in game: this fixes the 0.1 fps freeze when going into water. The PC is an RTX 4060 8 GB with a Ryzen 5 7600 and 32 GB RAM. Settings: Series X, DLSS Balanced, frame generation 2x; the system-managed pagefile gives a commit limit of 36,969 MiB. Plain v2026.11.29.05. Going into water binds a new pass over the screen (vertex This happened 14 times, 10.0 s apart: two keys, v2026.11.29.05 with this PR (merged locally on top of #3500). The same place, the same pipeline, the same deferral: There was no "a pass over the screen was waited for" line in the whole session, and no frame over 2 s. The frames around it ran at 79-94 ms, the normal rate for that scene. The water pass is dropped until it can be made instead of freezing the game. The same signature appears in #2303, #2319, #2385 and #3467. The regression came in with 60a08ef: compiles are put off rather than refused, so |
|
Independent Windows check on RTX 4080 16 GB / Ryzen 5 7600 / 32 GB RAM / driver 610.88, base Focused test: tests-only on base fails with Runtime mechanism check, deliberately induced: the signature was absent in my ordinary logs, so I set process-local
On base, the same screen pipeline was put off by the guard, then consecutive frames exhausted the entire 10 s screen-wait budget. With the patch, no unmade wait exhausted that budget. This independently exercises the screen-pass case already reported above, in addition to the ordinary 500 ms unit test. Limits: scenes were not matched and both arms were heavily degraded by the artificial floor. This is mechanism evidence, not a performance ABBA or a claim of higher normal FPS; other long loading frames remained. All runs closed normally. No raw title logs/dumps are attached. AI assistance: Claude ran the isolated tests and collected the hardware evidence; Codex reviewed the report and publication wording. |
… the memory guard puts the compile off (500 ms held every second at the commit limit)
No issue filed for this; found while tracing a half-second hitch on a PC at its commit limit.
What it changes
A pipeline whose compile the memory guard puts off is paused for a second and not waited for meanwhile. When the pause ran out, the next draw queued it again and waited for it. A worker took it, was refused within the millisecond and put it off again, which wakes the waiters, but
waitonly looked at whether the pipeline was made. So the draw stood there for the rest of its 500 ms budget, once a second, for as long as memory stayed short.pipeline/make.rswait: the loop also ends when the compile was put off (Pending::retry_waits).deferalready sets the pause before the waiters are woken, so nothing is missed.a_wait_ends_when_the_compile_is_put_off_for_memory: a worker thread refuses the compile 30 ms into a wait. It waits 508 ms without the change and returns with the refusal with it.a_pipeline_made_ready_is_the_one_the_title_getstakes a key of its own. It shared the process's list of used keys with the tests that ask for a pipeline of no shaders, on other threads, and passed or failed by their order (it began to fail once the new test changed the timing).How it was tested
frame times: 13 frames, median 40.0 ms, p95 51.2, p99 506.2, the same in every one-second window, withdraws dropped for pipelines not made yet ... keys=33f518084a3194a8b5ef1c17ab96ab87once a second andhost pipeline not made: the PC is short of memory (memory guard).median 49.3 ms, p95 52.0, no frame near 500 ms in any window.cargo testpassed for the crates it touches: yes forcargo test -p victory-gpu --locked --lib pipeline::make(31 passed, run six times in a row).cargo xtask policy --staged:asset policy: 1 files ok.cargo clippy -p victory-gpu --all-targets --locked -- -D warningsstops invictory-shaderonmainas it is (two unused imports and awhile_immutable_conditioninemit/lower), before it reaches this crate; without-D warningsthis change adds no warning.Checked for overlap
wait's loop, and this does not touchmemguardorcompilemem.