perf: Another Crab's Treasure beach is ~16 ms slower per frame since #20145's idle-store yield (draw recipes miss with template gone) #25535
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-22T07:50:21Z.
Title and scene
PPSA20423 (Another Crab's Treasure 02.000.000), the first beach after New Game, 1920x1080. A script presses cross every 6 s from 70 s through the menus and opening dialogue. Each capture is the 10 s window starting 330 s after launch (
APS5_TRACE_SECONDS=330:10).What is slow or what changed
Since #20145 (
ef4b9389b6, "stop the idle store for a thread blocked on the GPU mutex"), frame p50 on this beach has gone from about 73 ms to about 88-99 ms.Nearly all of the difference comes from its
YieldToGpuMutexWaiterswrapper around the idle store. IfStoreIdleResultspassesstoptoFlushAllPendingUntilagain (a one-line revert inVulkanDevice.cpp, nothing else changed), currentmainruns at 74-76 ms.Bisect. I bisected over the 427 first-parent merges that touch
libSceAgcDriverbetween71ce478956(11-11, p50 71.9-72.5 ms) and786bc3afa1(11-21). Each step was one capture with a clean build.3c3225458d, 73.0 ms.ef4b9389b6, the #20145 merge, 89.5 ms.A/B on current
main.786bc3afa1against the same commit with only the yield reverted (local commitd7d940a8c1). Arms alternated, each in its own run directory with its own shader cache, same scene and settings:Graphics.DrawWithRecipeper framemainmainmainSystem CPU outside the game was 0-7% in every run.
Why it is slower here. These figures come from one extra pair with
APS5_PROFILE_DRAW=1, used only for the counters; none of the frame times above come from it. Each is the average of three 10 s reports late in the beach:main[recipe] drawhits[recipe]pre-check misses: template gone[rescache] drawsmisses[rescache] revalidatefast-fail: pending imageWith the yield, the idle store in this scene presumably stops early most of the time, because queue 0 is about 95% busy and another thread is usually blocked on the GPU mutex. I didn't count the yields directly. The storage images it leaves pending then fail the fast revalidation proof (
pending image). The T1 refresh that follows replaces the templates the draw recipes refer to, so about 69k recipe draws per 10 s miss withtemplate goneand take the full draw path. Without the yield, the stores finish at idle, nothing is pending at revalidation, and the recipe path serves nearly every draw.I'm not proposing a revert: #20145 measured large gains in Slay The Princess and Ratchet & Clank: Rift Apart. This scene seems to be the opposite case, where the deferred stores cost more on the draw path than the waits they save. Possible directions, untested:
Setup
dirty: falsein every summary).APS5_PAD_INPUT_FILEand the trace switches, apart from the profiling pair noted above.Summary lines
Frame p50 and presents from each run's
aps5-summary.jsonlare in the table above; the commits match (786bc3afa1c8,d7d940a8c112). I can post the full lines or the traces if they help.Traces
Kept locally (
aps5-trace-*.json.gzfor each run above and for every bisect step); available on request.Capture
APS5_TRACE_*orAPS5_PROFILE_*switch was set in the six timed runs.AI-assisted: yes.