The title's thread affinities on the fast cores first (Intel hybrid CPUs) #419
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!419
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@justrealyme on GitHub · 2026-11-27 22:09 UTC · original
justrealyme:title-affinity-fast-cores→main· +192 −0 · 2 files · 1 commits · openProblem
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
@fromrivertothesea on GitHub · 2026-11-28 00:23 UTC · original
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.