perf(libkernel): end short sleeps when the GPU or a flip completes #6658
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6658"
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 nicolasabosch on 2026-10-16T02:02:47Z.
What
A
sceKernelUsleep,usleep,nanosleeporsceKernelNanosleepof 1 ms or less now returns as soon as one of these happens:Titles that poll a GPU label or the flip status between short sleeps no longer sleep out the rest of each 1 ms. SuperTuxKart's GL layer is one: it spins 200 us, then calls
sceKernelUsleep(1000)until its marker lands, about 35 times per frame in the menu.Limits that keep the console behaviour for everything else:
APS5_COARSE_TIMED_WAITSset, takes the same path as on main.APS5_NO_SLEEP_WAKE=1keeps every sleep in full.The early return is recorded in technical debt (libkernel, Functional).
Tested
Windows 11 Pro 10.0.26300, Intel i9-14900HX, 32 GB, NVIDIA GeForce RTX 4070 Laptop GPU (driver 616.92), 1920x1080 window.
Captured as the Performance report form describes:
APS5_TRACE_SECONDSonly, no redirected log, warm caches.43a2abaf7and this branch876ad540f(main merged in) built from clean checkouts and alternated in one session, same relinked executable.31cbb55d7)31cbb55d7)Other kart-selection runs of this branch gave 150.5 ms p50 (one more run) and, in an earlier session on main
31cbb55d7, 187.5 against 324.6 ms. One further run of the branch did not reach that scene and is not counted. DOOM was measured on the earlier base and not repeated; it paces itself at 60 Hz and its GPU time per present did not change.In the STK menu the guest no longer waits out its 1 ms sleeps: in the trace, a batch's cycle drops from about 1.7 ms to about 0.9 ms.
ctest -j 16(Windows, mingw) on this branch: 1689 of 1691 pass.agc_driver_pass_input_hazardfails the same way on main43a2abaf7without this change (3 of 3 runs).conversion_diagnosticstimed out under the parallel run and passes alone (3 of 3).agc_driver_preparation_scope_settleandagc_driver_bda_device, which failed in earlier runs, are explained by main failing or timing out the same way (7 of 144 and 3 of 3 runs).New test:
guest_sleep_wake.Validation layers (this change only, not compared with main): this branch with main
dbac9fa15b61merged in, built Release on the same machine and GPU,ctest -V -R 'sleep_wake|agc_driver_flip'withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1. 5 of 5 pass (agc_driver_flip,agc_driver_flip_stores_small_results,agc_driver_flip_compute,guest_sleep_wake,guest_sleep_wake_coarse); the log has noVUID-line and nowas not found but was requested by env var VK_INSTANCE_LAYERS. The same run on main was not done, so the no-new-VUID comparison with main is not made.Review of the Windows wake event: a wake that lands after a sleep stopped waiting left the per-thread event signalled, and the next sleep on that thread could spin its whole length. Measured on this machine with a 1000-run loop (a wake during a 300 us sleep, then a 1 ms sleep timed in thread cycles): without
ResetEvent65, 102 and 173 of 1000 of those second sleeps burned over 800 us of CPU; with the fix 3, 2 and 2. The same loop with no earlier wake gave 0 of 1000 in both. The fix is inSleepNanosUnlessChanged.Linux and macOS take the condition-variable path in
TimedWait::SleepNanosUnlessChanged. @jotitadev validated it on Linux in this review (Ubuntu 26.04, i7-8700, GCC 15.2):guest_sleep_wakepasses 100/100 alone and 120/120 with 12 and 24 parallel copies, and aborts withAPS5_NO_SLEEP_WAKE=1. That run was before the Windows fix above, which does not touch the Linux path. The GPU progress watcher and the flip wake were not run on Linux. macOS was not run.Summary lines, traces and
trace_digest.pyoutput for every capture: https://github.com/nicolasabosch/AnyPS5/releases/tag/perf-evidence-gpu-wake-sleeps (filesfinal-*are the captures in the table; the earlier session's are unprefixed).Summary lines
STK main menu, main
43a2abaf7:STK main menu, this branch
876ad540f:STK kart selection, main:
STK kart selection, this branch:
tools/trace_digest.py, STK main menu, mainseconds 40:10 from present 401: 184 presents, frame p50 53.3 / p90 57.6 / p99 77.5 / max 79.0 ms, GPU busy 1.5 ms per present
NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA 616.92, Windows 10.0.26300, 1920x1080, commit
43a2abaf77, dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 52.8, Driver.WorkerWait.idle_and_completion_poll 52.7, Graphics.Draw 4.9, Graphics.Draw.draw_and_resource_release 4.8, Vulkan.DrawFromRecipe 1.6, Graphics.DrawWithRecipe 1.6, Graphics.DrawWithRecipe.draw_and_resource_release 1.6, batch 1.5, Driver.Packet 1.0, Driver.Packet.draw 0.9
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
tools/trace_digest.py, STK main menu, this branchseconds 40:10 from present 851: 310 presents, frame p50 32.1 / p90 33.9 / p99 39.6 / max 40.3 ms, GPU busy 1.1 ms per present
NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA 616.92, Windows 10.0.26300, 1920x1080, commit
876ad540ff, dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 30.9, Driver.WorkerWait.idle_and_completion_poll 30.8, Graphics.Draw 4.7, Graphics.Draw.draw_and_resource_release 4.6, Vulkan.DrawFromRecipe 1.5, Graphics.DrawWithRecipe 1.5, Graphics.DrawWithRecipe.draw_and_resource_release 1.5, batch 1.1, Driver.Packet 0.8, Driver.Packet.draw 0.8
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T02:38:43Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/CMakeLists.txtL738Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceVideoOut/src/VideoOutDriver.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libSceVideoOut/src/VideoOutDriver.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Time/Time.cppcore/libs/prx/libkernel/Time/TimedWait.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cppcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mdcore/libs/prx/libSceVideoOut/src/VideoOutDriver.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Time/Time.cppcore/libs/prx/libkernel/Time/TimedWait.cppdocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mddocs/dev/debt/libkernel.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdImported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-16T02:42:44Z.
Moved the
SleepWake.hppinclude inRecorder.cppand the libkernel debt entry (now at the end of Functional) off the lines #6360 and #6586 change; both now merge cleanly with this branch (checked withgit merge-tree). The other listed PRs already conflict withmainand share files only, not the same functions, so none is a dependency.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T02:52:25Z.
Review: COMMENTED
Linux run of the condition-variable path in
TimedWait::SleepNanosUnlessChanged, which the description lists as not run. Validated at82dd28619fast-forwarded ontomain5d9dcc42d; the current head6ce90a728only moves theSleepWake.hppinclude inRecorder.cppand the debt entry, no code change.Machine: Ubuntu 26.04, Intel i7-8700 (6C/12T), GCC 15.2, full build, Release,
BUILD_TESTING=ON.guest_sleep_waketarget.guest_sleep_wakepasses on Linux: 100/100 runs alone, 120/120 with 12 copies in parallel and 120/120 with 24 copies in parallel (2x the logical CPUs).APS5_NO_SLEEP_WAKE=1it aborts.ctest -E "^agc|gpu|vulkan|video_out" -j12): 649/651; the only failures arefile_writer_binaryandfile_writer_text, which also fail onmainon this machine (648/650).guest_nanosleeppasses.Not covered here: the GPU progress watcher in
Recorder.cppand the VideoOut flip wake (no AGC/VideoOut tests or titles were run).Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-16T02:56:18Z.
Thanks @jotitadev for the Linux run. I added it to the description, with what it doesn't cover (GPU progress watcher, flip wake, macOS).
Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-16T19:03:17Z.
Data point: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows,
APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1;main93e54ceddvsmain+ this PR, interleaved with three other PRs in one batch, two rounds. FPS is the mean of the last 10[present]windows, GPU busy and idle gaps per frame over the last 8.main6ce90a728)Neutral on this scene (mean +0.4 %, within the row spread); no regression. 0 fatal.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-16T21:02:29Z.
Additional Windows test on Ryzen 7 5800H, 64 GiB RAM, RTX 3070 Laptop 8 GiB (NVIDIA 617.42), Windows 11 Pro 26H2 (build 26300.9550; NT 10.0).
I repeated the SuperTuxKart PPSA69421 comparison without the other local optimizations: clean
main5d9dcc42d2ec5401aebd089028b8d4d7410a77b4versus that base with only this PR (6ce90a72864ec5a08e2101b0f14ecccb3793d7f4). All 12 changed source files were checked against the PR's Git blob hashes.Startup/tutorial prompt over the main menu, 1920×1080 internal rendering. Same executable and shared warm shader cache, music/SFX disabled on both sides, normal flip pacing, no host-import-disabling switches. Both measured windows stayed foreground in the same maximized window, client area 2560×1369. No builds or GPU tests ran during the captures.
Each title run was limited to 35 seconds; the table uses the late
APS5_TRACE_SECONDS=22:8interval, without redirected console logs:The separately sampled last ~8 seconds also agreed in direction: 9.81 versus 15.67 FPS. Loaded library SHA256s were verified; both traces report
trace_dropped=false. Neither title process exited early; both were stopped intentionally. This is one short pair in the startup/menu scene, not racing gameplay or a general FPS claim.All 7 directly related sleep/import checks passed, including
guest_sleep_wake,guest_nanosleepandprecise_wait. The expanded selection passed 12/13;agc_driver_depth_fast_clear_submitsegfaulted, but the same test also segfaulted on the exact clean-main control, so this run does not establish a regression from this PR. The full repository test suite was not run.AI-assisted: yes. The builds, tests and measurements above were executed locally.
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T15:48:37Z.
AMD on Windows data point, the first from an AMD GPU: SuperTuxKart (PPSA69421 00.001.000) is about 42 % faster with this PR.
Radeon 860M (RDNA 3.5 APU, driver 32.0.13058.8001), Ryzen AI 7 350, Windows 11 26300, WinLibs GCC 15.2.0, Release.
main6efb7261bagainst the same commit with this PR (0469be9e9) merged, clean merge. The title starts in its menu with no input and runs for 60 s, throughtools/title_run.py(#7264). FPS is presents per second from theAPS5_TRACE_SUMMARY_EVERY=10summaries over the whole run. Run 1 starts with an empty AnyPS5 shader cache and runs 2 and 3 keep it.mainAll six runs reach
renderingwith no stop line and nodestroyed with GPU results pendingwarnings. A second round on mains power,mainand this PR built and run one after the other (with #6718 in between), gave the same picture:mainAI-assisted
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T19:18:04Z.
This pull request is labeled
perf, so it needs the summary line of a capture onmainand one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste bothaps5-summary.jsonllines, attach the two traces and add the output oftools/trace_digest.py.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T04:52:44Z.
@nicolasabosch thanks, this reads well, and the menu gain reproducing on three machines (one AMD) is convincing. One Windows fix before merge: the per-thread auto-reset
wakeevent isn't reset when the sleeper registers. A wake that arrives after the wait has returned but beforeUnregister, which is common when completions are frequent, leaves it signalled. The next short sleep on that thread then returns from its wait at once, sees no counter change, and busy-spins inYieldProcessorfor its whole length. AResetEvent(waiter->wake)right after registering, before the counter check inSleepNanosUnlessChanged(TimedWait.cpp), fixes it.Two smaller points, no change needed unless you prefer: on Windows the new path skips
APS5_COARSE_TIMED_WAITSfor sleeps of 1 ms or less, and sleeps under 50 µs now spin to the deadline where main did oneSwitchToThread.Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-19T14:42:58Z.
@oneandonlydean thanks, you're right. Fixed in
09093bfa2:SleepNanosUnlessChangednow callsResetEvent(waiter->wake)after the thread registers and before it checks the counter, so a wake left over from the previous sleep no longer ends the next wait (a wake that arrives in between still changes the counter, which the check sees). I also took the two smaller points: on Windows a sleep under 50 us, or any sleep withAPS5_COARSE_TIMED_WAITSset, goes throughTimedWait::SleepNanosas on main.Checked: the 12 sleep and timer tests (
guest_sleep_wake,guest_nanosleep, cancellation, nested-sleep and clock tests) pass 3/3. SuperTuxKart main menu with the fix on the measured base39ddb3585: p50 27.2 and 30.4 ms vs 30.9 and 29.1 ms without it, so no change in the gain. That check is on the old base because current mainc4c2b3aa7aborts this title at startup (Thread destructor callback is already registered), with or without this PR.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-19T15:43:15Z.
@oneandonlydean follow-up with what I measured, since my earlier reply fixed this without reproducing it first.
The stale event (Windows). Reproduced before keeping the fix. Loop of 1000 rounds: a wake lands 150 us into a 300 us sleep (which spins, so nothing consumes the event), then a 1 ms sleep is timed in thread cycles (
QueryThreadCycleTime). Without theResetEvent, 65, 102 and 173 of 1000 of those second sleeps burned over 800 us of CPU; with it (09093bfa2), 3, 2 and 2. The same loop with no earlier wake gave 0 of 1000 either way. A first version of my measurement used a wake that fell inside the wait, which the auto-reset event consumes, so it showed no difference; I discarded it. This is a measurement script, not a committed test: a CPU-time threshold would be flaky on shared CI runners.(a)
APS5_COARSE_TIMED_WAITS. You were right, the new path ignored it. Changed: with coarse waits set,SleepNanosUnlessChangednow callsSleepNanosas on main, so such a sleep is never ended early. I did not measure a case with coarse waits set beyondguest_sleep_wakeandguest_nanosleeppassing withAPS5_COARSE_TIMED_WAITS=1... correction:guest_sleep_wakeaborts with that variable set, because the test expects the early return, so that combination is not covered by a passing test.(b) Sleeps under 50 us. Also changed: they take
SleepNanos(oneSwitchToThread) as on main. I did not measure what the spin cost there; I restored main's behaviour because I had no number showing the spin was wanted.Tests:
precise_wait,guest_sleep_wake,guest_nanosleep, the cancellation, nested-sleep, clock and timed-wait tests pass on the merged head876ad540f. Fullctestthere: 1689 of 1691; the two failures areagc_driver_pass_input_hazard(fails the same on main43a2abaf7, 3 of 3) and aconversion_diagnosticstimeout under load (passes alone 3 of 3). SuperTuxKart main menu, main43a2abaf7vs this branch: p50 53.3 / 53.6 vs 32.1 / 30.2 ms; kart selection 319 vs 163 ms. The description has the summary lines and the traces are in the release.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-19T15:48:46Z.
Correction to my previous comment: its point (a) was garbled. The accurate version:
(a)
APS5_COARSE_TIMED_WAITS. You were right, the new path ignored it. Changed in09093bfa2: with coarse waits set,SleepNanosUnlessChangedcallsSleepNanosas on main, so such a sleep is never ended early. When I checked this,guest_sleep_wakeaborted with that variable set, because the test expected the early return. The test now has a coarse variant (guest_sleep_wake_coarse, commit447b744dd) that runs the same binary withAPS5_COARSE_TIMED_WAITS=1and checks that 12 sleeps with a waker running all last their full length. Both variants pass 3 of 3 here. I did not check that the coarse variant fails without theCoarse()check.The rest of the previous comment stands (stale-event measurement, (b), test and benchmark numbers). The branch is now at
843084a9d(main merged in); the sleep, cancellation and timer tests pass on it, and the STK numbers in the description were taken on main43a2abaf7.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T21:21:54Z.
Thanks for the
ResetEventfix and for restoring the coarse and sub-50 µs paths. Those look right.The new
guest_sleep_wake_coarsefails on Linux CI:Subprocess abortedafter 0.51 s (run 39321993940), and it fails every time.APS5_COARSE_TIMED_WAITSis a Windows-only switch.TimedWait::Coarse()only reads it under_WIN32, and the newif (Coarse() || nanos < YIELD_BELOW_NANOS)check inSleepNanosUnlessChangedis inside#ifdef _WIN32. On Linux, the condition-variable branch still ends the sleep whencompletionschanges. SoCoarseWaitsKeepEverySleepFullsees early returns and itsRequire(Usleep(...) >= 1000us)aborts.The code behaves correctly here. On Linux,
Coarse()is always true, so gating the wake on it would switch the feature off there. The test is what needs to change. Could you registerguest_sleep_wake_coarseonly insideif(WIN32), or have the coarse branch ofmainreturn 77 when it isn't built for_WIN32?Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-19T22:15:40Z.
@oneandonlydean you're right, and thanks for the diagnosis: I registered
guest_sleep_wake_coarsefor every platform, butAPS5_COARSE_TIMED_WAITSis read only under_WIN32, so on Linux the test asserted something the code does not do. Fixed in60d5149ef: the test is registered only insideif(WIN32), and the coarse branch ofmainin the test file is under#ifdef _WIN32as well, so setting the variable on another platform runs the normal test. No change toTimedWait.cpp; gating the wake onCoarse()would switch it off on Linux, as you say. On Windows bothguest_sleep_wakeandguest_sleep_wake_coarsepass 3 of 3 here. I cannot run Linux, so the Linux CI run of this commit is the check.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-20T07:26:25Z.
Ran this on GTA V (PPSA04263 01.010.002), Linux 7.2.8-zen1-2-zen, NVIDIA GeForce RTX 5060 Laptop GPU, NVIDIA 615.71.09, Graphics Mode Performance, the Story prologue after Resume Story, with no input.
main
eaa5c9238against maineaa5c9238+ #6658 at60d5149ef, same machine and session, two runs each in the order A B A B, window frames 3500:700, caches warm, APS5_TRACE_EVENTS=4194304 (BUILD.md's remedy for full trace buffers), no other APS5_TRACE_* or APS5_PROFILE_* switch, log not redirected. The harness navigates the menus from frame dumps in boot and load to present 3300 (APS5_DUMP_FRAMES=110, every 30 presents), which stop before the window.Frame p50: main 79.8, 80.6 ms, with #6658 81.3, 81.8 ms (+1.3 ms, +1.7 %). GPU busy per present: 64.4 and 64.9 ms.
Not tested: other scenes, Fidelity mode, other GPUs.
Written with AI assistance (Claude Code); measured on the machine above.
Summary lines (main, then the PR):
{"commit":"eaa5c9238687","dirty":false,"env":{"APS5_DUMP_FRAMES":"110","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3500:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","resolution":"3840x2160","window":{"spec":"frames 3500:700","first_present":3500,"ms":57186.269},"presents":700,"frame_ms":{"p50":79.77,"p90":89.907,"p99":111.025,"max":120.187},"gpu_busy_ms_per_present":64.252,"worker_busy_pct":{"queue worker 0x0":3678.844},"top_phases_ms_per_frame":{"Driver.EndSubmission":2939.752,"Driver.Packet":63.384,"Graphics.Draw":60.365,"Graphics.Draw.draw_and_resource_release":56.558,"Driver.Packet.draw":50.596,"Driver.Draw":50.385,"VideoOut.Flip":25.643,"Driver.Present":25.625},"trace_dropped":false,"trace":"aps5-trace-eaa5c9238687-1045163.json.gz"}
{"commit":"a04965c19dca","dirty":false,"env":{"APS5_DUMP_FRAMES":"110","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3500:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","resolution":"3840x2160","window":{"spec":"frames 3500:700","first_present":3500,"ms":57961.181},"presents":700,"frame_ms":{"p50":81.305,"p90":90.808,"p99":119.246,"max":149.866},"gpu_busy_ms_per_present":64.705,"worker_busy_pct":{"queue worker 0x0":3667.613},"top_phases_ms_per_frame":{"Driver.EndSubmission":2970.615,"Driver.Packet":63.939,"Graphics.Draw":61.131,"Graphics.Draw.draw_and_resource_release":57.226,"Driver.Packet.draw":50.747,"Driver.Draw":50.527,"VideoOut.Flip":26.102,"Driver.Present":26.085},"trace_dropped":false,"trace":"aps5-trace-a04965c19dca-1053052.json.gz"}
Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-20T16:52:54Z.
@oneandonlydean do you need something more from me?
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-20T16:54:33Z.
Race-scene data on AMD, as a follow-up to my menu numbers: this helps there too, by about 5%.
SuperTuxKart (PPSA69421 00.001.000), tutorial race, kart idle on the start line,
APS5_TRACE_SECONDS=110:20, one capture per tree, same machine, one after the other. Radeon 860M (driver 32.0.13058.8001), Windows 11 26300, Release. This PR doesn't merge cleanly with currentmain. I resolved the two conflicts by keeping both sides: an extra include inEntryPoints.cpp, and the newsubmitHoldmembers besideprogressWatcherinRecorder.hpp.Both trees include #8538 (the point-light fix) and #6718 (the texture-array upload saving):
main75787d2f6+ #8538 + #671860d5149ef)The waiting this PR targets is most of the frame:
APS5_TRACE_USLEEP, the title callssceKernelUsleep(1000)about 77 times per frame in the race (fromexe+0x11397andexe+0x110cb);The gain here is smaller than in the menu (6.7 → 9.7 FPS there), so in the race most of each wait seems to be the submission round trip itself rather than the rest of the 1 ms sleep.
AI-assisted: yes (Claude Code)