GPU: prioritize pipeline work requested by draws #546
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/546"
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?
Imported from Marvisak/VIctory. Originally posted by melon0918 on 2026-11-24T04:43:05Z.
Change
Compile pipelines needed by a draw or dispatch ahead of speculative early work. A first request promotes a pipeline that is still in the early queue. Workers claim each pipeline once and preserve FIFO order within each priority. The same frame wait budget applies to the request.
#275 addresses wait accounting and cache saves. This change addresses which pending job a worker takes next.
Verification
victory-gpudiagnostics suite passed 46 tests with one existing ignored test. The queue regression checks promotion, FIFO order within each priority, and single processing of a promoted entry. The asset policy passed.The reviewed captures show opening credits and 2D imagery. Live 3D rendering remains unverified. The prioritization run recorded substantially more draws at a lower median frame rate and encountered device removal. The queue measurements are evidence of scheduling behavior.
AI-assisted contribution. All test data and captures stayed local.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T11:51:44Z.
Review: APPROVED
Tested
a8bf0d3on Windows 11, RTX 5070, MSVC:cargo test -p victory-gpu -- --test-threads=144 passed, includingdraws_promote_early_pipelines_without_claiming_them_twice. With--features diagnostics, 46 passed. Clippy's 1 warning is the existing one in host.rs.QUEUE's lock:pushraisesqueue_stateandpopstoresMAKING. A pipeline promoted from early to requested is therefore claimed once. Its stale early entry is skipped by the== EARLYfilter inpop, and the test covers that sequence.start(load() >= priority) can only return early for a state that is already at least as high, so it never loses a promotion.WAITING/PEAKcount a pipeline once, on its first queueing, not on promotion, which matches the old accounting.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T11:43:30Z.
Independent verification & code review on Windows 11 Pro (build 26100) + AMD Radeon RX 9060 XT (RDNA4, driver
32.0.32029.2010, Rust1.98.1), cleanly merged ontomain(ffe310e):cargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: PASScargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings: PASScargo test -p victory-gpu --locked: 51 passed, 0 failed, 1 ignored (including newpipeline::make::tests::draws_promote_early_pipelines_without_claiming_them_twice)Diff review (
crates/victory-gpu/src/pipeline/make.rs): very clean state machine (NOT_QUEUED -> EARLY -> REQUESTED -> MAKING) serialized underQUEUE:EARLYentry toREQUESTEDpushes it torequestedwithout double-incrementingWAITING, andpop()skips promoted entries left inearly(queue_state != EARLY) so no pipeline is ever compiled twice.QUEUEbeforep.make(), and the no-workers fallback (!workers()) builds inline safely without touchingWAITING.AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Mumogg on 2026-11-24T17:57:19Z.
A data point for why this is needed even once library loads run in parallel (#1000), from Linux (RTX 5070 Ti, driver 615.78.08, Wine 11.22 Staging, vkd3d-proton from GE-Proton11-14; r4tedx
integration/testersupdate 9, diagnostics build, warm cache with 1,167 pipelines on the early list).One caveat first: I could not run this PR's code on that tree.
make.rsconflicts with #275, which the testers tree carries (the per-pipeline wait pair and the frame budget), so what I ran is a local change with the same idea: two queues, a pipeline a frame asks for goes to the urgent one even if it is already waiting in the early one, workers drain urgent first. A rebase of this PR over #275 would let testers run the real thing.Warm start, same cache, at world entry:
With only the lock fixed, the frame's own pipelines still sat behind several hundred early compute pipelines, each a multi-second load here.
(AI-assisted, Claude Code; runs on my machine.)
Edit: the Wine version was 11.22 Staging, not 11.21 (the system had updated before these runs).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:24:38Z.
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Already in main: make.rs has a queue for pipelines draws wait for ahead of the early starts, with promotion of a still-queued early entry and single processing (enqueue, test draws_go_ahead_of_early_starts).
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed