gpu: size the shader prewarm pool by the performance cores (smooth cold boots) #335
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!335
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-335"
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?
@derz92 on GitHub · 2026-11-27 12:26 UTC · original
derz92:fix/prewarm-performance-cores→main· +52 −9 · 3 files · 1 commits · merged 2026-11-27 16:14 UTCWhat this changes
Refs #332.
prewarm::pool_sizesizes the shader prewarm pool from the performance cores (hw.perflevel0.physicalcpu) minus two, at least two, instead of all cores minus two. On an 18-core M5 Max (6 performance cores) that is 4 workers instead of 16. Where the kinds of core aren't known it stays all cores minus two.VICTORY_PREWARM_WORKERS=<n>overrides the number, for checking other Macs. The workers keep the lowest priority of the default QoS class. docs/native-host.md says so now: it still said "utility QoS class", which the code no longer uses.Why: on a cold cache the 16 workers take the cores the title's own threads need, and the boot movie and first menus stutter all through the first ~50 s.
How it was tested
Apple M5 Max (6 + 12 cores), 36 GB, macOS 26.5,
--console series-s,VICTORY_METAL_RESIDENCY_SETS=heap. Every cold run used a fresh, emptyVICTORY_CACHE_DIR. Pacing comes fromVICTORY_COUNT_GREEN=1over the first 45–50 s (boot movie, start screen, first menus):image+0x500a5bb) and the main thread waiting on them: the title's own work.QOS_CLASS_UTILITY. That was much worse, with freezes of up to 7 s, and it never reached the story load. A title thread that needs a shader a starved utility worker is translating waits on that worker'sOnceLock.Checks:
cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: all pass excepthost_posix::ucrt::tests::dlls_that_are_not_the_c_runtime_are_left_alone, which fails the same way on main at86786a72without this change.cargo test -p victory-gpu --lib prewarm(arm64): 4 passed.the_pool_leaves_two_coresbecomesthe_pool_is_the_performance_cores_but_two, on a purepool_for(cores, performance)so it doesn't depend on the machine it runs on.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policyChecklist
VICTORY_*variable and documented (VICTORY_PREWARM_WORKERS, in docs/native-host.md)github-bot referenced this pull request2026-11-27 13:19:33 +00:00
a9e39aa02bto50b8ff5a5b@LakshanSivakumar on GitHub · 2026-11-27 16:15 UTC · original
Merged in
4cf84c83. Before pushing I ran the tests (native arm64), Windows clippy, the policy check, a release build, and one headless game run of the exact tree (170 s, Series S): menus at 30 fps, the world entered at about 81 s and kept presenting to the end at about 1 frame a second, 0 GPU errors, no crash. Thanks.