perf: SuperTuxKart (PPSA69421) race on Windows at 20-24 FPS: a serial chain of label round trips, measured ceilings and a direction #25912

Open
opened 2026-11-22 20:57:45 +00:00 by LeandroLP23 · 0 comments
LeandroLP23 commented 2026-11-22 20:57:45 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-22T20:57:45Z.


Title and scene

PPSA69421 (SuperTuxKart 00.001.000), the tutorial race at 1920x1080, driving straight from the start (scripted pad timeline below), 10 s window starting 80 s after the first present.

What is slow or what changed

On Windows the race runs at about 20 FPS on main 8c254da48b and about 24 FPS with the open #10442, #24445 and #24869 merged on top (682a512644, a local merge). Both are far from the title's 60. This report shows where the frame goes, gives ceilings measured with local prototypes, and asks for the same run on other machines. It also proposes a direction. The short version is that the frame is a serial chain of label round trips. That is the same mechanism #24728 found on macOS, and a different shape from the many-draws case in #17533.

Machine. Windows 11 (10.0.26300), NVIDIA GeForce RTX 5060 Ti (NVIDIA 621.24, PCIe 3.0 x8), Intel i5-10600K, WinLibs GCC 15.2.0 r7, Release.

The frame is a chain. The title submits work about 33 to 35 times per frame (Recorder.Submit and Recorder.Sync counts) and polls a label until each submission completes before it builds the next (#24728 found the same on macOS). From the traces (per frame; committer recording is the committer's busy time minus Recorder.Sync):

per frame (two runs each) main with the three PRs
GPU batches 34.8 / 35.0 33.4 / 33.2
GPU busy 20.7 / 20.3 ms 14.1 / 13.4 ms
GPU idle between batches 27.9 / 32.0 ms 28.0 / 28.0 ms
draw committer recording 10.2 / 10.5 ms 12.6 / 12.6 ms
committer in Recorder.Sync 23.9 / 23.6 ms 12.7 / 12.0 ms

The GPU sits idle between batches for more time than it works. That idle time is the latency of each round trip: recording the draw, submitting it, starting it, and the title waking on the label. It is paid about 34 times in series. The wake-up itself is not the problem: Recorder.Sync ends a median of 48 to 55 us after the last batch it waited for (p90 80 to 89 us).

The title's own thread (sampled with APS5_SAMPLE_THREADS on an earlier stack at about 38 ms per frame):

  • about 49 % waiting on labels;
  • about 33 % its own code, roughly 12.5 ms per frame;
  • about 8 to 10 % in our libraries, roughly 3.5 ms: direct-memory map and unmap of 64 KiB every frame, clock_gettime called about 5,000 times per frame, and the arena reset.

Even with every wait gone, the CPU side alone is about 16 ms per frame on this CPU, and the chain adds the GPU time of each draw on top. So 60 FPS would need both the chain and the CPU cost reduced.

What the GPU time is. APS5_PROFILE_GPU, per present, on an earlier local stack with these changes (a separate run, since the capture form excludes profile switches):

class per present
draws 5.3 ms
storage write-backs 7.8 ms (6 x 7.9 MB)
storage uploads 0.13 ms (after #24445 and #24869)

The write-backs are StoreDrawnLinear("label"). It stores two linear 1920x1080 RGBA8 targets in full at every label, about three times each per frame. The CPU then clears them with rep stos at the start of the next frame, and later draws sample them through their guest addresses.

Ceilings measured with local prototypes (not proposed as they are; frame p50 over the race window, two alternated rounds in one session on the earlier local stack with APS5_PROFILE_GPU=1, so compare within the table, not with the capture above):

prototype race frame p50 image
none (stack) 38.8 / 39.1 ms
skip the label stores of linear host-imported targets and keep them pending, so later samples are served from the pending image by pendingLookupSource 27.8 / 27.3 ms correct in the frame dumps, but unsafe without a trap
the same with a real read trap on Windows: PAGE_NOACCESS at the label, a vectored handler that restores protection and runs FlushGpuWrites 34.8 / 34.0 ms correct
render straight into guest memory: a linear image bound to the host-pointer import refuted NVIDIA gives linear RGBA8 no color-attachment support, and over PCIe a full-screen pass costs 2.2 to 3.6 ms against 0.016 ms in VRAM

The trap keeps about half of the gain. Its cost is not the protection: there were about 18,000 VirtualProtect calls over the whole run, and the regions are large. The cost is the title's clear at the next frame. That clear faults once per target per frame, and the faulting thread then waits for the store. Removing that store safely would need to know that the CPU only writes, which a page trap cannot tell.

Asking for the same run elsewhere. SuperTuxKart is free homebrew, so anyone can reproduce this. The recipe:

  • tools/title_run.py PPSA69421 --profile performance --trace-seconds 80:10 --seconds 110 --warmup-seconds 110 --scene "...", which warms up, restarts the title and captures with warm caches;
  • the pad timeline below set for PPSA69421 in tools/titles.json;
  • the game window must stay in the foreground, or the title drops to a fixed 3.8 FPS.

The most useful data:

  • an AMD discrete GPU on Windows;
  • Linux with NVIDIA and with RADV;
  • a PCIe 4.0 or 5.0 slot, to separate the link from the round-trip latency;
  • an AMD or Intel iGPU, where the write-backs cost almost nothing (0.16 ms per 8.3 MB copy on a Radeon 860M against 1.66 ms here).

The questions are whether the per-batch idle gap (a median of 440 to 460 us on main and 280 to 290 us with the three PRs here) is similar across drivers, and how much the 6 write-backs cost on each.

Direction proposed.

  1. Windows label read traps for drawn linear targets. trapReadsAtLabel in StoreDrawnLinear is macOS-only today, and #19054 ports the StoreReadbackBeforeLabel side to Linux. I have a design for a Windows backend in WindowsMappings and can post it: trap state, resolve-first in every protection writer, a resolver thread, and the three waits #19054 hit. Like #16372, it would be off by default and safe only on titles relinked with --frame-red-zone and #16371's relocation. About 13 % here.
  2. A relinker marker for framed images. The marker would let the runtime enable traps (and #16372's arming) only where red-zone leaves are framed, instead of relying on an environment switch. Without it, item 1 helps only users who opt in.
  3. The label contract. Most of the frame is the title waiting for GPU completion that nothing reads. #10442 already stores an unimported label at once when no unfinished work touches guest memory; in this race it gives 16 to 23 % more presents. Extending that, so a label is delivered before its batch completes when nothing pending can be observed through guest memory, is what would shorten the chain itself. I do not have a safe design for it. I would like to hear whether the maintainers see it as viable, and how it relates to the direct per-draw path planned in #17533.

Summary lines

{"commit":"8c254da48beb","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":1737,"ms":10039.900},"presents":207,"frame_ms":{"p50":48.305,"p90":49.878,"p99":53.828,"max":57.211},"gpu_busy_ms_per_present":20.673,"worker_busy_pct":{"queue worker 0x0":6.489},"phase_totals_ms":{"Driver.Completion":1.150,"Driver.Draw":497.178,"Driver.Draw.device_setup":29.434,"Driver.Draw.draw_enqueued":104.583,"Driver.Draw.post_compile_prepare":6.977,"Driver.Draw.prepare":42.474,"Driver.Draw.shader_compile_and_link":304.446,"Driver.EndSubmission":3.658,"Driver.Packet":646.647,"Driver.Packet.device_lock":9.423,"Driver.Packet.draw":505.553,"Driver.Packet.execute":53.746,"Driver.Packet.flip_flush":0.302,"Driver.Packet.flush_between_packets":14.724,"Driver.Packet.pipeline_drain":12.956,"Driver.Packet.pipeline_prepare":13.956,"Driver.Packet.prepare_memory":13.677,"Driver.Present":120.319,"Driver.Present.acquire_image":2.378,"Driver.Present.device_setup":0.126,"Driver.Present.gpu_mutex_wait":0.408,"Driver.Present.inflight_wait":0.485,"Driver.Present.present_display_buffer":25.210,"Driver.Present.queue_present":87.936,"Driver.Present.release_and_callback":0.248,"Driver.Present.render_fence_wait":3.019,"Driver.Present.resize":0.348,"Driver.Present.validate":0.041,"Driver.Suspend":0.062,"Graphics.Draw":1083.677,"Graphics.Draw.draw_and_resource_release":1031.605,"Graphics.Draw.index_upload":23.532,"Graphics.Draw.validate":21.581,"Graphics.Draw.vertex_upload":2.738,"Graphics.DrawWithRecipe":1018.943,"Graphics.DrawWithRecipe.draw_and_resource_release":965.471,"Graphics.DrawWithRecipe.index_upload":41.525,"Graphics.DrawWithRecipe.validate":6.020,"Graphics.DrawWithRecipe.vertex_upload":2.754,"Recorder.Reap":0.828,"Recorder.Submit":246.457,"Recorder.Sync":4955.487,"Shader.DrawStage":166.689,"Shader.DrawStage.capture_resources":108.123,"Shader.DrawStage.materialize":28.118,"Shader.DrawStage.prepared_invocation":28.179,"VideoOut.Flip":124.641,"VideoOut.Flip.completion_mutex_wait":0.160,"VideoOut.Flip.config_mutex_wait":0.023,"VideoOut.Flip.frame_limit":0.100,"VideoOut.Flip.notify_game":2.594,"VideoOut.Flip.present":120.210,"VideoOut.Flip.validate":0.238,"VideoOut.Flip.vblank_wait":0.128,"VideoOut.Flip.window_prepare":0.278,"VideoOut.Flip.window_title":0.764,"VideoOut.Readiness":0.464,"VideoOut.Readiness.locks_validate":0.162,"Vulkan.Acquire":2.162,"Vulkan.Acquire.acquire_fence_wait":0.399,"Vulkan.Acquire.acquire_image":1.171,"Vulkan.Acquire.fence_reset":0.439,"Vulkan.Acquire.retired_swapchains":0.092,"Vulkan.DrawFromRecipe":1024.852,"Vulkan.Present":19.423,"Vulkan.Present.command_record_scale":7.381,"Vulkan.Present.pixel_upload":0.361,"Vulkan.Present.queue_submit":11.419,"Vulkan.QueuePresent":87.594,"Vulkan.QueuePresent.queue_present":87.148,"Vulkan.Retire":2.935,"Vulkan.Retire.wait":0.678},"top_phases_ms_per_frame":{"Recorder.Sync":23.940,"Graphics.Draw":5.235,"Graphics.Draw.draw_and_resource_release":4.984,"Vulkan.DrawFromRecipe":4.951,"Graphics.DrawWithRecipe":4.922,"Graphics.DrawWithRecipe.draw_and_resource_release":4.664,"Driver.Packet":3.124,"Driver.Packet.draw":2.442},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":21609,"Graphics.Barrier.present-blit":414,"Graphics.Barrier.storage-upload":2484,"Graphics.Barrier.storage-writeback":3726,"Graphics.RenderPass":7203,"Graphics.RenderPass.Close.command":621,"Graphics.RenderPass.Close.new-batch":6582,"Graphics.RenderPass.Continued":8701},"trace_dropped":false,"trace":"aps5-trace-8c254da48beb-25632.json.gz"}
{"commit":"682a512644ad","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":2124,"ms":10002.906},"presents":238,"frame_ms":{"p50":41.686,"p90":43.543,"p99":48.510,"max":53.786},"gpu_busy_ms_per_present":14.084,"worker_busy_pct":{"queue worker 0x0":12.450},"phase_totals_ms":{"Driver.Completion":1.254,"Driver.Draw":599.771,"Driver.Draw.device_setup":33.749,"Driver.Draw.draw_enqueued":108.069,"Driver.Draw.post_compile_prepare":7.578,"Driver.Draw.prepare":47.627,"Driver.Draw.shader_compile_and_link":392.304,"Driver.EndSubmission":4.676,"Driver.Packet":1239.389,"Driver.Packet.device_lock":10.581,"Driver.Packet.draw":610.180,"Driver.Packet.execute":516.085,"Driver.Packet.flip_flush":0.373,"Driver.Packet.flush_between_packets":16.595,"Driver.Packet.pipeline_drain":14.392,"Driver.Packet.pipeline_prepare":15.991,"Driver.Packet.prepare_memory":15.352,"Driver.Present":138.516,"Driver.Present.acquire_image":2.711,"Driver.Present.device_setup":0.132,"Driver.Present.gpu_mutex_wait":0.454,"Driver.Present.inflight_wait":0.575,"Driver.Present.present_display_buffer":28.322,"Driver.Present.queue_present":101.999,"Driver.Present.release_and_callback":0.329,"Driver.Present.render_fence_wait":3.155,"Driver.Present.resize":0.420,"Driver.Present.validate":0.063,"Driver.Suspend":0.071,"Graphics.Draw":1579.550,"Graphics.Draw.draw_and_resource_release":1482.167,"Graphics.Draw.index_upload":60.532,"Graphics.Draw.validate":27.542,"Graphics.Draw.vertex_upload":3.850,"Graphics.DrawWithRecipe":1229.728,"Graphics.DrawWithRecipe.draw_and_resource_release":1190.333,"Graphics.DrawWithRecipe.index_upload":28.949,"Graphics.DrawWithRecipe.validate":4.802,"Graphics.DrawWithRecipe.vertex_upload":2.631,"Recorder.Reap":29.608,"Recorder.Submit":248.938,"Recorder.Sync":3032.463,"Shader.DrawStage":227.427,"Shader.DrawStage.capture_resources":147.742,"Shader.DrawStage.materialize":38.964,"Shader.DrawStage.prepared_invocation":37.515,"VideoOut.Flip":142.954,"VideoOut.Flip.completion_mutex_wait":0.208,"VideoOut.Flip.config_mutex_wait":0.025,"VideoOut.Flip.frame_limit":0.128,"VideoOut.Flip.notify_game":2.381,"VideoOut.Flip.present":138.373,"VideoOut.Flip.validate":0.258,"VideoOut.Flip.vblank_wait":0.197,"VideoOut.Flip.window_prepare":0.326,"VideoOut.Flip.window_title":0.899,"VideoOut.Readiness":0.490,"VideoOut.Readiness.locks_validate":0.188,"Vulkan.Acquire":2.488,"Vulkan.Acquire.acquire_fence_wait":0.460,"Vulkan.Acquire.acquire_image":1.341,"Vulkan.Acquire.fence_reset":0.495,"Vulkan.Acquire.retired_swapchains":0.122,"Vulkan.DrawFromRecipe":1234.830,"Vulkan.Present":21.814,"Vulkan.Present.command_record_scale":8.364,"Vulkan.Present.pixel_upload":0.439,"Vulkan.Present.queue_submit":12.716,"Vulkan.QueuePresent":101.617,"Vulkan.QueuePresent.queue_present":100.934,"Vulkan.Retire":3.038,"Vulkan.Retire.wait":0.970},"top_phases_ms_per_frame":{"Recorder.Sync":12.741,"Graphics.Draw":6.637,"Graphics.Draw.draw_and_resource_release":6.228,"Driver.Packet":5.208,"Vulkan.DrawFromRecipe":5.188,"Graphics.DrawWithRecipe":5.167,"Graphics.DrawWithRecipe.draw_and_resource_release":5.001,"Driver.Packet.draw":2.564},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.dcc-clear":952,"Graphics.Barrier.draw":23727,"Graphics.Barrier.present-blit":476,"Graphics.Barrier.storage-upload":1904,"Graphics.Barrier.storage-writeback":4284,"Graphics.RenderPass":7909,"Graphics.RenderPass.Close.command":714,"Graphics.RenderPass.Close.new-batch":7195,"Graphics.RenderPass.Continued":9996},"trace_dropped":false,"trace":"aps5-trace-682a512644ad-25708.json.gz"}
{"commit":"8c254da48beb","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":1679,"ms":10029.220},"presents":192,"frame_ms":{"p50":52.005,"p90":53.880,"p99":57.735,"max":57.908},"gpu_busy_ms_per_present":20.278,"worker_busy_pct":{"queue worker 0x0":7.989},"phase_totals_ms":{"Driver.Completion":1.068,"Driver.Draw":532.244,"Driver.Draw.device_setup":29.492,"Driver.Draw.draw_enqueued":108.489,"Driver.Draw.post_compile_prepare":7.020,"Driver.Draw.prepare":41.531,"Driver.Draw.shader_compile_and_link":336.562,"Driver.EndSubmission":98.859,"Driver.Packet":701.252,"Driver.Packet.device_lock":8.827,"Driver.Packet.draw":540.904,"Driver.Packet.execute":56.610,"Driver.Packet.flip_flush":0.293,"Driver.Packet.flush_between_packets":14.203,"Driver.Packet.pipeline_drain":12.097,"Driver.Packet.pipeline_prepare":14.247,"Driver.Packet.prepare_memory":12.798,"Driver.Present":102.237,"Driver.Present.acquire_image":2.208,"Driver.Present.device_setup":0.117,"Driver.Present.gpu_mutex_wait":0.364,"Driver.Present.inflight_wait":0.465,"Driver.Present.present_display_buffer":23.080,"Driver.Present.queue_present":72.701,"Driver.Present.release_and_callback":0.223,"Driver.Present.render_fence_wait":2.582,"Driver.Present.resize":0.330,"Driver.Present.validate":0.059,"Driver.Suspend":0.061,"Graphics.Draw":1174.870,"Graphics.Draw.draw_and_resource_release":1090.476,"Graphics.Draw.index_upload":51.961,"Graphics.Draw.validate":24.123,"Graphics.Draw.vertex_upload":3.386,"Graphics.DrawWithRecipe":839.745,"Graphics.DrawWithRecipe.draw_and_resource_release":795.143,"Graphics.DrawWithRecipe.index_upload":35.460,"Graphics.DrawWithRecipe.validate":4.326,"Graphics.DrawWithRecipe.vertex_upload":2.327,"Recorder.Reap":0.794,"Recorder.Submit":246.157,"Recorder.Sync":4533.574,"Shader.DrawStage":195.984,"Shader.DrawStage.capture_resources":127.284,"Shader.DrawStage.materialize":33.084,"Shader.DrawStage.prepared_invocation":32.967,"VideoOut.Flip":105.839,"VideoOut.Flip.completion_mutex_wait":0.161,"VideoOut.Flip.config_mutex_wait":0.023,"VideoOut.Flip.frame_limit":0.090,"VideoOut.Flip.notify_game":2.004,"VideoOut.Flip.present":102.159,"VideoOut.Flip.validate":0.224,"VideoOut.Flip.vblank_wait":0.121,"VideoOut.Flip.window_prepare":0.256,"VideoOut.Flip.window_title":0.704,"VideoOut.Readiness":0.475,"VideoOut.Readiness.locks_validate":0.154,"Vulkan.Acquire":2.018,"Vulkan.Acquire.acquire_fence_wait":0.385,"Vulkan.Acquire.acquire_image":1.075,"Vulkan.Acquire.fence_reset":0.395,"Vulkan.Acquire.retired_swapchains":0.105,"Vulkan.DrawFromRecipe":844.117,"Vulkan.Present":17.679,"Vulkan.Present.command_record_scale":6.758,"Vulkan.Present.pixel_upload":0.348,"Vulkan.Present.queue_submit":10.322,"Vulkan.QueuePresent":72.390,"Vulkan.QueuePresent.queue_present":71.968,"Vulkan.Retire":2.513,"Vulkan.Retire.wait":0.714},"top_phases_ms_per_frame":{"Recorder.Sync":23.612,"Graphics.Draw":6.119,"Graphics.Draw.draw_and_resource_release":5.680,"Vulkan.DrawFromRecipe":4.396,"Graphics.DrawWithRecipe":4.374,"Graphics.DrawWithRecipe.draw_and_resource_release":4.141,"Driver.Packet":3.652,"Driver.Packet.draw":2.817},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":20106,"Graphics.Barrier.present-blit":384,"Graphics.Barrier.storage-upload":2304,"Graphics.Barrier.storage-writeback":3456,"Graphics.RenderPass":6702,"Graphics.RenderPass.Close.command":576,"Graphics.RenderPass.Close.new-batch":6126,"Graphics.RenderPass.Continued":8045},"trace_dropped":false,"trace":"aps5-trace-8c254da48beb-22124.json.gz"}
{"commit":"682a512644ad","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":2159,"ms":10018.440},"presents":242,"frame_ms":{"p50":41.059,"p90":42.581,"p99":46.720,"max":48.300},"gpu_busy_ms_per_present":13.389,"worker_busy_pct":{"queue worker 0x0":12.632},"phase_totals_ms":{"Driver.Completion":1.385,"Driver.Draw":609.925,"Driver.Draw.device_setup":34.474,"Driver.Draw.draw_enqueued":110.575,"Driver.Draw.post_compile_prepare":7.915,"Driver.Draw.prepare":48.909,"Driver.Draw.shader_compile_and_link":397.435,"Driver.EndSubmission":4.788,"Driver.Packet":1259.290,"Driver.Packet.device_lock":10.646,"Driver.Packet.draw":620.591,"Driver.Packet.execute":523.970,"Driver.Packet.flip_flush":0.383,"Driver.Packet.flush_between_packets":16.756,"Driver.Packet.pipeline_drain":14.661,"Driver.Packet.pipeline_prepare":16.295,"Driver.Packet.prepare_memory":15.685,"Driver.Present":137.998,"Driver.Present.acquire_image":2.760,"Driver.Present.device_setup":0.144,"Driver.Present.gpu_mutex_wait":0.479,"Driver.Present.inflight_wait":0.613,"Driver.Present.present_display_buffer":28.716,"Driver.Present.queue_present":101.238,"Driver.Present.release_and_callback":0.362,"Driver.Present.render_fence_wait":3.100,"Driver.Present.resize":0.396,"Driver.Present.validate":0.054,"Driver.Suspend":0.073,"Graphics.Draw":1597.391,"Graphics.Draw.draw_and_resource_release":1497.805,"Graphics.Draw.index_upload":62.635,"Graphics.Draw.validate":27.692,"Graphics.Draw.vertex_upload":3.814,"Graphics.DrawWithRecipe":1251.432,"Graphics.DrawWithRecipe.draw_and_resource_release":1212.141,"Graphics.DrawWithRecipe.index_upload":28.809,"Graphics.DrawWithRecipe.validate":4.811,"Graphics.DrawWithRecipe.vertex_upload":2.587,"Recorder.Reap":30.385,"Recorder.Submit":253.103,"Recorder.Sync":2907.257,"Shader.DrawStage":229.842,"Shader.DrawStage.capture_resources":150.003,"Shader.DrawStage.materialize":39.461,"Shader.DrawStage.prepared_invocation":37.282,"VideoOut.Flip":142.418,"VideoOut.Flip.completion_mutex_wait":0.214,"VideoOut.Flip.config_mutex_wait":0.031,"VideoOut.Flip.frame_limit":0.112,"VideoOut.Flip.notify_game":2.236,"VideoOut.Flip.present":137.993,"VideoOut.Flip.validate":0.275,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.361,"VideoOut.Flip.window_title":0.900,"VideoOut.Readiness":0.506,"VideoOut.Readiness.locks_validate":0.199,"Vulkan.Acquire":2.523,"Vulkan.Acquire.acquire_fence_wait":0.476,"Vulkan.Acquire.acquire_image":1.357,"Vulkan.Acquire.fence_reset":0.500,"Vulkan.Acquire.retired_swapchains":0.119,"Vulkan.DrawFromRecipe":1256.633,"Vulkan.Present":22.007,"Vulkan.Present.command_record_scale":8.570,"Vulkan.Present.pixel_upload":0.453,"Vulkan.Present.queue_submit":12.678,"Vulkan.QueuePresent":100.862,"Vulkan.QueuePresent.queue_present":100.138,"Vulkan.Retire":3.005,"Vulkan.Retire.wait":0.733},"top_phases_ms_per_frame":{"Recorder.Sync":12.013,"Graphics.Draw":6.601,"Graphics.Draw.draw_and_resource_release":6.189,"Driver.Packet":5.204,"Vulkan.DrawFromRecipe":5.193,"Graphics.DrawWithRecipe":5.171,"Graphics.DrawWithRecipe.draw_and_resource_release":5.009,"Driver.Packet.draw":2.564},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.dcc-clear":968,"Graphics.Barrier.draw":24039,"Graphics.Barrier.present-blit":484,"Graphics.Barrier.storage-upload":1936,"Graphics.Barrier.storage-writeback":4356,"Graphics.RenderPass":8013,"Graphics.RenderPass.Close.command":726,"Graphics.RenderPass.Close.new-batch":7287,"Graphics.RenderPass.Continued":10164},"trace_dropped":false,"trace":"aps5-trace-682a512644ad-25708.json.gz"}

Traces

GitHub does not let me attach files from the command line, so the four traces (run order main-r1, stack-r1, main-r2, stack-r2, one session) are assets of a release on my fork:

The full digests and the four summary lines are in the same release (summary-lines.jsonl).

Digest

main-r1 (full digest)

seconds 80:10 from present 1737: 207 presents, frame p50 48.3 / p90 49.9 / p99 53.8 / max 57.2 ms, GPU busy 20.7 ms per present
NVIDIA GeForce RTX 5060 Ti, NVIDIA 621.24, Windows 10.0.26300, 1920x1080, commit 8c254da48b, dropped: no

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 2.1 (4 %) 45.0 (93 %) 1.3 4.6 Driver.Packet 2.1, VideoOut.Readiness 0.0
draw committer 34.1 (70 %) 0.0 (0 %) 14.4 0.3 Recorder.Sync 23.9, Graphics.Draw 5.2
presenter 0.6 (1 %) 0.0 (0 %) 47.9 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
gpu 20.7 (43 %) 0.0 (0 %) 27.8 0.0 batch 20.7
stack-r1 (full digest)

seconds 80:10 from present 2124: 238 presents, frame p50 41.7 / p90 43.5 / p99 48.5 / max 53.8 ms, GPU busy 14.1 ms per present
NVIDIA GeForce RTX 5060 Ti, NVIDIA 621.24, Windows 10.0.26300, 1920x1080, commit 682a512644ad, dropped: no

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 4.3 (10 %) 36.5 (87 %) 1.2 4.4 Driver.Packet 4.3
draw committer 25.3 (60 %) 0.0 (0 %) 16.7 0.4 Recorder.Sync 12.7, Graphics.Draw 6.6
presenter 0.6 (1 %) 0.0 (0 %) 41.4 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
gpu 14.1 (34 %) 0.0 (0 %) 27.9 0.0 batch 14.1

Capture

  • The caches were warm (title_run.py --profile performance: a 110 s warm-up run of the same route, then a restart and the capture)
  • No other APS5_TRACE_* or APS5_PROFILE_* switch was set and the log was not redirected (the performance profile cleans the environment and writes to the console)
  • Captures compared here come from the same machine, scene and settings
Pad timeline (race-pad.json)
{"after_s": 40, "events": [{"at_ms": 0, "hold_ms": 150, "buttons": [], "left_stick": [255, 128]}, {"at_ms": 1500, "hold_ms": 200, "buttons": ["cross"]}, {"at_ms": 30000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 35000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 40000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 45000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 50000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 55000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 60000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 65000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 70000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 75000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 80000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 85000, "hold_ms": 4800, "buttons": ["cross"]}]}

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6547697859 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/25912). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-22T20:57:45Z. --- ### Title and scene PPSA69421 (SuperTuxKart 00.001.000), the tutorial race at 1920x1080, driving straight from the start (scripted pad timeline below), 10 s window starting 80 s after the first present. ### What is slow or what changed On Windows the race runs at about 20 FPS on `main` `8c254da48b` and about 24 FPS with the open #10442, #24445 and #24869 merged on top (`682a512644`, a local merge). Both are far from the title's 60. This report shows where the frame goes, gives ceilings measured with local prototypes, and asks for the same run on other machines. It also proposes a direction. The short version is that the frame is a serial chain of label round trips. That is the same mechanism #24728 found on macOS, and a different shape from the many-draws case in #17533. **Machine.** Windows 11 (10.0.26300), NVIDIA GeForce RTX 5060 Ti (NVIDIA 621.24, PCIe 3.0 x8), Intel i5-10600K, WinLibs GCC 15.2.0 r7, Release. **The frame is a chain.** The title submits work about 33 to 35 times per frame (`Recorder.Submit` and `Recorder.Sync` counts) and polls a label until each submission completes before it builds the next (#24728 found the same on macOS). From the traces (per frame; committer recording is the committer's busy time minus `Recorder.Sync`): | per frame (two runs each) | `main` | with the three PRs | |---|---|---| | GPU batches | 34.8 / 35.0 | 33.4 / 33.2 | | GPU busy | 20.7 / 20.3 ms | 14.1 / 13.4 ms | | GPU idle between batches | 27.9 / 32.0 ms | 28.0 / 28.0 ms | | draw committer recording | 10.2 / 10.5 ms | 12.6 / 12.6 ms | | committer in `Recorder.Sync` | 23.9 / 23.6 ms | 12.7 / 12.0 ms | The GPU sits idle between batches for more time than it works. That idle time is the latency of each round trip: recording the draw, submitting it, starting it, and the title waking on the label. It is paid about 34 times in series. The wake-up itself is not the problem: `Recorder.Sync` ends a median of 48 to 55 us after the last batch it waited for (p90 80 to 89 us). **The title's own thread** (sampled with `APS5_SAMPLE_THREADS` on an earlier stack at about 38 ms per frame): - about 49 % waiting on labels; - about 33 % its own code, roughly 12.5 ms per frame; - about 8 to 10 % in our libraries, roughly 3.5 ms: direct-memory map and unmap of 64 KiB every frame, `clock_gettime` called about 5,000 times per frame, and the arena reset. Even with every wait gone, the CPU side alone is about 16 ms per frame on this CPU, and the chain adds the GPU time of each draw on top. So 60 FPS would need both the chain and the CPU cost reduced. **What the GPU time is.** `APS5_PROFILE_GPU`, per present, on an earlier local stack with these changes (a separate run, since the capture form excludes profile switches): | class | per present | |---|---| | draws | 5.3 ms | | storage write-backs | 7.8 ms (6 x 7.9 MB) | | storage uploads | 0.13 ms (after #24445 and #24869) | The write-backs are `StoreDrawnLinear("label")`. It stores two linear 1920x1080 RGBA8 targets in full at every label, about three times each per frame. The CPU then clears them with `rep stos` at the start of the next frame, and later draws sample them through their guest addresses. **Ceilings measured with local prototypes** (not proposed as they are; frame p50 over the race window, two alternated rounds in one session on the earlier local stack with `APS5_PROFILE_GPU=1`, so compare within the table, not with the capture above): | prototype | race frame p50 | image | |---|---|---| | none (stack) | 38.8 / 39.1 ms | | | skip the label stores of linear host-imported targets and keep them pending, so later samples are served from the pending image by `pendingLookupSource` | 27.8 / 27.3 ms | correct in the frame dumps, but unsafe without a trap | | the same with a real read trap on Windows: `PAGE_NOACCESS` at the label, a vectored handler that restores protection and runs `FlushGpuWrites` | 34.8 / 34.0 ms | correct | | render straight into guest memory: a linear image bound to the host-pointer import | refuted | NVIDIA gives linear RGBA8 no color-attachment support, and over PCIe a full-screen pass costs 2.2 to 3.6 ms against 0.016 ms in VRAM | The trap keeps about half of the gain. Its cost is not the protection: there were about 18,000 `VirtualProtect` calls over the whole run, and the regions are large. The cost is the title's clear at the next frame. That clear faults once per target per frame, and the faulting thread then waits for the store. Removing that store safely would need to know that the CPU only writes, which a page trap cannot tell. **Asking for the same run elsewhere.** SuperTuxKart is free homebrew, so anyone can reproduce this. The recipe: - `tools/title_run.py PPSA69421 --profile performance --trace-seconds 80:10 --seconds 110 --warmup-seconds 110 --scene "..."`, which warms up, restarts the title and captures with warm caches; - the pad timeline below set for PPSA69421 in `tools/titles.json`; - the game window must stay in the foreground, or the title drops to a fixed 3.8 FPS. The most useful data: - an AMD discrete GPU on Windows; - Linux with NVIDIA and with RADV; - a PCIe 4.0 or 5.0 slot, to separate the link from the round-trip latency; - an AMD or Intel iGPU, where the write-backs cost almost nothing (0.16 ms per 8.3 MB copy on a Radeon 860M against 1.66 ms here). The questions are whether the per-batch idle gap (a median of 440 to 460 us on `main` and 280 to 290 us with the three PRs here) is similar across drivers, and how much the 6 write-backs cost on each. **Direction proposed.** 1. **Windows label read traps for drawn linear targets.** `trapReadsAtLabel` in `StoreDrawnLinear` is macOS-only today, and #19054 ports the `StoreReadbackBeforeLabel` side to Linux. I have a design for a Windows backend in `WindowsMappings` and can post it: trap state, resolve-first in every protection writer, a resolver thread, and the three waits #19054 hit. Like #16372, it would be off by default and safe only on titles relinked with `--frame-red-zone` and #16371's relocation. About 13 % here. 2. **A relinker marker for framed images.** The marker would let the runtime enable traps (and #16372's arming) only where red-zone leaves are framed, instead of relying on an environment switch. Without it, item 1 helps only users who opt in. 3. **The label contract.** Most of the frame is the title waiting for GPU completion that nothing reads. #10442 already stores an unimported label at once when no unfinished work touches guest memory; in this race it gives 16 to 23 % more presents. Extending that, so a label is delivered before its batch completes when nothing pending can be observed through guest memory, is what would shorten the chain itself. I do not have a safe design for it. I would like to hear whether the maintainers see it as viable, and how it relates to the direct per-draw path planned in #17533. ### Summary lines ```json {"commit":"8c254da48beb","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":1737,"ms":10039.900},"presents":207,"frame_ms":{"p50":48.305,"p90":49.878,"p99":53.828,"max":57.211},"gpu_busy_ms_per_present":20.673,"worker_busy_pct":{"queue worker 0x0":6.489},"phase_totals_ms":{"Driver.Completion":1.150,"Driver.Draw":497.178,"Driver.Draw.device_setup":29.434,"Driver.Draw.draw_enqueued":104.583,"Driver.Draw.post_compile_prepare":6.977,"Driver.Draw.prepare":42.474,"Driver.Draw.shader_compile_and_link":304.446,"Driver.EndSubmission":3.658,"Driver.Packet":646.647,"Driver.Packet.device_lock":9.423,"Driver.Packet.draw":505.553,"Driver.Packet.execute":53.746,"Driver.Packet.flip_flush":0.302,"Driver.Packet.flush_between_packets":14.724,"Driver.Packet.pipeline_drain":12.956,"Driver.Packet.pipeline_prepare":13.956,"Driver.Packet.prepare_memory":13.677,"Driver.Present":120.319,"Driver.Present.acquire_image":2.378,"Driver.Present.device_setup":0.126,"Driver.Present.gpu_mutex_wait":0.408,"Driver.Present.inflight_wait":0.485,"Driver.Present.present_display_buffer":25.210,"Driver.Present.queue_present":87.936,"Driver.Present.release_and_callback":0.248,"Driver.Present.render_fence_wait":3.019,"Driver.Present.resize":0.348,"Driver.Present.validate":0.041,"Driver.Suspend":0.062,"Graphics.Draw":1083.677,"Graphics.Draw.draw_and_resource_release":1031.605,"Graphics.Draw.index_upload":23.532,"Graphics.Draw.validate":21.581,"Graphics.Draw.vertex_upload":2.738,"Graphics.DrawWithRecipe":1018.943,"Graphics.DrawWithRecipe.draw_and_resource_release":965.471,"Graphics.DrawWithRecipe.index_upload":41.525,"Graphics.DrawWithRecipe.validate":6.020,"Graphics.DrawWithRecipe.vertex_upload":2.754,"Recorder.Reap":0.828,"Recorder.Submit":246.457,"Recorder.Sync":4955.487,"Shader.DrawStage":166.689,"Shader.DrawStage.capture_resources":108.123,"Shader.DrawStage.materialize":28.118,"Shader.DrawStage.prepared_invocation":28.179,"VideoOut.Flip":124.641,"VideoOut.Flip.completion_mutex_wait":0.160,"VideoOut.Flip.config_mutex_wait":0.023,"VideoOut.Flip.frame_limit":0.100,"VideoOut.Flip.notify_game":2.594,"VideoOut.Flip.present":120.210,"VideoOut.Flip.validate":0.238,"VideoOut.Flip.vblank_wait":0.128,"VideoOut.Flip.window_prepare":0.278,"VideoOut.Flip.window_title":0.764,"VideoOut.Readiness":0.464,"VideoOut.Readiness.locks_validate":0.162,"Vulkan.Acquire":2.162,"Vulkan.Acquire.acquire_fence_wait":0.399,"Vulkan.Acquire.acquire_image":1.171,"Vulkan.Acquire.fence_reset":0.439,"Vulkan.Acquire.retired_swapchains":0.092,"Vulkan.DrawFromRecipe":1024.852,"Vulkan.Present":19.423,"Vulkan.Present.command_record_scale":7.381,"Vulkan.Present.pixel_upload":0.361,"Vulkan.Present.queue_submit":11.419,"Vulkan.QueuePresent":87.594,"Vulkan.QueuePresent.queue_present":87.148,"Vulkan.Retire":2.935,"Vulkan.Retire.wait":0.678},"top_phases_ms_per_frame":{"Recorder.Sync":23.940,"Graphics.Draw":5.235,"Graphics.Draw.draw_and_resource_release":4.984,"Vulkan.DrawFromRecipe":4.951,"Graphics.DrawWithRecipe":4.922,"Graphics.DrawWithRecipe.draw_and_resource_release":4.664,"Driver.Packet":3.124,"Driver.Packet.draw":2.442},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":21609,"Graphics.Barrier.present-blit":414,"Graphics.Barrier.storage-upload":2484,"Graphics.Barrier.storage-writeback":3726,"Graphics.RenderPass":7203,"Graphics.RenderPass.Close.command":621,"Graphics.RenderPass.Close.new-batch":6582,"Graphics.RenderPass.Continued":8701},"trace_dropped":false,"trace":"aps5-trace-8c254da48beb-25632.json.gz"} {"commit":"682a512644ad","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":2124,"ms":10002.906},"presents":238,"frame_ms":{"p50":41.686,"p90":43.543,"p99":48.510,"max":53.786},"gpu_busy_ms_per_present":14.084,"worker_busy_pct":{"queue worker 0x0":12.450},"phase_totals_ms":{"Driver.Completion":1.254,"Driver.Draw":599.771,"Driver.Draw.device_setup":33.749,"Driver.Draw.draw_enqueued":108.069,"Driver.Draw.post_compile_prepare":7.578,"Driver.Draw.prepare":47.627,"Driver.Draw.shader_compile_and_link":392.304,"Driver.EndSubmission":4.676,"Driver.Packet":1239.389,"Driver.Packet.device_lock":10.581,"Driver.Packet.draw":610.180,"Driver.Packet.execute":516.085,"Driver.Packet.flip_flush":0.373,"Driver.Packet.flush_between_packets":16.595,"Driver.Packet.pipeline_drain":14.392,"Driver.Packet.pipeline_prepare":15.991,"Driver.Packet.prepare_memory":15.352,"Driver.Present":138.516,"Driver.Present.acquire_image":2.711,"Driver.Present.device_setup":0.132,"Driver.Present.gpu_mutex_wait":0.454,"Driver.Present.inflight_wait":0.575,"Driver.Present.present_display_buffer":28.322,"Driver.Present.queue_present":101.999,"Driver.Present.release_and_callback":0.329,"Driver.Present.render_fence_wait":3.155,"Driver.Present.resize":0.420,"Driver.Present.validate":0.063,"Driver.Suspend":0.071,"Graphics.Draw":1579.550,"Graphics.Draw.draw_and_resource_release":1482.167,"Graphics.Draw.index_upload":60.532,"Graphics.Draw.validate":27.542,"Graphics.Draw.vertex_upload":3.850,"Graphics.DrawWithRecipe":1229.728,"Graphics.DrawWithRecipe.draw_and_resource_release":1190.333,"Graphics.DrawWithRecipe.index_upload":28.949,"Graphics.DrawWithRecipe.validate":4.802,"Graphics.DrawWithRecipe.vertex_upload":2.631,"Recorder.Reap":29.608,"Recorder.Submit":248.938,"Recorder.Sync":3032.463,"Shader.DrawStage":227.427,"Shader.DrawStage.capture_resources":147.742,"Shader.DrawStage.materialize":38.964,"Shader.DrawStage.prepared_invocation":37.515,"VideoOut.Flip":142.954,"VideoOut.Flip.completion_mutex_wait":0.208,"VideoOut.Flip.config_mutex_wait":0.025,"VideoOut.Flip.frame_limit":0.128,"VideoOut.Flip.notify_game":2.381,"VideoOut.Flip.present":138.373,"VideoOut.Flip.validate":0.258,"VideoOut.Flip.vblank_wait":0.197,"VideoOut.Flip.window_prepare":0.326,"VideoOut.Flip.window_title":0.899,"VideoOut.Readiness":0.490,"VideoOut.Readiness.locks_validate":0.188,"Vulkan.Acquire":2.488,"Vulkan.Acquire.acquire_fence_wait":0.460,"Vulkan.Acquire.acquire_image":1.341,"Vulkan.Acquire.fence_reset":0.495,"Vulkan.Acquire.retired_swapchains":0.122,"Vulkan.DrawFromRecipe":1234.830,"Vulkan.Present":21.814,"Vulkan.Present.command_record_scale":8.364,"Vulkan.Present.pixel_upload":0.439,"Vulkan.Present.queue_submit":12.716,"Vulkan.QueuePresent":101.617,"Vulkan.QueuePresent.queue_present":100.934,"Vulkan.Retire":3.038,"Vulkan.Retire.wait":0.970},"top_phases_ms_per_frame":{"Recorder.Sync":12.741,"Graphics.Draw":6.637,"Graphics.Draw.draw_and_resource_release":6.228,"Driver.Packet":5.208,"Vulkan.DrawFromRecipe":5.188,"Graphics.DrawWithRecipe":5.167,"Graphics.DrawWithRecipe.draw_and_resource_release":5.001,"Driver.Packet.draw":2.564},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.dcc-clear":952,"Graphics.Barrier.draw":23727,"Graphics.Barrier.present-blit":476,"Graphics.Barrier.storage-upload":1904,"Graphics.Barrier.storage-writeback":4284,"Graphics.RenderPass":7909,"Graphics.RenderPass.Close.command":714,"Graphics.RenderPass.Close.new-batch":7195,"Graphics.RenderPass.Continued":9996},"trace_dropped":false,"trace":"aps5-trace-682a512644ad-25708.json.gz"} {"commit":"8c254da48beb","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":1679,"ms":10029.220},"presents":192,"frame_ms":{"p50":52.005,"p90":53.880,"p99":57.735,"max":57.908},"gpu_busy_ms_per_present":20.278,"worker_busy_pct":{"queue worker 0x0":7.989},"phase_totals_ms":{"Driver.Completion":1.068,"Driver.Draw":532.244,"Driver.Draw.device_setup":29.492,"Driver.Draw.draw_enqueued":108.489,"Driver.Draw.post_compile_prepare":7.020,"Driver.Draw.prepare":41.531,"Driver.Draw.shader_compile_and_link":336.562,"Driver.EndSubmission":98.859,"Driver.Packet":701.252,"Driver.Packet.device_lock":8.827,"Driver.Packet.draw":540.904,"Driver.Packet.execute":56.610,"Driver.Packet.flip_flush":0.293,"Driver.Packet.flush_between_packets":14.203,"Driver.Packet.pipeline_drain":12.097,"Driver.Packet.pipeline_prepare":14.247,"Driver.Packet.prepare_memory":12.798,"Driver.Present":102.237,"Driver.Present.acquire_image":2.208,"Driver.Present.device_setup":0.117,"Driver.Present.gpu_mutex_wait":0.364,"Driver.Present.inflight_wait":0.465,"Driver.Present.present_display_buffer":23.080,"Driver.Present.queue_present":72.701,"Driver.Present.release_and_callback":0.223,"Driver.Present.render_fence_wait":2.582,"Driver.Present.resize":0.330,"Driver.Present.validate":0.059,"Driver.Suspend":0.061,"Graphics.Draw":1174.870,"Graphics.Draw.draw_and_resource_release":1090.476,"Graphics.Draw.index_upload":51.961,"Graphics.Draw.validate":24.123,"Graphics.Draw.vertex_upload":3.386,"Graphics.DrawWithRecipe":839.745,"Graphics.DrawWithRecipe.draw_and_resource_release":795.143,"Graphics.DrawWithRecipe.index_upload":35.460,"Graphics.DrawWithRecipe.validate":4.326,"Graphics.DrawWithRecipe.vertex_upload":2.327,"Recorder.Reap":0.794,"Recorder.Submit":246.157,"Recorder.Sync":4533.574,"Shader.DrawStage":195.984,"Shader.DrawStage.capture_resources":127.284,"Shader.DrawStage.materialize":33.084,"Shader.DrawStage.prepared_invocation":32.967,"VideoOut.Flip":105.839,"VideoOut.Flip.completion_mutex_wait":0.161,"VideoOut.Flip.config_mutex_wait":0.023,"VideoOut.Flip.frame_limit":0.090,"VideoOut.Flip.notify_game":2.004,"VideoOut.Flip.present":102.159,"VideoOut.Flip.validate":0.224,"VideoOut.Flip.vblank_wait":0.121,"VideoOut.Flip.window_prepare":0.256,"VideoOut.Flip.window_title":0.704,"VideoOut.Readiness":0.475,"VideoOut.Readiness.locks_validate":0.154,"Vulkan.Acquire":2.018,"Vulkan.Acquire.acquire_fence_wait":0.385,"Vulkan.Acquire.acquire_image":1.075,"Vulkan.Acquire.fence_reset":0.395,"Vulkan.Acquire.retired_swapchains":0.105,"Vulkan.DrawFromRecipe":844.117,"Vulkan.Present":17.679,"Vulkan.Present.command_record_scale":6.758,"Vulkan.Present.pixel_upload":0.348,"Vulkan.Present.queue_submit":10.322,"Vulkan.QueuePresent":72.390,"Vulkan.QueuePresent.queue_present":71.968,"Vulkan.Retire":2.513,"Vulkan.Retire.wait":0.714},"top_phases_ms_per_frame":{"Recorder.Sync":23.612,"Graphics.Draw":6.119,"Graphics.Draw.draw_and_resource_release":5.680,"Vulkan.DrawFromRecipe":4.396,"Graphics.DrawWithRecipe":4.374,"Graphics.DrawWithRecipe.draw_and_resource_release":4.141,"Driver.Packet":3.652,"Driver.Packet.draw":2.817},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":20106,"Graphics.Barrier.present-blit":384,"Graphics.Barrier.storage-upload":2304,"Graphics.Barrier.storage-writeback":3456,"Graphics.RenderPass":6702,"Graphics.RenderPass.Close.command":576,"Graphics.RenderPass.Close.new-batch":6126,"Graphics.RenderPass.Continued":8045},"trace_dropped":false,"trace":"aps5-trace-8c254da48beb-22124.json.gz"} {"commit":"682a512644ad","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PAD_RECORD":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"80:10"},"gpu":"NVIDIA GeForce RTX 5060 Ti","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz","cpu_threads":12,"memory_mib":32685,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 80:10","first_present":2159,"ms":10018.440},"presents":242,"frame_ms":{"p50":41.059,"p90":42.581,"p99":46.720,"max":48.300},"gpu_busy_ms_per_present":13.389,"worker_busy_pct":{"queue worker 0x0":12.632},"phase_totals_ms":{"Driver.Completion":1.385,"Driver.Draw":609.925,"Driver.Draw.device_setup":34.474,"Driver.Draw.draw_enqueued":110.575,"Driver.Draw.post_compile_prepare":7.915,"Driver.Draw.prepare":48.909,"Driver.Draw.shader_compile_and_link":397.435,"Driver.EndSubmission":4.788,"Driver.Packet":1259.290,"Driver.Packet.device_lock":10.646,"Driver.Packet.draw":620.591,"Driver.Packet.execute":523.970,"Driver.Packet.flip_flush":0.383,"Driver.Packet.flush_between_packets":16.756,"Driver.Packet.pipeline_drain":14.661,"Driver.Packet.pipeline_prepare":16.295,"Driver.Packet.prepare_memory":15.685,"Driver.Present":137.998,"Driver.Present.acquire_image":2.760,"Driver.Present.device_setup":0.144,"Driver.Present.gpu_mutex_wait":0.479,"Driver.Present.inflight_wait":0.613,"Driver.Present.present_display_buffer":28.716,"Driver.Present.queue_present":101.238,"Driver.Present.release_and_callback":0.362,"Driver.Present.render_fence_wait":3.100,"Driver.Present.resize":0.396,"Driver.Present.validate":0.054,"Driver.Suspend":0.073,"Graphics.Draw":1597.391,"Graphics.Draw.draw_and_resource_release":1497.805,"Graphics.Draw.index_upload":62.635,"Graphics.Draw.validate":27.692,"Graphics.Draw.vertex_upload":3.814,"Graphics.DrawWithRecipe":1251.432,"Graphics.DrawWithRecipe.draw_and_resource_release":1212.141,"Graphics.DrawWithRecipe.index_upload":28.809,"Graphics.DrawWithRecipe.validate":4.811,"Graphics.DrawWithRecipe.vertex_upload":2.587,"Recorder.Reap":30.385,"Recorder.Submit":253.103,"Recorder.Sync":2907.257,"Shader.DrawStage":229.842,"Shader.DrawStage.capture_resources":150.003,"Shader.DrawStage.materialize":39.461,"Shader.DrawStage.prepared_invocation":37.282,"VideoOut.Flip":142.418,"VideoOut.Flip.completion_mutex_wait":0.214,"VideoOut.Flip.config_mutex_wait":0.031,"VideoOut.Flip.frame_limit":0.112,"VideoOut.Flip.notify_game":2.236,"VideoOut.Flip.present":137.993,"VideoOut.Flip.validate":0.275,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.361,"VideoOut.Flip.window_title":0.900,"VideoOut.Readiness":0.506,"VideoOut.Readiness.locks_validate":0.199,"Vulkan.Acquire":2.523,"Vulkan.Acquire.acquire_fence_wait":0.476,"Vulkan.Acquire.acquire_image":1.357,"Vulkan.Acquire.fence_reset":0.500,"Vulkan.Acquire.retired_swapchains":0.119,"Vulkan.DrawFromRecipe":1256.633,"Vulkan.Present":22.007,"Vulkan.Present.command_record_scale":8.570,"Vulkan.Present.pixel_upload":0.453,"Vulkan.Present.queue_submit":12.678,"Vulkan.QueuePresent":100.862,"Vulkan.QueuePresent.queue_present":100.138,"Vulkan.Retire":3.005,"Vulkan.Retire.wait":0.733},"top_phases_ms_per_frame":{"Recorder.Sync":12.013,"Graphics.Draw":6.601,"Graphics.Draw.draw_and_resource_release":6.189,"Driver.Packet":5.204,"Vulkan.DrawFromRecipe":5.193,"Graphics.DrawWithRecipe":5.171,"Graphics.DrawWithRecipe.draw_and_resource_release":5.009,"Driver.Packet.draw":2.564},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.dcc-clear":968,"Graphics.Barrier.draw":24039,"Graphics.Barrier.present-blit":484,"Graphics.Barrier.storage-upload":1936,"Graphics.Barrier.storage-writeback":4356,"Graphics.RenderPass":8013,"Graphics.RenderPass.Close.command":726,"Graphics.RenderPass.Close.new-batch":7287,"Graphics.RenderPass.Continued":10164},"trace_dropped":false,"trace":"aps5-trace-682a512644ad-25708.json.gz"} ``` ### Traces GitHub does not let me attach files from the command line, so the four traces (run order main-r1, stack-r1, main-r2, stack-r2, one session) are assets of a release on my fork: - [main-r1-aps5-trace-8c254da48beb-25632.json.gz](https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/main-r1-aps5-trace-8c254da48beb-25632.json.gz) - [stack-r1-aps5-trace-682a512644ad-25708.json.gz](https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/stack-r1-aps5-trace-682a512644ad-25708.json.gz) - [main-r2-aps5-trace-8c254da48beb-22124.json.gz](https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/main-r2-aps5-trace-8c254da48beb-22124.json.gz) - [stack-r2-aps5-trace-682a512644ad-25708.json.gz](https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/stack-r2-aps5-trace-682a512644ad-25708.json.gz) The full digests and the four summary lines are in the same release ([summary-lines.jsonl](https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/summary-lines.jsonl)). ### Digest <details><summary>main-r1 (<a href="https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/digest-main-r1.txt">full digest</a>)</summary> **seconds 80:10** from present 1737: 207 presents, frame p50 48.3 / p90 49.9 / p99 53.8 / max 57.2 ms, GPU busy 20.7 ms per present NVIDIA GeForce RTX 5060 Ti, NVIDIA 621.24, Windows 10.0.26300, 1920x1080, commit 8c254da48beb, dropped: no **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 2.1 (4 %) | 45.0 (93 %) | 1.3 | 4.6 | Driver.Packet 2.1, VideoOut.Readiness 0.0 | | draw committer | 34.1 (70 %) | 0.0 (0 %) | 14.4 | 0.3 | Recorder.Sync 23.9, Graphics.Draw 5.2 | | presenter | 0.6 (1 %) | 0.0 (0 %) | 47.9 | 0.1 | VideoOut.Flip 0.6, Driver.Present 0.0 | | gpu | 20.7 (43 %) | 0.0 (0 %) | 27.8 | 0.0 | batch 20.7 | </details> <details><summary>stack-r1 (<a href="https://github.com/LeandroLP23/AnyPS5/releases/download/perf-traces-stk-label-chain-20261122/digest-stack-r1.txt">full digest</a>)</summary> **seconds 80:10** from present 2124: 238 presents, frame p50 41.7 / p90 43.5 / p99 48.5 / max 53.8 ms, GPU busy 14.1 ms per present NVIDIA GeForce RTX 5060 Ti, NVIDIA 621.24, Windows 10.0.26300, 1920x1080, commit 682a512644ad, dropped: no **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 4.3 (10 %) | 36.5 (87 %) | 1.2 | 4.4 | Driver.Packet 4.3 | | draw committer | 25.3 (60 %) | 0.0 (0 %) | 16.7 | 0.4 | Recorder.Sync 12.7, Graphics.Draw 6.6 | | presenter | 0.6 (1 %) | 0.0 (0 %) | 41.4 | 0.1 | VideoOut.Flip 0.6, Driver.Present 0.0 | | gpu | 14.1 (34 %) | 0.0 (0 %) | 27.9 | 0.0 | batch 14.1 | </details> ### Capture - [x] The caches were warm (`title_run.py --profile performance`: a 110 s warm-up run of the same route, then a restart and the capture) - [x] No other APS5_TRACE_* or APS5_PROFILE_* switch was set and the log was not redirected (the performance profile cleans the environment and writes to the console) - [x] Captures compared here come from the same machine, scene and settings <details><summary>Pad timeline (race-pad.json)</summary> ```json {"after_s": 40, "events": [{"at_ms": 0, "hold_ms": 150, "buttons": [], "left_stick": [255, 128]}, {"at_ms": 1500, "hold_ms": 200, "buttons": ["cross"]}, {"at_ms": 30000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 35000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 40000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 45000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 50000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 55000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 60000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 65000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 70000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 75000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 80000, "hold_ms": 4800, "buttons": ["cross"]}, {"at_ms": 85000, "hold_ms": 4800, "buttons": ["cross"]}]} ``` </details> AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#25912
No description provided.