Repository navigation
perf(hle): let the title's threads run on every processor and keep the scheduler's boost (VICTORY_TITLE_FREE) - #329
PiloteCode wants to merge 1 commit into
Conversation
…e scheduler's boost (VICTORY_TITLE_FREE)
|
Read-only security & triage review on
|
|
Automated triage for the maintainers (not an approval). Verdict: Review SummaryVerdict: What was checked
Minor non-blocking notes
Next stepRun a short local real-GPU smoke test on Generated with Antigravity CLI ( |
|
Allowlist & Architect Deep Review ( Win32 thread-hook audit (
Next step ( |
Summary
The title pins each of its threads to a single logical processor (as on the console's seven cores) and turns the scheduler's priority boost off for the whole process. On a PC those threads share the processors with the layer's own pools (submitting thread, list translators, storage workers): a woken title thread waits for its processor while others sit idle ("woken, not running yet" was 6-10 ms of each frame's critical chain in a busy, crowded area), and the layer's threads lose the boost too.
This PR binds the title's imports of
SetThreadAffinityMask,SetThreadGroupAffinityandSetProcessPriorityBoostto small wrappers: a pin becomes the process's whole affinity mask, and the boost stays on. Default on;VICTORY_TITLE_FREE=0passes the title's calls to the system unchanged, as before.After bigboss22869's fork (
4c41be4f3,07d08694e) andtrustno1-coder/VIctory-NVIDIApull request 2803; in our fork's play defaults since 1 Dec.Changes
crates/victory-hle/src/modules/title_free.rs(new): the three wrappers; the process mask is read withGetProcessAffinityMask(if it cannot be read, the title's own mask is kept); one info line the first time a pin is widened. Diagnostics builds can switch it inside a run (VICTORY_AB=<s>,VICTORY_TITLE_FREE): a helper thread re-applies the remembered pins and the boost word at each phase change, so both arms are real.crates/victory-hle/src/host.rs: one hook inHostPolicy::resolve, before the existingtitlewritehook (the same place our fork binds it).crates/victory-hle/src/modules/mod.rs: the module (Windows only).GROUP_AFFINITYlayout, and that only these three imports are bound.Rig Specs Tested On (our fork, not this tree)
Run Settings & Profile
victory-hle/victory-gpu)VICTORY_AB(8-12 switches, 10 s phases in a mixed order, ~56 phases kept at the busiest place of a saved game), drift fitted by least squares; each phase's own frame median, p90, meanMeasurements & Verification
The card was 2.5-2.7 points busier (the title's threads ran 0.75 processors a second more); pictures compared at fixed points: the same. No crash or device removal in these runs; in daily play since 1 Dec without a report against it.
main3230974; offline,--locked, toolchain 1.98.1-msvc):cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test(not run by us on this tree)cargo xtask policy(not run; the new file is a small.rstext file with no hex/base64 runs or title identifiers)Limits