gpu/land: raise default landing thread cap from 4 to 8 on high-core CPUs #4614

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

@⁠TheOriginalF on GitHub · 2026-11-30 23:50 UTC · original
TheOriginalF:perf/land-default-threads-up-to-8 → main · +17 −1 · 2 files · 1 commits · open

What it changes

In crates/victory-gpu/src/land.rs, threads() previously capped the automatic victory-land worker count at 4 ((available_parallelism / 4).clamp(1, 4)). On 24–32+ logical-core CPUs under heavy readback workloads (~535 landing jobs / ~55–63 MB copied back per frame in Series X 4K + VICTORY_HW_RT=1), merging what was fetched spent ~96 ms of CPU time across 4 threads (31.4 ms median wall time per frame), making landing a major bottleneck on the relay thread.

  • Extracted default_threads_for(parallelism: usize) -> usize and raised the automatic upper clamp from 4 to 8 ((parallelism / 4).clamp(1, 8)), leaving 8–16 logical-core CPUs unchanged at 2–4 threads and scaling 24–32+ logical-core CPUs to 6–8 threads (VICTORY_LAND_THREADS override .clamp(1, 16) unchanged).
  • Added unit test default_threads_scale_up_to_eight_on_high_core_cpus in crates/victory-gpu/src/land/tests.rs.

How it was tested

  • Test system:
    • CPU: AMD Ryzen 9 5950X (16C/32T, Corsair iCUE H150i RGB Pro XT)
    • GPU: Palit GeForce RTX 4090 GameRock OC (SM 6.8)
    • Motherboard: ASUS ROG Strix X570-E Gaming
    • RAM: Corsair Vengeance RGB Pro 32GB (2x16GB @ 3600MHz)
    • PSU: Corsair RM850x (850W)
    • Storage: Corsair MP600 2TB NVMe Gen4 + Seagate Barracuda 2TB HDD
  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Palit GeForce RTX 4090 GameRock OC (SM 6.8), Series X (4K), DLSS Balanced, Frame Generation On (2x), VICTORY_HW_RT=1, VICTORY_WINDOW_KB=1024, VICTORY_WINDOW_TAILS=1, VICTORY_PIPELINE_WORKERS=6, -Fps 30 -NoMenu.
  • Strict isolated A/B (same binary, same save checkpoint, same ~287 s route & movement, only VICTORY_LAND_THREADS changed between 4 and 8):
    • Before (VICTORY_LAND_THREADS=4, 287.2 s, 0 errors):
      • land merge wall: 31.40 ms med / 32.07 ms avg (538 jobs/frame)
      • relay total landing (copying back): 48.35 ms med / 50.07 ms avg (17.6 flights/frame)
      • Warm draws >= 1500 (n=43): 13.80 med / 13.70 avg fps (72.2 ms med)
      • Peak 3D draws >= 5000 (n=24, ~7,359 draws): 13.30 med / 13.32 avg fps (75.2 ms med, p95 104.6 ms)
      • frame_times avg p95 (n=216): 137.9 ms; GPU cardmeter: 38.48 ms; peak commit: 63,542 MB
    • After (VICTORY_LAND_THREADS=8, 286.7 s, 0 errors):
      • land merge wall: 27.59 ms med / 28.66 ms avg (-3.81 ms / -12.1%) (534 jobs/frame)
      • relay total landing (copying back): 44.65 ms med / 45.76 ms avg (-4.31 ms avg) (17.6 flights/frame)
      • Warm draws >= 1500 (n=44): 14.55 med / 13.83 avg fps (68.8 ms med, +5.4% med)
      • Peak 3D draws >= 5000 (n=23, ~7,172 draws): 13.90 med / 14.01 avg fps (+5.2% avg, 71.8 ms med, p95 89.6 ms / -15.0 ms)
      • frame_times avg p95 (n=223): 115.5 ms (-22.4 ms); GPU cardmeter: 38.45 ms; peak commit: 61,609 MB
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes)
  • cargo test passed for the crates it touches: yes (cargo test -p victory-gpu --lib --locked land:: — 10 passed, 0 failed, 1 ignored; cargo clippy -p victory-gpu --lib --locked — 0 new warnings; xtask policy --staged — ok)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3626 (batches land_card guard opens in land.rs, orthogonal to default thread count)
