GPU: allow pipeline worker count and priority overrides #3527

Open
github-bot wants to merge 1 commit from github-bot/gh-3527 into main AGit
Owner

@⁠tharun-37 on GitHub · 2026-11-27 14:22 UTC · original
tharun-37:perf/pso-workers → main · +74 −5 · 1 files · 1 commits · open

Adds two opt-in environment knobs to the background host pipeline workers:

  • VICTORY_PSO_WORKERS (1..=64) — worker count.
  • VICTORY_PSO_PRIORITY (below or normal) — worker thread priority.

Both are read once when the workers start. Invalid values fall back to the defaults: half the logical processors clamped to 2..=8, and below priority. Existing runs are unchanged unless a knob is set.

Why: world-entry warm-up can be dominated by background pipeline compilation. A run can now A/B worker capacity and scheduling priority without rebuilding. This change only exposes the controls; changing the defaults is left to a measured follow-up.

Verification:

  • cargo clippy --workspace --all-targets --locked -- -D warnings passes.
  • cargo test --workspace --locked: 230 passed on this branch versus 228 on base, with the same 3 pre-existing failures.
  • Added unit tests for parsing, bounds and defaults.

AI-assisted (OpenCode).

**@⁠tharun-37** on GitHub · 2026-11-27 14:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/3527) `tharun-37:perf/pso-workers` → `main` · +74 −5 · 1 files · 1 commits · open Adds two opt-in environment knobs to the background host pipeline workers: - `VICTORY_PSO_WORKERS` (`1..=64`) — worker count. - `VICTORY_PSO_PRIORITY` (`below` or `normal`) — worker thread priority. Both are read once when the workers start. Invalid values fall back to the defaults: half the logical processors clamped to `2..=8`, and `below` priority. Existing runs are unchanged unless a knob is set. Why: world-entry warm-up can be dominated by background pipeline compilation. A run can now A/B worker capacity and scheduling priority without rebuilding. This change only exposes the controls; changing the defaults is left to a measured follow-up. Verification: - `cargo clippy --workspace --all-targets --locked -- -D warnings` passes. - `cargo test --workspace --locked`: 230 passed on this branch versus 228 on base, with the same 3 pre-existing failures. - Added unit tests for parsing, bounds and defaults. AI-assisted (OpenCode).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:25:37 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 14:47 UTC · original

Independent CPU/WARP verification (no physical GPU, no game, no game data). AI use: Claude Code (Claude Sonnet 5.5).

Environment: AMD Ryzen 7 5700X3D 8C/16T, Windows 11 25H2 build 10.0.26200, rustc 1.98.1 (48a229cea 2026-09-01), system WARP (d3d10warp.dll) 10.0.26100.9818, -j 4, one shared target dir. Run with VICTORY_WARP=1, VICTORY_D3D12_WARP=1, VICTORY_DXIL set to the Windows SDK 10.0.26100 dxil.dll. (I could not find VICTORY_WARP in the source, only VICTORY_D3D12_WARP is documented; I set both.)
SHAs: head cdfb6587bd2f342433080ad77e7759708434fbf6 (unchanged when I started and when I posted), merge base 63bcca43c6a00a758510398fa43096ce7e4f7df0 (current main tip).

base head
cargo test -p victory-gpu --lib --locked 231 passed, 0 failed, 1 ignored 233 passed, 0 failed, 1 ignored
pipeline::make:: n/a 4 passed (the two new tests plus two existing)
cargo clippy -p victory-gpu --all-targets --locked -- -D warnings not run clean

No regressions. The PR has no other comments, so nothing to duplicate. Lib tests do not start the pipeline workers, so the env paths are covered by the parsing unit tests and the read below, not by a live run.

