perf(agc): retile linear write-backs into host-memory imports on request #21536

Merged
LloydNicholson merged 1 commit from upstream-pr/21536 into main 2026-11-19 09:14:29 +00:00
LloydNicholson commented 2026-11-16 11:14:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LloydNicholson on 2026-11-16T11:14:43Z.


What

A whole-layer write-back of a linear storage image into a host import retiles into device scratch and then copies the rows into the import with vkCmdCopyBuffer, unless the import is in a device-local heap (unified memory), where it retiles into the import directly. For linear rows the retile writes the same bytes to the import as the copy, so on a discrete GPU the direct route moves no more data over the bus and drops the scratch buffer, a barrier and a vkCmdCopyBuffer per write-back. RADV looks up its copy pipeline for every region (vk_meta_get_pipeline_layout, memcmp of the key), which showed up on the draw committer.

  • APS5_LINEAR_IMPORT_RETILE_HOST=1 lets such write-backs retile into a host-memory import as well. Off by default; documented in docs/dev/ENVIRONMENT.md.
  • With APS5_PIPELINE_STATS, an [import-writeback] line counts import write-backs by route every 10 s: retiled into the import, eligible but copied (host-memory import), other.
  • agc_storage_write_back_host_retile runs the storage write-back test with the switch on, and the test's route expectations account for it.

On the Astro Bot world map the committer was the busiest thread (about 84 % of 10 s). With APS5_PIPELINE_STATS=2 (separate runs, not the captures below): about 1,200 of 2,300 import write-backs per 10 s took the scratch route and were eligible; with the switch, all of them retiled directly, end-of-pipe commits went from 27-31 to about 22 us each and draw commits from 52-58 to 46-49 us each on the committer.

Tested

Linux 7.3.4 (Nobara, Fedora 44), AMD Radeon RX 9060 XT (RADV GFX1200, Mesa 27.0.0-devel), Ryzen 7 5700X.

Astro Bot (PPSA21564), world map, standing at the same spot, warm caches, APS5_TRACE_SECONDS=180:20, no other APS5_TRACE_* or APS5_PROFILE_* switch, log not redirected. Both captures come from the same session and the same converted title, both with APS5_LINEAR_IMPORT_RETILE_HOST=1 set (main does not read it), so the summary lines differ only in commit; only libSceAgcDriver.prx differs between the runs.

main e4caa07950f8 this PR 023ea7bc27df
presents in 20 s 261 313
frame p50 / p90 / p99 / max 76.5 / 81.0 / 88.3 / 91.7 ms 63.7 / 67.5 / 71.9 / 134.6 ms
GPU busy per present 47.0 ms 41.7 ms

An earlier capture of main in the same session without the variable gave 276 presents, p50 / p90 / p99 / max 72.5 / 76.1 / 78.2 / 81.1 ms (aps5-trace-e4caa07950f8-3424790.json.gz), so the gain is 13-20 % depending on which main capture it is compared with. The 134.6 ms maximum is the first present of the window (present 3549, at 0 ms). All traces filled the queue worker's and the committer's event buffers before the window closed (dropped: yes); the summary statistics are unaffected.

Summary lines:

{"commit":"e4caa07950f8","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3071,"ms":20029.127},"presents":261,"frame_ms":{"p50":76.534,"p90":81.005,"p99":88.268,"max":91.671},"gpu_busy_ms_per_present":47.034,"worker_busy_pct":{"queue worker 0x0":97.628,"queue worker 0x40":99.673,"queue worker 0x48":95.479,"queue worker 0x3a":0.000,"queue worker 0x46":1.544},"phase_totals_ms":{"Driver.Completion":21.882,"Driver.Dispatch":4351.050,"Driver.Dispatch.capture_resources":242.311,"Driver.Dispatch.decode_key_device_setup":76.195,"Driver.Dispatch.lookup_cache":66.416,"Driver.Dispatch.materialize":10.756,"Driver.Dispatch.prepared_invocation":7.763,"Driver.Draw":9554.086,"Driver.Draw.device_setup":343.425,"Driver.Draw.draw_enqueued":2820.729,"Driver.Draw.post_compile_prepare":68.003,"Driver.Draw.prepare":640.909,"Driver.Draw.shader_compile_and_link":5018.181,"Driver.EndSubmission":1108.900,"Driver.Packet":57818.602,"Driver.Packet.device_lock":54.446,"Driver.Packet.dispatch":8999.863,"Driver.Packet.draw":9613.739,"Driver.Packet.execute":583.089,"Driver.Packet.flip_flush":37.028,"Driver.Packet.flush_between_packets":672.974,"Driver.Packet.memory_wait":33240.328,"Driver.Packet.pipeline_drain":335.032,"Driver.Packet.pipeline_prepare":89.920,"Driver.Packet.prepare_memory":1516.777,"Driver.Packet.rendering_wait":0.291,"Driver.Present":1852.170,"Driver.Present.acquire_image":14.640,"Driver.Present.device_setup":0.181,"Driver.Present.gpu_mutex_wait":0.554,"Driver.Present.inflight_wait":0.684,"Driver.Present.present_display_buffer":57.700,"Driver.Present.queue_present":8.850,"Driver.Present.release_and_callback":0.296,"Driver.Present.render_fence_wait":1768.526,"Driver.Present.resize":0.406,"Driver.Present.validate":0.083,"Driver.Suspend":1.246,"GpuMutex.wait.dispatch":1481.301,"GpuMutex.wait.draw":2290.818,"GpuMutex.wait.end":465.409,"GpuMutex.wait.fill":50.277,"GpuMutex.wait.flush":72.353,"GpuMutex.wait.hook":33.554,"GpuMutex.wait.indirect":19.311,"GpuMutex.wait.label":787.801,"GpuMutex.wait.present":0.048,"GpuMutex.wait.wait":1158.216,"Graphics.Draw":6460.633,"Graphics.Draw.draw_and_resource_release":5462.224,"Graphics.Draw.index_upload":275.925,"Graphics.Draw.validate":442.989,"Graphics.Draw.vertex_upload":214.226,"Graphics.DrawWithRecipe":702.809,"Graphics.DrawWithRecipe.draw_and_resource_release":670.852,"Graphics.DrawWithRecipe.index_upload":4.654,"Graphics.DrawWithRecipe.validate":10.299,"Graphics.DrawWithRecipe.vertex_upload":12.611,"Recorder.Reap":646.573,"Recorder.Submit":4330.728,"Recorder.WaitSerial":1868.865,"Resources.Complete":154.411,"Resources.Prepare":112.632,"Shader.DrawStage":3555.456,"Shader.DrawStage.capture_resources":2643.030,"Shader.DrawStage.materialize":538.096,"Shader.DrawStage.prepared_invocation":348.253,"Shader.ResolveAbi":57.945,"Shader.ResolveGraphicsAbi":22.346,"Shader.ResolveGraphicsStagesAbi":200.393,"VideoOut.Flip":1856.265,"VideoOut.Flip.completion_mutex_wait":0.216,"VideoOut.Flip.config_mutex_wait":0.015,"VideoOut.Flip.frame_limit":0.146,"VideoOut.Flip.notify_game":1.874,"VideoOut.Flip.present":1849.125,"VideoOut.Flip.validate":0.334,"VideoOut.Flip.vblank_wait":0.207,"VideoOut.Flip.window_prepare":0.374,"VideoOut.Flip.window_title":3.852,"VideoOut.Readiness":0.486,"VideoOut.Readiness.locks_validate":0.287,"Vulkan.Acquire":14.173,"Vulkan.Acquire.acquire_fence_wait":0.746,"Vulkan.Acquire.acquire_image":11.324,"Vulkan.Acquire.fence_reset":1.832,"Vulkan.Acquire.retired_swapchains":0.156,"Vulkan.Dispatch":1041.802,"Vulkan.Dispatch.command_record":164.612,"Vulkan.Dispatch.shader_resources":870.203,"Vulkan.DispatchRecipe":88.228,"Vulkan.DispatchRecipe.command_record":87.532,"Vulkan.DrawFromRecipe":708.775,"Vulkan.Present":51.298,"Vulkan.Present.command_record_scale":7.506,"Vulkan.Present.pixel_upload":0.797,"Vulkan.Present.queue_submit":42.756,"Vulkan.QueuePresent":8.408,"Vulkan.QueuePresent.queue_present":8.148,"Vulkan.Retire":1768.321,"Vulkan.Retire.wait":1763.639},"top_phases_ms_per_frame":{"Driver.Packet":221.527,"Driver.Packet.memory_wait":127.358,"Driver.Packet.draw":36.834,"Driver.Draw":36.606,"Driver.Packet.dispatch":34.482,"Graphics.Draw":24.753,"Graphics.Draw.draw_and_resource_release":20.928,"Driver.Draw.shader_compile_and_link":19.227},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3138,"Graphics.Barrier.dcc-clear":3132,"Graphics.Barrier.dcc-keys":3132,"Graphics.Barrier.dispatch-lead":17828,"Graphics.Barrier.dispatch-trail":22707,"Graphics.Barrier.draw":56952,"Graphics.Barrier.fill":8194,"Graphics.Barrier.fill-clear":3654,"Graphics.Barrier.indirect-args":1827,"Graphics.Barrier.label-run":179184,"Graphics.Barrier.present-blit":522,"Graphics.Barrier.shadow-publish":1566,"Graphics.Barrier.staging-in":12263,"Graphics.Barrier.staging-out":5481,"Graphics.Barrier.storage-upload":9934,"Graphics.Barrier.storage-writeback":43327,"Graphics.BarrierMerged.dispatch-lead":8533,"Graphics.BarrierMerged.fill":2676,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1044,"Graphics.BarrierMerged.staging-in":4180,"Graphics.BarrierMerged.staging-out":5481,"Graphics.BarrierMerged.storage-writeback":7215,"Graphics.Copy":24534,"Graphics.Copy.bytes":13919077800,"Graphics.RenderPass":23925,"Graphics.RenderPass.Close.command":10403,"Graphics.RenderPass.Close.image":2863,"Graphics.RenderPass.Close.key":1282,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":9355,"Graphics.RenderPass.Continued":171267},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.862,"events_lost":413552,"totals_full":false},"draw committer":{"events_full_after_s":17.394,"events_lost":40772,"totals_full":false}},"trace":"aps5-trace-e4caa07950f8-3542653.json.gz"}
{"commit":"023ea7bc27df","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3549,"ms":20055.840},"presents":313,"frame_ms":{"p50":63.666,"p90":67.525,"p99":71.905,"max":134.637},"gpu_busy_ms_per_present":41.747,"worker_busy_pct":{"queue worker 0x0":96.887,"queue worker 0x40":99.328,"queue worker 0x48":90.951,"queue worker 0x3a":0.000,"queue worker 0x46":1.860},"phase_totals_ms":{"Driver.Completion":19.988,"Driver.Dispatch":3341.741,"Driver.Dispatch.capture_resources":263.593,"Driver.Dispatch.decode_key_device_setup":90.177,"Driver.Dispatch.lookup_cache":78.855,"Driver.Dispatch.materialize":10.151,"Driver.Dispatch.prepared_invocation":7.457,"Driver.Draw":9552.685,"Driver.Draw.device_setup":360.824,"Driver.Draw.draw_enqueued":2695.294,"Driver.Draw.post_compile_prepare":73.116,"Driver.Draw.prepare":627.499,"Driver.Draw.shader_compile_and_link":4987.354,"Driver.EndSubmission":560.443,"Driver.Packet":57385.715,"Driver.Packet.device_lock":61.609,"Driver.Packet.dispatch":7260.549,"Driver.Packet.draw":9618.792,"Driver.Packet.execute":662.086,"Driver.Packet.flip_flush":45.921,"Driver.Packet.flush_between_packets":424.435,"Driver.Packet.memory_wait":34118.030,"Driver.Packet.pipeline_drain":409.582,"Driver.Packet.pipeline_prepare":105.663,"Driver.Packet.prepare_memory":1766.594,"Driver.Packet.rendering_wait":0.345,"Driver.Present":1641.536,"Driver.Present.acquire_image":16.899,"Driver.Present.device_setup":0.196,"Driver.Present.gpu_mutex_wait":0.584,"Driver.Present.inflight_wait":0.847,"Driver.Present.present_display_buffer":69.753,"Driver.Present.queue_present":10.639,"Driver.Present.release_and_callback":0.355,"Driver.Present.render_fence_wait":1541.420,"Driver.Present.resize":0.445,"Driver.Present.validate":0.107,"Driver.Suspend":0.266,"GpuMutex.wait.dispatch":822.622,"GpuMutex.wait.draw":1437.443,"GpuMutex.wait.end":240.771,"GpuMutex.wait.fill":60.644,"GpuMutex.wait.flush":80.024,"GpuMutex.wait.hook":39.562,"GpuMutex.wait.indirect":21.754,"GpuMutex.wait.label":558.407,"GpuMutex.wait.present":0.015,"GpuMutex.wait.wait":228.239,"Graphics.Draw":6997.017,"Graphics.Draw.draw_and_resource_release":5915.613,"Graphics.Draw.index_upload":322.737,"Graphics.Draw.validate":448.154,"Graphics.Draw.vertex_upload":241.178,"Graphics.DrawWithRecipe":1230.244,"Graphics.DrawWithRecipe.draw_and_resource_release":1167.807,"Graphics.DrawWithRecipe.index_upload":10.923,"Graphics.DrawWithRecipe.validate":20.575,"Graphics.DrawWithRecipe.vertex_upload":23.073,"Recorder.Reap":759.054,"Recorder.Submit":5104.127,"Recorder.WaitSerial":1591.060,"Resources.Complete":164.995,"Resources.Prepare":123.797,"Shader.DrawStage":3415.969,"Shader.DrawStage.capture_resources":2515.907,"Shader.DrawStage.materialize":528.947,"Shader.DrawStage.prepared_invocation":345.041,"Shader.ResolveAbi":66.304,"Shader.ResolveGraphicsAbi":22.748,"Shader.ResolveGraphicsStagesAbi":240.248,"VideoOut.Flip":1653.963,"VideoOut.Flip.completion_mutex_wait":0.277,"VideoOut.Flip.config_mutex_wait":0.020,"VideoOut.Flip.frame_limit":0.173,"VideoOut.Flip.notify_game":5.842,"VideoOut.Flip.present":1641.474,"VideoOut.Flip.validate":0.391,"VideoOut.Flip.vblank_wait":0.244,"VideoOut.Flip.window_prepare":0.433,"VideoOut.Flip.window_title":4.930,"VideoOut.Readiness":0.573,"VideoOut.Readiness.locks_validate":0.340,"Vulkan.Acquire":16.347,"Vulkan.Acquire.acquire_fence_wait":0.770,"Vulkan.Acquire.acquire_image":12.907,"Vulkan.Acquire.fence_reset":2.269,"Vulkan.Acquire.retired_swapchains":0.262,"Vulkan.Dispatch":1172.550,"Vulkan.Dispatch.command_record":192.052,"Vulkan.Dispatch.shader_resources":972.647,"Vulkan.DispatchRecipe":107.530,"Vulkan.DispatchRecipe.command_record":106.719,"Vulkan.DrawFromRecipe":1241.091,"Vulkan.Present":62.058,"Vulkan.Present.command_record_scale":9.033,"Vulkan.Present.pixel_upload":0.734,"Vulkan.Present.queue_submit":51.992,"Vulkan.QueuePresent":10.131,"Vulkan.QueuePresent.queue_present":9.847,"Vulkan.Retire":1541.204,"Vulkan.Retire.wait":1536.251},"top_phases_ms_per_frame":{"Driver.Packet":183.341,"Driver.Packet.memory_wait":109.003,"Driver.Packet.draw":30.731,"Driver.Draw":30.520,"Driver.Packet.dispatch":23.197,"Graphics.Draw":22.355,"Graphics.Draw.draw_and_resource_release":18.900,"Recorder.Submit":16.307},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3762,"Graphics.Barrier.dcc-clear":3756,"Graphics.Barrier.dcc-keys":3756,"Graphics.Barrier.dispatch-lead":21396,"Graphics.Barrier.dispatch-trail":27226,"Graphics.Barrier.draw":66256,"Graphics.Barrier.fill":9751,"Graphics.Barrier.fill-clear":4382,"Graphics.Barrier.indirect-args":2191,"Graphics.Barrier.label-run":214061,"Graphics.Barrier.present-blit":626,"Graphics.Barrier.shadow-publish":1878,"Graphics.Barrier.staging-in":14710,"Graphics.Barrier.staging-out":6568,"Graphics.Barrier.storage-upload":11894,"Graphics.Barrier.storage-writeback":48828,"Graphics.BarrierMerged.dispatch-lead":10212,"Graphics.BarrierMerged.fill":3233,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1252,"Graphics.BarrierMerged.staging-in":4994,"Graphics.BarrierMerged.staging-out":6568,"Graphics.BarrierMerged.storage-writeback":8686,"Graphics.Copy":29406,"Graphics.Copy.bytes":16683375944,"Graphics.RenderPass":27893,"Graphics.RenderPass.Close.command":12441,"Graphics.RenderPass.Close.image":3433,"Graphics.RenderPass.Close.key":1550,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":10443,"Graphics.RenderPass.Continued":201751},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.337,"events_lost":446066,"totals_full":false},"draw committer":{"events_full_after_s":15.119,"events_lost":85073,"totals_full":false}},"trace":"aps5-trace-023ea7bc27df-3434660.json.gz"}