**@⁠TheOriginalF** on GitHub · 2026-11-30 23:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4613) `TheOriginalF:perf/land-default-threads-up-to-8` → `main` · +17 −1 · 2 files · 1 commits · open ## What it changes In `crates/victory-gpu/src/land.rs`, `threads()` previously capped the automatic `victory-land` worker count at `4` (`(available_parallelism / 4).clamp(1, 4)`). On 24–32+ logical-core CPUs under heavy readback workloads (~535 landing jobs / ~55–63 MB copied back per frame in Series X 4K + `VICTORY_HW_RT=1`), `merging what was fetched` spent `~96 ms` of CPU time across 4 threads (`31.4 ms` median wall time per frame), making landing a major bottleneck on the relay thread. - Extracted `default_threads_for(parallelism: usize) -> usize` and raised the automatic upper clamp from `4` to `8` (`(parallelism / 4).clamp(1, 8)`), leaving 8–16 logical-core CPUs unchanged at `2–4` threads and scaling 24–32+ logical-core CPUs to `6–8` threads (`VICTORY_LAND_THREADS` override `.clamp(1, 16)` unchanged). - Added unit test `default_threads_scale_up_to_eight_on_high_core_cpus` in `crates/victory-gpu/src/land/tests.rs`. ## How it was tested - Test system: - CPU: AMD Ryzen 9 5950X (16C/32T, Corsair iCUE H150i RGB Pro XT) - GPU: Palit GeForce RTX 4090 GameRock OC (SM 6.8) - Motherboard: ASUS ROG Strix X570-E Gaming - RAM: Corsair Vengeance RGB Pro 32GB (2x16GB @ 3600MHz) - PSU: Corsair RM850x (850W) - Storage: Corsair MP600 2TB NVMe Gen4 + Seagate Barracuda 2TB HDD - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Palit GeForce RTX 4090 GameRock OC (SM 6.8), Series X (`4K`), DLSS Balanced, Frame Generation On (2x), `VICTORY_HW_RT=1`, `VICTORY_WINDOW_KB=1024`, `VICTORY_WINDOW_TAILS=1`, `VICTORY_PIPELINE_WORKERS=6`, `-Fps 30 -NoMenu`. - Strict isolated A/B (same binary, same save checkpoint, same ~287 s route & movement, only `VICTORY_LAND_THREADS` changed between `4` and `8`): - **Before (`VICTORY_LAND_THREADS=4`, `287.2 s`, `0` errors):** - `land` merge wall: `31.40 ms` med / `32.07 ms` avg (`538` jobs/frame) - `relay` total landing (`copying back`): `48.35 ms` med / `50.07 ms` avg (`17.6` flights/frame) - Warm `draws >= 1500` (`n=43`): `13.80` med / `13.70` avg fps (`72.2 ms` med) - Peak 3D `draws >= 5000` (`n=24`, ~`7,359` draws): `13.30` med / `13.32` avg fps (`75.2 ms` med, `p95 104.6 ms`) - `frame_times` avg p95 (`n=216`): `137.9 ms`; GPU `cardmeter`: `38.48 ms`; peak commit: `63,542 MB` - **After (`VICTORY_LAND_THREADS=8`, `286.7 s`, `0` errors):** - `land` merge wall: **`27.59 ms` med / `28.66 ms` avg (`-3.81 ms` / `-12.1%`)** (`534` jobs/frame) - `relay` total landing (`copying back`): **`44.65 ms` med / `45.76 ms` avg (`-4.31 ms` avg)** (`17.6` flights/frame) - Warm `draws >= 1500` (`n=44`): **`14.55` med / `13.83` avg fps (`68.8 ms` med, `+5.4%` med)** - Peak 3D `draws >= 5000` (`n=23`, ~`7,172` draws): **`13.90` med / `14.01` avg fps (`+5.2%` avg, `71.8 ms` med, `p95 89.6 ms` / `-15.0 ms`)** - `frame_times` avg p95 (`n=223`): **`115.5 ms` (`-22.4 ms`)**; GPU `cardmeter`: `38.45 ms`; peak commit: `61,609 MB` - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes) - `cargo test` passed for the crates it touches: yes (`cargo test -p victory-gpu --lib --locked land::` — 10 passed, 0 failed, 1 ignored; `cargo clippy -p victory-gpu --lib --locked` — 0 new warnings; `xtask policy --staged` — ok) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3626 (batches `land_card` guard opens in `land.rs`, orthogonal to default thread count)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:04:34 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/4614/head:github-bot/gh-4613'
git switch 'github-bot/gh-4613'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4613'
git switch 'github-bot/gh-4613'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4613'
git switch 'github-bot/gh-4613'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4613'
git switch 'main'
git merge --squash 'github-bot/gh-4613'
git switch 'main'
git merge --ff-only 'github-bot/gh-4613'
git switch 'main'
git merge 'github-bot/gh-4613'
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/trustno1-coder--VIctory-NVIDIA!4614
No description provided.