Diff read:

  • Defaults are unchanged: worker_count(None, n) is (n/2).clamp(2,8), as before, and the available_parallelism error case still gives 2. Priority defaults to THREAD_PRIORITY_BELOW_NORMAL, the same call as before. Invalid or out-of-range worker values ("", abc, 0, 65) fall back to that default, as the body says, and " 3 " is trimmed. The only added behaviour on the default path is one tracing::info! line (make.rs:~308).
  • Finding 1 (minor): VICTORY_PSO_PRIORITY is matched case-sensitively (worker_priority, make.rs:285-290), so NORMAL or Normal silently falls back to below. The body only says below or normal; a note, or eq_ignore_ascii_case, would avoid a confusing A/B run.
  • Finding 2 (minor): neither knob logs when a value is rejected, so a typo is indistinguishable from the default. The new info line prints the effective values, which helps.
  • Finding 3 (nit): the doc and body say both are "read once", but priority is re-read from the environment in every worker thread (make.rs:342) rather than once next to the count (:307). Same result unless the environment changes mid-run.
  • Priority mapping is Below to THREAD_PRIORITY_BELOW_NORMAL and Normal to THREAD_PRIORITY_NORMAL, applied with SetThreadPriority on the worker's own thread, which is correct.
**@⁠oni-swr** on GitHub · 2026-11-27 14:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/3527#issuecomment-7221239041) Independent CPU/WARP verification (no physical GPU, no game, no game data). AI use: Claude Code (Claude Sonnet 5.5). **Environment:** AMD Ryzen 7 5700X3D 8C/16T, Windows 11 25H2 build 10.0.26200, rustc 1.98.1 (48a229cea 2026-09-01), system WARP (`d3d10warp.dll`) 10.0.26100.9818, `-j 4`, one shared target dir. Run with `VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`, `VICTORY_DXIL` set to the Windows SDK 10.0.26100 `dxil.dll`. (I could not find `VICTORY_WARP` in the source, only `VICTORY_D3D12_WARP` is documented; I set both.) **SHAs:** head `cdfb6587bd2f342433080ad77e7759708434fbf6` (unchanged when I started and when I posted), merge base `63bcca43c6a00a758510398fa43096ce7e4f7df0` (current main tip). | | base | head | |---|---|---| | `cargo test -p victory-gpu --lib --locked` | 231 passed, 0 failed, 1 ignored | 233 passed, 0 failed, 1 ignored | | `pipeline::make::` | n/a | 4 passed (the two new tests plus two existing) | | `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` | not run | clean | No regressions. The PR has no other comments, so nothing to duplicate. Lib tests do not start the pipeline workers, so the env paths are covered by the parsing unit tests and the read below, not by a live run. **Diff read:** - Defaults are unchanged: `worker_count(None, n)` is `(n/2).clamp(2,8)`, as before, and the `available_parallelism` error case still gives 2. Priority defaults to `THREAD_PRIORITY_BELOW_NORMAL`, the same call as before. Invalid or out-of-range worker values (`""`, `abc`, `0`, `65`) fall back to that default, as the body says, and `" 3 "` is trimmed. The only added behaviour on the default path is one `tracing::info!` line (`make.rs:~308`). - Finding 1 (minor): `VICTORY_PSO_PRIORITY` is matched case-sensitively (`worker_priority`, `make.rs:285-290`), so `NORMAL` or `Normal` silently falls back to `below`. The body only says `below` or `normal`; a note, or `eq_ignore_ascii_case`, would avoid a confusing A/B run. - Finding 2 (minor): neither knob logs when a value is rejected, so a typo is indistinguishable from the default. The new info line prints the effective values, which helps. - Finding 3 (nit): the doc and body say both are "read once", but priority is re-read from the environment in every worker thread (`make.rs:342`) rather than once next to the count (`:307`). Same result unless the environment changes mid-run. - Priority mapping is `Below` to `THREAD_PRIORITY_BELOW_NORMAL` and `Normal` to `THREAD_PRIORITY_NORMAL`, applied with `SetThreadPriority` on the worker's own thread, which is correct.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 19:52 UTC · original

NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head cdfb658 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 868 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: worker_count_parsing_keeps_the_default_bounds, worker_priority_defaults_to_below_normal.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-27 19:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/3527#issuecomment-7226948061) NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head `cdfb658` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **868 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `worker_count_parsing_keeps_the_default_bounds`, `worker_priority_defaults_to_below_normal`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3527/head:github-bot/gh-3527'
git switch 'github-bot/gh-3527'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3527'
git switch 'github-bot/gh-3527'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3527'
git switch 'github-bot/gh-3527'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3527'
git switch 'main'
git merge --squash 'github-bot/gh-3527'
git switch 'main'
git merge --ff-only 'github-bot/gh-3527'
git switch 'main'
git merge 'github-bot/gh-3527'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3527
No description provided.