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

Closed
tiadiff wants to merge 1 commit from upstream-pr/499 into main
tiadiff commented 2026-11-27 23:35:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tiadiff on 2026-11-27T23:35:30Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5534484849 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499). Originally posted by [tiadiff](https://github.com/tiadiff) on 2026-11-27T23:35:30Z. --- ### 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.
POMXARK commented 2026-11-28 00:29:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T00:29:35Z.


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 4×, 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 title's own threads + VICTORY_HELPER_PRIORITY=1). On an 8-physical-core / 16-logical-thread CPU, this caused noticeable thread oversubscription during initial 3D load 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 heavy streaming.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7230955337 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7230955337). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T00:29:35Z. --- 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 4×, 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 title's own threads + `VICTORY_HELPER_PRIORITY=1`). On an 8-physical-core / 16-logical-thread CPU, this caused noticeable thread oversubscription during initial 3D load 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 heavy streaming.
tiadiff commented 2026-11-28 01:12:34 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tiadiff on 2026-11-28T01:12:34Z.


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)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231500067 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7231500067). Originally posted by [tiadiff](https://github.com/tiadiff) on 2026-11-28T01:12:34Z. --- 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)
Luqueze commented 2026-11-28 01:32:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Luqueze on 2026-11-28T01:32:03Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231733678 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7231733678). Originally posted by [Luqueze](https://github.com/Luqueze) on 2026-11-28T01:32:03Z. --- 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.
tiadiff commented 2026-11-28 01:47:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tiadiff on 2026-11-28T01:47:11Z.


  • 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?

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231915345 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7231915345). Originally posted by [tiadiff](https://github.com/tiadiff) on 2026-11-28T01:47:11Z. --- - 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?
tiadiff commented 2026-11-28 22:33:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tiadiff on 2026-11-28T22:33:16Z.


This PR was auto-closed by GitHub when the original fork was detached into standalone repo tiadiff/VIctory-NVIDIA-LowStutter, before the 8C/16T follow-up fix could be pushed here.

I rebased the updated patch cleanly onto current main (d4b5d51) — keeping defaults (8 / 6 / 4) on < 24 logical CPUs in both apps/victory/src/play.rs and scripts/play-gta6-framegen.ps1 (only scaling 12 / 8 / 8 on >= 24 logical CPUs, with VICTORY_PLACED_ORDER=1 enabled unless GTA6_NO_TUNE=1), and verified cargo test --release --locked -p victory --bin victory (30 passed; 0 failed):

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246817056 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/499#issuecomment-7246817056). Originally posted by [tiadiff](https://github.com/tiadiff) on 2026-11-28T22:33:16Z. --- This PR was auto-closed by GitHub when the original fork was detached into standalone repo `tiadiff/VIctory-NVIDIA-LowStutter`, before the 8C/16T follow-up fix could be pushed here. I rebased the updated patch cleanly onto current `main` (`d4b5d51`) — keeping defaults (`8 / 6 / 4`) on `< 24` logical CPUs in both `apps/victory/src/play.rs` and `scripts/play-gta6-framegen.ps1` (only scaling `12 / 8 / 8` on `>= 24` logical CPUs, with `VICTORY_PLACED_ORDER=1` enabled unless `GTA6_NO_TUNE=1`), and verified `cargo test --release --locked -p victory --bin victory` (`30 passed; 0 failed`): - Branch: https://github.com/tiadiff/VIctory-NVIDIA-LowStutter/tree/pr/play-cpu-tuning - Commit: https://github.com/tiadiff/VIctory-NVIDIA-LowStutter/commit/cfcc539781ec59e5a2ba39a740ead58ac56227a5 - Direct patch (`git am`): https://github.com/tiadiff/VIctory-NVIDIA-LowStutter/commit/cfcc539781ec59e5a2ba39a740ead58ac56227a5.patch

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
trustno1-coder/VIctory-NVIDIA!499
No description provided.