GPU: pipeline workers at the title's priority, not below it #1504
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1505"
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 KevinPratap on 2026-11-24T18:35:15Z.
Problem
Pipeline workers lower themselves to
THREAD_PRIORITY_BELOW_NORMAL. In the world, the title's own threads keep every processor busy, and below-normal threads then get almost no time. Draws whose pipelines are not made yet are dropped, so the screen stays black until the backlog clears, and on a laptop it never did.Measured on an RTX 4050 Laptop (16 logical processors, diagnostics build, counting
host pipelinelog lines per minute):With the backlog draining, the same run went from about 10 to up to 1,475 recorded draws a frame.
Fix
The workers keep the title's priority (the call is removed). #546 decides which pipeline a worker takes next; this decides whether the workers run at all. The two are independent and merge together.
Verified
cargo clippy -p victory-gpu --all-targets: no new warnings;cargo test -p victory-gpu --lib pipeline::makepasses.Only
crates/victory-gpu/src/pipeline/make.rschanges.AI-assisted.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by KevinPratap on 2026-11-24T22:33:08Z.
Rebased onto today's
main(70564ae0). The new queue already puts draw-requested pipelines first (as #546 did), butwork()still lowers the workers toTHREAD_PRIORITY_BELOW_NORMAL; this removes that call.cargo clippy -p victory-gpu --all-targets -- -D warningsis clean, and thepipeline::maketests pass. With the pre-build from the shader pack, fewer pipelines are made in the world, so this matters most on a first run and for pipelines the pack doesn't cover. AI-assisted.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:16:42Z.
Automated triage for the maintainers.
Merge candidate. Removes the
SetThreadPriority(..., THREAD_PRIORITY_BELOW_NORMAL)call fromwork()incrates/victory-gpu/src/pipeline/make.rs, so the pipeline workers (half the logical processors, clamped to 2..8) run at normal priority. I checked that nothing else inmake.rsdepends on the lower priority and that the change is limited to that call. The measurements in the description mix this change with others (#546, #1129), so the gain from this change alone is shown only by the 7-pipelines-a-minute starvation row; whether normal-priority workers cost the title's own threads too much is a maintainer's call.CI: no check runs reported for this head.
Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 14:07:18 +00:00
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:56:22Z.
Code review and RTX 5090 + WARP verification at head
d4ef6a596be3merged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/pipeline/make.rs:295-300):SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL)(and itsunsafeFFI block) so pipeline compilation workers run at normal priority alongside title threads instead of starving under load, while preserving the(cpus / 2).clamp(2, 8)pool sizing andnow-before-earlyqueue priority. Verified no otherSetThreadPrioritycalls remain in the repo.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy --locked -p victory-gpu --tests -- -D warnings(default +--features diagnostics): 0 warningsvictory-gpu --lib -- pipeline::: 23/23 passed default on RTX 5090; 26/26 passed (--features diagnostics) on both RTX 5090 and WARP.LGTM.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.