Traces (attached in a comment): aps5-trace-e4caa07950f8-3542653.json.gz (main), aps5-trace-023ea7bc27df-3434660.json.gz (this PR), and the earlier main capture aps5-trace-e4caa07950f8-3424790.json.gz.

tools/trace_digest.py, main e4caa07950f8

seconds 180:20 from present 3071: 261 presents, frame p50 76.5 / p90 81.0 / p99 88.3 / max 91.7 ms, GPU busy 47.0 ms per present
AMD Radeon RX 9060 XT (RADV GFX1200), radv Mesa 27.0.0-devel, Linux 7.3.4-201.nobara.fc44.x86_64, 3840x2160, commit e4caa07950, dropped: yes

{"commit":"e4caa07950f8","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3071,"ms":20029.127},"presents":261,"frame_ms":{"p50":76.534,"p90":81.005,"p99":88.268,"max":91.671},"gpu_busy_ms_per_present":47.034,"worker_busy_pct":{"queue worker 0x0":97.628,"queue worker 0x40":99.673,"queue worker 0x48":95.479,"queue worker 0x3a":0.0,"queue worker 0x46":1.544},"phase_totals_ms":{"Driver.Completion":21.882,"Driver.Dispatch":4351.05,"Driver.Dispatch.capture_resources":242.311,"Driver.Dispatch.decode_key_device_setup":76.195,"Driver.Dispatch.lookup_cache":66.416,"Driver.Dispatch.materialize":10.756,"Driver.Dispatch.prepared_invocation":7.763,"Driver.Draw":9554.086,"Driver.Draw.device_setup":343.425,"Driver.Draw.draw_enqueued":2820.729,"Driver.Draw.post_compile_prepare":68.003,"Driver.Draw.prepare":640.909,"Driver.Draw.shader_compile_and_link":5018.181,"Driver.EndSubmission":1108.9,"Driver.Packet":57818.602,"Driver.Packet.device_lock":54.446,"Driver.Packet.dispatch":8999.863,"Driver.Packet.draw":9613.739,"Driver.Packet.execute":583.089,"Driver.Packet.flip_flush":37.028,"Driver.Packet.flush_between_packets":672.974,"Driver.Packet.memory_wait":33240.328,"Driver.Packet.pipeline_drain":335.032,"Driver.Packet.pipeline_prepare":89.92,"Driver.Packet.prepare_memory":1516.777,"Driver.Packet.rendering_wait":0.291,"Driver.Present":1852.17,"Driver.Present.acquire_image":14.64,"Driver.Present.device_setup":0.181,"Driver.Present.gpu_mutex_wait":0.554,"Driver.Present.inflight_wait":0.684,"Driver.Present.present_display_buffer":57.7,"Driver.Present.queue_present":8.85,"Driver.Present.release_and_callback":0.296,"Driver.Present.render_fence_wait":1768.526,"Driver.Present.resize":0.406,"Driver.Present.validate":0.083,"Driver.Suspend":1.246,"GpuMutex.wait.dispatch":1481.301,"GpuMutex.wait.draw":2290.818,"GpuMutex.wait.end":465.409,"GpuMutex.wait.fill":50.277,"GpuMutex.wait.flush":72.353,"GpuMutex.wait.hook":33.554,"GpuMutex.wait.indirect":19.311,"GpuMutex.wait.label":787.801,"GpuMutex.wait.present":0.048,"GpuMutex.wait.wait":1158.216,"Graphics.Draw":6460.633,"Graphics.Draw.draw_and_resource_release":5462.224,"Graphics.Draw.index_upload":275.925,"Graphics.Draw.validate":442.989,"Graphics.Draw.vertex_upload":214.226,"Graphics.DrawWithRecipe":702.809,"Graphics.DrawWithRecipe.draw_and_resource_release":670.852,"Graphics.DrawWithRecipe.index_upload":4.654,"Graphics.DrawWithRecipe.validate":10.299,"Graphics.DrawWithRecipe.vertex_upload":12.611,"Recorder.Reap":646.573,"Recorder.Submit":4330.728,"Recorder.WaitSerial":1868.865,"Resources.Complete":154.411,"Resources.Prepare":112.632,"Shader.DrawStage":3555.456,"Shader.DrawStage.capture_resources":2643.03,"Shader.DrawStage.materialize":538.096,"Shader.DrawStage.prepared_invocation":348.253,"Shader.ResolveAbi":57.945,"Shader.ResolveGraphicsAbi":22.346,"Shader.ResolveGraphicsStagesAbi":200.393,"VideoOut.Flip":1856.265,"VideoOut.Flip.completion_mutex_wait":0.216,"VideoOut.Flip.config_mutex_wait":0.015,"VideoOut.Flip.frame_limit":0.146,"VideoOut.Flip.notify_game":1.874,"VideoOut.Flip.present":1849.125,"VideoOut.Flip.validate":0.334,"VideoOut.Flip.vblank_wait":0.207,"VideoOut.Flip.window_prepare":0.374,"VideoOut.Flip.window_title":3.852,"VideoOut.Readiness":0.486,"VideoOut.Readiness.locks_validate":0.287,"Vulkan.Acquire":14.173,"Vulkan.Acquire.acquire_fence_wait":0.746,"Vulkan.Acquire.acquire_image":11.324,"Vulkan.Acquire.fence_reset":1.832,"Vulkan.Acquire.retired_swapchains":0.156,"Vulkan.Dispatch":1041.802,"Vulkan.Dispatch.command_record":164.612,"Vulkan.Dispatch.shader_resources":870.203,"Vulkan.DispatchRecipe":88.228,"Vulkan.DispatchRecipe.command_record":87.532,"Vulkan.DrawFromRecipe":708.775,"Vulkan.Present":51.298,"Vulkan.Present.command_record_scale":7.506,"Vulkan.Present.pixel_upload":0.797,"Vulkan.Present.queue_submit":42.756,"Vulkan.QueuePresent":8.408,"Vulkan.QueuePresent.queue_present":8.148,"Vulkan.Retire":1768.321,"Vulkan.Retire.wait":1763.639},"top_phases_ms_per_frame":{"Driver.Packet":221.527,"Driver.Packet.memory_wait":127.358,"Driver.Packet.draw":36.834,"Driver.Draw":36.606,"Driver.Packet.dispatch":34.482,"Graphics.Draw":24.753,"Graphics.Draw.draw_and_resource_release":20.928,"Driver.Draw.shader_compile_and_link":19.227},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3138,"Graphics.Barrier.dcc-clear":3132,"Graphics.Barrier.dcc-keys":3132,"Graphics.Barrier.dispatch-lead":17828,"Graphics.Barrier.dispatch-trail":22707,"Graphics.Barrier.draw":56952,"Graphics.Barrier.fill":8194,"Graphics.Barrier.fill-clear":3654,"Graphics.Barrier.indirect-args":1827,"Graphics.Barrier.label-run":179184,"Graphics.Barrier.present-blit":522,"Graphics.Barrier.shadow-publish":1566,"Graphics.Barrier.staging-in":12263,"Graphics.Barrier.staging-out":5481,"Graphics.Barrier.storage-upload":9934,"Graphics.Barrier.storage-writeback":43327,"Graphics.BarrierMerged.dispatch-lead":8533,"Graphics.BarrierMerged.fill":2676,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1044,"Graphics.BarrierMerged.staging-in":4180,"Graphics.BarrierMerged.staging-out":5481,"Graphics.BarrierMerged.storage-writeback":7215,"Graphics.Copy":24534,"Graphics.Copy.bytes":13919077800,"Graphics.RenderPass":23925,"Graphics.RenderPass.Close.command":10403,"Graphics.RenderPass.Close.image":2863,"Graphics.RenderPass.Close.key":1282,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":9355,"Graphics.RenderPass.Continued":171267},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.862,"events_lost":413552,"totals_full":false},"draw committer":{"events_full_after_s":17.394,"events_lost":40772,"totals_full":false}},"trace":"aps5-trace-e4caa07950f8-3542653.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 413552 events lost; buffer full at 7862.4 ms
  • draw committer: 40772 events lost; buffer full at 17393.6 ms

