Cold shader cache: the prewarm pool takes the cores the boot needs (boot movie and menus stutter) #332
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T12:23:19Z.
Summary
On a cold shader cache (the first launch, or any launch after the cache key changes), the boot movie and the first menus stutter badly. The shader prewarm pool runs one worker per core but two (16 on an 18-core M5 Max). Even at the lowest priority of the default QoS class, those workers take the cores the title's own threads need, so frames are dropped every second for the first ~50 s.
If the pool is the performance cores minus two (4 on an M5 Max), a cold first launch is smoother than a warm launch was before, and the world still loads.
Numbers
Apple M5 Max (6 + 12 cores), 36 GB, macOS 26.5,
--console series-s,VICTORY_METAL_RESIDENCY_SETS=heap. Each cold run uses a fresh, emptyVICTORY_CACHE_DIR. Pacing comes fromVICTORY_COUNT_GREEN=1(present pacing ... longest_ms) over the first 45–50 s: boot movie, start screen, first menus.The remaining sub-second hitch at the start of the intro movie is the title's own parallel job: thread dumps during it show about 12 title threads in title code at
image+0x500a5bb, with the main thread waiting on them. It is the same with the cache warm.The world still loads with 4 workers. In a cold run into the story load, the title reached frame 2538 at 170 s with no watchdog fault. Shaders the first world frame needs before the pool reaches them are put off (
glue::put_off, 1024 put off in that run), as on main. The pool had about 5,200 shaders left at the end.What did not work: keeping 4 workers in the default class and moving the other 12 to
QOS_CLASS_UTILITYwas much worse: freezes of up to 7 s, and the run never reached the story load. A title thread that needs a shader a starved utility worker is translating waits on that worker'sOnceLock(priority inversion). The comment onlower_priorityalready warned against the utility class.Proposed change
prewarm::pool_size: the performance cores (hw.perflevel0.physicalcpu) minus two, at least two; all cores minus two where the kinds of core are not known. PlusVICTORY_PREWARM_WORKERS=<n>to override it, for testing on other Macs. I'd like to take this one and will send a PR.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T12:23:23Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T12:23:35Z.
Claimed by @derz92. Open a draft pull request with
Refs #332in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:35:48Z.
Thank you for the numbers. The prewarm pool is now the performance cores minus two (at least two), so 4 on an M5 Max, and
VICTORY_PREWARM_WORKERS=<n>sets it by hand (#335, on main). You measured about 216 dropped frames in the first 50 s before and about 50 after. I did not measure it myself. Closing. Please retest a cold first launch ona6a58361and tell me if the boot movie and menus are smooth. Reopen if not.