Pipeline wait: a pipeline still being made costs the full per-frame budget on every frame; a panic in a worker would leave it "being made" for good #217
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD#217
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:41 UTC · original
What we found
pipeline::make::waitgives each title frame a budget (500 ms by default,VICTORY_PIPELINE_WAIT_MS; screen passes 10 s onrx9070xt, 20 s onmain). The budget restarts every frame and nothing records that a given pipeline has already used a whole one:Pendinghas no waited-time field. A pipeline that takes longer than the budget, or sits behind long compiles, therefore costs up to a full budget on every frame that binds it, until it is made.This is the behaviour in fxceless/victory-fork#1181 (4 pipelines "being made" for a whole session: 500 ms waited on every world frame, median 761 ms; with the wait set to 50 ms the median was 252 ms). Your own notes point the same way: the comment at
make.rs421-427 onrx9070xtrecords 2.5 s of waiting per frame before the budget was shared, anddocs/findings.mdlists 270-660 s of a session in frames over 200 ms, almost all while pipelines were made.What we did
catch_unwindaround the worker'smake(): on a panic the pipeline is marked refused (made = none, waiters notified, counters released) and the worker survives. Without it a panic ends the worker thread and leaves the pipeline "being made" for the rest of the run, so the first problem applies to it forever and the pool is one worker smaller.Where in your code
readyandwaitinpipeline/make.rs(main124-182,rx9070xt392-496) and the worker loops (main192-221,rx9070xt681-699, wherep.make()runs bare). The release profile does not setpanic = "abort", so a panic unwinds. We have not seen a panic inmake()on your build; that second point is from reading the code only.Caveats
Dropping a draw sooner for a slow pipeline is the same trade as today once the budget is gone. Screen passes may want a larger per-pipeline allowance than ordinary ones.
@adrianmjim on GitHub · 2026-11-26 19:53 UTC · original
Checked on main
4f62c2awith local unit tests: Windows 11, debug test build, no game, no real driver compile. Other heavy jobs were running on the machine at the same time.One code detail not in the issue:
worker_lost(make.rs226) is called only by the compile watchdog (library.rs279, 309). After a panic inmake(), the pipeline is never markedlost, theAT_WORKentry stays, andWAITINGis not decremented (211). The panic hook invictory-loader/src/crash.rs:60only logs.On
rx9070xt(81ebb7b), from reading only:lost()(make.rs:280) is the only path that gives up on a pipeline, and only the access-violation handler reaches it (make.rs:229-273). So it does not cover a panic inmake()there either.Measured with the 500 ms ordinary budget:
waiton 4 frames: 511, 513, 512 and 512 ms, 2.05 s in total.make()panics in a worker: each of 3 frames waited 511-516 ms. 10 s later the pipeline was still being made,lostwas false, andwaiting()was still 1.#219 (head
978681c, base4f62c2a):make_withon the test thread. I also sent a panic through a real worker on its head. The pipeline was refused within 55 us,waiting()went back to 0, and the pool made the next pipeline.watch::tests, in one run on each side. These are flaky on this machine under load.The first point is now covered by #229. I posted my results on it there. Together, #229 and #219 cover both points.
Not tested:
--features diagnosticstests.rx9070xtbranch.