Slowest frames (largest slices inside each, inclusive)

  • present 3299: 91.7 ms at 17483 ms: Driver.Packet (queue worker 0x40) 91.0, Driver.WorkerWait (queue worker 0x46) 90.5, Driver.Packet.memory_wait (queue worker 0x40) 80.9, Driver.Packet (queue worker 0x48) 80.4
  • present 3098: 91.2 ms at 2079 ms: Driver.Packet (queue worker 0x40) 90.5, Driver.WorkerWait (queue worker 0x46) 89.8, Driver.Packet (queue worker 0x0) 83.1, Driver.Packet.memory_wait (queue worker 0x40) 80.4
  • present 3287: 88.3 ms at 16546 ms: Driver.Packet (queue worker 0x40) 87.4, Driver.WorkerWait (queue worker 0x46) 87.1, Driver.Packet.memory_wait (queue worker 0x40) 77.9, Driver.Packet (queue worker 0x48) 77.2
  • present 3301: 86.3 ms at 17655 ms: Driver.WorkerWait (queue worker 0x46) 85.0, Driver.Packet (queue worker 0x40) 84.7, Driver.Packet.memory_wait (queue worker 0x40) 73.6, Driver.Packet (queue worker 0x48) 73.2
  • present 3100: 85.7 ms at 2256 ms: Driver.Packet (queue worker 0x40) 84.8, Driver.WorkerWait (queue worker 0x46) 84.3, Driver.Packet (queue worker 0x0) 77.1, Driver.Packet.memory_wait (queue worker 0x40) 75.0

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 3299: 91.7 ms at 17483 ms, persistence 23.7 ms
  • present 3098: 91.2 ms at 2079 ms, persistence 22.3 ms
  • present 3287: 88.3 ms at 16546 ms, persistence 15.4 ms
  • present 3173: 84.1 ms at 7845 ms, persistence 14.1 ms
  • present 3075: 84.9 ms at 308 ms, persistence 14.0 ms
  • present 3309: 83.7 ms at 18285 ms, persistence 12.2 ms
  • present 3130: 84.7 ms at 4607 ms, persistence 11.5 ms
  • present 3262: 81.3 ms at 14667 ms, persistence 10.8 ms
  • present 3178: 84.0 ms at 8231 ms, persistence 10.5 ms
  • present 3166: 81.1 ms at 7317 ms, persistence 10.3 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 26.8 (35 %) 0.5 (1 %) 49.4 17.7 Driver.Packet 26.8, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 76.7 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 76.7 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 76.7 0.1 Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 11.1 (15 %) 65.6 0.6 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x40 7.8 (10 %) 68.3 (89 %) 0.6 2.2 Driver.Packet 75.8, Driver.EndSubmission 0.3
queue worker 0x48 6.2 (8 %) 70.2 (92 %) 0.3 0.2 Driver.Packet 69.5, Driver.EndSubmission 3.7
draw committer 33.0 (43 %) 9.8 (13 %) 33.9 10.4 Graphics.Draw 19.7, Recorder.Submit 10.8
presenter 0.4 (0 %) 6.8 (9 %) 69.6 0.0 VideoOut.Flip 7.1, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 76.7 0.1 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x46 0.9 (1 %) 75.4 (98 %) 0.4 0.8 Driver.Packet 0.8, Driver.EndSubmission 0.2
title 0.0 (0 %) 0.0 (0 %) 76.7 0.0
gpu 47.0 (61 %) 0.0 (0 %) 29.7 0.0 batch 47.0

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 173.0, Driver.Packet.memory_wait 127.3, Driver.WorkerWait 79.0, Driver.WorkerWait.dequeue_order 63.6, batch 47.0, Driver.Packet.dispatch 20.7, Graphics.Draw 19.7, Graphics.Draw.draw_and_resource_release 15.5, Driver.WorkerWait.idle_and_completion_poll 15.4, Recorder.Submit 14.8

Longest waits

  • Driver.WorkerWait (queue worker 0x46) 120.4 ms at 16194 ms, present 3282
  • Driver.WorkerWait (queue worker 0x46) 110.8 ms at 11681 ms, present 3222
  • Driver.WorkerWait (queue worker 0x46) 108.0 ms at 7055 ms, present 3162
  • Driver.WorkerWait (queue worker 0x46) 90.4 ms at 17484 ms, present 3299
  • Driver.WorkerWait (queue worker 0x46) 89.7 ms at 2081 ms, present 3098
  • Driver.WorkerWait (queue worker 0x46) 87.1 ms at 16547 ms, present 3287
  • Driver.WorkerWait (queue worker 0x46) 84.9 ms at 17657 ms, present 3301
  • Driver.WorkerWait (queue worker 0x46) 84.3 ms at 2258 ms, present 3100
  • Driver.WorkerWait (queue worker 0x46) 84.3 ms at 2172 ms, present 3099
  • Driver.WorkerWait (queue worker 0x46) 83.6 ms at 309 ms, present 3075

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 29613: 5.6 ms at 18823 ms, present 3316: GPU no ranges; recorded by no CPU slices
  • batch 30323: 5.6 ms at 19285 ms, present 3322: GPU no ranges; recorded by no CPU slices
  • batch 13509: 5.6 ms at 8555 ms, present 3182: GPU no ranges; recorded by no CPU slices
  • batch 6708: 5.6 ms at 4304 ms, present 3126: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 34.1, Driver.Packet.dispatch (queue worker 0x0) 16.7, Driver.Packet.draw (queue worker 0x0) 15.0, Driver.Draw (queue worker 0x0) 14.9
  • batch 17620: 5.6 ms at 11193 ms, present 3216: GPU no ranges; recorded by no CPU slices
tools/trace_digest.py, this PR 023ea7bc27df

seconds 180:20 from present 3549: 313 presents, frame p50 63.7 / p90 67.5 / p99 71.9 / max 134.6 ms, GPU busy 41.7 ms per present
AMD Radeon RX 9060 XT (RADV GFX1200), radv Mesa 27.0.0-devel, Linux 7.3.4-201.nobara.fc44.x86_64, 3840x2160, commit 023ea7bc27, dropped: yes

{"commit":"023ea7bc27df","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3549,"ms":20055.84},"presents":313,"frame_ms":{"p50":63.666,"p90":67.525,"p99":71.905,"max":134.637},"gpu_busy_ms_per_present":41.747,"worker_busy_pct":{"queue worker 0x0":96.887,"queue worker 0x40":99.328,"queue worker 0x48":90.951,"queue worker 0x3a":0.0,"queue worker 0x46":1.86},"phase_totals_ms":{"Driver.Completion":19.988,"Driver.Dispatch":3341.741,"Driver.Dispatch.capture_resources":263.593,"Driver.Dispatch.decode_key_device_setup":90.177,"Driver.Dispatch.lookup_cache":78.855,"Driver.Dispatch.materialize":10.151,"Driver.Dispatch.prepared_invocation":7.457,"Driver.Draw":9552.685,"Driver.Draw.device_setup":360.824,"Driver.Draw.draw_enqueued":2695.294,"Driver.Draw.post_compile_prepare":73.116,"Driver.Draw.prepare":627.499,"Driver.Draw.shader_compile_and_link":4987.354,"Driver.EndSubmission":560.443,"Driver.Packet":57385.715,"Driver.Packet.device_lock":61.609,"Driver.Packet.dispatch":7260.549,"Driver.Packet.draw":9618.792,"Driver.Packet.execute":662.086,"Driver.Packet.flip_flush":45.921,"Driver.Packet.flush_between_packets":424.435,"Driver.Packet.memory_wait":34118.03,"Driver.Packet.pipeline_drain":409.582,"Driver.Packet.pipeline_prepare":105.663,"Driver.Packet.prepare_memory":1766.594,"Driver.Packet.rendering_wait":0.345,"Driver.Present":1641.536,"Driver.Present.acquire_image":16.899,"Driver.Present.device_setup":0.196,"Driver.Present.gpu_mutex_wait":0.584,"Driver.Present.inflight_wait":0.847,"Driver.Present.present_display_buffer":69.753,"Driver.Present.queue_present":10.639,"Driver.Present.release_and_callback":0.355,"Driver.Present.render_fence_wait":1541.42,"Driver.Present.resize":0.445,"Driver.Present.validate":0.107,"Driver.Suspend":0.266,"GpuMutex.wait.dispatch":822.622,"GpuMutex.wait.draw":1437.443,"GpuMutex.wait.end":240.771,"GpuMutex.wait.fill":60.644,"GpuMutex.wait.flush":80.024,"GpuMutex.wait.hook":39.562,"GpuMutex.wait.indirect":21.754,"GpuMutex.wait.label":558.407,"GpuMutex.wait.present":0.015,"GpuMutex.wait.wait":228.239,"Graphics.Draw":6997.017,"Graphics.Draw.draw_and_resource_release":5915.613,"Graphics.Draw.index_upload":322.737,"Graphics.Draw.validate":448.154,"Graphics.Draw.vertex_upload":241.178,"Graphics.DrawWithRecipe":1230.244,"Graphics.DrawWithRecipe.draw_and_resource_release":1167.807,"Graphics.DrawWithRecipe.index_upload":10.923,"Graphics.DrawWithRecipe.validate":20.575,"Graphics.DrawWithRecipe.vertex_upload":23.073,"Recorder.Reap":759.054,"Recorder.Submit":5104.127,"Recorder.WaitSerial":1591.06,"Resources.Complete":164.995,"Resources.Prepare":123.797,"Shader.DrawStage":3415.969,"Shader.DrawStage.capture_resources":2515.907,"Shader.DrawStage.materialize":528.947,"Shader.DrawStage.prepared_invocation":345.041,"Shader.ResolveAbi":66.304,"Shader.ResolveGraphicsAbi":22.748,"Shader.ResolveGraphicsStagesAbi":240.248,"VideoOut.Flip":1653.963,"VideoOut.Flip.completion_mutex_wait":0.277,"VideoOut.Flip.config_mutex_wait":0.02,"VideoOut.Flip.frame_limit":0.173,"VideoOut.Flip.notify_game":5.842,"VideoOut.Flip.present":1641.474,"VideoOut.Flip.validate":0.391,"VideoOut.Flip.vblank_wait":0.244,"VideoOut.Flip.window_prepare":0.433,"VideoOut.Flip.window_title":4.93,"VideoOut.Readiness":0.573,"VideoOut.Readiness.locks_validate":0.34,"Vulkan.Acquire":16.347,"Vulkan.Acquire.acquire_fence_wait":0.77,"Vulkan.Acquire.acquire_image":12.907,"Vulkan.Acquire.fence_reset":2.269,"Vulkan.Acquire.retired_swapchains":0.262,"Vulkan.Dispatch":1172.55,"Vulkan.Dispatch.command_record":192.052,"Vulkan.Dispatch.shader_resources":972.647,"Vulkan.DispatchRecipe":107.53,"Vulkan.DispatchRecipe.command_record":106.719,"Vulkan.DrawFromRecipe":1241.091,"Vulkan.Present":62.058,"Vulkan.Present.command_record_scale":9.033,"Vulkan.Present.pixel_upload":0.734,"Vulkan.Present.queue_submit":51.992,"Vulkan.QueuePresent":10.131,"Vulkan.QueuePresent.queue_present":9.847,"Vulkan.Retire":1541.204,"Vulkan.Retire.wait":1536.251},"top_phases_ms_per_frame":{"Driver.Packet":183.341,"Driver.Packet.memory_wait":109.003,"Driver.Packet.draw":30.731,"Driver.Draw":30.52,"Driver.Packet.dispatch":23.197,"Graphics.Draw":22.355,"Graphics.Draw.draw_and_resource_release":18.9,"Recorder.Submit":16.307},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3762,"Graphics.Barrier.dcc-clear":3756,"Graphics.Barrier.dcc-keys":3756,"Graphics.Barrier.dispatch-lead":21396,"Graphics.Barrier.dispatch-trail":27226,"Graphics.Barrier.draw":66256,"Graphics.Barrier.fill":9751,"Graphics.Barrier.fill-clear":4382,"Graphics.Barrier.indirect-args":2191,"Graphics.Barrier.label-run":214061,"Graphics.Barrier.present-blit":626,"Graphics.Barrier.shadow-publish":1878,"Graphics.Barrier.staging-in":14710,"Graphics.Barrier.staging-out":6568,"Graphics.Barrier.storage-upload":11894,"Graphics.Barrier.storage-writeback":48828,"Graphics.BarrierMerged.dispatch-lead":10212,"Graphics.BarrierMerged.fill":3233,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1252,"Graphics.BarrierMerged.staging-in":4994,"Graphics.BarrierMerged.staging-out":6568,"Graphics.BarrierMerged.storage-writeback":8686,"Graphics.Copy":29406,"Graphics.Copy.bytes":16683375944,"Graphics.RenderPass":27893,"Graphics.RenderPass.Close.command":12441,"Graphics.RenderPass.Close.image":3433,"Graphics.RenderPass.Close.key":1550,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":10443,"Graphics.RenderPass.Continued":201751},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.337,"events_lost":446066,"totals_full":false},"draw committer":{"events_full_after_s":15.119,"events_lost":85073,"totals_full":false}},"trace":"aps5-trace-023ea7bc27df-3434660.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 446066 events lost; buffer full at 7336.6 ms
  • draw committer: 85073 events lost; buffer full at 15118.7 ms

