perf: draw cache entry limit thrashes Snoopy (PPSA28795), but a larger limit slows Another Crab's Treasure #26586
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 boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-24T06:36:24Z.
What happens
Snoopy and the Great Mystery Club (PPSA28795) runs at about 11 FPS in the backyard. The draw cache is full at its 65,536-entry limit and keeps evicting entries that would be hit again. Raising only the entry count (
APS5_DRAW_CACHE_ENTRIES=262144, byte budget unchanged) gives +39 % presents on this title. But the same setting is about 3 % slower on Another Crab's Treasure (PPSA20423), so a flat default raise like #21467's (4096 → 65536) trades one title against another here. This looks like an admission/replacement question rather than a size question, so I'm filing measurements, not a PR.System
Windows 11 Enterprise 22621, Ryzen 9 5950X, RX 6700 XT (AMD 26.11.2), WinLibs GCC 15.2 UCRT r7, Release. Snoopy: the runtime's
main2ef49858bblibraries. Crab:main678b294c89. Arms differ only in the environment variable, which is cleared before every run.Snoopy: why lookups miss
APS5_TRACE_DRAW_CACHE=1, backyard, steady 10 s lines:An earlier profiling run (
APS5_PROFILE_DRAW=1,mainf784587f30+ #26360, same scene) shows the cache pinned at 65,536 entries holding ~149 MiB of its 256 MiB budget. It made 179,541 inserts per 10 s, 0 shape updates, 1,931,876 evictions in total and 0 over the byte budget, so the entry count binds, not memory. In a trace-only capture onmainf784587f30, about half of all draws (33,062 of 70,267 in a 20 s window) payDriver.Draw.shader_compile_and_linkat ~29 µs each, ~34 ms per frame, on a 99 % busy queue worker 0.The user-words half is #9755's case (and #20130's). The evicted half is the new part: on FAR (PPSA03766) evictions were only 6,600–14,600 per 10 s, while here they are about 110,000.
Snoopy: entry count A/B
Trace-only (
APS5_TRACE_SECONDS=100:20), standard 180 s route, two jobs:APS5_DRAW_CACHE_ENTRIES=262144onlyAPS5_DRAW_CACHE_BYTES=1073741824The entry count alone gives the whole gain (+39 % presents, about −25 ms p50); the larger byte budget adds nothing. One further default arm aborted at 13.7 s on an unrelated presentation error and is not counted.
Crab: the same setting
Beach, 420 s runs,
APS5_TRACE_SECONDS=330:10only,main678b294c89, two jobs, order default, entries, entries, default, entries, default, default, entries:APS5_DRAW_CACHE_ENTRIES=262144Two of the four 262,144 runs are slower than every default run, and the mean p50 is 2.6 ms (3 %) worse. That is not decisive with this spread, but it is enough not to propose 262,144 as a flat default. Crab's misses are dominated by moved user-data pointers (#25535), so a larger LRU mostly keeps more one-shot entries there.
Where I'd look
cacheDrawStages(DrawCapture.cpp) usesreplaceShapeonly when the key is not admitted. On Snoopy the profile reports 0 shape updates against 179,541 inserts, so same-shape draws with a new key add entries instead of replacing their predecessor. If those are the one-shot entries, they would be what evicts the reusable ones.I haven't confirmed the first point beyond the counters. If useful, I can run any candidate policy on both titles with the same setup.
AI-assisted: yes.