play: auto-tune worker thread pools for 24+ logical CPUs (keep defaults on <24) #499

Closed
github-bot wants to merge 1 commit from github-bot/gh-499 into main AGit
Owner

@⁠tiadiff on GitHub · 2026-11-27 23:35 UTC · original
pr/play-cpu-tuning → main · +38 −0 · 1 files · 1 commits · closed without merging

Problem

  • Running victory.exe directly (victory play / double-click) omits VICTORY_PLACED_ORDER=1 and the 24+ logical CPU worker-pool tuning (VICTORY_THIN_THREADS=12, VICTORY_UNDER_THREADS=8, VICTORY_LAND_THREADS=8, noted at +22-29% in heavy scenes in scripts/play-gta6-framegen.ps1).
  • Applying the 12 / 8 / 6 override (26 worker threads total) to 16..23 logical CPU machines (such as 8C/16T Ryzen 7 5700X) oversubscribes the CPU alongside VICTORY_HELPER_PRIORITY=1 and the title's own streaming threads, causing heavy initial 3D streaming stalls compared to the crate defaults (8 thin / 6 under / 4 land).

Change

  • Apply VICTORY_PLACED_ORDER=1 for all CPUs and restrict worker-pool scaling (12 / 8 / 8) to cpus >= 24 via apply_cpu_tuning in apps/victory/src/play.rs before victory-settings.txt and --set overrides (GTA6_NO_TUNE=1 disables).
  • Remove the 16..23 logical CPU 12 / 8 / 6 override from scripts/play-gta6-framegen.ps1 so PLAY_FRAMEGEN.cmd and victory.exe stay consistent and leave < 24 logical CPUs (e.g., 8C/16T) on the crate defaults (8 / 6 / 4).
  • F1 menu settings (victory-settings.txt) and --set flags still take precedence and can override or clear any value.

Verification

  • cargo test --release --locked -p victory --bin victory (24 passed; 0 failed, including updated cpu_tuning_scales_worker_pools_by_logical_cores covering 8, 16, and 24 logical CPUs)
  • cargo xtask policy (290 files ok)
  • cargo build --release --locked -p victory (succeeded)

Part of the low-stutter patch stack (with prebuilt Windows releases) in https://github.com/tiadiff/VIctory-NVIDIA-LowStutter.

**@⁠tiadiff** on GitHub · 2026-11-27 23:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499) `pr/play-cpu-tuning` → `main` · +38 −0 · 1 files · 1 commits · closed without merging ### Problem - Running `victory.exe` directly (`victory play` / double-click) omits `VICTORY_PLACED_ORDER=1` and the `24+` logical CPU worker-pool tuning (`VICTORY_THIN_THREADS=12`, `VICTORY_UNDER_THREADS=8`, `VICTORY_LAND_THREADS=8`, noted at +22-29% in heavy scenes in `scripts/play-gta6-framegen.ps1`). - Applying the `12 / 8 / 6` override (`26` worker threads total) to `16..23` logical CPU machines (such as 8C/16T Ryzen 7 5700X) oversubscribes the CPU alongside `VICTORY_HELPER_PRIORITY=1` and the title's own streaming threads, causing heavy initial 3D streaming stalls compared to the crate defaults (`8` thin / `6` under / `4` land). ### Change - Apply `VICTORY_PLACED_ORDER=1` for all CPUs and restrict worker-pool scaling (`12 / 8 / 8`) to `cpus >= 24` via `apply_cpu_tuning` in `apps/victory/src/play.rs` before `victory-settings.txt` and `--set` overrides (`GTA6_NO_TUNE=1` disables). - Remove the `16..23` logical CPU `12 / 8 / 6` override from `scripts/play-gta6-framegen.ps1` so `PLAY_FRAMEGEN.cmd` and `victory.exe` stay consistent and leave `< 24` logical CPUs (e.g., 8C/16T) on the crate defaults (`8 / 6 / 4`). - F1 menu settings (`victory-settings.txt`) and `--set` flags still take precedence and can override or clear any value. ### Verification - `cargo test --release --locked -p victory --bin victory` (`24 passed; 0 failed`, including updated `cpu_tuning_scales_worker_pools_by_logical_cores` covering 8, 16, and 24 logical CPUs) - `cargo xtask policy` (`290 files ok`) - `cargo build --release --locked -p victory` (succeeded) Part of the low-stutter patch stack (with prebuilt Windows releases) in https://github.com/tiadiff/VIctory-NVIDIA-LowStutter.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:41:37 +00:00
Author
Owner