Slowest frames (largest slices inside each, inclusive)

  • present 3549: 134.6 ms at 0 ms: Driver.WorkerWait (queue worker 0x46) 65.7, Driver.WorkerWait.dequeue_order (queue worker 0x46) 64.2, Driver.Packet (queue worker 0x48) 61.5, Driver.Packet (queue worker 0x0) 57.7
  • present 3599: 75.7 ms at 3228 ms: Driver.Packet (queue worker 0x40) 75.0, Driver.WorkerWait (queue worker 0x46) 74.5, Driver.Packet (queue worker 0x0) 66.7, Driver.Packet (queue worker 0x48) 65.7
  • present 3744: 74.7 ms at 12529 ms: Driver.Packet (queue worker 0x40) 74.0, Driver.WorkerWait (queue worker 0x46) 73.7, Driver.Packet.memory_wait (queue worker 0x40) 66.4, Driver.Packet (queue worker 0x48) 64.5
  • present 3623: 71.9 ms at 4757 ms: Driver.Packet (queue worker 0x40) 71.2, Driver.WorkerWait (queue worker 0x46) 70.6, Driver.Packet (queue worker 0x48) 63.5, Driver.Packet (queue worker 0x0) 62.4
  • present 3766: 71.4 ms at 13926 ms: Driver.Packet (queue worker 0x40) 70.5, Driver.Packet (queue worker 0x48) 70.0, Driver.WorkerWait (queue worker 0x46) 66.3, Driver.Packet.memory_wait (queue worker 0x48) 65.0

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 3549: 134.6 ms at 0 ms, persistence 77.3 ms
  • present 3599: 75.7 ms at 3228 ms, persistence 18.4 ms
  • present 3744: 74.7 ms at 12529 ms, persistence 16.4 ms
  • present 3766: 71.4 ms at 13926 ms, persistence 13.2 ms
  • present 3623: 71.9 ms at 4757 ms, persistence 12.9 ms
  • present 3660: 70.8 ms at 7152 ms, persistence 11.4 ms
  • present 3817: 70.5 ms at 17164 ms, persistence 11.3 ms
  • present 3712: 69.0 ms at 10487 ms, persistence 10.5 ms
  • present 3688: 68.1 ms at 8959 ms, persistence 9.3 ms
  • present 3555: 67.5 ms at 442 ms, persistence 9.0 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 19.9 (31 %) 0.5 (1 %) 43.7 15.5 Driver.Packet 20.0, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 64.0 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 64.1 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 64.1 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 5.6 (9 %) 58.5 0.6 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x40 7.1 (11 %) 56.1 (88 %) 0.8 2.2 Driver.Packet 63.0, Driver.EndSubmission 0.3
draw committer 27.5 (43 %) 4.5 (7 %) 32.1 9.4 Graphics.Draw 15.3, Recorder.Submit 9.3
queue worker 0x48 1.7 (3 %) 61.9 (97 %) 0.5 0.2 Driver.Packet 57.0, Driver.EndSubmission 1.2
presenter 0.4 (1 %) 4.9 (8 %) 58.8 0.0 VideoOut.Flip 5.3, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 64.1 0.1 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x46 0.9 (1 %) 62.6 (98 %) 0.6 0.8 Driver.Packet 0.8, Driver.EndSubmission 0.2
gpu 41.9 (65 %) 0.0 (0 %) 22.2 0.0 batch 41.9

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 140.8, Driver.Packet.memory_wait 108.9, Driver.WorkerWait 68.3, Driver.WorkerWait.dequeue_order 55.8, batch 41.9, Graphics.Draw 15.3, Recorder.Submit 12.9, Driver.WorkerWait.idle_and_completion_poll 12.4, Driver.Packet.dispatch 12.4, Graphics.Draw.draw_and_resource_release 12.2

Longest waits

  • Driver.WorkerWait (queue worker 0x46) 97.6 ms at 6406 ms, present 3648
  • Driver.WorkerWait (queue worker 0x46) 96.5 ms at 17912 ms, present 3828
  • Driver.WorkerWait (queue worker 0x46) 95.6 ms at 2536 ms, present 3588
  • Driver.WorkerWait (queue worker 0x46) 95.4 ms at 13962 ms, present 3766
  • Driver.WorkerWait (queue worker 0x46) 94.4 ms at 13517 ms, present 3759
  • Driver.WorkerWait (queue worker 0x46) 93.9 ms at 14089 ms, present 3768
  • Driver.WorkerWait (queue worker 0x46) 74.6 ms at 3229 ms, present 3599
  • Driver.WorkerWait (queue worker 0x46) 73.7 ms at 12530 ms, present 3744
  • Driver.WorkerWait (queue worker 0x46) 70.5 ms at 4759 ms, present 3623
  • Driver.WorkerWait (queue worker 0x46) 69.7 ms at 7153 ms, present 3660

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 31382: 5.6 ms at 17167 ms, present 3817: GPU no ranges; recorded by no CPU slices
  • batch 34483: 5.6 ms at 18902 ms, present 3844: GPU no ranges; recorded by no CPU slices
  • batch 654: 5.6 ms at 445 ms, present 3555: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 28.9, Driver.Packet.draw (queue worker 0x0) 17.7, Driver.Draw (queue worker 0x0) 17.6, Driver.Draw.shader_compile_and_link (queue worker 0x0) 7.7
  • batch 18554: 5.6 ms at 10163 ms, present 3707: GPU no ranges; recorded by no CPU slices
  • batch 5645: 5.6 ms at 3167 ms, present 3598: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 25.6, Driver.Packet.draw (queue worker 0x0) 14.4, Driver.Draw (queue worker 0x0) 14.2, Driver.Packet.dispatch (queue worker 0x0) 7.7

Focused tests on main and on this PR, same machine and GPU, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R "agc_storage_write_back|agc_copied_write_back|agc_storage_split_writeback|agc_storage_writeback_blocks|agc_storage_import_segment_memo|agc_unwatch_snapshot_scope_linear", validation layer 1.4.341 (/usr/lib64/libVkLayer_khronos_validation.so): main 8/8 passed, this PR 9/9 passed; every log shows Insert instance layer "VK_LAYER_KHRONOS_validation", none reports was not found but was requested, and neither has a VUID- line.

