Repository navigation
fix(gpu): prioritize and bound-wait cold compute pipelines before dropping dispatches - #420
Conversation
…pping dispatches Give cold compute dispatches a dedicated priority worker lane ahead of queued graphics pipelines and an independent bounded wall-clock wait window (VICTORY_SYNC_COMPUTE_PSO, on by default; 0 disables) so one-time compute passes are not dropped when a cold frame exhausts the shorter graphics compilation budget: - pipeline/schedule.rs: add a three-lane PriorityQueue (Compute, Graphics, Early) and WaitBudgets tracking the 500 ms per-frame graphics wait budget separately from a 10 s per-frame wall-clock and per-pipeline compute compilation cap, plus unit tests runnable on both macOS and Windows. - pipeline/make.rs: classify compute pipelines in Pending, record when a worker begins compiling each pipeline, promote requested compute pipelines to Lane::Compute ahead of Lane::Graphics and Lane::Early, and log once if a compute dispatch or pipeline exceeds its cap.
|
Physical M4 Pro A/B for gdemontalivet’s exact #420 revision. I used one Windows test binary on CrossOver 26.3 / D3DMetal 4.0 beta 3. After exhausting the same frame’s 500 ms graphics allowance, a generated compute shader went through the normal guest dispatch. The same test gate held publication of the real worker-created PSO for 40 ms after compilation and the first wait request.
This exercises preservation of the first dispatch under controlled PSO readiness. The added wait includes the test hold. Production compile and frame times need separate measurement. Prepared and tested with Codex. |
|
In-game check on an M5 Pro (macOS 27.0.1, CrossOver 26.3 Wine with the repo's current patches, D3DMetal 4.0 beta 3, Series X). Base:
That matches the description: one-time setup work dropped on a cold start leaves the scene wrong for good, and #420 keeps it. In steady state, runs with and without #420 drop about the same, roughly 40 per frame, so #420 doesn't change that part. Only a few runs, so take the totals as rough. I can run more if that helps. Prepared with Claude Code. |
Summary
[now, early]) inpipeline/make.rswith a 3-lanePriorityQueue(Compute → Graphics → Early) incrates/victory-gpu/src/pipeline/schedule.rsso cold compute dispatches jump ahead of queued graphics pipelines and pre-warms.VICTORY_SYNC_COMPUTE_PSO, default ON,0disables) so one-time initialization/skinning/bake compute dispatches are not dropped on cold launches once graphics compilation exhausts the shared 500 ms frame wait budget.Verification
cargo xtask policy: passcargo test -p victory-gpu: 107 passed (including 6 newpipeline::schedule::tests::*tests)cargo clippy --target x86_64-pc-windows-gnullvm --workspace --all-targets -- -D warnings(default &--features diagnostics): 0 warnings