perf(cores,shadow): offload background workers to hybrid E-cores and cap wide_threads for non-SMT P-cores #4146

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

@⁠Andreww2009 on GitHub · 2026-11-30 16:46 UTC · original
Andreww2009:perf/hybrid-ecore-offload-and-wide-cap → main · +143 −24 · 2 files · 1 commits · open

Summary

  1. Add opt-out VICTORY_HYBRID_OFFLOAD (default on; =0 restores previous behavior) in crates/victory-gpu/src/cores.rs to route background worker pools and D3D Background Thread to efficiency cores on hybrid Intel CPUs instead of competing with frame-critical threads on P-cores.
  2. Add default_wide_threads(logical, fast_cores) in crates/victory-gpu/src/shadow.rs capping default wide_threads() at fast - 1 on hybrid CPUs (fast > 2) so victory-submit + victory-wide-* never oversubscribe P-cores (especially non-SMT Arrow Lake / Core Ultra 200HX), while leaving homogeneous CPUs unchanged.

Problem

On hybrid Intel CPUs with non-SMT P-cores (for example Intel Core Ultra 9 275HX: 8 Lion Cove P-cores + 16 Skymont E-cores = 24 logical processors), wide_threads() defaulted to (24 * 3 / 8).clamp(2, 8) = 8 helper threads. Because victory-submit itself participates in wide_each_scoped and runs at raised priority on fast cores, 9 hot-spinning threads contend for 8 physical P-cores, causing barrier preemption spikes on every refresh flush (VICTORY_PASSES_HOT=1) while 16 E-cores sit underutilized by background pools.

Root Cause

  • wide_threads() only inspected total logical processor count (available_parallelism()) and did not account for hybrid fast-core counts.
  • Background pools and D3D Background Thread had no hybrid E-core routing helper (VICTORY_HYBRID_OFFLOAD).

Implementation

  • crates/victory-gpu/src/cores.rs: expose fast_core_count(), add hybrid E-core affinity helpers gated by VICTORY_HYBRID_OFFLOAD (default on; =0 disables), and migrate D3D Background Thread onto E-cores when hybrid offloading is active.
  • crates/victory-gpu/src/shadow.rs: factor default_wide_threads(logical, fast_cores) so hybrid CPUs with fast > 2 cap wide_threads() at base.min(fast - 1).max(2) (e.g., 7 helpers + 1 victory-submit = 8 threads 1:1 on 8 P-cores of Core Ultra 9 275HX; 13600K = 7, 14900K = 8, homogeneous CPUs unchanged), with unit test hybrid_wide_threads_leave_a_fast_core_for_submit.

Testing

  • cargo test --locked -p victory-gpu --lib cores::tests: 4 passed, 0 failed, 2 ignored.
  • cargo test --locked -p victory-gpu --lib hybrid_wide_threads: 1 passed, 0 failed (wide_: 12 passed, 0 failed).
  • Zero new compiler/Clippy warnings in cores.rs or shadow.rs.

Performance Before and After

Measured with cargo test --release --locked -p victory-gpu pass_overhead -- --ignored --nocapture under VICTORY_BENCH_LOAD=8 (8 concurrent busy threads simulating title workload) on Intel Core Ultra 9 275HX (8P+16E no-SMT):

Configuration (VICTORY_PASSES_HOT=1) Threads on 8 P-cores Mean / pass Median / pass 24 passes
Before (VICTORY_WIDE_THREADS=8, upstream default) 9 on 8 P-cores 19.4 us 23.1 us 0.47 ms
After (7 helpers, fast - 1 cap) 8 on 8 P-cores (1:1) 13.7 us (-29.4%) 6.1 us (3.79x faster, -73.6%) 0.33 ms (-29.8%)

Hardware Configuration

  • CPU: Intel Core Ultra 9 275HX (8P+16E no-SMT, 24 logical)
  • GPU: NVIDIA GeForce RTX 5080 Laptop GPU (16 GB GDDR7, driver 621.14)
  • RAM: 64 GB DDR5-4800
  • OS: Windows 11 x64 (build 26200)

Compatibility

  • Homogeneous CPUs (e.g., AMD Ryzen 7 7800X3D, Ryzen 9 9950X3D) have fast_core_count() == None and follow the unchanged logical * 3 / 8 path.
  • Explicit VICTORY_WIDE_THREADS=<n> or VICTORY_HYBRID_OFFLOAD=0 overrides defaults cleanly.