@⁠POMXARK on GitHub · 2026-11-28 00:29 UTC · original

Testing feedback on an 8C/16T CPU (AMD Ryzen 7 5700X, RTX 5080 16 GB, 32 GB RAM, Series X 1440p + DLSS Quality + DLSS MFG 4x, on top of v2026.11.27.8):

The cpus >= 16 tier sets VICTORY_THIN_THREADS=12, VICTORY_UNDER_THREADS=8, and VICTORY_LAND_THREADS=6 (26 worker threads total alongside the game's own threads + VICTORY_HELPER_PRIORITY=1). On an 8-physical-core / 16-logical-thread CPU, this caused noticeable thread oversubscription during initial 3D scene entry and heavy streaming:

  • First ~60 seconds of 3D dropped to 3.0–6.8 FPS (copies spikes up to 101.1 ms, textures up to 49.9 ms, visibly slower texture streaming compared to default worker counts on the same hardware).

Suggestion: consider distinguishing 16-logical-thread (8C/16T) CPUs from 24+ thread CPUs with lower worker counts (or scaling by physical/logical core count so total worker threads stay below cpus) so 8C/16T systems don't oversubscribe during texture/scene streaming.

**@⁠POMXARK** on GitHub · 2026-11-28 00:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7230955337) Testing feedback on an **8C/16T CPU** (AMD Ryzen 7 5700X, RTX 5080 16 GB, 32 GB RAM, Series X 1440p + DLSS Quality + DLSS MFG 4x, on top of `v2026.11.27.8`): The `cpus >= 16` tier sets `VICTORY_THIN_THREADS=12`, `VICTORY_UNDER_THREADS=8`, and `VICTORY_LAND_THREADS=6` (**26 worker threads total** alongside the game's own threads + `VICTORY_HELPER_PRIORITY=1`). On an 8-physical-core / 16-logical-thread CPU, this caused noticeable thread oversubscription during initial 3D scene entry and heavy streaming: - First ~60 seconds of 3D dropped to **3.0–6.8 FPS** (`copies` spikes up to `101.1 ms`, `textures` up to `49.9 ms`, visibly slower texture streaming compared to default worker counts on the same hardware). Suggestion: consider distinguishing 16-logical-thread (8C/16T) CPUs from 24+ thread CPUs with lower worker counts (or scaling by physical/logical core count so total worker threads stay below `cpus`) so 8C/16T systems don't oversubscribe during texture/scene streaming.
github-bot closed this pull request 2026-11-28 00:49:43 +00:00
github-bot changed title from play: auto-tune worker thread pools for 16+ and 24+ logical CPUs to play: auto-tune worker thread pools for 24+ logical CPUs (keep defaults on <24) 2026-11-28 01:12:43 +00:00
Author
Owner

@⁠tiadiff on GitHub · 2026-11-28 01:12 UTC · original

If you want to re-test on your 5700X + RTX 5080 without building from source, I just published a prebuilt drop-in Windows release with this 8C/16T fix (along with the rest of the low-stutter patch stack — u64 descriptor bitset, dense HeapRanges, single-wait PSO budget, Wave32 waterfall prover, and the 6-mode launcher):

https://github.com/tiadiff/VIctory-NVIDIA-LowStutter/releases/tag/v2026.11.27.8-tiadiff-rev1

Would love to hear if initial 3D entry and texture streaming are back to normal on your 5700X (feel free to post results here or in the repo's benchmark reports/discussions)

**@⁠tiadiff** on GitHub · 2026-11-28 01:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7231500067) If you want to re-test on your 5700X + RTX 5080 without building from source, I just published a prebuilt drop-in Windows release with this 8C/16T fix (along with the rest of the low-stutter patch stack — u64 descriptor bitset, dense HeapRanges, single-wait PSO budget, Wave32 waterfall prover, and the 6-mode launcher): https://github.com/tiadiff/VIctory-NVIDIA-LowStutter/releases/tag/v2026.11.27.8-tiadiff-rev1 Would love to hear if initial 3D entry and texture streaming are back to normal on your 5700X (feel free to post results here or in the repo's benchmark reports/discussions)
Author
Owner

@⁠Luqueze on GitHub · 2026-11-28 01:32 UTC · original

Tested on RTX 4070 SUPER + Ryzen 7 5700X3D (8C/16T, so this PR's 16+ branch), Windows 11, Series X profile at native 1440p, DLSS off, warm pipeline cache, main 64d4931. I set the same switches via -More (THIN_THREADS=12, UNDER_THREADS=8, LAND_THREADS=6, PLACED_ORDER=1). Two runs, same save and route:

baseline this PR's values
1000–2500 draws 24.2 fps / 40.8 ms 23.1 fps / 42.2 ms
2500+ draws 16.7 fps / 60 ms (n=11) 19.9 fps / 50.3 ms (n=35)
submitting thread, median 41.3 ms 41.3 ms

No clear gain here. The heavy-scene difference is within what the different samples could explain, and the submitting thread, which is the limit on this CPU, is unchanged. Subjectively no better, maybe slightly worse. It may be worth gating on physical cores rather than logical CPUs: 12+8+6 workers on 8 cores may oversubscribe.

**@⁠Luqueze** on GitHub · 2026-11-28 01:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7231733678) Tested on RTX 4070 SUPER + Ryzen 7 5700X3D (8C/16T, so this PR's 16+ branch), Windows 11, Series X profile at native 1440p, DLSS off, warm pipeline cache, `main` 64d4931. I set the same switches via `-More` (`THIN_THREADS=12, UNDER_THREADS=8, LAND_THREADS=6, PLACED_ORDER=1`). Two runs, same save and route: | | baseline | this PR's values | |---|---|---| | 1000–2500 draws | 24.2 fps / 40.8 ms | 23.1 fps / 42.2 ms | | 2500+ draws | 16.7 fps / 60 ms (n=11) | 19.9 fps / 50.3 ms (n=35) | | submitting thread, median | 41.3 ms | 41.3 ms | No clear gain here. The heavy-scene difference is within what the different samples could explain, and the submitting thread, which is the limit on this CPU, is unchanged. Subjectively no better, maybe slightly worse. It may be worth gating on physical cores rather than logical CPUs: 12+8+6 workers on 8 cores may oversubscribe.
Author
Owner

@⁠tiadiff on GitHub · 2026-11-28 01:47 UTC · original

  • Note that because this PR was already closed before the follow-up fix, the diff attached here (a00b354) still shows the original 16+ (12/8/6) branch that was mirrored from upstream's scripts/play-gta6-framegen.ps1.

After @⁠POMXARK's report, I dropped the 16..23 tier in my fork (1b8a1d2) so anything under 24 logical CPUs stays on the crate defaults (8/6/4) — in both play.rs and play-gta6-framegen.ps1.

  • Good point on gating by physical cores as well. std:🧵:available_parallelism() only reports logical CPUs, so raising the cutoff to >= 24 logical CPUs already excludes all 8C/16T parts (it only triggers on 12C/24T or 16C/24T+ hybrid CPUs), though querying physical cores via GetLogicalProcessorInformationEx on Windows would be cleaner if we ever want finer-grained scaling (especially for hybrid P+E topologies).

  • Your numbers are also a good signal that upstream's elseif ($cpus -ge 16) (12/8/6) in scripts/play-gta6-framegen.ps1 is likely net-neutral or slightly negative on 8C/16T.

Out of curiosity, did you happen to notice whether VICTORY_PLACED_ORDER=1 by itself (with default 8/6/4 pools) makes any difference on the 5700X3D, or is it also submitting-thread bound?

**@⁠tiadiff** on GitHub · 2026-11-28 01:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7231915345) - Note that because this PR was already closed before the follow-up fix, the diff attached here (a00b354) still shows the original 16+ (12/8/6) branch that was mirrored from upstream's scripts/play-gta6-framegen.ps1. After @⁠POMXARK's report, I dropped the 16..23 tier in my fork (1b8a1d2) so anything under 24 logical CPUs stays on the crate defaults (8/6/4) — in both play.rs and play-gta6-framegen.ps1. - Good point on gating by physical cores as well. std::thread::available_parallelism() only reports logical CPUs, so raising the cutoff to >= 24 logical CPUs already excludes all 8C/16T parts (it only triggers on 12C/24T or 16C/24T+ hybrid CPUs), though querying physical cores via GetLogicalProcessorInformationEx on Windows would be cleaner if we ever want finer-grained scaling (especially for hybrid P+E topologies). - Your numbers are also a good signal that upstream's elseif ($cpus -ge 16) (12/8/6) in scripts/play-gta6-framegen.ps1 is likely net-neutral or slightly negative on 8C/16T. Out of curiosity, did you happen to notice whether VICTORY_PLACED_ORDER=1 by itself (with default 8/6/4 pools) makes any difference on the 5700X3D, or is it also submitting-thread bound?

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.