Not covered: on this machine the storage write-back test's linear cases do not reach the import route (GuestMemory::Watched is false for them), so the test checks that the switch leaves the other routes unchanged, not the retile into a host import itself. The direct route was checked in game only (no visible difference on the world map) and on one GPU.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9060 XT, RADV (Mesa 27.0.0-devel), Linux 7.3.4 (Fedora 44 / Nobara)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5335948012 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21536). Originally posted by [LloydNicholson](https://github.com/LloydNicholson) on 2026-11-16T11:14:43Z. --- ### What A whole-layer write-back of a linear storage image into a host import retiles into device scratch and then copies the rows into the import with `vkCmdCopyBuffer`, unless the import is in a device-local heap (unified memory), where it retiles into the import directly. For linear rows the retile writes the same bytes to the import as the copy, so on a discrete GPU the direct route moves no more data over the bus and drops the scratch buffer, a barrier and a `vkCmdCopyBuffer` per write-back. RADV looks up its copy pipeline for every region (`vk_meta_get_pipeline_layout`, `memcmp` of the key), which showed up on the draw committer. - `APS5_LINEAR_IMPORT_RETILE_HOST=1` lets such write-backs retile into a host-memory import as well. Off by default; documented in `docs/dev/ENVIRONMENT.md`. - With `APS5_PIPELINE_STATS`, an `[import-writeback]` line counts import write-backs by route every 10 s: retiled into the import, eligible but copied (host-memory import), other. - `agc_storage_write_back_host_retile` runs the storage write-back test with the switch on, and the test's route expectations account for it. On the Astro Bot world map the committer was the busiest thread (about 84 % of 10 s). With `APS5_PIPELINE_STATS=2` (separate runs, not the captures below): about 1,200 of 2,300 import write-backs per 10 s took the scratch route and were eligible; with the switch, all of them retiled directly, end-of-pipe commits went from 27-31 to about 22 us each and draw commits from 52-58 to 46-49 us each on the committer. ### Tested Linux 7.3.4 (Nobara, Fedora 44), AMD Radeon RX 9060 XT (RADV GFX1200, Mesa 27.0.0-devel), Ryzen 7 5700X. Astro Bot (PPSA21564), world map, standing at the same spot, warm caches, `APS5_TRACE_SECONDS=180:20`, no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch, log not redirected. Both captures come from the same session and the same converted title, both with `APS5_LINEAR_IMPORT_RETILE_HOST=1` set (main does not read it), so the summary lines differ only in commit; only `libSceAgcDriver.prx` differs between the runs. | | main `e4caa07950f8` | this PR `023ea7bc27df` | |---|---|---| | presents in 20 s | 261 | 313 | | frame p50 / p90 / p99 / max | 76.5 / 81.0 / 88.3 / 91.7 ms | 63.7 / 67.5 / 71.9 / 134.6 ms | | GPU busy per present | 47.0 ms | 41.7 ms | An earlier capture of main in the same session without the variable gave 276 presents, p50 / p90 / p99 / max 72.5 / 76.1 / 78.2 / 81.1 ms (`aps5-trace-e4caa07950f8-3424790.json.gz`), so the gain is 13-20 % depending on which main capture it is compared with. The 134.6 ms maximum is the first present of the window (present 3549, at 0 ms). All traces filled the queue worker's and the committer's event buffers before the window closed (`dropped: yes`); the summary statistics are unaffected. Summary lines: ```json {"commit":"e4caa07950f8","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3071,"ms":20029.127},"presents":261,"frame_ms":{"p50":76.534,"p90":81.005,"p99":88.268,"max":91.671},"gpu_busy_ms_per_present":47.034,"worker_busy_pct":{"queue worker 0x0":97.628,"queue worker 0x40":99.673,"queue worker 0x48":95.479,"queue worker 0x3a":0.000,"queue worker 0x46":1.544},"phase_totals_ms":{"Driver.Completion":21.882,"Driver.Dispatch":4351.050,"Driver.Dispatch.capture_resources":242.311,"Driver.Dispatch.decode_key_device_setup":76.195,"Driver.Dispatch.lookup_cache":66.416,"Driver.Dispatch.materialize":10.756,"Driver.Dispatch.prepared_invocation":7.763,"Driver.Draw":9554.086,"Driver.Draw.device_setup":343.425,"Driver.Draw.draw_enqueued":2820.729,"Driver.Draw.post_compile_prepare":68.003,"Driver.Draw.prepare":640.909,"Driver.Draw.shader_compile_and_link":5018.181,"Driver.EndSubmission":1108.900,"Driver.Packet":57818.602,"Driver.Packet.device_lock":54.446,"Driver.Packet.dispatch":8999.863,"Driver.Packet.draw":9613.739,"Driver.Packet.execute":583.089,"Driver.Packet.flip_flush":37.028,"Driver.Packet.flush_between_packets":672.974,"Driver.Packet.memory_wait":33240.328,"Driver.Packet.pipeline_drain":335.032,"Driver.Packet.pipeline_prepare":89.920,"Driver.Packet.prepare_memory":1516.777,"Driver.Packet.rendering_wait":0.291,"Driver.Present":1852.170,"Driver.Present.acquire_image":14.640,"Driver.Present.device_setup":0.181,"Driver.Present.gpu_mutex_wait":0.554,"Driver.Present.inflight_wait":0.684,"Driver.Present.present_display_buffer":57.700,"Driver.Present.queue_present":8.850,"Driver.Present.release_and_callback":0.296,"Driver.Present.render_fence_wait":1768.526,"Driver.Present.resize":0.406,"Driver.Present.validate":0.083,"Driver.Suspend":1.246,"GpuMutex.wait.dispatch":1481.301,"GpuMutex.wait.draw":2290.818,"GpuMutex.wait.end":465.409,"GpuMutex.wait.fill":50.277,"GpuMutex.wait.flush":72.353,"GpuMutex.wait.hook":33.554,"GpuMutex.wait.indirect":19.311,"GpuMutex.wait.label":787.801,"GpuMutex.wait.present":0.048,"GpuMutex.wait.wait":1158.216,"Graphics.Draw":6460.633,"Graphics.Draw.draw_and_resource_release":5462.224,"Graphics.Draw.index_upload":275.925,"Graphics.Draw.validate":442.989,"Graphics.Draw.vertex_upload":214.226,"Graphics.DrawWithRecipe":702.809,"Graphics.DrawWithRecipe.draw_and_resource_release":670.852,"Graphics.DrawWithRecipe.index_upload":4.654,"Graphics.DrawWithRecipe.validate":10.299,"Graphics.DrawWithRecipe.vertex_upload":12.611,"Recorder.Reap":646.573,"Recorder.Submit":4330.728,"Recorder.WaitSerial":1868.865,"Resources.Complete":154.411,"Resources.Prepare":112.632,"Shader.DrawStage":3555.456,"Shader.DrawStage.capture_resources":2643.030,"Shader.DrawStage.materialize":538.096,"Shader.DrawStage.prepared_invocation":348.253,"Shader.ResolveAbi":57.945,"Shader.ResolveGraphicsAbi":22.346,"Shader.ResolveGraphicsStagesAbi":200.393,"VideoOut.Flip":1856.265,"VideoOut.Flip.completion_mutex_wait":0.216,"VideoOut.Flip.config_mutex_wait":0.015,"VideoOut.Flip.frame_limit":0.146,"VideoOut.Flip.notify_game":1.874,"VideoOut.Flip.present":1849.125,"VideoOut.Flip.validate":0.334,"VideoOut.Flip.vblank_wait":0.207,"VideoOut.Flip.window_prepare":0.374,"VideoOut.Flip.window_title":3.852,"VideoOut.Readiness":0.486,"VideoOut.Readiness.locks_validate":0.287,"Vulkan.Acquire":14.173,"Vulkan.Acquire.acquire_fence_wait":0.746,"Vulkan.Acquire.acquire_image":11.324,"Vulkan.Acquire.fence_reset":1.832,"Vulkan.Acquire.retired_swapchains":0.156,"Vulkan.Dispatch":1041.802,"Vulkan.Dispatch.command_record":164.612,"Vulkan.Dispatch.shader_resources":870.203,"Vulkan.DispatchRecipe":88.228,"Vulkan.DispatchRecipe.command_record":87.532,"Vulkan.DrawFromRecipe":708.775,"Vulkan.Present":51.298,"Vulkan.Present.command_record_scale":7.506,"Vulkan.Present.pixel_upload":0.797,"Vulkan.Present.queue_submit":42.756,"Vulkan.QueuePresent":8.408,"Vulkan.QueuePresent.queue_present":8.148,"Vulkan.Retire":1768.321,"Vulkan.Retire.wait":1763.639},"top_phases_ms_per_frame":{"Driver.Packet":221.527,"Driver.Packet.memory_wait":127.358,"Driver.Packet.draw":36.834,"Driver.Draw":36.606,"Driver.Packet.dispatch":34.482,"Graphics.Draw":24.753,"Graphics.Draw.draw_and_resource_release":20.928,"Driver.Draw.shader_compile_and_link":19.227},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3138,"Graphics.Barrier.dcc-clear":3132,"Graphics.Barrier.dcc-keys":3132,"Graphics.Barrier.dispatch-lead":17828,"Graphics.Barrier.dispatch-trail":22707,"Graphics.Barrier.draw":56952,"Graphics.Barrier.fill":8194,"Graphics.Barrier.fill-clear":3654,"Graphics.Barrier.indirect-args":1827,"Graphics.Barrier.label-run":179184,"Graphics.Barrier.present-blit":522,"Graphics.Barrier.shadow-publish":1566,"Graphics.Barrier.staging-in":12263,"Graphics.Barrier.staging-out":5481,"Graphics.Barrier.storage-upload":9934,"Graphics.Barrier.storage-writeback":43327,"Graphics.BarrierMerged.dispatch-lead":8533,"Graphics.BarrierMerged.fill":2676,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1044,"Graphics.BarrierMerged.staging-in":4180,"Graphics.BarrierMerged.staging-out":5481,"Graphics.BarrierMerged.storage-writeback":7215,"Graphics.Copy":24534,"Graphics.Copy.bytes":13919077800,"Graphics.RenderPass":23925,"Graphics.RenderPass.Close.command":10403,"Graphics.RenderPass.Close.image":2863,"Graphics.RenderPass.Close.key":1282,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":9355,"Graphics.RenderPass.Continued":171267},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.862,"events_lost":413552,"totals_full":false},"draw committer":{"events_full_after_s":17.394,"events_lost":40772,"totals_full":false}},"trace":"aps5-trace-e4caa07950f8-3542653.json.gz"} {"commit":"023ea7bc27df","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3549,"ms":20055.840},"presents":313,"frame_ms":{"p50":63.666,"p90":67.525,"p99":71.905,"max":134.637},"gpu_busy_ms_per_present":41.747,"worker_busy_pct":{"queue worker 0x0":96.887,"queue worker 0x40":99.328,"queue worker 0x48":90.951,"queue worker 0x3a":0.000,"queue worker 0x46":1.860},"phase_totals_ms":{"Driver.Completion":19.988,"Driver.Dispatch":3341.741,"Driver.Dispatch.capture_resources":263.593,"Driver.Dispatch.decode_key_device_setup":90.177,"Driver.Dispatch.lookup_cache":78.855,"Driver.Dispatch.materialize":10.151,"Driver.Dispatch.prepared_invocation":7.457,"Driver.Draw":9552.685,"Driver.Draw.device_setup":360.824,"Driver.Draw.draw_enqueued":2695.294,"Driver.Draw.post_compile_prepare":73.116,"Driver.Draw.prepare":627.499,"Driver.Draw.shader_compile_and_link":4987.354,"Driver.EndSubmission":560.443,"Driver.Packet":57385.715,"Driver.Packet.device_lock":61.609,"Driver.Packet.dispatch":7260.549,"Driver.Packet.draw":9618.792,"Driver.Packet.execute":662.086,"Driver.Packet.flip_flush":45.921,"Driver.Packet.flush_between_packets":424.435,"Driver.Packet.memory_wait":34118.030,"Driver.Packet.pipeline_drain":409.582,"Driver.Packet.pipeline_prepare":105.663,"Driver.Packet.prepare_memory":1766.594,"Driver.Packet.rendering_wait":0.345,"Driver.Present":1641.536,"Driver.Present.acquire_image":16.899,"Driver.Present.device_setup":0.196,"Driver.Present.gpu_mutex_wait":0.584,"Driver.Present.inflight_wait":0.847,"Driver.Present.present_display_buffer":69.753,"Driver.Present.queue_present":10.639,"Driver.Present.release_and_callback":0.355,"Driver.Present.render_fence_wait":1541.420,"Driver.Present.resize":0.445,"Driver.Present.validate":0.107,"Driver.Suspend":0.266,"GpuMutex.wait.dispatch":822.622,"GpuMutex.wait.draw":1437.443,"GpuMutex.wait.end":240.771,"GpuMutex.wait.fill":60.644,"GpuMutex.wait.flush":80.024,"GpuMutex.wait.hook":39.562,"GpuMutex.wait.indirect":21.754,"GpuMutex.wait.label":558.407,"GpuMutex.wait.present":0.015,"GpuMutex.wait.wait":228.239,"Graphics.Draw":6997.017,"Graphics.Draw.draw_and_resource_release":5915.613,"Graphics.Draw.index_upload":322.737,"Graphics.Draw.validate":448.154,"Graphics.Draw.vertex_upload":241.178,"Graphics.DrawWithRecipe":1230.244,"Graphics.DrawWithRecipe.draw_and_resource_release":1167.807,"Graphics.DrawWithRecipe.index_upload":10.923,"Graphics.DrawWithRecipe.validate":20.575,"Graphics.DrawWithRecipe.vertex_upload":23.073,"Recorder.Reap":759.054,"Recorder.Submit":5104.127,"Recorder.WaitSerial":1591.060,"Resources.Complete":164.995,"Resources.Prepare":123.797,"Shader.DrawStage":3415.969,"Shader.DrawStage.capture_resources":2515.907,"Shader.DrawStage.materialize":528.947,"Shader.DrawStage.prepared_invocation":345.041,"Shader.ResolveAbi":66.304,"Shader.ResolveGraphicsAbi":22.748,"Shader.ResolveGraphicsStagesAbi":240.248,"VideoOut.Flip":1653.963,"VideoOut.Flip.completion_mutex_wait":0.277,"VideoOut.Flip.config_mutex_wait":0.020,"VideoOut.Flip.frame_limit":0.173,"VideoOut.Flip.notify_game":5.842,"VideoOut.Flip.present":1641.474,"VideoOut.Flip.validate":0.391,"VideoOut.Flip.vblank_wait":0.244,"VideoOut.Flip.window_prepare":0.433,"VideoOut.Flip.window_title":4.930,"VideoOut.Readiness":0.573,"VideoOut.Readiness.locks_validate":0.340,"Vulkan.Acquire":16.347,"Vulkan.Acquire.acquire_fence_wait":0.770,"Vulkan.Acquire.acquire_image":12.907,"Vulkan.Acquire.fence_reset":2.269,"Vulkan.Acquire.retired_swapchains":0.262,"Vulkan.Dispatch":1172.550,"Vulkan.Dispatch.command_record":192.052,"Vulkan.Dispatch.shader_resources":972.647,"Vulkan.DispatchRecipe":107.530,"Vulkan.DispatchRecipe.command_record":106.719,"Vulkan.DrawFromRecipe":1241.091,"Vulkan.Present":62.058,"Vulkan.Present.command_record_scale":9.033,"Vulkan.Present.pixel_upload":0.734,"Vulkan.Present.queue_submit":51.992,"Vulkan.QueuePresent":10.131,"Vulkan.QueuePresent.queue_present":9.847,"Vulkan.Retire":1541.204,"Vulkan.Retire.wait":1536.251},"top_phases_ms_per_frame":{"Driver.Packet":183.341,"Driver.Packet.memory_wait":109.003,"Driver.Packet.draw":30.731,"Driver.Draw":30.520,"Driver.Packet.dispatch":23.197,"Graphics.Draw":22.355,"Graphics.Draw.draw_and_resource_release":18.900,"Recorder.Submit":16.307},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3762,"Graphics.Barrier.dcc-clear":3756,"Graphics.Barrier.dcc-keys":3756,"Graphics.Barrier.dispatch-lead":21396,"Graphics.Barrier.dispatch-trail":27226,"Graphics.Barrier.draw":66256,"Graphics.Barrier.fill":9751,"Graphics.Barrier.fill-clear":4382,"Graphics.Barrier.indirect-args":2191,"Graphics.Barrier.label-run":214061,"Graphics.Barrier.present-blit":626,"Graphics.Barrier.shadow-publish":1878,"Graphics.Barrier.staging-in":14710,"Graphics.Barrier.staging-out":6568,"Graphics.Barrier.storage-upload":11894,"Graphics.Barrier.storage-writeback":48828,"Graphics.BarrierMerged.dispatch-lead":10212,"Graphics.BarrierMerged.fill":3233,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1252,"Graphics.BarrierMerged.staging-in":4994,"Graphics.BarrierMerged.staging-out":6568,"Graphics.BarrierMerged.storage-writeback":8686,"Graphics.Copy":29406,"Graphics.Copy.bytes":16683375944,"Graphics.RenderPass":27893,"Graphics.RenderPass.Close.command":12441,"Graphics.RenderPass.Close.image":3433,"Graphics.RenderPass.Close.key":1550,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":10443,"Graphics.RenderPass.Continued":201751},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.337,"events_lost":446066,"totals_full":false},"draw committer":{"events_full_after_s":15.119,"events_lost":85073,"totals_full":false}},"trace":"aps5-trace-023ea7bc27df-3434660.json.gz"} ``` Traces (attached in a comment): `aps5-trace-e4caa07950f8-3542653.json.gz` (main), `aps5-trace-023ea7bc27df-3434660.json.gz` (this PR), and the earlier main capture `aps5-trace-e4caa07950f8-3424790.json.gz`. <details><summary><code>tools/trace_digest.py</code>, main <code>e4caa07950f8</code></summary> **seconds 180:20** from present 3071: 261 presents, frame p50 76.5 / p90 81.0 / p99 88.3 / max 91.7 ms, GPU busy 47.0 ms per present AMD Radeon RX 9060 XT (RADV GFX1200), radv Mesa 27.0.0-devel, Linux 7.3.4-201.nobara.fc44.x86_64, 3840x2160, commit e4caa07950f8, dropped: yes ```json {"commit":"e4caa07950f8","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3071,"ms":20029.127},"presents":261,"frame_ms":{"p50":76.534,"p90":81.005,"p99":88.268,"max":91.671},"gpu_busy_ms_per_present":47.034,"worker_busy_pct":{"queue worker 0x0":97.628,"queue worker 0x40":99.673,"queue worker 0x48":95.479,"queue worker 0x3a":0.0,"queue worker 0x46":1.544},"phase_totals_ms":{"Driver.Completion":21.882,"Driver.Dispatch":4351.05,"Driver.Dispatch.capture_resources":242.311,"Driver.Dispatch.decode_key_device_setup":76.195,"Driver.Dispatch.lookup_cache":66.416,"Driver.Dispatch.materialize":10.756,"Driver.Dispatch.prepared_invocation":7.763,"Driver.Draw":9554.086,"Driver.Draw.device_setup":343.425,"Driver.Draw.draw_enqueued":2820.729,"Driver.Draw.post_compile_prepare":68.003,"Driver.Draw.prepare":640.909,"Driver.Draw.shader_compile_and_link":5018.181,"Driver.EndSubmission":1108.9,"Driver.Packet":57818.602,"Driver.Packet.device_lock":54.446,"Driver.Packet.dispatch":8999.863,"Driver.Packet.draw":9613.739,"Driver.Packet.execute":583.089,"Driver.Packet.flip_flush":37.028,"Driver.Packet.flush_between_packets":672.974,"Driver.Packet.memory_wait":33240.328,"Driver.Packet.pipeline_drain":335.032,"Driver.Packet.pipeline_prepare":89.92,"Driver.Packet.prepare_memory":1516.777,"Driver.Packet.rendering_wait":0.291,"Driver.Present":1852.17,"Driver.Present.acquire_image":14.64,"Driver.Present.device_setup":0.181,"Driver.Present.gpu_mutex_wait":0.554,"Driver.Present.inflight_wait":0.684,"Driver.Present.present_display_buffer":57.7,"Driver.Present.queue_present":8.85,"Driver.Present.release_and_callback":0.296,"Driver.Present.render_fence_wait":1768.526,"Driver.Present.resize":0.406,"Driver.Present.validate":0.083,"Driver.Suspend":1.246,"GpuMutex.wait.dispatch":1481.301,"GpuMutex.wait.draw":2290.818,"GpuMutex.wait.end":465.409,"GpuMutex.wait.fill":50.277,"GpuMutex.wait.flush":72.353,"GpuMutex.wait.hook":33.554,"GpuMutex.wait.indirect":19.311,"GpuMutex.wait.label":787.801,"GpuMutex.wait.present":0.048,"GpuMutex.wait.wait":1158.216,"Graphics.Draw":6460.633,"Graphics.Draw.draw_and_resource_release":5462.224,"Graphics.Draw.index_upload":275.925,"Graphics.Draw.validate":442.989,"Graphics.Draw.vertex_upload":214.226,"Graphics.DrawWithRecipe":702.809,"Graphics.DrawWithRecipe.draw_and_resource_release":670.852,"Graphics.DrawWithRecipe.index_upload":4.654,"Graphics.DrawWithRecipe.validate":10.299,"Graphics.DrawWithRecipe.vertex_upload":12.611,"Recorder.Reap":646.573,"Recorder.Submit":4330.728,"Recorder.WaitSerial":1868.865,"Resources.Complete":154.411,"Resources.Prepare":112.632,"Shader.DrawStage":3555.456,"Shader.DrawStage.capture_resources":2643.03,"Shader.DrawStage.materialize":538.096,"Shader.DrawStage.prepared_invocation":348.253,"Shader.ResolveAbi":57.945,"Shader.ResolveGraphicsAbi":22.346,"Shader.ResolveGraphicsStagesAbi":200.393,"VideoOut.Flip":1856.265,"VideoOut.Flip.completion_mutex_wait":0.216,"VideoOut.Flip.config_mutex_wait":0.015,"VideoOut.Flip.frame_limit":0.146,"VideoOut.Flip.notify_game":1.874,"VideoOut.Flip.present":1849.125,"VideoOut.Flip.validate":0.334,"VideoOut.Flip.vblank_wait":0.207,"VideoOut.Flip.window_prepare":0.374,"VideoOut.Flip.window_title":3.852,"VideoOut.Readiness":0.486,"VideoOut.Readiness.locks_validate":0.287,"Vulkan.Acquire":14.173,"Vulkan.Acquire.acquire_fence_wait":0.746,"Vulkan.Acquire.acquire_image":11.324,"Vulkan.Acquire.fence_reset":1.832,"Vulkan.Acquire.retired_swapchains":0.156,"Vulkan.Dispatch":1041.802,"Vulkan.Dispatch.command_record":164.612,"Vulkan.Dispatch.shader_resources":870.203,"Vulkan.DispatchRecipe":88.228,"Vulkan.DispatchRecipe.command_record":87.532,"Vulkan.DrawFromRecipe":708.775,"Vulkan.Present":51.298,"Vulkan.Present.command_record_scale":7.506,"Vulkan.Present.pixel_upload":0.797,"Vulkan.Present.queue_submit":42.756,"Vulkan.QueuePresent":8.408,"Vulkan.QueuePresent.queue_present":8.148,"Vulkan.Retire":1768.321,"Vulkan.Retire.wait":1763.639},"top_phases_ms_per_frame":{"Driver.Packet":221.527,"Driver.Packet.memory_wait":127.358,"Driver.Packet.draw":36.834,"Driver.Draw":36.606,"Driver.Packet.dispatch":34.482,"Graphics.Draw":24.753,"Graphics.Draw.draw_and_resource_release":20.928,"Driver.Draw.shader_compile_and_link":19.227},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3138,"Graphics.Barrier.dcc-clear":3132,"Graphics.Barrier.dcc-keys":3132,"Graphics.Barrier.dispatch-lead":17828,"Graphics.Barrier.dispatch-trail":22707,"Graphics.Barrier.draw":56952,"Graphics.Barrier.fill":8194,"Graphics.Barrier.fill-clear":3654,"Graphics.Barrier.indirect-args":1827,"Graphics.Barrier.label-run":179184,"Graphics.Barrier.present-blit":522,"Graphics.Barrier.shadow-publish":1566,"Graphics.Barrier.staging-in":12263,"Graphics.Barrier.staging-out":5481,"Graphics.Barrier.storage-upload":9934,"Graphics.Barrier.storage-writeback":43327,"Graphics.BarrierMerged.dispatch-lead":8533,"Graphics.BarrierMerged.fill":2676,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1044,"Graphics.BarrierMerged.staging-in":4180,"Graphics.BarrierMerged.staging-out":5481,"Graphics.BarrierMerged.storage-writeback":7215,"Graphics.Copy":24534,"Graphics.Copy.bytes":13919077800,"Graphics.RenderPass":23925,"Graphics.RenderPass.Close.command":10403,"Graphics.RenderPass.Close.image":2863,"Graphics.RenderPass.Close.key":1282,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":9355,"Graphics.RenderPass.Continued":171267},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.862,"events_lost":413552,"totals_full":false},"draw committer":{"events_full_after_s":17.394,"events_lost":40772,"totals_full":false}},"trace":"aps5-trace-e4caa07950f8-3542653.json.gz"} ``` **Incomplete trace:** recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately. - queue worker 0x0: 413552 events lost; buffer full at 7862.4 ms - draw committer: 40772 events lost; buffer full at 17393.6 ms **Slowest frames** (largest slices inside each, inclusive) - present 3299: 91.7 ms at 17483 ms: Driver.Packet (queue worker 0x40) 91.0, Driver.WorkerWait (queue worker 0x46) 90.5, Driver.Packet.memory_wait (queue worker 0x40) 80.9, Driver.Packet (queue worker 0x48) 80.4 - present 3098: 91.2 ms at 2079 ms: Driver.Packet (queue worker 0x40) 90.5, Driver.WorkerWait (queue worker 0x46) 89.8, Driver.Packet (queue worker 0x0) 83.1, Driver.Packet.memory_wait (queue worker 0x40) 80.4 - present 3287: 88.3 ms at 16546 ms: Driver.Packet (queue worker 0x40) 87.4, Driver.WorkerWait (queue worker 0x46) 87.1, Driver.Packet.memory_wait (queue worker 0x40) 77.9, Driver.Packet (queue worker 0x48) 77.2 - present 3301: 86.3 ms at 17655 ms: Driver.WorkerWait (queue worker 0x46) 85.0, Driver.Packet (queue worker 0x40) 84.7, Driver.Packet.memory_wait (queue worker 0x40) 73.6, Driver.Packet (queue worker 0x48) 73.2 - present 3100: 85.7 ms at 2256 ms: Driver.Packet (queue worker 0x40) 84.8, Driver.WorkerWait (queue worker 0x46) 84.3, Driver.Packet (queue worker 0x0) 77.1, Driver.Packet.memory_wait (queue worker 0x40) 75.0 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 3299: 91.7 ms at 17483 ms, persistence 23.7 ms - present 3098: 91.2 ms at 2079 ms, persistence 22.3 ms - present 3287: 88.3 ms at 16546 ms, persistence 15.4 ms - present 3173: 84.1 ms at 7845 ms, persistence 14.1 ms - present 3075: 84.9 ms at 308 ms, persistence 14.0 ms - present 3309: 83.7 ms at 18285 ms, persistence 12.2 ms - present 3130: 84.7 ms at 4607 ms, persistence 11.5 ms - present 3262: 81.3 ms at 14667 ms, persistence 10.8 ms - present 3178: 84.0 ms at 8231 ms, persistence 10.5 ms - present 3166: 81.1 ms at 7317 ms, persistence 10.3 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 26.8 (35 %) | 0.5 (1 %) | 49.4 | 17.7 | Driver.Packet 26.8, Driver.EndSubmission 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 76.7 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 76.7 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 76.7 | 0.1 | Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 11.1 (15 %) | 65.6 | 0.6 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | queue worker 0x40 | 7.8 (10 %) | 68.3 (89 %) | 0.6 | 2.2 | Driver.Packet 75.8, Driver.EndSubmission 0.3 | | queue worker 0x48 | 6.2 (8 %) | 70.2 (92 %) | 0.3 | 0.2 | Driver.Packet 69.5, Driver.EndSubmission 3.7 | | draw committer | 33.0 (43 %) | 9.8 (13 %) | 33.9 | 10.4 | Graphics.Draw 19.7, Recorder.Submit 10.8 | | presenter | 0.4 (0 %) | 6.8 (9 %) | 69.6 | 0.0 | VideoOut.Flip 7.1, Driver.Present 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 76.7 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x46 | 0.9 (1 %) | 75.4 (98 %) | 0.4 | 0.8 | Driver.Packet 0.8, Driver.EndSubmission 0.2 | | title | 0.0 (0 %) | 0.0 (0 %) | 76.7 | 0.0 | | | gpu | 47.0 (61 %) | 0.0 (0 %) | 29.7 | 0.0 | batch 47.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 173.0, Driver.Packet.memory_wait 127.3, Driver.WorkerWait 79.0, Driver.WorkerWait.dequeue_order 63.6, batch 47.0, Driver.Packet.dispatch 20.7, Graphics.Draw 19.7, Graphics.Draw.draw_and_resource_release 15.5, Driver.WorkerWait.idle_and_completion_poll 15.4, Recorder.Submit 14.8 **Longest waits** - Driver.WorkerWait (queue worker 0x46) 120.4 ms at 16194 ms, present 3282 - Driver.WorkerWait (queue worker 0x46) 110.8 ms at 11681 ms, present 3222 - Driver.WorkerWait (queue worker 0x46) 108.0 ms at 7055 ms, present 3162 - Driver.WorkerWait (queue worker 0x46) 90.4 ms at 17484 ms, present 3299 - Driver.WorkerWait (queue worker 0x46) 89.7 ms at 2081 ms, present 3098 - Driver.WorkerWait (queue worker 0x46) 87.1 ms at 16547 ms, present 3287 - Driver.WorkerWait (queue worker 0x46) 84.9 ms at 17657 ms, present 3301 - Driver.WorkerWait (queue worker 0x46) 84.3 ms at 2258 ms, present 3100 - Driver.WorkerWait (queue worker 0x46) 84.3 ms at 2172 ms, present 3099 - Driver.WorkerWait (queue worker 0x46) 83.6 ms at 309 ms, present 3075 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 29613: 5.6 ms at 18823 ms, present 3316: GPU no ranges; recorded by no CPU slices - batch 30323: 5.6 ms at 19285 ms, present 3322: GPU no ranges; recorded by no CPU slices - batch 13509: 5.6 ms at 8555 ms, present 3182: GPU no ranges; recorded by no CPU slices - batch 6708: 5.6 ms at 4304 ms, present 3126: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 34.1, Driver.Packet.dispatch (queue worker 0x0) 16.7, Driver.Packet.draw (queue worker 0x0) 15.0, Driver.Draw (queue worker 0x0) 14.9 - batch 17620: 5.6 ms at 11193 ms, present 3216: GPU no ranges; recorded by no CPU slices </details> <details><summary><code>tools/trace_digest.py</code>, this PR <code>023ea7bc27df</code></summary> **seconds 180:20** from present 3549: 313 presents, frame p50 63.7 / p90 67.5 / p99 71.9 / max 134.6 ms, GPU busy 41.7 ms per present AMD Radeon RX 9060 XT (RADV GFX1200), radv Mesa 27.0.0-devel, Linux 7.3.4-201.nobara.fc44.x86_64, 3840x2160, commit 023ea7bc27df, dropped: yes ```json {"commit":"023ea7bc27df","dirty":false,"env":{"APS5_LINEAR_IMPORT_RETILE_HOST":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:20"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 27.0.0-devel","os":"Linux 7.3.4-201.nobara.fc44.x86_64","cpu":"AMD Ryzen 7 5700X 8-Core Processor","cpu_threads":16,"memory_mib":32007,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 180:20","first_present":3549,"ms":20055.84},"presents":313,"frame_ms":{"p50":63.666,"p90":67.525,"p99":71.905,"max":134.637},"gpu_busy_ms_per_present":41.747,"worker_busy_pct":{"queue worker 0x0":96.887,"queue worker 0x40":99.328,"queue worker 0x48":90.951,"queue worker 0x3a":0.0,"queue worker 0x46":1.86},"phase_totals_ms":{"Driver.Completion":19.988,"Driver.Dispatch":3341.741,"Driver.Dispatch.capture_resources":263.593,"Driver.Dispatch.decode_key_device_setup":90.177,"Driver.Dispatch.lookup_cache":78.855,"Driver.Dispatch.materialize":10.151,"Driver.Dispatch.prepared_invocation":7.457,"Driver.Draw":9552.685,"Driver.Draw.device_setup":360.824,"Driver.Draw.draw_enqueued":2695.294,"Driver.Draw.post_compile_prepare":73.116,"Driver.Draw.prepare":627.499,"Driver.Draw.shader_compile_and_link":4987.354,"Driver.EndSubmission":560.443,"Driver.Packet":57385.715,"Driver.Packet.device_lock":61.609,"Driver.Packet.dispatch":7260.549,"Driver.Packet.draw":9618.792,"Driver.Packet.execute":662.086,"Driver.Packet.flip_flush":45.921,"Driver.Packet.flush_between_packets":424.435,"Driver.Packet.memory_wait":34118.03,"Driver.Packet.pipeline_drain":409.582,"Driver.Packet.pipeline_prepare":105.663,"Driver.Packet.prepare_memory":1766.594,"Driver.Packet.rendering_wait":0.345,"Driver.Present":1641.536,"Driver.Present.acquire_image":16.899,"Driver.Present.device_setup":0.196,"Driver.Present.gpu_mutex_wait":0.584,"Driver.Present.inflight_wait":0.847,"Driver.Present.present_display_buffer":69.753,"Driver.Present.queue_present":10.639,"Driver.Present.release_and_callback":0.355,"Driver.Present.render_fence_wait":1541.42,"Driver.Present.resize":0.445,"Driver.Present.validate":0.107,"Driver.Suspend":0.266,"GpuMutex.wait.dispatch":822.622,"GpuMutex.wait.draw":1437.443,"GpuMutex.wait.end":240.771,"GpuMutex.wait.fill":60.644,"GpuMutex.wait.flush":80.024,"GpuMutex.wait.hook":39.562,"GpuMutex.wait.indirect":21.754,"GpuMutex.wait.label":558.407,"GpuMutex.wait.present":0.015,"GpuMutex.wait.wait":228.239,"Graphics.Draw":6997.017,"Graphics.Draw.draw_and_resource_release":5915.613,"Graphics.Draw.index_upload":322.737,"Graphics.Draw.validate":448.154,"Graphics.Draw.vertex_upload":241.178,"Graphics.DrawWithRecipe":1230.244,"Graphics.DrawWithRecipe.draw_and_resource_release":1167.807,"Graphics.DrawWithRecipe.index_upload":10.923,"Graphics.DrawWithRecipe.validate":20.575,"Graphics.DrawWithRecipe.vertex_upload":23.073,"Recorder.Reap":759.054,"Recorder.Submit":5104.127,"Recorder.WaitSerial":1591.06,"Resources.Complete":164.995,"Resources.Prepare":123.797,"Shader.DrawStage":3415.969,"Shader.DrawStage.capture_resources":2515.907,"Shader.DrawStage.materialize":528.947,"Shader.DrawStage.prepared_invocation":345.041,"Shader.ResolveAbi":66.304,"Shader.ResolveGraphicsAbi":22.748,"Shader.ResolveGraphicsStagesAbi":240.248,"VideoOut.Flip":1653.963,"VideoOut.Flip.completion_mutex_wait":0.277,"VideoOut.Flip.config_mutex_wait":0.02,"VideoOut.Flip.frame_limit":0.173,"VideoOut.Flip.notify_game":5.842,"VideoOut.Flip.present":1641.474,"VideoOut.Flip.validate":0.391,"VideoOut.Flip.vblank_wait":0.244,"VideoOut.Flip.window_prepare":0.433,"VideoOut.Flip.window_title":4.93,"VideoOut.Readiness":0.573,"VideoOut.Readiness.locks_validate":0.34,"Vulkan.Acquire":16.347,"Vulkan.Acquire.acquire_fence_wait":0.77,"Vulkan.Acquire.acquire_image":12.907,"Vulkan.Acquire.fence_reset":2.269,"Vulkan.Acquire.retired_swapchains":0.262,"Vulkan.Dispatch":1172.55,"Vulkan.Dispatch.command_record":192.052,"Vulkan.Dispatch.shader_resources":972.647,"Vulkan.DispatchRecipe":107.53,"Vulkan.DispatchRecipe.command_record":106.719,"Vulkan.DrawFromRecipe":1241.091,"Vulkan.Present":62.058,"Vulkan.Present.command_record_scale":9.033,"Vulkan.Present.pixel_upload":0.734,"Vulkan.Present.queue_submit":51.992,"Vulkan.QueuePresent":10.131,"Vulkan.QueuePresent.queue_present":9.847,"Vulkan.Retire":1541.204,"Vulkan.Retire.wait":1536.251},"top_phases_ms_per_frame":{"Driver.Packet":183.341,"Driver.Packet.memory_wait":109.003,"Driver.Packet.draw":30.731,"Driver.Draw":30.52,"Driver.Packet.dispatch":23.197,"Graphics.Draw":22.355,"Graphics.Draw.draw_and_resource_release":18.9,"Recorder.Submit":16.307},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":3762,"Graphics.Barrier.dcc-clear":3756,"Graphics.Barrier.dcc-keys":3756,"Graphics.Barrier.dispatch-lead":21396,"Graphics.Barrier.dispatch-trail":27226,"Graphics.Barrier.draw":66256,"Graphics.Barrier.fill":9751,"Graphics.Barrier.fill-clear":4382,"Graphics.Barrier.indirect-args":2191,"Graphics.Barrier.label-run":214061,"Graphics.Barrier.present-blit":626,"Graphics.Barrier.shadow-publish":1878,"Graphics.Barrier.staging-in":14710,"Graphics.Barrier.staging-out":6568,"Graphics.Barrier.storage-upload":11894,"Graphics.Barrier.storage-writeback":48828,"Graphics.BarrierMerged.dispatch-lead":10212,"Graphics.BarrierMerged.fill":3233,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1252,"Graphics.BarrierMerged.staging-in":4994,"Graphics.BarrierMerged.staging-out":6568,"Graphics.BarrierMerged.storage-writeback":8686,"Graphics.Copy":29406,"Graphics.Copy.bytes":16683375944,"Graphics.RenderPass":27893,"Graphics.RenderPass.Close.command":12441,"Graphics.RenderPass.Close.image":3433,"Graphics.RenderPass.Close.key":1550,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":10443,"Graphics.RenderPass.Continued":201751},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.337,"events_lost":446066,"totals_full":false},"draw committer":{"events_full_after_s":15.119,"events_lost":85073,"totals_full":false}},"trace":"aps5-trace-023ea7bc27df-3434660.json.gz"} ``` **Incomplete trace:** recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately. - queue worker 0x0: 446066 events lost; buffer full at 7336.6 ms - draw committer: 85073 events lost; buffer full at 15118.7 ms **Slowest frames** (largest slices inside each, inclusive) - present 3549: 134.6 ms at 0 ms: Driver.WorkerWait (queue worker 0x46) 65.7, Driver.WorkerWait.dequeue_order (queue worker 0x46) 64.2, Driver.Packet (queue worker 0x48) 61.5, Driver.Packet (queue worker 0x0) 57.7 - present 3599: 75.7 ms at 3228 ms: Driver.Packet (queue worker 0x40) 75.0, Driver.WorkerWait (queue worker 0x46) 74.5, Driver.Packet (queue worker 0x0) 66.7, Driver.Packet (queue worker 0x48) 65.7 - present 3744: 74.7 ms at 12529 ms: Driver.Packet (queue worker 0x40) 74.0, Driver.WorkerWait (queue worker 0x46) 73.7, Driver.Packet.memory_wait (queue worker 0x40) 66.4, Driver.Packet (queue worker 0x48) 64.5 - present 3623: 71.9 ms at 4757 ms: Driver.Packet (queue worker 0x40) 71.2, Driver.WorkerWait (queue worker 0x46) 70.6, Driver.Packet (queue worker 0x48) 63.5, Driver.Packet (queue worker 0x0) 62.4 - present 3766: 71.4 ms at 13926 ms: Driver.Packet (queue worker 0x40) 70.5, Driver.Packet (queue worker 0x48) 70.0, Driver.WorkerWait (queue worker 0x46) 66.3, Driver.Packet.memory_wait (queue worker 0x48) 65.0 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 3549: 134.6 ms at 0 ms, persistence 77.3 ms - present 3599: 75.7 ms at 3228 ms, persistence 18.4 ms - present 3744: 74.7 ms at 12529 ms, persistence 16.4 ms - present 3766: 71.4 ms at 13926 ms, persistence 13.2 ms - present 3623: 71.9 ms at 4757 ms, persistence 12.9 ms - present 3660: 70.8 ms at 7152 ms, persistence 11.4 ms - present 3817: 70.5 ms at 17164 ms, persistence 11.3 ms - present 3712: 69.0 ms at 10487 ms, persistence 10.5 ms - present 3688: 68.1 ms at 8959 ms, persistence 9.3 ms - present 3555: 67.5 ms at 442 ms, persistence 9.0 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 19.9 (31 %) | 0.5 (1 %) | 43.7 | 15.5 | Driver.Packet 20.0, Driver.EndSubmission 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 64.0 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 64.1 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 64.1 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.0 (0 %) | 5.6 (9 %) | 58.5 | 0.6 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | queue worker 0x40 | 7.1 (11 %) | 56.1 (88 %) | 0.8 | 2.2 | Driver.Packet 63.0, Driver.EndSubmission 0.3 | | draw committer | 27.5 (43 %) | 4.5 (7 %) | 32.1 | 9.4 | Graphics.Draw 15.3, Recorder.Submit 9.3 | | queue worker 0x48 | 1.7 (3 %) | 61.9 (97 %) | 0.5 | 0.2 | Driver.Packet 57.0, Driver.EndSubmission 1.2 | | presenter | 0.4 (1 %) | 4.9 (8 %) | 58.8 | 0.0 | VideoOut.Flip 5.3, Driver.Present 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 64.1 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x46 | 0.9 (1 %) | 62.6 (98 %) | 0.6 | 0.8 | Driver.Packet 0.8, Driver.EndSubmission 0.2 | | gpu | 41.9 (65 %) | 0.0 (0 %) | 22.2 | 0.0 | batch 41.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 140.8, Driver.Packet.memory_wait 108.9, Driver.WorkerWait 68.3, Driver.WorkerWait.dequeue_order 55.8, batch 41.9, Graphics.Draw 15.3, Recorder.Submit 12.9, Driver.WorkerWait.idle_and_completion_poll 12.4, Driver.Packet.dispatch 12.4, Graphics.Draw.draw_and_resource_release 12.2 **Longest waits** - Driver.WorkerWait (queue worker 0x46) 97.6 ms at 6406 ms, present 3648 - Driver.WorkerWait (queue worker 0x46) 96.5 ms at 17912 ms, present 3828 - Driver.WorkerWait (queue worker 0x46) 95.6 ms at 2536 ms, present 3588 - Driver.WorkerWait (queue worker 0x46) 95.4 ms at 13962 ms, present 3766 - Driver.WorkerWait (queue worker 0x46) 94.4 ms at 13517 ms, present 3759 - Driver.WorkerWait (queue worker 0x46) 93.9 ms at 14089 ms, present 3768 - Driver.WorkerWait (queue worker 0x46) 74.6 ms at 3229 ms, present 3599 - Driver.WorkerWait (queue worker 0x46) 73.7 ms at 12530 ms, present 3744 - Driver.WorkerWait (queue worker 0x46) 70.5 ms at 4759 ms, present 3623 - Driver.WorkerWait (queue worker 0x46) 69.7 ms at 7153 ms, present 3660 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 31382: 5.6 ms at 17167 ms, present 3817: GPU no ranges; recorded by no CPU slices - batch 34483: 5.6 ms at 18902 ms, present 3844: GPU no ranges; recorded by no CPU slices - batch 654: 5.6 ms at 445 ms, present 3555: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 28.9, Driver.Packet.draw (queue worker 0x0) 17.7, Driver.Draw (queue worker 0x0) 17.6, Driver.Draw.shader_compile_and_link (queue worker 0x0) 7.7 - batch 18554: 5.6 ms at 10163 ms, present 3707: GPU no ranges; recorded by no CPU slices - batch 5645: 5.6 ms at 3167 ms, present 3598: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 25.6, Driver.Packet.draw (queue worker 0x0) 14.4, Driver.Draw (queue worker 0x0) 14.2, Driver.Packet.dispatch (queue worker 0x0) 7.7 </details> Focused tests on main and on this PR, same machine and GPU, with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R "agc_storage_write_back|agc_copied_write_back|agc_storage_split_writeback|agc_storage_writeback_blocks|agc_storage_import_segment_memo|agc_unwatch_snapshot_scope_linear"`, validation layer 1.4.341 (`/usr/lib64/libVkLayer_khronos_validation.so`): main 8/8 passed, this PR 9/9 passed; every log shows `Insert instance layer "VK_LAYER_KHRONOS_validation"`, none reports `was not found but was requested`, and neither has a `VUID-` line. Not covered: on this machine the storage write-back test's linear cases do not reach the import route (`GuestMemory::Watched` is false for them), so the test checks that the switch leaves the other routes unchanged, not the retile into a host import itself. The direct route was checked in game only (no visible difference on the world map) and on one GPU. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9060 XT, RADV (Mesa 27.0.0-devel), Linux 7.3.4 (Fedora 44 / Nobara) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-17 02:49:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T02:49:37Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this; the points below are optional.