Risks and Limitations

Low. Live open-world gameplay frame pacing gains will vary depending on CPU bottleneck vs GPU bottleneck; synthetic pass_overhead specifically verifies eliminating P-core barrier oversubscription.

  • Searched open pull requests and recent main commits (84bd61e2). Complementary to #3416 (already merged: VICTORY_FAST_CORES stage default), #2803 (VICTORY_TITLE_SLOW_SPREAD for title threads in kernel.rs), and #4069 (VICTORY_SLOW_CORES opt-in for list translators).
**@⁠Andreww2009** on GitHub · 2026-11-30 16:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4146) `Andreww2009:perf/hybrid-ecore-offload-and-wide-cap` → `main` · +143 −24 · 2 files · 1 commits · open ## Summary 1. Add opt-out `VICTORY_HYBRID_OFFLOAD` (default on; `=0` restores previous behavior) in `crates/victory-gpu/src/cores.rs` to route background worker pools and `D3D Background Thread` to efficiency cores on hybrid Intel CPUs instead of competing with frame-critical threads on P-cores. 2. Add `default_wide_threads(logical, fast_cores)` in `crates/victory-gpu/src/shadow.rs` capping default `wide_threads()` at `fast - 1` on hybrid CPUs (`fast > 2`) so `victory-submit` + `victory-wide-*` never oversubscribe P-cores (especially non-SMT Arrow Lake / Core Ultra 200HX), while leaving homogeneous CPUs unchanged. ## Problem On hybrid Intel CPUs with non-SMT P-cores (for example Intel Core Ultra 9 275HX: 8 Lion Cove P-cores + 16 Skymont E-cores = 24 logical processors), `wide_threads()` defaulted to `(24 * 3 / 8).clamp(2, 8) = 8` helper threads. Because `victory-submit` itself participates in `wide_each_scoped` and runs at raised priority on fast cores, 9 hot-spinning threads contend for 8 physical P-cores, causing barrier preemption spikes on every refresh flush (`VICTORY_PASSES_HOT=1`) while 16 E-cores sit underutilized by background pools. ## Root Cause - `wide_threads()` only inspected total logical processor count (`available_parallelism()`) and did not account for hybrid fast-core counts. - Background pools and `D3D Background Thread` had no hybrid E-core routing helper (`VICTORY_HYBRID_OFFLOAD`). ## Implementation - `crates/victory-gpu/src/cores.rs`: expose `fast_core_count()`, add hybrid E-core affinity helpers gated by `VICTORY_HYBRID_OFFLOAD` (default on; `=0` disables), and migrate `D3D Background Thread` onto E-cores when hybrid offloading is active. - `crates/victory-gpu/src/shadow.rs`: factor `default_wide_threads(logical, fast_cores)` so hybrid CPUs with `fast > 2` cap `wide_threads()` at `base.min(fast - 1).max(2)` (e.g., 7 helpers + 1 `victory-submit` = 8 threads 1:1 on 8 P-cores of Core Ultra 9 275HX; 13600K = 7, 14900K = 8, homogeneous CPUs unchanged), with unit test `hybrid_wide_threads_leave_a_fast_core_for_submit`. ## Testing - `cargo test --locked -p victory-gpu --lib cores::tests`: 4 passed, 0 failed, 2 ignored. - `cargo test --locked -p victory-gpu --lib hybrid_wide_threads`: 1 passed, 0 failed (`wide_`: 12 passed, 0 failed). - Zero new compiler/Clippy warnings in `cores.rs` or `shadow.rs`. ## Performance Before and After Measured with `cargo test --release --locked -p victory-gpu pass_overhead -- --ignored --nocapture` under `VICTORY_BENCH_LOAD=8` (8 concurrent busy threads simulating title workload) on Intel Core Ultra 9 275HX (8P+16E no-SMT): | Configuration (`VICTORY_PASSES_HOT=1`) | Threads on 8 P-cores | Mean / pass | Median / pass | 24 passes | |---|---:|---:|---:|---:| | Before (`VICTORY_WIDE_THREADS=8`, upstream default) | 9 on 8 P-cores | `19.4 us` | **`23.1 us`** | `0.47 ms` | | **After (7 helpers, `fast - 1` cap)** | **8 on 8 P-cores (1:1)** | **`13.7 us` (-29.4%)** | **`6.1 us` (3.79x faster, -73.6%)** | **`0.33 ms` (-29.8%)** | ## Hardware Configuration - CPU: Intel Core Ultra 9 275HX (8P+16E no-SMT, 24 logical) - GPU: NVIDIA GeForce RTX 5080 Laptop GPU (16 GB GDDR7, driver 621.14) - RAM: 64 GB DDR5-4800 - OS: Windows 11 x64 (build 26200) ## Compatibility - Homogeneous CPUs (e.g., AMD Ryzen 7 7800X3D, Ryzen 9 9950X3D) have `fast_core_count() == None` and follow the unchanged `logical * 3 / 8` path. - Explicit `VICTORY_WIDE_THREADS=<n>` or `VICTORY_HYBRID_OFFLOAD=0` overrides defaults cleanly. ## Risks and Limitations Low. Live open-world gameplay frame pacing gains will vary depending on CPU bottleneck vs GPU bottleneck; synthetic `pass_overhead` specifically verifies eliminating P-core barrier oversubscription. ## Related Issues / Overlap Check - [x] Searched open pull requests and recent `main` commits (`84bd61e2`). Complementary to #3416 (already merged: `VICTORY_FAST_CORES` stage default), #2803 (`VICTORY_TITLE_SLOW_SPREAD` for title threads in `kernel.rs`), and #4069 (`VICTORY_SLOW_CORES` opt-in for list translators).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 16:51:51 +00:00
Author
Owner

