GPU: VICTORY_PIPELINE_WORKERS chooses how many workers make pipelines #3714
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3714"
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 rpmaster2 on 2026-11-28T10:43:04Z.
GPU: let
VICTORY_PIPELINE_WORKERSchoose how many workers make pipelinesThe number of pipeline workers is fixed at build time: half the logical processors, 2 to 8. On a cold cache hundreds of pipelines are queued at once, and how many threads should make them is not the same on every machine — a 6-core part and a 32-thread part want different answers, and a user who is debugging a stall wants to try 1 and 16 without touching code. This adds an environment variable for it; the default does not change.
Provenance — this is not my code
worker_countand the variable are taken fromBelobug/VIctory-Belobug-AMD, commitffdde86"Pipeline workers follow the CPU; one pad that never disconnects" (authorlocal <local@localhost>,Co-Authored-By: Claude Opus 5.5 <[email protected]>), GPL-3.0-or-later, the same licence as here. That repository has since been deleted from GitHub; the hash and message above keep the origin checkable.What I kept from it, and what I changed:
worker_count(a value given is clamped to 1–64) and its test, with the expectations adjusted to the default below.workers()function fed by a queue of their own; here the spawn happens insidequeue()'sOnceLock, so the call sits there. I also added thepipeline workerslog line.Behaviour
VICTORY_PIPELINE_WORKERSunset: exactly as today —(processors / 2).clamp(2, 8).VICTORY_PIPELINE_WORKERS=1: one worker (all pipeline making on one thread, which is the interesting case when a stall is suspected).info, aspipeline workers.BELOW_NORMAL), same cache saving.Numbers here, if useful
Ryzen 5 5600 (12 threads), RX 9070 XT: today's default is 6 workers; the fork runs 8 plus its 2 screen-only workers. I have not yet claimed that either is better — that is what the variable is for, and I will post a table (2 / 6 / 8 / 12 on a cold pipeline cache, same save) as a comment once it is run rather than guess.
How it was checked
cargo build --locked --profile diag -p victory --features diagnosticson Windows 11 26100, Rust 1.98.1;cargo test --locked -p victory-gpu --lib worker_count: 1 passed, 0 failed, 232 filtered out — the test above;VICTORY_PIPELINE_WORKERS=1on the RX 9070 XT,--console series-s: the log showspipeline workers workers=1, and the effect is visible in the same run —dropped 1467/1693/1954 without a host pipelineper frame, against 100–300 at the default six workers on this 12-thread part. That is the knob doing what it says, not a claim that one is better.Nothing changes when the variable is unset: the default is the same expression as today.
AI-assisted: written by DeepSeek (OpenCode harness) using the original commit's code and my run logs; no game files or paths.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T11:08:51Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
058c1abc5cb3a742857d7158eec6481c3e7fd488, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-gpu --lib -- pipeline::make::tests::worker_count_follows_the_processors_and_the_switch --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 232 filtered, exit 0.git grep -Ffor the test name on the base returned no match (test is new on this PR);git diff --check 63bcca4 HEADclean (1 file, +27/-3).CARGO_TARGET_DIR(never shared),CARGO_BUILD_JOBS=2. Only the named synthetic test was replayed; full workspace suite and clippy were not run locally.AI-assisted (Hy4 flash).
Imported from Marvisak/VIctory. Originally posted by rpmaster2 on 2026-11-28T12:20:08Z.
Numbers from this card on the switch itself, so that nobody has to guess what it changes. RX 9070 XT, Ryzen 5 5600 (6 cores, 12 threads),
--console series-s, warm pipeline library, three runs of 100 s each from the same restored save, only this variable differing:VICTORY_PIPELINE_WORKERShost pipelines all made412Two honest readings of that:
all madewithin a second, because nothing is compiled, only loaded; 4 workers is visibly worse than 6 (325 against 184 dropped draws a frame) and 12 I cannot judge, because that run sat on the loading screen at 8 draws a frame, where there is nothing to drop.VICTORY_PIPELINE_WORKERS=1gavedropped 1467/1693/1954 without a host pipelineper frame, against 100–300 at the default on this machine. That is the case the switch exists for.So the default stays as it is; this is a knob for a cold cache, a smaller CPU, or a machine where the workers starve the title's own threads — not a free speed-up on a warm one.
AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; numbers and versions only, no game files or paths.
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.