The opt-in route is correct by reading at head 023ea7bc27, and the default path is unchanged while the switch is off.

What I ran

Head 023ea7bc27df33d1ba15c3b40f8565aea1cd1501, base main. No build and no test was run here; the reader was used to read the repository at head.

repo_read.py search directImport core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7600 7760
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 130 155
repo_read.py cat core/libs/prx/libSceAgcDriver/tests/Recorder.cpp 9690 9715
repo_read.py cat core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake 318 340
repo_read.py search HostImportDeviceLocal core/libs/prx/libSceAgcDriver
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp 40 75
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 757 790
repo_read.py search VK_BUFFER_USAGE_STORAGE_BUFFER_BIT core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp

Results

Check Result Note
Changed hunks read passed 4 of 4 reviewed files
Barrier order of the direct route passed Read at head
Host import buffer usage passed Same creation path for both heaps
Build and ctest not run Author reports 8/8 and 9/9
Performance captures not run Author's traces, not rerun

Findings

Blocking

None.

Non-blocking

  1. core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:9706: the host-retile expectation applies only when the surface is watched and linear. The description says those cases do not reach the import route on this machine. So agc_storage_write_back_host_retile does not check that the new route retiles into the import; with the switch set, the checks at lines 9707 and 9709 cannot fail for it. The test shows that the other routes are unchanged, nothing more.
  2. core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:148: the [import-writeback] (10 s) line prints the counts since the last print. After a quiet gap it covers more than 10 s, and the last window before traffic stops is never printed. The label or the window logic should match.
  3. docs/dev/ENVIRONMENT.md:243: "(discrete GPUs)" is an inference from the heap flag that HostImportDeviceLocal checks. "outside a device-local heap" alone is what the code tests.