@⁠Luca121 on GitHub · 2026-11-30 20:14 UTC · original

Note: Log parsing and report formatting were assisted by an AI tool on behalf of the hardware owner. No game screenshots or title assets are included.

Hardware stability check on Intel hybrid (i7-13700K, 8P+8E / 24 logical)

How it was tested (integrated stack — not isolated A/B)

  • GPU and profile: RTX 4070 Ti 12 GB | i7-13700K (8P+8E) | 32 GB RAM (+32 GB pagefile) | Win 11 — Series S, 1113x626 -> 1920x1080, DLSS Balanced, DLSS FG 2x, RT Off
  • Before: Previous Wave-5 long session (04804ef6, 99.2m) — prep med 43.8 ms, gpu wait med 11.3 ms, 10.2 med FPS (10.8 -> 9.9 early->late)
  • After (cherry-picked cleanly onto 84bd61e2 in an integrated multi-PR build): 39.9m gameplay (410 5s samples with draws >= 1000) — 0 crashes, 0 hangs/deadlocks, clean shutdown; prep med 35.4 ms, gpu wait med 3.85 ms, submit_lock 0.0 ms, lists_air 0.0 ms, heaps med 1.2 ms; 11.9 med (9.3 p10, 23.3 max), 12.0 -> 16.55 early->late base FPS, card_busy=96.0%
  • Wave sizes tested: 32 lanes
  • cargo test passed for the crates it touches: victory-gpu (1,170/1,173 passed; 3 failures were unrelated/pre-existing in the integrated branch, none in cores/shadow worker offload)

Disclosure: tested in an integrated multi-PR build, so this confirms clean Intel 8P+8E stability/compatibility rather than isolated A/B delta.

**@⁠Luca121** on GitHub · 2026-11-30 20:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4146#issuecomment-7290612224) > *Note: Log parsing and report formatting were assisted by an AI tool on behalf of the hardware owner. No game screenshots or title assets are included.* ### Hardware stability check on Intel hybrid (`i7-13700K`, 8P+8E / 24 logical) ### How it was tested (integrated stack — not isolated A/B) - **GPU and profile:** RTX 4070 Ti 12 GB | i7-13700K (8P+8E) | 32 GB RAM (+32 GB pagefile) | Win 11 — **Series S**, `1113x626 -> 1920x1080`, DLSS Balanced, DLSS FG 2x, RT Off - **Before:** Previous Wave-5 long session (`04804ef6`, 99.2m) — `prep` med `43.8 ms`, `gpu` wait med `11.3 ms`, `10.2` med FPS (`10.8 -> 9.9` early->late) - **After (cherry-picked cleanly onto `84bd61e2` in an integrated multi-PR build):** 39.9m gameplay (`410` 5s samples with `draws >= 1000`) — **0 crashes, 0 hangs/deadlocks, clean shutdown**; `prep` med `35.4 ms`, `gpu` wait med `3.85 ms`, `submit_lock` `0.0 ms`, `lists_air` `0.0 ms`, `heaps` med `1.2 ms`; `11.9` med (`9.3` p10, `23.3` max), `12.0 -> 16.55` early->late base FPS, `card_busy=96.0%` - **Wave sizes tested:** 32 lanes - **`cargo test` passed for the crates it touches:** `victory-gpu` (`1,170/1,173` passed; 3 failures were unrelated/pre-existing in the integrated branch, none in `cores`/`shadow` worker offload) *Disclosure: tested in an integrated multi-PR build, so this confirms clean Intel 8P+8E stability/compatibility rather than isolated A/B delta.*
Author
Owner

