The title's thread affinities on the fast cores first (Intel hybrid CPUs) #419
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/419"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by justrealyme on 2026-11-27T22:09:28Z.
Problem
The title pins its threads by processor number with
SetThreadGroupAffinity, as it would on the console, where all eight cores are the same. The call went straight to the host. On a CPU with two kinds of core, those numbers land on a mix of fast and slow cores.On an Intel Core Ultra 7 265K, the fast cores (P-cores) are logical processors 0, 1, 6-9, 18 and 19. A thread dump in the prison cell showed:
0xFF(0-7)0x1F00(8-12)0x2000(13 alone)The layer's own threads already keep to the fast cores (
cores.rs). The title's own threads didn't.Change
SetThreadGroupAffinityfromapi-ms-win-core-processtopology-*is now handled bymodules::kernel, next to the existingSetThreadPriorityoverride.VICTORY_TITLE_AFFINITYhas three settings:fast(default): the title's processoribecomes the host'si-th fastest, ordered by efficiency class and then by number (GetSystemCpuSetInformation, group 0). On the 265K the title's 0-7 become the eight fast cores. On a CPU where all cores are alike (a Ryzen without E-cores, for example), the order is the host's own and every mask stays unchanged.free: the call is answered as done (with the previous affinity) and the thread is left to the Windows scheduler.keep: as before.A unit test covers the 265K layout and the all-cores-alike case. The only other change is the
Win32_System_SystemInformationfeature forvictory-hle.Validation
Core Ultra 7 265K, RTX 5070 Ti (driver 621.40), 31 GB RAM, Windows 11. Release build,
play-nvidia.ps1defaults (Series X, 1440p, DLSS Quality), same scripted route into the prison cell, presents per second from 140 to 205 s, caches warm. Before / after:keep)fast)What it does: the title-side waits are gone and the dips are smaller. What it doesn't do: raise the average on this CPU, because the submitting thread is the next limit. The fps figures are from one run each, and the same route varies by about ±3 fps between runs, so read the mean as "unchanged". The internal timings are the clearer signal.
f3534e6, rebased ontodf2daaf, rebuilt, and confirmed to run. Not re-measured on the new base.cargo test -p victory-hle: all pass (175 + the rest).cargo clippy -p victory-hle --all-targets: nothing in the changed file. With-D warningsit stops on existingvictory-gpufindings (dead code inhost/indirects.rs, among others), which are there on main as well.VICTORY_FAST_CORES=3) made no difference.Done with AI assistance (Claude Code). No game data is included.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by fromrivertothesea on 2026-11-28T00:23:48Z.
Measured on a different hybrid CPU, for comparison: i5-12600KF (6 P-cores + 4 E-cores), RTX 5070 Ti, 32 GB, GTA VI 1.0.2.1, first playable part (the prison cell), Series X profile, DLSS Quality, frame generation not prepared (
-NoFrameGenReady). Same build both times (this PR merged in); the only difference isVICTORY_TITLE_AFFINITY. Medians over 90 s of settled gameplay:VICTORY_TITLE_AFFINITYkeepfast(default)So no gain here; the difference is within run-to-run noise. On this PC the frame is limited by the submitting thread's own work (about 43 ms per frame preparing, mostly refreshes of title buffers), and that thread is the layer's, which
cores.rsalready keeps on fast cores.One thing to look at: the first run with this PR crashed once while loading, at frame 11463, with
draw.rs:128: index out of bounds: the len is 5 but the index is 17inTableGroup::entry, on a list thread (list::thin::run_plain). ATablePlancan't hold that index as built, so it reads like a stale pipeline pointer or a race. That build also had #378 merged in, the crash happened only once, and the later run with this PR on didn't crash, so I can't say this PR causes it. It may just be the different thread timing exposing something older.🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by x-nihil0 on 2026-11-28T16:38:10Z.
Core Ultra 9 285:
fastis slower thankeephere, because it moves the title's 8-13 off the P-coresMachine: Intel Core Ultra 9 285 (8 P-cores + 16 E-cores, no hyperthreading; the P-cores are logical processors 0, 1, 10-13, 22 and 23), RTX 5080 16 GB, driver 621.40, 64 GB RAM, Windows 11. Release build of
main63b902f+ this PR (9ec281f), the release launcher's set (Series X, 1440p, DLSS Quality, frame generation not made ready). Six unattended 300 s runs from one save in the open world, one after the other on one build, the only changeVICTORY_TITLE_AFFINITY. fps medians over the same 230 s, by draws per frame:VICTORY_TITLE_AFFINITYkeep(first run)fast(default)freekeep(last run)The two
keepruns are 0.3-0.6 fps apart in the first two bands (the first one had my analysis tools running beside it, the later ones had nothing).fastis 0.6-1.2 fps below them at 7-9k draws and 1.2-1.5 at 9-11k.Why, from a log line I added for each mask the title asks for: with
fast,0x1F00(8-12) becomes0x7C(2-6) and0x2000(13) becomes0x80(7). On the 285 those are all E-cores, while withkeepthe same threads sit on three P-cores plus two E-cores (8-12) and on one P-core (13). On this machine those are the title's busy threads: read live in an earlier session, the five threads at0x1F00used 270-320 ms of CPU a second each and the one at0x2000453 ms. Sofastgives 0-7 the eight P-cores and moves these busy threads to E-cores. On the 265K in the description the same remap takes only 8 and 9 off P-cores (13 is an E-core there withkeeptoo), which may be why it came out even there.I also tried a mapping of my own that puts 8-13 on P-cores and 0-7 on E-cores: 20.6 / 18.3 / 15.9, no better than
keep. So on a 285 I'd keepkeep(orfree) as the default. I can't say what's best on CPUs with more P-cores.No game files, captures or saves are attached. Made with AI help; the figures come from the run logs.