Sources

Not verified

  • The build and the ctest runs were not done here. The 8/8 and 9/9 counts are the author's.
  • The gain is measured on one RX 9060 XT with RADV and one title. Performance on other discrete GPUs, on APUs and on other titles is not shown. The claim that the direct route moves no more data over the bus is an inference.
  • The RADV vk_meta_get_pipeline_layout cost is in Mesa, not in this repository.
  • The trace files, including aps5-trace-e4caa07950f8-3424790.json.gz, are not in the review folder. The performance figures were checked only against the digests in the description, and the separate APS5_PIPELINE_STATS=2 counts were not checked.
  • Read: Texture.cpp (the changed hunks, head 130-155 and 7600-7760, and the import helpers they call); Recorder.cpp (the changed hunk and head 9690-9715); the cmake file and ENVIRONMENT.md in full from the diff. Not read: the rest of Texture.cpp (7,988 lines) and of Recorder.cpp (17,860 lines). Excluded by rule: none.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5931952668 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21536#pullrequestreview-5931952668). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T02:49:37Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this; the points below are optional. The opt-in route is correct by reading at head 023ea7bc27df, and the default path is unchanged while the switch is off. ## What I ran Head `023ea7bc27df33d1ba15c3b40f8565aea1cd1501`, base `main`. No build and no test was run here; the reader was used to read the repository at head. ``` repo_read.py search directImport core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7600 7760 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 130 155 repo_read.py cat core/libs/prx/libSceAgcDriver/tests/Recorder.cpp 9690 9715 repo_read.py cat core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake 318 340 repo_read.py search HostImportDeviceLocal core/libs/prx/libSceAgcDriver repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp 40 75 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 757 790 repo_read.py search VK_BUFFER_USAGE_STORAGE_BUFFER_BIT core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp ``` ## Results | Check | Result | Note | |---|---|---| | Changed hunks read | passed | 4 of 4 reviewed files | | Barrier order of the direct route | passed | Read at head | | Host import buffer usage | passed | Same creation path for both heaps | | Build and ctest | not run | Author reports 8/8 and 9/9 | | Performance captures | not run | Author's traces, not rerun | ## Findings ### Blocking None. ### Non-blocking 1. `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:9706`: the host-retile expectation applies only when the surface is watched and linear. The description says those cases do not reach the import route on this machine. So `agc_storage_write_back_host_retile` does not check that the new route retiles into the import; with the switch set, the checks at lines 9707 and 9709 cannot fail for it. The test shows that the other routes are unchanged, nothing more. 2. `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:148`: the `[import-writeback] (10 s)` line prints the counts since the last print. After a quiet gap it covers more than 10 s, and the last window before traffic stops is never printed. The label or the window logic should match. 3. `docs/dev/ENVIRONMENT.md:243`: "(discrete GPUs)" is an inference from the heap flag that `HostImportDeviceLocal` checks. "outside a device-local heap" alone is what the code tests. ## Sources - Route choice and counters: https://github.com/boykopovar/AnyPS5/blob/023ea7bc27df33d1ba15c3b40f8565aea1cd1501/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L7652-L7660 - Device-local test: https://github.com/boykopovar/AnyPS5/blob/023ea7bc27df33d1ba15c3b40f8565aea1cd1501/core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp#L60-L62 - Host-pointer import for either heap: https://github.com/boykopovar/AnyPS5/blob/023ea7bc27df33d1ba15c3b40f8565aea1cd1501/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L757-L771 ## Not verified - The build and the ctest runs were not done here. The 8/8 and 9/9 counts are the author's. - The gain is measured on one RX 9060 XT with RADV and one title. Performance on other discrete GPUs, on APUs and on other titles is not shown. The claim that the direct route moves no more data over the bus is an inference. - The RADV `vk_meta_get_pipeline_layout` cost is in Mesa, not in this repository. - The trace files, including `aps5-trace-e4caa07950f8-3424790.json.gz`, are not in the review folder. The performance figures were checked only against the digests in the description, and the separate `APS5_PIPELINE_STATS=2` counts were not checked. - Read: `Texture.cpp` (the changed hunks, head 130-155 and 7600-7760, and the import helpers they call); `Recorder.cpp` (the changed hunk and head 9690-9715); the cmake file and `ENVIRONMENT.md` in full from the diff. Not read: the rest of `Texture.cpp` (7,988 lines) and of `Recorder.cpp` (17,860 lines). Excluded by rule: none. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
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!21536
No description provided.