@⁠nicolasabosch on GitHub · 2026-11-30 21:52 UTC · original

Tested on an RTX 4070 Laptop 8 GB: no measurable fps difference in this scene (2 runs).

Tested on main e1251c31 with this PR (d4880bfe) merged on top and nothing else changed. Release build, same profile as main.

Setup

  • PC: RTX 4070 Laptop 8 GB, i9-14900HX, 32 GB RAM, Windows 11.
  • Command: victory play --series-s --dlss performance --framegen 2, with no fps cap and the window minimized.
  • Route: scripted Enter presses into the world from a save, then the character idles there for 300 s.
  • fps is the mean of the last 40 host: reports, about 200 s. These are real frames, not generated ones.
  • The submit-thread figures come from the "preparing per frame, the submitting thread" line, also over the last 40 reports.
  • The second run starts from a fixed copy of the save. In the first run the save had moved on, so the scene was a little different.
run fps ms/frame submit thread ms refreshes ms
main, 7 runs 15.96 – 18.76 53.4 – 62.7 35.0 – 41.4 13.3 – 15.4
main, fixed save only (4 runs) 16.21 – 18.18 (median 16.37) 55.1 – 61.8 35.0 – 40.5 13.3 – 15.2
this PR, run 1 16.64 60.2 39.2 15.2
this PR, run 2 (fixed save) 16.23 61.7 38.1 14.4

On this laptop, identical main runs differ by up to about 2–2.5 fps, so only an effect of roughly 2–3 fps or more would be visible in this scene. This CPU is hybrid with hyper-threaded P-cores (8P+16E, 32 threads). Both runs sit at the low end of main's range, so a small cost can't be ruled out, but it isn't separable from noise either.

Not tested: driving, camera turns, interiors, an image comparison, other GPUs.

**@⁠nicolasabosch** on GitHub · 2026-11-30 21:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4146#issuecomment-7293021598) **Tested on an RTX 4070 Laptop 8 GB: no measurable fps difference in this scene (2 runs).** Tested on main `e1251c31` with this PR (`d4880bfe`) merged on top and nothing else changed. Release build, same profile as main. **Setup** - PC: RTX 4070 Laptop 8 GB, i9-14900HX, 32 GB RAM, Windows 11. - Command: `victory play --series-s --dlss performance --framegen 2`, with no fps cap and the window minimized. - Route: scripted Enter presses into the world from a save, then the character idles there for 300 s. - fps is the mean of the last 40 `host:` reports, about 200 s. These are real frames, not generated ones. - The submit-thread figures come from the "preparing per frame, the submitting thread" line, also over the last 40 reports. - The second run starts from a fixed copy of the save. In the first run the save had moved on, so the scene was a little different. | run | fps | ms/frame | submit thread ms | refreshes ms | |---|---|---|---|---| | main, 7 runs | 15.96 – 18.76 | 53.4 – 62.7 | 35.0 – 41.4 | 13.3 – 15.4 | | main, fixed save only (4 runs) | 16.21 – 18.18 (median 16.37) | 55.1 – 61.8 | 35.0 – 40.5 | 13.3 – 15.2 | | this PR, run 1 | 16.64 | 60.2 | 39.2 | 15.2 | | this PR, run 2 (fixed save) | 16.23 | 61.7 | 38.1 | 14.4 | On this laptop, identical main runs differ by up to about 2–2.5 fps, so only an effect of roughly 2–3 fps or more would be visible in this scene. This CPU is hybrid with hyper-threaded P-cores (8P+16E, 32 threads). Both runs sit at the low end of main's range, so a small cost can't be ruled out, but it isn't separable from noise either. **Not tested:** driving, camera turns, interiors, an image comparison, other GPUs.
github-bot force-pushed github-bot/gh-4146 from d4880bfece to 74088d6fae 2026-12-01 09:51:24 +00:00 Compare
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/4146/head:github-bot/gh-4146'
git switch 'github-bot/gh-4146'

Merge

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