Pipeline wait budget is per frame only: a pipeline that stays "being made" costs the whole budget in every frame that binds it #73
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX#73
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@j-fuxa on GitHub · 2026-11-26 01:40 UTC · original
What the code does.
pipeline/make.rsbounds the wait for a pipeline that is not made yet per frame (wait_budget, 500 ms,VICTORY_PIPELINE_WAIT_MS, shared by all threads) but remembers nothing per pipeline.ready()enterswait()wheneverp.made.get().is_none(), so a pipeline whose build outlasts the budget takes it again in every frame that binds it. For passes over the screen the budget isVICTORY_SCREEN_WAIT_MS, 10 s by default.Evidence. #61 (median 398 ms a frame, GPU 0.0 ms, 459-539 ms "waiting for pipelines", 1,251 draws a frame dropped as "being made") and #67 (about 380 ms a frame, 80 ms of it work) have this shape, though their logs cannot tell "slow to build" from "stuck". fxceless/victory-fork#1181 measured the loop on four stuck pipelines: 500.1 ms waited in every world frame; with a 50 ms budget the median went from 761 to 252 ms. Our tree had the same code shape (found by code review, then fixed as below).
Second gap.
Pending::make()runsHostPipeline::newwith nocatch_unwind(used elsewhere in the crate:list/thin.rs,host/aside.rs,land.rs,queue/behind.rs). If it panics, the worker ends,madestays unset and the state stays MAKING (start()returns early for good),WAITINGand a slow slot (slow_now) are never given back, and every frame that binds the pipeline waits again. We have not seen such a panic; this is from reading the code.Suggested fix.
Pending).wait()takes the smaller of the frame's and the pipeline's budget left and returns at once at zero; the draw is dropped as now and finds the pipeline when it appears. A per-pipeline budget well under the frame budget keeps the first-frame wait for cheap pipelines.catch_unwind; on a panic log the shaders and setmadetoNone(refused).Smaller.
shader_cache::cachedstores only successes (its test says "Failures are not stored"), so a program that does not translate is translated and refused again every run. In our tree about 114 programs did, roughly 100 s of worker time a run;victory shadersshows your count. A negative entry keyed like the positive one would stop it.Caveat. Your library locking (
same_namestripes,saving) already matches what mattered for us: one lock over every library call left 8 workers waiting 59 % of the time on a 404 MB library (about 150 ms a load).@BE29ZZ on GitHub · 2026-11-26 01:46 UTC · original
Are you still struggling with this error? Would you like me to help?
@jtrudeau1530 on GitHub · 2026-11-26 08:40 UTC · original
On Linux/vkd3d-proton one root cause of a pipeline that stays "being made" forever is a host compile thread that dies: dxil-spirv overflows its stack on a few large shaders (see #111). Then the whole 500 ms budget is spent every frame (measured 500.1-500.2 ms/frame, 3.4 fps). #162 detects the dead thread and compiles the shader again in another control-flow shape: 0.0 ms waiting, 13.7-15.1 fps on the same build. It doesn't change the per-frame budget logic itself, so the cap discussed here is still worth having for pipelines that are genuinely slow.