Pipelines: VICTORY_PIPELINE_WORKERS sets the worker count #1727

Closed
npanu420 wants to merge 1 commit from upstream-pr/1728 into main
npanu420 commented 2026-11-24 21:25:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by npanu420 on 2026-11-24T21:25:40Z.


What

VICTORY_PIPELINE_WORKERS=n sets the number of host pipeline workers (1 to 64). Without it nothing changes: half the logical processors, 2 to 8. The count is logged (host pipeline workers).

Why

On a first run with an empty pipeline library, the world's pipelines are compiled by the driver on these workers, and draws whose pipeline is not made yet are dropped. On NVIDIA the largest world programs take seconds each. Same machine, same scene (i9-9900X with 20 threads, RTX 3070, Windows 11):

Workers Pipelines made per minute while the queue drained
8 (default) 542 → 106 → 42 → 22 over four minutes (the queue grew to 1,228)
16 109 → 150 per minute; the queue (2,175 at launch, half loaded from the library) emptied before the world started

The two runs did not start from the same library state, so the rates are an indication, not a clean A/B. The CPU stayed below 80 % with 16 workers. CPUs with more threads than 16 may want more, and CPUs with fewer may want less while the title loads.

Changes

  • worker_count(asked, processors) reads the switch, clamped to 1-64, else keeps the default.
  • Test worker_count_takes_the_switch_within_bounds.

Verification

cargo test -p victory-gpu --lib worker_count
cargo clippy -p victory-gpu --all-targets --locked -- -D warnings
cargo xtask policy

No game data is used or committed. AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6591731765 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1728). Originally posted by [npanu420](https://github.com/npanu420) on 2026-11-24T21:25:40Z. --- ## What `VICTORY_PIPELINE_WORKERS=n` sets the number of host pipeline workers (1 to 64). Without it nothing changes: half the logical processors, 2 to 8. The count is logged (`host pipeline workers`). ## Why On a first run with an empty pipeline library, the world's pipelines are compiled by the driver on these workers, and draws whose pipeline is not made yet are dropped. On NVIDIA the largest world programs take seconds each. Same machine, same scene (i9-9900X with 20 threads, RTX 3070, Windows 11): | Workers | Pipelines made per minute while the queue drained | |---|---| | 8 (default) | 542 → 106 → 42 → 22 over four minutes (the queue grew to 1,228) | | 16 | 109 → 150 per minute; the queue (2,175 at launch, half loaded from the library) emptied before the world started | The two runs did not start from the same library state, so the rates are an indication, not a clean A/B. The CPU stayed below 80 % with 16 workers. CPUs with more threads than 16 may want more, and CPUs with fewer may want less while the title loads. ## Changes - `worker_count(asked, processors)` reads the switch, clamped to 1-64, else keeps the default. - Test `worker_count_takes_the_switch_within_bounds`. ## Verification ```powershell cargo test -p victory-gpu --lib worker_count cargo clippy -p victory-gpu --all-targets --locked -- -D warnings cargo xtask policy ``` No game data is used or committed. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-24 22:02:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:36:44Z.

Review: COMMENTED


Static review only: this crate is Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.

VICTORY_PIPELINE_WORKERS: default half the logical processors clamped to 2-8, env override clamped 1-64, parse failures fall back to default. worker_count has a unit test (worker_count_takes_the_switch_within_bounds) but victory-gpu is Windows-only so it only runs there. Rationale (driver compile of the world's largest programs bounds first run with empty library) is documented. Fine.

<!-- greyfinch-sync:Marvisak/VIctory:review:6047808270 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1728#pullrequestreview-6047808270). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T21:36:44Z. **Review:** COMMENTED --- Static review only: this crate is Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff. VICTORY_PIPELINE_WORKERS: default half the logical processors clamped to 2-8, env override clamped 1-64, parse failures fall back to default. worker_count has a unit test (worker_count_takes_the_switch_within_bounds) but victory-gpu is Windows-only so it only runs there. Rationale (driver compile of the world's largest programs bounds first run with empty library) is documented. Fine.
Marvisak commented 2026-11-25 04:06:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:36:15Z.


Automated triage for the maintainers.

Merge candidate. worker_count in pipeline/make.rs keeps the old default (half the logical processors, 2 to 8, and 2 when the count is unknown); VICTORY_PIPELINE_WORKERS overrides it, clamped to 1-64, and the count is logged once. The test covers the default, the clamps and an unparsable value. It only reads an environment variable and changes the thread count. Suggestion: add a row to the README switch table. #1861 also adds this switch, so only one should land. CI has not run (it needs approval).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152069174 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1728#issuecomment-7152069174). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:36:15Z. --- <!-- victory-triage v1 head=463e835868ba74b9e3d74dc0f87b57ef2562a340 verdict=merge-candidate at=2026-11-25T03:42:20Z --> Automated triage for the maintainers. **Merge candidate.** `worker_count` in `pipeline/make.rs` keeps the old default (half the logical processors, 2 to 8, and 2 when the count is unknown); `VICTORY_PIPELINE_WORKERS` overrides it, clamped to 1-64, and the count is logged once. The test covers the default, the clamps and an unparsable value. It only reads an environment variable and changes the thread count. Suggestion: add a row to the README switch table. #1861 also adds this switch, so only one should land. CI has not run (it needs approval). --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 22:03:06 +00:00
Marvisak commented 2026-11-25 22:04:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:02:08Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing as the narrower of two duplicates. #2250 adds the same switch for the runtime workers and for victory translate's worker pool, with a README row, and the two conflict in make.rs. Whether such a switch goes in will be decided on #2250.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175852345 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1728#issuecomment-7175852345). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:02:08Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing as the narrower of two duplicates. #2250 adds the same switch for the runtime workers and for `victory translate`'s worker pool, with a README row, and the two conflict in `make.rs`. Whether such a switch goes in will be decided on #2250. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1727
No description provided.