perf(agc): bind indices behind a GPU writer for draws with vertex attributes #26775

Merged
Gonic0 merged 1 commit from upstream-pr/26775 into main 2026-11-25 15:40:18 +00:00
Gonic0 commented 2026-11-24 21:08:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gonic0 on 2026-11-24T21:08:04Z.


What

With APS5_INDEX_IN_PLACE_BEHIND_WRITER, an indexed draw binds its index range in place from the host import behind a pending GPU writer, instead of waiting for the writer and copying the range on the CPU. Until now InPlaceIndexBehindWriter refused every draw whose vertex shader has fixed vertex attributes (IndexBehindWriter::VertexAttributes). The vertex buffer copies are sized from the highest index, and the CPU cannot read that while the GPU still writes the indices. Those draws fell back to InPlaceDrawInput(..., nullptr), whose FlushGpuWrites waits for the writer under the GPU mutex.

This PR takes those draws behind the writer too:

  • InPlaceIndexBehindWriter no longer refuses vertex attributes. Its vertexAttributes parameter and the VertexAttributes outcome are removed.
  • In prepareDrawInputs, when the indices are bound behind the writer (inputs.indexInputBehindGpuWrite), each attribute's range is the whole buffer descriptor (VertexBufferExtent), as for an indirect draw. firstByte, fetchValid and rangeFrom follow the same rule.
  • docs/dev/ENVIRONMENT.md describes the new behaviour and drops vertex attributes from the [index-behind-writer] outcomes.

The switch stays opt-in. Without it nothing changes.

This touches the same lines of Graphics/src/Draw.cpp as #19620 (fetchValid), #26036 (firstByte), #26041 and #26706 (Draw.hpp), on other topics. Whichever lands second has a small textual conflict.

#21923 works on the same wait from the other side: it releases the GPU mutex while an indexed draw waits for its index writer. This PR removes that wait for draws with vertex attributes when APS5_INDEX_IN_PLACE_BEHIND_WRITER is on. They do not implement the same thing, but both change the InPlaceIndexBehindWriter call line in prepareDrawInputs.

Tested

macOS 27.3, Apple M5 Pro, MoltenVK from Vulkan SDK 1.4.363.0, x86_64 Release build under Rosetta. main does not build on macOS right now (libc/src/exception/Runtime.cpp uses __sub_kind values that Apple's libc++abi does not declare), so #26739 was applied locally for both builds and is not part of this PR.

  • New test agc_driver_index_behind_writer_vertex_attributes (tests/execution/IndexBehindWriterVertexAttributes.cpp):

    • An indexed draw with 16-bit indices and one fixed vertex attribute (16 records, stride 32, OOB_SELECT 2), over a watched, host-imported index block. The CPU first writes stale indices {0, 1, 2, ...}. A recorded FillBuffer in the open batch then writes {0, 9, 15, 3, 12, 7}.
    • With the switch on, the draw takes Taken and nothing else. Every referenced vertex holds its exact attribute bits, including record 15, which a range sized from the stale indices (highest 2) misses. Unreferenced vertices stay unwritten.
    • With the switch off, the outcome counters do not move and the output is identical.
    • With only the descriptor-range sizing reverted, the test fails: vertex fetch exceeds descriptor record count: OOB_SELECT 2, stride 32, NUM_RECORDS 16, vertex index 65535.
  • agc_index_in_place_behind_writer (updated for the removed outcome) passes.

  • Validation layer A/B, same machine, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer and the 1.4.363 layer, running ctest --test-dir build -R <pattern> -V:

    • main: agc_index_in_place_behind_writer, agc_driver_vertex_fetch and agc_driver_draw_offset_indices pass.
    • This PR: the same three plus the new test pass.
    • Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" for every test and no was not found but was requested by env var VK_INSTANCE_LAYERS.
    • The only validation message in both is VUID-VkDeviceCreateInfo-sType-unique, twice, at device creation in agc_index_in_place_behind_writer. The PR adds no new VUID-.
  • Grand Theft Auto V (PPSA04264), first 3D scene, on a lab build that needs unmerged fixes to get there, not main. With APS5_INDEX_IN_PLACE_BEHIND_WRITER=1, [index-behind-writer] counted about 70 refusals per 10 s as vertex attributes. Each one waited about 40 ms for its writer under the GPU mutex, with the index bytes unchanged after the wait. With the switch on in both runs, this change brought the GPU mutex waits over 1 ms from 226 to 23 ms per frame. The draw committer went from 102.8 µs per commit ([draw] pipelined, a run without the switch) to 59.6 µs (switch on, this change).

    The frame time did not change, because those waits were not on that scene's critical path. I make no speed claim.

Performance capture

main does not reach this scene on macOS, so both captures come from the lab build of the GTA V bullet above, with the same steps for each:

  • Baseline d39ebf7cec89: the lab build, with the lab copy of this change removed.
  • Candidate 49105d912269: the baseline with this PR's commit cherry-picked onto it (the same 5 files, +277/-29).

Both builds are clean (dirty: false). Same machine (Apple M5 Pro, macOS 27.3, x86_64 Release under Rosetta), KosmicKrisp (Mesa fc930002fc with local lab changes), GTA V 01.011.001 at 3840x2160, the same pad script, the same APS5_* environment with APS5_INDEX_IN_PLACE_BEHIND_WRITER=1, and frames 2800:150. tools/performance_compare.py --require-matching-context reports no configuration difference.

  • GpuMutex.wait.hook went from 175.9 to 29.3 ms per frame, and GpuMutex.wait.end from 9.1 to 0.8.
  • Frame p50 went from 316.4 to 304.7 ms and the mean from 323.6 to 307.7 ms. This is one capture of each build. Two earlier runs of one unchanged lab build on this scene gave a p50 of 321.0 and 327.6 ms, so the frame-time difference is within run-to-run noise. The candidate window also compiled more shaders (Driver.Draw.shader_compile_and_link 81.2 against 19.8 ms per frame). I still make no speed claim.

The two traces are attached in a comment below.

Baseline summary line:

{"commit":"d39ebf7cec89","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":48545.598},"presents":150,"frame_ms":{"p50":316.403,"p90":354.129,"p99":439.834,"max":455.281},"gpu_busy_ms_per_present":190.704,"worker_busy_pct":{"queue worker 0x0":99.537,"queue worker 0x20":46.972,"queue worker 0x38":63.942,"queue worker 0x28":47.116,"queue worker 0x30":38.595},"phase_totals_ms":{"Driver.Completion":1.306,"Driver.Dispatch":41094.310,"Driver.Dispatch.capture_resources":7959.406,"Driver.Dispatch.decode_key_device_setup":3.996,"Driver.Dispatch.lab_candidate":1.939,"Driver.Dispatch.lab_device":24.657,"Driver.Dispatch.lab_drain":5923.919,"Driver.Dispatch.lab_fill":4.294,"Driver.Dispatch.lab_hle":4.008,"Driver.Dispatch.lab_htile":2.536,"Driver.Dispatch.lab_indirect":3.587,"Driver.Dispatch.lab_msclear":2.467,"Driver.Dispatch.lab_partial":1.550,"Driver.Dispatch.lab_split":5.799,"Driver.Dispatch.lookup_cache":6055.296,"Driver.Dispatch.materialize":2174.080,"Driver.Dispatch.prepared_invocation":27.275,"Driver.Draw":20272.107,"Driver.Draw.device_setup":131.947,"Driver.Draw.draw_enqueued":15956.359,"Driver.Draw.post_compile_prepare":348.678,"Driver.Draw.prepare":621.843,"Driver.Draw.shader_compile_and_link":2962.783,"Driver.EndSubmission":1492.551,"Driver.Packet":141969.669,"Driver.Packet.device_lock":49.734,"Driver.Packet.dispatch":47086.159,"Driver.Packet.draw":20304.307,"Driver.Packet.execute":531.437,"Driver.Packet.flip_flush":39.782,"Driver.Packet.flush_between_packets":1704.751,"Driver.Packet.memory_wait":70900.215,"Driver.Packet.pipeline_drain":236.789,"Driver.Packet.pipeline_prepare":74.937,"Driver.Packet.prepare_memory":104.526,"Driver.Packet.rendering_wait":0.171,"Driver.Present":4156.354,"Driver.Present.acquire_image":23.033,"Driver.Present.device_setup":0.110,"Driver.Present.gpu_mutex_wait":2.995,"Driver.Present.inflight_wait":0.486,"Driver.Present.present_display_buffer":13.820,"Driver.Present.queue_present":11.951,"Driver.Present.release_and_callback":0.390,"Driver.Present.render_fence_wait":4099.542,"Driver.Present.resize":3.919,"Driver.Present.validate":0.034,"Driver.Rewind":309.931,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":136.646,"GpuMutex.wait.draw":3017.024,"GpuMutex.wait.end":1365.863,"GpuMutex.wait.fill":4.196,"GpuMutex.wait.flush":1556.514,"GpuMutex.wait.hook":26384.912,"GpuMutex.wait.indirect":23.865,"GpuMutex.wait.label":130.287,"GpuMutex.wait.other":59.035,"GpuMutex.wait.present":2.673,"Graphics.Draw":20542.466,"Graphics.Draw.draw_and_resource_release":7795.932,"Graphics.Draw.index_upload":11946.512,"Graphics.Draw.validate":347.228,"Graphics.Draw.vertex_upload":330.686,"Graphics.DrawWithRecipe":1322.869,"Graphics.DrawWithRecipe.draw_and_resource_release":1118.324,"Graphics.DrawWithRecipe.index_upload":176.400,"Graphics.DrawWithRecipe.validate":4.994,"Graphics.DrawWithRecipe.vertex_upload":19.760,"Graphics.Submit":0.022,"Graphics.Submit.command_end":0.010,"Graphics.Submit.queue_submit":0.011,"Graphics.Wait":10.523,"Graphics.Wait.fence_wait":10.289,"Recorder.Reap":139.682,"Recorder.Submit":1295.740,"Recorder.Sync":10968.370,"Recorder.WaitSerial":9947.133,"Resources.Complete":5964.761,"Resources.Prepare":1366.702,"Shader.DrawStage":2067.381,"Shader.DrawStage.capture_resources":882.322,"Shader.DrawStage.materialize":820.165,"Shader.DrawStage.prepared_invocation":348.362,"Shader.ResolveGraphicsStagesAbi":4.168,"VideoOut.Flip":4178.633,"VideoOut.Flip.completion_mutex_wait":0.510,"VideoOut.Flip.config_mutex_wait":0.013,"VideoOut.Flip.frame_limit":0.097,"VideoOut.Flip.notify_game":3.660,"VideoOut.Flip.present":4140.163,"VideoOut.Flip.validate":0.223,"VideoOut.Flip.vblank_wait":0.213,"VideoOut.Flip.window_prepare":4.989,"VideoOut.Flip.window_title":28.648,"VideoOut.Readiness":0.375,"VideoOut.Readiness.locks_validate":0.206,"Vulkan.Acquire":22.849,"Vulkan.Acquire.acquire_fence_wait":0.206,"Vulkan.Acquire.acquire_image":22.024,"Vulkan.Acquire.fence_reset":0.463,"Vulkan.Acquire.retired_swapchains":0.087,"Vulkan.ComputePipeline":73.132,"Vulkan.Dispatch":7087.961,"Vulkan.Dispatch.command_record":644.135,"Vulkan.Dispatch.shader_resources":6434.076,"Vulkan.DispatchRecipe":109.346,"Vulkan.DispatchRecipe.command_record":107.996,"Vulkan.DrawFromRecipe":1324.997,"Vulkan.Present":10.522,"Vulkan.Present.command_record_scale":8.650,"Vulkan.Present.pixel_upload":0.383,"Vulkan.Present.queue_submit":1.362,"Vulkan.QueuePresent":11.762,"Vulkan.QueuePresent.queue_present":8.477,"Vulkan.Retire":4099.483,"Vulkan.Retire.wait":4097.108},"top_phases_ms_per_frame":{"Driver.Packet":946.464,"Driver.Packet.memory_wait":472.668,"Driver.Packet.dispatch":313.908,"Driver.Dispatch":273.962,"GpuMutex.wait.hook":175.899,"Graphics.Draw":136.950,"Driver.Packet.draw":135.362,"Driver.Draw":135.147},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":8543,"Graphics.Barrier.dcc-clear":5964,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68434,"Graphics.Barrier.dispatch-trail":35689,"Graphics.Barrier.draw":68304,"Graphics.Barrier.fill":7245,"Graphics.Barrier.fill-clear":2788,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":67419,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1784,"Graphics.Barrier.staging-in":37859,"Graphics.Barrier.staging-out":17944,"Graphics.Barrier.storage-upload":16680,"Graphics.Barrier.storage-writeback":17767,"Graphics.BarrierMerged.dispatch-lead":9281,"Graphics.BarrierMerged.fill":3833,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1468,"Graphics.BarrierMerged.staging-in":17316,"Graphics.BarrierMerged.staging-out":17944,"Graphics.BarrierMerged.storage-writeback":4572,"Graphics.Copy":60895,"Graphics.Copy.bytes":35051367814,"Graphics.RenderPass":28321,"Graphics.RenderPass.Close.command":6848,"Graphics.RenderPass.Close.image":6898,"Graphics.RenderPass.Close.key":3374,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":11082,"Graphics.RenderPass.Close.raw":17,"Graphics.RenderPass.Continued":174350},"trace_dropped":false,"trace":"aps5-trace-d39ebf7cec89-58640.json.gz"}

Candidate summary line:

{"commit":"49105d912269","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":46157.274},"presents":150,"frame_ms":{"p50":304.723,"p90":336.207,"p99":382.189,"max":389.934},"gpu_busy_ms_per_present":179.080,"worker_busy_pct":{"queue worker 0x0":99.543,"queue worker 0x20":37.884,"queue worker 0x28":49.230,"queue worker 0x38":63.510,"queue worker 0x30":46.649},"phase_totals_ms":{"Driver.Completion":1.081,"Driver.Dispatch":39591.809,"Driver.Dispatch.capture_resources":7584.924,"Driver.Dispatch.decode_key_device_setup":3.717,"Driver.Dispatch.lab_candidate":1.883,"Driver.Dispatch.lab_device":22.391,"Driver.Dispatch.lab_drain":5162.182,"Driver.Dispatch.lab_fill":3.968,"Driver.Dispatch.lab_hle":3.557,"Driver.Dispatch.lab_htile":2.292,"Driver.Dispatch.lab_indirect":3.409,"Driver.Dispatch.lab_msclear":2.266,"Driver.Dispatch.lab_partial":1.484,"Driver.Dispatch.lab_split":5.295,"Driver.Dispatch.lookup_cache":5512.459,"Driver.Dispatch.materialize":2373.021,"Driver.Dispatch.prepared_invocation":25.266,"Driver.Draw":18964.975,"Driver.Draw.device_setup":117.430,"Driver.Draw.draw_enqueued":5504.747,"Driver.Draw.post_compile_prepare":340.797,"Driver.Draw.prepare":567.044,"Driver.Draw.shader_compile_and_link":12179.167,"Driver.EndSubmission":277.879,"Driver.Packet":136396.854,"Driver.Packet.device_lock":46.299,"Driver.Packet.dispatch":45757.888,"Driver.Packet.draw":18993.443,"Driver.Packet.execute":390.092,"Driver.Packet.flip_flush":38.109,"Driver.Packet.flush_between_packets":1225.669,"Driver.Packet.memory_wait":69049.885,"Driver.Packet.pipeline_drain":229.004,"Driver.Packet.pipeline_prepare":68.229,"Driver.Packet.prepare_memory":97.463,"Driver.Packet.rendering_wait":0.147,"Driver.Present":4478.204,"Driver.Present.acquire_image":21.418,"Driver.Present.device_setup":0.134,"Driver.Present.gpu_mutex_wait":4.392,"Driver.Present.inflight_wait":0.410,"Driver.Present.present_display_buffer":13.188,"Driver.Present.queue_present":12.469,"Driver.Present.release_and_callback":0.461,"Driver.Present.render_fence_wait":4422.078,"Driver.Present.resize":3.547,"Driver.Present.validate":0.034,"Driver.Rewind":326.286,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":147.690,"GpuMutex.wait.draw":2828.828,"GpuMutex.wait.end":113.441,"GpuMutex.wait.fill":58.889,"GpuMutex.wait.flush":1082.000,"GpuMutex.wait.hook":4402.172,"GpuMutex.wait.indirect":16.232,"GpuMutex.wait.label":84.191,"GpuMutex.wait.other":95.222,"GpuMutex.wait.present":4.085,"Graphics.Draw":9438.076,"Graphics.Draw.draw_and_resource_release":8484.534,"Graphics.Draw.index_upload":237.455,"Graphics.Draw.validate":322.542,"Graphics.Draw.vertex_upload":301.295,"Graphics.DrawWithRecipe":643.314,"Graphics.DrawWithRecipe.draw_and_resource_release":620.175,"Graphics.DrawWithRecipe.index_upload":3.193,"Graphics.DrawWithRecipe.validate":3.207,"Graphics.DrawWithRecipe.vertex_upload":14.405,"Graphics.Submit":0.048,"Graphics.Submit.command_end":0.014,"Graphics.Submit.queue_submit":0.034,"Graphics.Wait":6.158,"Graphics.Wait.fence_wait":5.922,"Recorder.Reap":119.401,"Recorder.Submit":1186.896,"Recorder.Sync":820.615,"Recorder.WaitSerial":10199.435,"Resources.Complete":5823.088,"Resources.Prepare":1333.297,"Shader.DrawStage":2114.769,"Shader.DrawStage.capture_resources":821.093,"Shader.DrawStage.materialize":971.271,"Shader.DrawStage.prepared_invocation":306.747,"Shader.ResolveGraphicsStagesAbi":3.968,"VideoOut.Flip":4483.789,"VideoOut.Flip.completion_mutex_wait":0.513,"VideoOut.Flip.config_mutex_wait":0.012,"VideoOut.Flip.frame_limit":0.103,"VideoOut.Flip.notify_game":4.823,"VideoOut.Flip.present":4445.570,"VideoOut.Flip.validate":0.177,"VideoOut.Flip.vblank_wait":0.262,"VideoOut.Flip.window_prepare":4.149,"VideoOut.Flip.window_title":28.039,"VideoOut.Readiness":0.404,"VideoOut.Readiness.locks_validate":0.226,"Vulkan.Acquire":21.240,"Vulkan.Acquire.acquire_fence_wait":0.187,"Vulkan.Acquire.acquire_image":20.451,"Vulkan.Acquire.fence_reset":0.456,"Vulkan.Acquire.retired_swapchains":0.080,"Vulkan.Dispatch":6970.825,"Vulkan.Dispatch.command_record":626.482,"Vulkan.Dispatch.shader_resources":6335.010,"Vulkan.DispatchRecipe":100.917,"Vulkan.DispatchRecipe.command_record":99.642,"Vulkan.DrawFromRecipe":644.699,"Vulkan.Present":9.963,"Vulkan.Present.command_record_scale":8.188,"Vulkan.Present.pixel_upload":0.397,"Vulkan.Present.queue_submit":1.245,"Vulkan.QueuePresent":12.282,"Vulkan.QueuePresent.queue_present":8.332,"Vulkan.Retire":4422.019,"Vulkan.Retire.wait":4419.736},"top_phases_ms_per_frame":{"Driver.Packet":909.312,"Driver.Packet.memory_wait":460.333,"Driver.Packet.dispatch":305.053,"Driver.Dispatch":263.945,"Driver.Packet.draw":126.623,"Driver.Draw":126.433,"Driver.Draw.shader_compile_and_link":81.194,"Recorder.WaitSerial":67.996},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":9219,"Graphics.Barrier.dcc-clear":5968,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68509,"Graphics.Barrier.dispatch-trail":35781,"Graphics.Barrier.draw":88556,"Graphics.Barrier.fill":7169,"Graphics.Barrier.fill-clear":2834,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":66653,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1803,"Graphics.Barrier.staging-in":38008,"Graphics.Barrier.staging-out":18001,"Graphics.Barrier.storage-upload":16828,"Graphics.Barrier.storage-writeback":17772,"Graphics.BarrierMerged.dispatch-lead":9308,"Graphics.BarrierMerged.fill":3835,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1483,"Graphics.BarrierMerged.staging-in":17511,"Graphics.BarrierMerged.staging-out":18001,"Graphics.BarrierMerged.storage-writeback":4546,"Graphics.Copy":61119,"Graphics.Copy.bytes":34864607802,"Graphics.RenderPass":34981,"Graphics.RenderPass.Close.command":14139,"Graphics.RenderPass.Close.image":6808,"Graphics.RenderPass.Close.key":3296,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":10598,"Graphics.RenderPass.Close.raw":18,"Graphics.RenderPass.Continued":158832},"trace_dropped":false,"trace":"aps5-trace-49105d912269-87121.json.gz"}
tools/performance_compare.py

Performance comparison

Capture Commit Trace Presents Window (ms)
baseline d39ebf7cec89 aps5-trace-d39ebf7cec89-58640.json.gz 150 48545.598
candidate 49105d912269 aps5-trace-49105d912269-87121.json.gz 150 46157.274
  • Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene.
  • Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval.
  • A missing top phase is unreported, not zero; its change is unavailable.
  • Worker busy changes are percentage points; change (%) is relative to the baseline. Workers are matched by their recorded names; a missing worker is unreported, not idle.
  • Graphics-track rates are per present; a capture without a graphics track is unknown, not zero.

Frame and GPU times (ms)

Metric Baseline Candidate Change Change (%)
frame_ms.p50 316.403 304.723 -11.680 -3.691
frame_ms.p90 354.129 336.207 -17.922 -5.061
frame_ms.p99 439.834 382.189 -57.645 -13.106
frame_ms.max 455.281 389.934 -65.347 -14.353
mean_frame_ms 323.637 307.715 -15.922 -4.920
gpu_busy_ms_per_present 190.704 179.080 -11.624 -6.095

Top phases (ms per frame)

Metric Baseline Candidate Change Change (%)
Driver.Dispatch 273.962 263.945 -10.017 -3.656
Driver.Draw 135.147 126.433 -8.714 -6.448
Driver.Draw.shader_compile_and_link n/a 81.194 n/a n/a
Driver.Packet 946.464 909.312 -37.152 -3.925
Driver.Packet.dispatch 313.908 305.053 -8.855 -2.821
Driver.Packet.draw 135.362 126.623 -8.739 -6.456
Driver.Packet.memory_wait 472.668 460.333 -12.335 -2.610
GpuMutex.wait.hook 175.899 n/a n/a n/a
Graphics.Draw 136.950 n/a n/a n/a
Recorder.WaitSerial n/a 67.996 n/a n/a

Worker busy time (%)

Metric Baseline Candidate Change (pp) Change (%)
queue worker 0x0 99.537 99.543 +0.006 +0.006
queue worker 0x20 46.972 37.884 -9.088 -19.348
queue worker 0x28 47.116 49.230 +2.114 +4.487
queue worker 0x30 38.595 46.649 +8.054 +20.868
queue worker 0x38 63.942 63.510 -0.432 -0.676

Graphics track (per present)

Metric Baseline Candidate Change Change (%)
render passes 188.807 233.207 +44.400 +23.516
continued draws 1162.333 1058.880 -103.453 -8.900
barriers 2541.473 2679.347 +137.873 +5.425
merged barriers 362.933 364.707 +1.773 +0.489
copies 405.967 407.460 +1.493 +0.368
copy MiB 222.851 221.663 -1.187 -0.533
tools/trace_digest.py, baseline

frames 2800:150 from present 2800: 150 presents, frame p50 316.4 / p90 354.1 / p99 439.8 / max 455.3 ms, GPU busy 190.7 ms per present
Apple M5 Pro, KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc), Darwin 27.3.0, 3840x2160, commit d39ebf7cec89, dropped: no

{"commit":"d39ebf7cec89","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":48545.598},"presents":150,"frame_ms":{"p50":316.403,"p90":354.129,"p99":439.834,"max":455.281},"gpu_busy_ms_per_present":190.704,"worker_busy_pct":{"queue worker 0x0":99.537,"queue worker 0x20":46.972,"queue worker 0x38":63.942,"queue worker 0x28":47.116,"queue worker 0x30":38.595},"phase_totals_ms":{"Driver.Completion":1.306,"Driver.Dispatch":41094.31,"Driver.Dispatch.capture_resources":7959.406,"Driver.Dispatch.decode_key_device_setup":3.996,"Driver.Dispatch.lab_candidate":1.939,"Driver.Dispatch.lab_device":24.657,"Driver.Dispatch.lab_drain":5923.919,"Driver.Dispatch.lab_fill":4.294,"Driver.Dispatch.lab_hle":4.008,"Driver.Dispatch.lab_htile":2.536,"Driver.Dispatch.lab_indirect":3.587,"Driver.Dispatch.lab_msclear":2.467,"Driver.Dispatch.lab_partial":1.55,"Driver.Dispatch.lab_split":5.799,"Driver.Dispatch.lookup_cache":6055.296,"Driver.Dispatch.materialize":2174.08,"Driver.Dispatch.prepared_invocation":27.275,"Driver.Draw":20272.107,"Driver.Draw.device_setup":131.947,"Driver.Draw.draw_enqueued":15956.359,"Driver.Draw.post_compile_prepare":348.678,"Driver.Draw.prepare":621.843,"Driver.Draw.shader_compile_and_link":2962.783,"Driver.EndSubmission":1492.551,"Driver.Packet":141969.669,"Driver.Packet.device_lock":49.734,"Driver.Packet.dispatch":47086.159,"Driver.Packet.draw":20304.307,"Driver.Packet.execute":531.437,"Driver.Packet.flip_flush":39.782,"Driver.Packet.flush_between_packets":1704.751,"Driver.Packet.memory_wait":70900.215,"Driver.Packet.pipeline_drain":236.789,"Driver.Packet.pipeline_prepare":74.937,"Driver.Packet.prepare_memory":104.526,"Driver.Packet.rendering_wait":0.171,"Driver.Present":4156.354,"Driver.Present.acquire_image":23.033,"Driver.Present.device_setup":0.11,"Driver.Present.gpu_mutex_wait":2.995,"Driver.Present.inflight_wait":0.486,"Driver.Present.present_display_buffer":13.82,"Driver.Present.queue_present":11.951,"Driver.Present.release_and_callback":0.39,"Driver.Present.render_fence_wait":4099.542,"Driver.Present.resize":3.919,"Driver.Present.validate":0.034,"Driver.Rewind":309.931,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":136.646,"GpuMutex.wait.draw":3017.024,"GpuMutex.wait.end":1365.863,"GpuMutex.wait.fill":4.196,"GpuMutex.wait.flush":1556.514,"GpuMutex.wait.hook":26384.912,"GpuMutex.wait.indirect":23.865,"GpuMutex.wait.label":130.287,"GpuMutex.wait.other":59.035,"GpuMutex.wait.present":2.673,"Graphics.Draw":20542.466,"Graphics.Draw.draw_and_resource_release":7795.932,"Graphics.Draw.index_upload":11946.512,"Graphics.Draw.validate":347.228,"Graphics.Draw.vertex_upload":330.686,"Graphics.DrawWithRecipe":1322.869,"Graphics.DrawWithRecipe.draw_and_resource_release":1118.324,"Graphics.DrawWithRecipe.index_upload":176.4,"Graphics.DrawWithRecipe.validate":4.994,"Graphics.DrawWithRecipe.vertex_upload":19.76,"Graphics.Submit":0.022,"Graphics.Submit.command_end":0.01,"Graphics.Submit.queue_submit":0.011,"Graphics.Wait":10.523,"Graphics.Wait.fence_wait":10.289,"Recorder.Reap":139.682,"Recorder.Submit":1295.74,"Recorder.Sync":10968.37,"Recorder.WaitSerial":9947.133,"Resources.Complete":5964.761,"Resources.Prepare":1366.702,"Shader.DrawStage":2067.381,"Shader.DrawStage.capture_resources":882.322,"Shader.DrawStage.materialize":820.165,"Shader.DrawStage.prepared_invocation":348.362,"Shader.ResolveGraphicsStagesAbi":4.168,"VideoOut.Flip":4178.633,"VideoOut.Flip.completion_mutex_wait":0.51,"VideoOut.Flip.config_mutex_wait":0.013,"VideoOut.Flip.frame_limit":0.097,"VideoOut.Flip.notify_game":3.66,"VideoOut.Flip.present":4140.163,"VideoOut.Flip.validate":0.223,"VideoOut.Flip.vblank_wait":0.213,"VideoOut.Flip.window_prepare":4.989,"VideoOut.Flip.window_title":28.648,"VideoOut.Readiness":0.375,"VideoOut.Readiness.locks_validate":0.206,"Vulkan.Acquire":22.849,"Vulkan.Acquire.acquire_fence_wait":0.206,"Vulkan.Acquire.acquire_image":22.024,"Vulkan.Acquire.fence_reset":0.463,"Vulkan.Acquire.retired_swapchains":0.087,"Vulkan.ComputePipeline":73.132,"Vulkan.Dispatch":7087.961,"Vulkan.Dispatch.command_record":644.135,"Vulkan.Dispatch.shader_resources":6434.076,"Vulkan.DispatchRecipe":109.346,"Vulkan.DispatchRecipe.command_record":107.996,"Vulkan.DrawFromRecipe":1324.997,"Vulkan.Present":10.522,"Vulkan.Present.command_record_scale":8.65,"Vulkan.Present.pixel_upload":0.383,"Vulkan.Present.queue_submit":1.362,"Vulkan.QueuePresent":11.762,"Vulkan.QueuePresent.queue_present":8.477,"Vulkan.Retire":4099.483,"Vulkan.Retire.wait":4097.108},"top_phases_ms_per_frame":{"Driver.Packet":946.464,"Driver.Packet.memory_wait":472.668,"Driver.Packet.dispatch":313.908,"Driver.Dispatch":273.962,"GpuMutex.wait.hook":175.899,"Graphics.Draw":136.95,"Driver.Packet.draw":135.362,"Driver.Draw":135.147},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":8543,"Graphics.Barrier.dcc-clear":5964,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68434,"Graphics.Barrier.dispatch-trail":35689,"Graphics.Barrier.draw":68304,"Graphics.Barrier.fill":7245,"Graphics.Barrier.fill-clear":2788,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":67419,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1784,"Graphics.Barrier.staging-in":37859,"Graphics.Barrier.staging-out":17944,"Graphics.Barrier.storage-upload":16680,"Graphics.Barrier.storage-writeback":17767,"Graphics.BarrierMerged.dispatch-lead":9281,"Graphics.BarrierMerged.fill":3833,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1468,"Graphics.BarrierMerged.staging-in":17316,"Graphics.BarrierMerged.staging-out":17944,"Graphics.BarrierMerged.storage-writeback":4572,"Graphics.Copy":60895,"Graphics.Copy.bytes":35051367814,"Graphics.RenderPass":28321,"Graphics.RenderPass.Close.command":6848,"Graphics.RenderPass.Close.image":6898,"Graphics.RenderPass.Close.key":3374,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":11082,"Graphics.RenderPass.Close.raw":17,"Graphics.RenderPass.Continued":174350},"trace_dropped":false,"trace":"aps5-trace-d39ebf7cec89-58640.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2898: 455.3 ms at 31732 ms: Driver.WorkerWait (queue worker 0x38) 455.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 455.3, Driver.WorkerWait (queue worker 0x30) 455.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 455.3
  • present 2824: 439.8 ms at 8235 ms: Driver.WorkerWait (queue worker 0x20) 439.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 439.8, Driver.Packet (queue worker 0x30) 439.5, Driver.Packet (queue worker 0x0) 425.2
  • present 2935: 400.6 ms at 43515 ms: Driver.WorkerWait (queue worker 0x28) 400.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 400.6, Driver.Packet (queue worker 0x20) 390.0, Driver.Packet (queue worker 0x0) 380.4
  • present 2866: 400.5 ms at 21185 ms: Driver.WorkerWait (queue worker 0x38) 400.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 400.5, Driver.WorkerWait (queue worker 0x28) 400.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 400.5
  • present 2827: 398.3 ms at 9344 ms: Driver.WorkerWait (queue worker 0x38) 398.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 398.3, Driver.WorkerWait (queue worker 0x28) 398.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 398.3

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

  • present 2898: 455.3 ms at 31732 ms, persistence 167.8 ms
  • present 2824: 439.8 ms at 8235 ms, persistence 152.3 ms
  • present 2935: 400.6 ms at 43515 ms, persistence 93.3 ms
  • present 2866: 400.5 ms at 21185 ms, persistence 91.6 ms
  • present 2827: 398.3 ms at 9344 ms, persistence 72.5 ms
  • present 2802: 377.0 ms at 736 ms, persistence 55.1 ms
  • present 2937: 349.6 ms at 44232 ms, persistence 32.7 ms
  • present 2885: 334.2 ms at 27623 ms, persistence 22.1 ms
  • present 2941: 337.0 ms at 45563 ms, persistence 21.4 ms
  • present 2924: 330.2 ms at 39988 ms, persistence 20.4 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.1 (0 %) 323.5 0.0 Recorder.Submit 0.0
queue worker 0x0 216.8 (67 %) 90.3 (28 %) 16.5 86.0 Driver.Packet 304.4, Driver.Rewind 1.8
draw committer 144.5 (45 %) 21.6 (7 %) 157.5 25.6 Graphics.Draw 129.1, Vulkan.DrawFromRecipe 8.6
presenter 0.6 (0 %) 27.3 (8 %) 295.7 0.0 VideoOut.Flip 27.9, Driver.Present 0.1
title 0.0 (0 %) 0.5 (0 %) 323.1 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x20 20.7 (6 %) 298.7 (92 %) 4.2 1.8 Driver.Packet 149.4, Driver.EndSubmission 2.5
queue worker 0x38 35.2 (11 %) 286.2 (88 %) 2.2 3.8 Driver.Packet 204.1, Driver.EndSubmission 2.6
title 0.0 (0 %) 0.5 (0 %) 323.1 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.5 (0 %) 323.1 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x28 18.6 (6 %) 301.2 (93 %) 3.8 1.8 Driver.Packet 150.1, Driver.EndSubmission 2.3
title 0.0 (0 %) 0.5 (0 %) 323.1 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x30 14.5 (4 %) 307.4 (95 %) 1.7 1.2 Driver.Packet 121.1, Driver.EndSubmission 1.7
gpu 190.5 (59 %) 0.0 (0 %) 133.1 0.0 batch 190.5

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 929.1, Driver.WorkerWait 647.9, Driver.WorkerWait.idle_and_completion_poll 647.9, Driver.Packet.memory_wait 470.6, Driver.Packet.dispatch 313.3, Driver.Dispatch 273.3, batch 190.5, GpuMutex.wait.hook 175.8, Graphics.Draw 129.1, Driver.Packet.draw 124.6

Longest waits

  • Driver.WorkerWait (queue worker 0x30) 3713.0 ms at 15065 ms, present 2845
  • Driver.WorkerWait (queue worker 0x30) 2788.4 ms at 28336 ms, present 2887
  • Driver.WorkerWait (queue worker 0x20) 2675.2 ms at 6381 ms, present 2818
  • Driver.WorkerWait (queue worker 0x28) 2349.2 ms at 1906 ms, present 2805
  • Driver.WorkerWait (queue worker 0x30) 2254.5 ms at 12390 ms, present 2836
  • Driver.WorkerWait (queue worker 0x20) 2123.8 ms at 24903 ms, present 2876
  • Driver.WorkerWait (queue worker 0x20) 2037.9 ms at 9905 ms, present 2828
  • Driver.WorkerWait (queue worker 0x28) 2036.6 ms at 20284 ms, present 2863
  • Driver.WorkerWait (queue worker 0x30) 1827.0 ms at 9807 ms, present 2828
  • Driver.WorkerWait (queue worker 0x28) 1651.7 ms at 12697 ms, present 2837

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

  • batch 11657: 85.2 ms at 20893 ms, present 2865: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 14.1, Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Prepare (draw committer) 0.0
  • batch 26226: 85.1 ms at 47641 ms, present 2947: GPU no ranges; recorded by Recorder.Sync (draw committer) 86.1, GpuMutex.wait.draw (draw committer) 16.7, Graphics.Draw (draw committer) 1.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.8
  • batch 24778: 84.2 ms at 44992 ms, present 2939: GPU no ranges; recorded by Recorder.Sync (draw committer) 85.3, GpuMutex.wait.draw (draw committer) 14.1, Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.5
  • batch 24957: 84.1 ms at 45319 ms, present 2940: GPU no ranges; recorded by Recorder.Sync (draw committer) 85.2, GpuMutex.wait.draw (draw committer) 13.8, Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.5
  • batch 26043: 84.1 ms at 47301 ms, present 2946: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 16.0, Graphics.Draw (draw committer) 1.0, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Graphics.Draw.vertex_upload (draw committer) 0.0
tools/trace_digest.py, candidate

frames 2800:150 from present 2800: 150 presents, frame p50 304.7 / p90 336.2 / p99 382.2 / max 389.9 ms, GPU busy 179.1 ms per present
Apple M5 Pro, KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc), Darwin 27.3.0, 3840x2160, commit 49105d912269, dropped: no

{"commit":"49105d912269","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":46157.274},"presents":150,"frame_ms":{"p50":304.723,"p90":336.207,"p99":382.189,"max":389.934},"gpu_busy_ms_per_present":179.08,"worker_busy_pct":{"queue worker 0x0":99.543,"queue worker 0x20":37.884,"queue worker 0x28":49.23,"queue worker 0x38":63.51,"queue worker 0x30":46.649},"phase_totals_ms":{"Driver.Completion":1.081,"Driver.Dispatch":39591.809,"Driver.Dispatch.capture_resources":7584.924,"Driver.Dispatch.decode_key_device_setup":3.717,"Driver.Dispatch.lab_candidate":1.883,"Driver.Dispatch.lab_device":22.391,"Driver.Dispatch.lab_drain":5162.182,"Driver.Dispatch.lab_fill":3.968,"Driver.Dispatch.lab_hle":3.557,"Driver.Dispatch.lab_htile":2.292,"Driver.Dispatch.lab_indirect":3.409,"Driver.Dispatch.lab_msclear":2.266,"Driver.Dispatch.lab_partial":1.484,"Driver.Dispatch.lab_split":5.295,"Driver.Dispatch.lookup_cache":5512.459,"Driver.Dispatch.materialize":2373.021,"Driver.Dispatch.prepared_invocation":25.266,"Driver.Draw":18964.975,"Driver.Draw.device_setup":117.43,"Driver.Draw.draw_enqueued":5504.747,"Driver.Draw.post_compile_prepare":340.797,"Driver.Draw.prepare":567.044,"Driver.Draw.shader_compile_and_link":12179.167,"Driver.EndSubmission":277.879,"Driver.Packet":136396.854,"Driver.Packet.device_lock":46.299,"Driver.Packet.dispatch":45757.888,"Driver.Packet.draw":18993.443,"Driver.Packet.execute":390.092,"Driver.Packet.flip_flush":38.109,"Driver.Packet.flush_between_packets":1225.669,"Driver.Packet.memory_wait":69049.885,"Driver.Packet.pipeline_drain":229.004,"Driver.Packet.pipeline_prepare":68.229,"Driver.Packet.prepare_memory":97.463,"Driver.Packet.rendering_wait":0.147,"Driver.Present":4478.204,"Driver.Present.acquire_image":21.418,"Driver.Present.device_setup":0.134,"Driver.Present.gpu_mutex_wait":4.392,"Driver.Present.inflight_wait":0.41,"Driver.Present.present_display_buffer":13.188,"Driver.Present.queue_present":12.469,"Driver.Present.release_and_callback":0.461,"Driver.Present.render_fence_wait":4422.078,"Driver.Present.resize":3.547,"Driver.Present.validate":0.034,"Driver.Rewind":326.286,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":147.69,"GpuMutex.wait.draw":2828.828,"GpuMutex.wait.end":113.441,"GpuMutex.wait.fill":58.889,"GpuMutex.wait.flush":1082.0,"GpuMutex.wait.hook":4402.172,"GpuMutex.wait.indirect":16.232,"GpuMutex.wait.label":84.191,"GpuMutex.wait.other":95.222,"GpuMutex.wait.present":4.085,"Graphics.Draw":9438.076,"Graphics.Draw.draw_and_resource_release":8484.534,"Graphics.Draw.index_upload":237.455,"Graphics.Draw.validate":322.542,"Graphics.Draw.vertex_upload":301.295,"Graphics.DrawWithRecipe":643.314,"Graphics.DrawWithRecipe.draw_and_resource_release":620.175,"Graphics.DrawWithRecipe.index_upload":3.193,"Graphics.DrawWithRecipe.validate":3.207,"Graphics.DrawWithRecipe.vertex_upload":14.405,"Graphics.Submit":0.048,"Graphics.Submit.command_end":0.014,"Graphics.Submit.queue_submit":0.034,"Graphics.Wait":6.158,"Graphics.Wait.fence_wait":5.922,"Recorder.Reap":119.401,"Recorder.Submit":1186.896,"Recorder.Sync":820.615,"Recorder.WaitSerial":10199.435,"Resources.Complete":5823.088,"Resources.Prepare":1333.297,"Shader.DrawStage":2114.769,"Shader.DrawStage.capture_resources":821.093,"Shader.DrawStage.materialize":971.271,"Shader.DrawStage.prepared_invocation":306.747,"Shader.ResolveGraphicsStagesAbi":3.968,"VideoOut.Flip":4483.789,"VideoOut.Flip.completion_mutex_wait":0.513,"VideoOut.Flip.config_mutex_wait":0.012,"VideoOut.Flip.frame_limit":0.103,"VideoOut.Flip.notify_game":4.823,"VideoOut.Flip.present":4445.57,"VideoOut.Flip.validate":0.177,"VideoOut.Flip.vblank_wait":0.262,"VideoOut.Flip.window_prepare":4.149,"VideoOut.Flip.window_title":28.039,"VideoOut.Readiness":0.404,"VideoOut.Readiness.locks_validate":0.226,"Vulkan.Acquire":21.24,"Vulkan.Acquire.acquire_fence_wait":0.187,"Vulkan.Acquire.acquire_image":20.451,"Vulkan.Acquire.fence_reset":0.456,"Vulkan.Acquire.retired_swapchains":0.08,"Vulkan.Dispatch":6970.825,"Vulkan.Dispatch.command_record":626.482,"Vulkan.Dispatch.shader_resources":6335.01,"Vulkan.DispatchRecipe":100.917,"Vulkan.DispatchRecipe.command_record":99.642,"Vulkan.DrawFromRecipe":644.699,"Vulkan.Present":9.963,"Vulkan.Present.command_record_scale":8.188,"Vulkan.Present.pixel_upload":0.397,"Vulkan.Present.queue_submit":1.245,"Vulkan.QueuePresent":12.282,"Vulkan.QueuePresent.queue_present":8.332,"Vulkan.Retire":4422.019,"Vulkan.Retire.wait":4419.736},"top_phases_ms_per_frame":{"Driver.Packet":909.312,"Driver.Packet.memory_wait":460.333,"Driver.Packet.dispatch":305.053,"Driver.Dispatch":263.945,"Driver.Packet.draw":126.623,"Driver.Draw":126.433,"Driver.Draw.shader_compile_and_link":81.194,"Recorder.WaitSerial":67.996},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":9219,"Graphics.Barrier.dcc-clear":5968,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68509,"Graphics.Barrier.dispatch-trail":35781,"Graphics.Barrier.draw":88556,"Graphics.Barrier.fill":7169,"Graphics.Barrier.fill-clear":2834,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":66653,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1803,"Graphics.Barrier.staging-in":38008,"Graphics.Barrier.staging-out":18001,"Graphics.Barrier.storage-upload":16828,"Graphics.Barrier.storage-writeback":17772,"Graphics.BarrierMerged.dispatch-lead":9308,"Graphics.BarrierMerged.fill":3835,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1483,"Graphics.BarrierMerged.staging-in":17511,"Graphics.BarrierMerged.staging-out":18001,"Graphics.BarrierMerged.storage-writeback":4546,"Graphics.Copy":61119,"Graphics.Copy.bytes":34864607802,"Graphics.RenderPass":34981,"Graphics.RenderPass.Close.command":14139,"Graphics.RenderPass.Close.image":6808,"Graphics.RenderPass.Close.key":3296,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":10598,"Graphics.RenderPass.Close.raw":18,"Graphics.RenderPass.Continued":158832},"trace_dropped":false,"trace":"aps5-trace-49105d912269-87121.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2847: 389.9 ms at 14174 ms: Driver.WorkerWait (queue worker 0x20) 389.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 389.9, Driver.Packet (queue worker 0x28) 388.3, Driver.Packet (queue worker 0x0) 374.2
  • present 2822: 382.2 ms at 5901 ms: Driver.WorkerWait (queue worker 0x20) 382.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 382.2, Driver.WorkerWait (queue worker 0x30) 382.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 382.2
  • present 2889: 381.1 ms at 26856 ms: Driver.WorkerWait (queue worker 0x30) 381.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 381.1, Driver.Packet (queue worker 0x38) 379.8, Driver.Packet (queue worker 0x0) 359.0
  • present 2888: 371.2 ms at 26485 ms: Driver.WorkerWait (queue worker 0x30) 371.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 371.2, Driver.Packet (queue worker 0x38) 370.4, Driver.Packet (queue worker 0x0) 349.3
  • present 2892: 370.5 ms at 27901 ms: Driver.WorkerWait (queue worker 0x30) 370.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 370.5, Driver.Packet (queue worker 0x0) 351.6, Driver.Packet (queue worker 0x28) 340.3

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

  • present 2847: 389.9 ms at 14174 ms, persistence 145.2 ms
  • present 2889: 381.1 ms at 26856 ms, persistence 92.9 ms
  • present 2822: 382.2 ms at 5901 ms, persistence 63.1 ms
  • present 2812: 303.6 ms at 3262 ms, persistence 58.8 ms
  • present 2945: 344.6 ms at 44543 ms, persistence 50.7 ms
  • present 2892: 370.5 ms at 27901 ms, persistence 42.5 ms
  • present 2850: 337.8 ms at 15178 ms, persistence 42.1 ms
  • present 2909: 340.4 ms at 33438 ms, persistence 38.2 ms
  • present 2921: 326.6 ms at 37179 ms, persistence 26.9 ms
  • present 2880: 314.9 ms at 24111 ms, persistence 23.2 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.1 (0 %) 307.7 0.0 Recorder.Submit 0.0
queue worker 0x0 199.1 (65 %) 92.7 (30 %) 15.9 82.5 Driver.Packet 289.0, Driver.Rewind 1.9
draw committer 65.9 (21 %) 20.2 (7 %) 221.7 24.5 Graphics.Draw 55.5, Recorder.Submit 5.9
presenter 0.6 (0 %) 29.5 (10 %) 277.6 0.0 VideoOut.Flip 29.9, Driver.Present 0.2
title 0.0 (0 %) 0.4 (0 %) 307.3 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x20 27.9 (9 %) 277.5 (90 %) 2.3 1.2 Driver.Packet 116.3, Driver.EndSubmission 0.2
queue worker 0x28 34.6 (11 %) 270.0 (88 %) 3.1 1.7 Driver.Packet 151.2, Driver.EndSubmission 0.1
title 0.0 (0 %) 0.2 (0 %) 307.5 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x38 50.3 (16 %) 255.3 (83 %) 2.1 3.6 Driver.Packet 194.8, Driver.EndSubmission 0.3
title 0.0 (0 %) 0.4 (0 %) 307.3 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x30 31.7 (10 %) 270.6 (88 %) 5.4 2.0 Driver.Packet 143.1, Driver.EndSubmission 0.3
title 0.0 (0 %) 0.3 (0 %) 307.4 0.0 Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 178.5 (58 %) 0.0 (0 %) 129.2 0.0 batch 178.5

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 894.4, Driver.WorkerWait 611.6, Driver.WorkerWait.idle_and_completion_poll 611.6, Driver.Packet.memory_wait 460.3, Driver.Packet.dispatch 304.4, Driver.Dispatch 263.3, batch 178.5, Driver.Packet.draw 116.0, Driver.Draw 115.9, Driver.Draw.shader_compile_and_link 70.4

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 5956.2 ms at 5271 ms, present 2819
  • Driver.WorkerWait (queue worker 0x30) 3276.9 ms at 26340 ms, present 2887
  • Driver.WorkerWait (queue worker 0x20) 3062.1 ms at 31067 ms, present 2901
  • Driver.WorkerWait (queue worker 0x20) 2413.9 ms at 39685 ms, present 2929
  • Driver.WorkerWait (queue worker 0x28) 2289.0 ms at 38886 ms, present 2926
  • Driver.WorkerWait (queue worker 0x30) 2020.6 ms at 14417 ms, present 2847
  • Driver.WorkerWait (queue worker 0x30) 1834.7 ms at 34161 ms, present 2911
  • Driver.WorkerWait (queue worker 0x38) 1817.0 ms at 29429 ms, present 2896
  • Driver.WorkerWait (queue worker 0x20) 1693.3 ms at 12905 ms, present 2843
  • Driver.WorkerWait (queue worker 0x30) 1658.7 ms at 16854 ms, present 2855

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

  • batch 15449: 82.0 ms at 26953 ms, present 2889: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.4, Graphics.Draw (draw committer) 1.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.8
  • batch 15808: 81.2 ms at 27656 ms, present 2891: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.8, Graphics.Draw (draw committer) 0.8, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Resources.Prepare (draw committer) 0.0
  • batch 15635: 81.0 ms at 27327 ms, present 2890: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.4, Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Resources.Prepare (draw committer) 0.0
  • batch 15264: 80.5 ms at 26575 ms, present 2888: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.9, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.1
  • batch 15984: 80.4 ms at 28010 ms, present 2892: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 14.7, Graphics.Draw (draw committer) 1.8, Graphics.Draw.draw_and_resource_release (draw committer) 1.2, Resources.Prepare (draw committer) 0.1

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: Apple M5 Pro, MoltenVK (Vulkan SDK 1.4.363.0), macOS 27.3
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5480359763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26775). Originally posted by [Gonic0](https://github.com/Gonic0) on 2026-11-24T21:08:04Z. --- ### What With `APS5_INDEX_IN_PLACE_BEHIND_WRITER`, an indexed draw binds its index range in place from the host import behind a pending GPU writer, instead of waiting for the writer and copying the range on the CPU. Until now `InPlaceIndexBehindWriter` refused every draw whose vertex shader has fixed vertex attributes (`IndexBehindWriter::VertexAttributes`). The vertex buffer copies are sized from the highest index, and the CPU cannot read that while the GPU still writes the indices. Those draws fell back to `InPlaceDrawInput(..., nullptr)`, whose `FlushGpuWrites` waits for the writer under the GPU mutex. This PR takes those draws behind the writer too: - `InPlaceIndexBehindWriter` no longer refuses vertex attributes. Its `vertexAttributes` parameter and the `VertexAttributes` outcome are removed. - In `prepareDrawInputs`, when the indices are bound behind the writer (`inputs.indexInputBehindGpuWrite`), each attribute's range is the whole buffer descriptor (`VertexBufferExtent`), as for an indirect draw. `firstByte`, `fetchValid` and `rangeFrom` follow the same rule. - `docs/dev/ENVIRONMENT.md` describes the new behaviour and drops `vertex attributes` from the `[index-behind-writer]` outcomes. The switch stays opt-in. Without it nothing changes. This touches the same lines of `Graphics/src/Draw.cpp` as #19620 (`fetchValid`), #26036 (`firstByte`), #26041 and #26706 (`Draw.hpp`), on other topics. Whichever lands second has a small textual conflict. #21923 works on the same wait from the other side: it releases the GPU mutex while an indexed draw waits for its index writer. This PR removes that wait for draws with vertex attributes when `APS5_INDEX_IN_PLACE_BEHIND_WRITER` is on. They do not implement the same thing, but both change the `InPlaceIndexBehindWriter` call line in `prepareDrawInputs`. ### Tested macOS 27.3, Apple M5 Pro, MoltenVK from Vulkan SDK 1.4.363.0, x86_64 Release build under Rosetta. `main` does not build on macOS right now (`libc/src/exception/Runtime.cpp` uses `__sub_kind` values that Apple's libc++abi does not declare), so #26739 was applied locally for both builds and is not part of this PR. - New test `agc_driver_index_behind_writer_vertex_attributes` (`tests/execution/IndexBehindWriterVertexAttributes.cpp`): - An indexed draw with 16-bit indices and one fixed vertex attribute (16 records, stride 32, OOB_SELECT 2), over a watched, host-imported index block. The CPU first writes stale indices {0, 1, 2, ...}. A recorded `FillBuffer` in the open batch then writes {0, 9, 15, 3, 12, 7}. - With the switch on, the draw takes `Taken` and nothing else. Every referenced vertex holds its exact attribute bits, including record 15, which a range sized from the stale indices (highest 2) misses. Unreferenced vertices stay unwritten. - With the switch off, the outcome counters do not move and the output is identical. - With only the descriptor-range sizing reverted, the test fails: `vertex fetch exceeds descriptor record count: OOB_SELECT 2, stride 32, NUM_RECORDS 16, vertex index 65535`. - `agc_index_in_place_behind_writer` (updated for the removed outcome) passes. - Validation layer A/B, same machine, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer` and the 1.4.363 layer, running `ctest --test-dir build -R <pattern> -V`: - `main`: `agc_index_in_place_behind_writer`, `agc_driver_vertex_fetch` and `agc_driver_draw_offset_indices` pass. - This PR: the same three plus the new test pass. - Both logs show `Insert instance layer "VK_LAYER_KHRONOS_validation"` for every test and no `was not found but was requested by env var VK_INSTANCE_LAYERS`. - The only validation message in both is `VUID-VkDeviceCreateInfo-sType-unique`, twice, at device creation in `agc_index_in_place_behind_writer`. The PR adds no new `VUID-`. - Grand Theft Auto V (PPSA04264), first 3D scene, on a lab build that needs unmerged fixes to get there, not `main`. With `APS5_INDEX_IN_PLACE_BEHIND_WRITER=1`, `[index-behind-writer]` counted about 70 refusals per 10 s as `vertex attributes`. Each one waited about 40 ms for its writer under the GPU mutex, with the index bytes unchanged after the wait. With the switch on in both runs, this change brought the GPU mutex waits over 1 ms from 226 to 23 ms per frame. The draw committer went from 102.8 µs per commit (`[draw] pipelined`, a run without the switch) to 59.6 µs (switch on, this change). The frame time did not change, because those waits were not on that scene's critical path. I make no speed claim. #### Performance capture `main` does not reach this scene on macOS, so both captures come from the lab build of the GTA V bullet above, with the same steps for each: - Baseline `d39ebf7cec89`: the lab build, with the lab copy of this change removed. - Candidate `49105d912269`: the baseline with this PR's commit cherry-picked onto it (the same 5 files, +277/-29). Both builds are clean (`dirty: false`). Same machine (Apple M5 Pro, macOS 27.3, x86_64 Release under Rosetta), KosmicKrisp (Mesa `fc930002fc` with local lab changes), GTA V 01.011.001 at 3840x2160, the same pad script, the same `APS5_*` environment with `APS5_INDEX_IN_PLACE_BEHIND_WRITER=1`, and frames `2800:150`. `tools/performance_compare.py --require-matching-context` reports no configuration difference. - `GpuMutex.wait.hook` went from 175.9 to 29.3 ms per frame, and `GpuMutex.wait.end` from 9.1 to 0.8. - Frame p50 went from 316.4 to 304.7 ms and the mean from 323.6 to 307.7 ms. This is one capture of each build. Two earlier runs of one unchanged lab build on this scene gave a p50 of 321.0 and 327.6 ms, so the frame-time difference is within run-to-run noise. The candidate window also compiled more shaders (`Driver.Draw.shader_compile_and_link` 81.2 against 19.8 ms per frame). I still make no speed claim. The two traces are attached in a comment below. Baseline summary line: ```json {"commit":"d39ebf7cec89","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":48545.598},"presents":150,"frame_ms":{"p50":316.403,"p90":354.129,"p99":439.834,"max":455.281},"gpu_busy_ms_per_present":190.704,"worker_busy_pct":{"queue worker 0x0":99.537,"queue worker 0x20":46.972,"queue worker 0x38":63.942,"queue worker 0x28":47.116,"queue worker 0x30":38.595},"phase_totals_ms":{"Driver.Completion":1.306,"Driver.Dispatch":41094.310,"Driver.Dispatch.capture_resources":7959.406,"Driver.Dispatch.decode_key_device_setup":3.996,"Driver.Dispatch.lab_candidate":1.939,"Driver.Dispatch.lab_device":24.657,"Driver.Dispatch.lab_drain":5923.919,"Driver.Dispatch.lab_fill":4.294,"Driver.Dispatch.lab_hle":4.008,"Driver.Dispatch.lab_htile":2.536,"Driver.Dispatch.lab_indirect":3.587,"Driver.Dispatch.lab_msclear":2.467,"Driver.Dispatch.lab_partial":1.550,"Driver.Dispatch.lab_split":5.799,"Driver.Dispatch.lookup_cache":6055.296,"Driver.Dispatch.materialize":2174.080,"Driver.Dispatch.prepared_invocation":27.275,"Driver.Draw":20272.107,"Driver.Draw.device_setup":131.947,"Driver.Draw.draw_enqueued":15956.359,"Driver.Draw.post_compile_prepare":348.678,"Driver.Draw.prepare":621.843,"Driver.Draw.shader_compile_and_link":2962.783,"Driver.EndSubmission":1492.551,"Driver.Packet":141969.669,"Driver.Packet.device_lock":49.734,"Driver.Packet.dispatch":47086.159,"Driver.Packet.draw":20304.307,"Driver.Packet.execute":531.437,"Driver.Packet.flip_flush":39.782,"Driver.Packet.flush_between_packets":1704.751,"Driver.Packet.memory_wait":70900.215,"Driver.Packet.pipeline_drain":236.789,"Driver.Packet.pipeline_prepare":74.937,"Driver.Packet.prepare_memory":104.526,"Driver.Packet.rendering_wait":0.171,"Driver.Present":4156.354,"Driver.Present.acquire_image":23.033,"Driver.Present.device_setup":0.110,"Driver.Present.gpu_mutex_wait":2.995,"Driver.Present.inflight_wait":0.486,"Driver.Present.present_display_buffer":13.820,"Driver.Present.queue_present":11.951,"Driver.Present.release_and_callback":0.390,"Driver.Present.render_fence_wait":4099.542,"Driver.Present.resize":3.919,"Driver.Present.validate":0.034,"Driver.Rewind":309.931,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":136.646,"GpuMutex.wait.draw":3017.024,"GpuMutex.wait.end":1365.863,"GpuMutex.wait.fill":4.196,"GpuMutex.wait.flush":1556.514,"GpuMutex.wait.hook":26384.912,"GpuMutex.wait.indirect":23.865,"GpuMutex.wait.label":130.287,"GpuMutex.wait.other":59.035,"GpuMutex.wait.present":2.673,"Graphics.Draw":20542.466,"Graphics.Draw.draw_and_resource_release":7795.932,"Graphics.Draw.index_upload":11946.512,"Graphics.Draw.validate":347.228,"Graphics.Draw.vertex_upload":330.686,"Graphics.DrawWithRecipe":1322.869,"Graphics.DrawWithRecipe.draw_and_resource_release":1118.324,"Graphics.DrawWithRecipe.index_upload":176.400,"Graphics.DrawWithRecipe.validate":4.994,"Graphics.DrawWithRecipe.vertex_upload":19.760,"Graphics.Submit":0.022,"Graphics.Submit.command_end":0.010,"Graphics.Submit.queue_submit":0.011,"Graphics.Wait":10.523,"Graphics.Wait.fence_wait":10.289,"Recorder.Reap":139.682,"Recorder.Submit":1295.740,"Recorder.Sync":10968.370,"Recorder.WaitSerial":9947.133,"Resources.Complete":5964.761,"Resources.Prepare":1366.702,"Shader.DrawStage":2067.381,"Shader.DrawStage.capture_resources":882.322,"Shader.DrawStage.materialize":820.165,"Shader.DrawStage.prepared_invocation":348.362,"Shader.ResolveGraphicsStagesAbi":4.168,"VideoOut.Flip":4178.633,"VideoOut.Flip.completion_mutex_wait":0.510,"VideoOut.Flip.config_mutex_wait":0.013,"VideoOut.Flip.frame_limit":0.097,"VideoOut.Flip.notify_game":3.660,"VideoOut.Flip.present":4140.163,"VideoOut.Flip.validate":0.223,"VideoOut.Flip.vblank_wait":0.213,"VideoOut.Flip.window_prepare":4.989,"VideoOut.Flip.window_title":28.648,"VideoOut.Readiness":0.375,"VideoOut.Readiness.locks_validate":0.206,"Vulkan.Acquire":22.849,"Vulkan.Acquire.acquire_fence_wait":0.206,"Vulkan.Acquire.acquire_image":22.024,"Vulkan.Acquire.fence_reset":0.463,"Vulkan.Acquire.retired_swapchains":0.087,"Vulkan.ComputePipeline":73.132,"Vulkan.Dispatch":7087.961,"Vulkan.Dispatch.command_record":644.135,"Vulkan.Dispatch.shader_resources":6434.076,"Vulkan.DispatchRecipe":109.346,"Vulkan.DispatchRecipe.command_record":107.996,"Vulkan.DrawFromRecipe":1324.997,"Vulkan.Present":10.522,"Vulkan.Present.command_record_scale":8.650,"Vulkan.Present.pixel_upload":0.383,"Vulkan.Present.queue_submit":1.362,"Vulkan.QueuePresent":11.762,"Vulkan.QueuePresent.queue_present":8.477,"Vulkan.Retire":4099.483,"Vulkan.Retire.wait":4097.108},"top_phases_ms_per_frame":{"Driver.Packet":946.464,"Driver.Packet.memory_wait":472.668,"Driver.Packet.dispatch":313.908,"Driver.Dispatch":273.962,"GpuMutex.wait.hook":175.899,"Graphics.Draw":136.950,"Driver.Packet.draw":135.362,"Driver.Draw":135.147},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":8543,"Graphics.Barrier.dcc-clear":5964,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68434,"Graphics.Barrier.dispatch-trail":35689,"Graphics.Barrier.draw":68304,"Graphics.Barrier.fill":7245,"Graphics.Barrier.fill-clear":2788,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":67419,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1784,"Graphics.Barrier.staging-in":37859,"Graphics.Barrier.staging-out":17944,"Graphics.Barrier.storage-upload":16680,"Graphics.Barrier.storage-writeback":17767,"Graphics.BarrierMerged.dispatch-lead":9281,"Graphics.BarrierMerged.fill":3833,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1468,"Graphics.BarrierMerged.staging-in":17316,"Graphics.BarrierMerged.staging-out":17944,"Graphics.BarrierMerged.storage-writeback":4572,"Graphics.Copy":60895,"Graphics.Copy.bytes":35051367814,"Graphics.RenderPass":28321,"Graphics.RenderPass.Close.command":6848,"Graphics.RenderPass.Close.image":6898,"Graphics.RenderPass.Close.key":3374,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":11082,"Graphics.RenderPass.Close.raw":17,"Graphics.RenderPass.Continued":174350},"trace_dropped":false,"trace":"aps5-trace-d39ebf7cec89-58640.json.gz"} ``` Candidate summary line: ```json {"commit":"49105d912269","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":46157.274},"presents":150,"frame_ms":{"p50":304.723,"p90":336.207,"p99":382.189,"max":389.934},"gpu_busy_ms_per_present":179.080,"worker_busy_pct":{"queue worker 0x0":99.543,"queue worker 0x20":37.884,"queue worker 0x28":49.230,"queue worker 0x38":63.510,"queue worker 0x30":46.649},"phase_totals_ms":{"Driver.Completion":1.081,"Driver.Dispatch":39591.809,"Driver.Dispatch.capture_resources":7584.924,"Driver.Dispatch.decode_key_device_setup":3.717,"Driver.Dispatch.lab_candidate":1.883,"Driver.Dispatch.lab_device":22.391,"Driver.Dispatch.lab_drain":5162.182,"Driver.Dispatch.lab_fill":3.968,"Driver.Dispatch.lab_hle":3.557,"Driver.Dispatch.lab_htile":2.292,"Driver.Dispatch.lab_indirect":3.409,"Driver.Dispatch.lab_msclear":2.266,"Driver.Dispatch.lab_partial":1.484,"Driver.Dispatch.lab_split":5.295,"Driver.Dispatch.lookup_cache":5512.459,"Driver.Dispatch.materialize":2373.021,"Driver.Dispatch.prepared_invocation":25.266,"Driver.Draw":18964.975,"Driver.Draw.device_setup":117.430,"Driver.Draw.draw_enqueued":5504.747,"Driver.Draw.post_compile_prepare":340.797,"Driver.Draw.prepare":567.044,"Driver.Draw.shader_compile_and_link":12179.167,"Driver.EndSubmission":277.879,"Driver.Packet":136396.854,"Driver.Packet.device_lock":46.299,"Driver.Packet.dispatch":45757.888,"Driver.Packet.draw":18993.443,"Driver.Packet.execute":390.092,"Driver.Packet.flip_flush":38.109,"Driver.Packet.flush_between_packets":1225.669,"Driver.Packet.memory_wait":69049.885,"Driver.Packet.pipeline_drain":229.004,"Driver.Packet.pipeline_prepare":68.229,"Driver.Packet.prepare_memory":97.463,"Driver.Packet.rendering_wait":0.147,"Driver.Present":4478.204,"Driver.Present.acquire_image":21.418,"Driver.Present.device_setup":0.134,"Driver.Present.gpu_mutex_wait":4.392,"Driver.Present.inflight_wait":0.410,"Driver.Present.present_display_buffer":13.188,"Driver.Present.queue_present":12.469,"Driver.Present.release_and_callback":0.461,"Driver.Present.render_fence_wait":4422.078,"Driver.Present.resize":3.547,"Driver.Present.validate":0.034,"Driver.Rewind":326.286,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":147.690,"GpuMutex.wait.draw":2828.828,"GpuMutex.wait.end":113.441,"GpuMutex.wait.fill":58.889,"GpuMutex.wait.flush":1082.000,"GpuMutex.wait.hook":4402.172,"GpuMutex.wait.indirect":16.232,"GpuMutex.wait.label":84.191,"GpuMutex.wait.other":95.222,"GpuMutex.wait.present":4.085,"Graphics.Draw":9438.076,"Graphics.Draw.draw_and_resource_release":8484.534,"Graphics.Draw.index_upload":237.455,"Graphics.Draw.validate":322.542,"Graphics.Draw.vertex_upload":301.295,"Graphics.DrawWithRecipe":643.314,"Graphics.DrawWithRecipe.draw_and_resource_release":620.175,"Graphics.DrawWithRecipe.index_upload":3.193,"Graphics.DrawWithRecipe.validate":3.207,"Graphics.DrawWithRecipe.vertex_upload":14.405,"Graphics.Submit":0.048,"Graphics.Submit.command_end":0.014,"Graphics.Submit.queue_submit":0.034,"Graphics.Wait":6.158,"Graphics.Wait.fence_wait":5.922,"Recorder.Reap":119.401,"Recorder.Submit":1186.896,"Recorder.Sync":820.615,"Recorder.WaitSerial":10199.435,"Resources.Complete":5823.088,"Resources.Prepare":1333.297,"Shader.DrawStage":2114.769,"Shader.DrawStage.capture_resources":821.093,"Shader.DrawStage.materialize":971.271,"Shader.DrawStage.prepared_invocation":306.747,"Shader.ResolveGraphicsStagesAbi":3.968,"VideoOut.Flip":4483.789,"VideoOut.Flip.completion_mutex_wait":0.513,"VideoOut.Flip.config_mutex_wait":0.012,"VideoOut.Flip.frame_limit":0.103,"VideoOut.Flip.notify_game":4.823,"VideoOut.Flip.present":4445.570,"VideoOut.Flip.validate":0.177,"VideoOut.Flip.vblank_wait":0.262,"VideoOut.Flip.window_prepare":4.149,"VideoOut.Flip.window_title":28.039,"VideoOut.Readiness":0.404,"VideoOut.Readiness.locks_validate":0.226,"Vulkan.Acquire":21.240,"Vulkan.Acquire.acquire_fence_wait":0.187,"Vulkan.Acquire.acquire_image":20.451,"Vulkan.Acquire.fence_reset":0.456,"Vulkan.Acquire.retired_swapchains":0.080,"Vulkan.Dispatch":6970.825,"Vulkan.Dispatch.command_record":626.482,"Vulkan.Dispatch.shader_resources":6335.010,"Vulkan.DispatchRecipe":100.917,"Vulkan.DispatchRecipe.command_record":99.642,"Vulkan.DrawFromRecipe":644.699,"Vulkan.Present":9.963,"Vulkan.Present.command_record_scale":8.188,"Vulkan.Present.pixel_upload":0.397,"Vulkan.Present.queue_submit":1.245,"Vulkan.QueuePresent":12.282,"Vulkan.QueuePresent.queue_present":8.332,"Vulkan.Retire":4422.019,"Vulkan.Retire.wait":4419.736},"top_phases_ms_per_frame":{"Driver.Packet":909.312,"Driver.Packet.memory_wait":460.333,"Driver.Packet.dispatch":305.053,"Driver.Dispatch":263.945,"Driver.Packet.draw":126.623,"Driver.Draw":126.433,"Driver.Draw.shader_compile_and_link":81.194,"Recorder.WaitSerial":67.996},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":9219,"Graphics.Barrier.dcc-clear":5968,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68509,"Graphics.Barrier.dispatch-trail":35781,"Graphics.Barrier.draw":88556,"Graphics.Barrier.fill":7169,"Graphics.Barrier.fill-clear":2834,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":66653,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1803,"Graphics.Barrier.staging-in":38008,"Graphics.Barrier.staging-out":18001,"Graphics.Barrier.storage-upload":16828,"Graphics.Barrier.storage-writeback":17772,"Graphics.BarrierMerged.dispatch-lead":9308,"Graphics.BarrierMerged.fill":3835,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1483,"Graphics.BarrierMerged.staging-in":17511,"Graphics.BarrierMerged.staging-out":18001,"Graphics.BarrierMerged.storage-writeback":4546,"Graphics.Copy":61119,"Graphics.Copy.bytes":34864607802,"Graphics.RenderPass":34981,"Graphics.RenderPass.Close.command":14139,"Graphics.RenderPass.Close.image":6808,"Graphics.RenderPass.Close.key":3296,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":10598,"Graphics.RenderPass.Close.raw":18,"Graphics.RenderPass.Continued":158832},"trace_dropped":false,"trace":"aps5-trace-49105d912269-87121.json.gz"} ``` <details><summary><code>tools/performance_compare.py</code></summary> # Performance comparison | Capture | Commit | Trace | Presents | Window (ms) | | --- | --- | --- | ---: | ---: | | baseline | d39ebf7cec89 | aps5-trace-d39ebf7cec89-58640.json.gz | 150 | 48545.598 | | candidate | 49105d912269 | aps5-trace-49105d912269-87121.json.gz | 150 | 46157.274 | - Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene. - Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval. - A missing top phase is unreported, not zero; its change is unavailable. - Worker busy changes are percentage points; change (%) is relative to the baseline. Workers are matched by their recorded names; a missing worker is unreported, not idle. - Graphics-track rates are per present; a capture without a graphics track is unknown, not zero. ## Frame and GPU times (ms) | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | frame_ms.p50 | 316.403 | 304.723 | -11.680 | -3.691 | | frame_ms.p90 | 354.129 | 336.207 | -17.922 | -5.061 | | frame_ms.p99 | 439.834 | 382.189 | -57.645 | -13.106 | | frame_ms.max | 455.281 | 389.934 | -65.347 | -14.353 | | mean_frame_ms | 323.637 | 307.715 | -15.922 | -4.920 | | gpu_busy_ms_per_present | 190.704 | 179.080 | -11.624 | -6.095 | ## Top phases (ms per frame) | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | Driver.Dispatch | 273.962 | 263.945 | -10.017 | -3.656 | | Driver.Draw | 135.147 | 126.433 | -8.714 | -6.448 | | Driver.Draw.shader_compile_and_link | n/a | 81.194 | n/a | n/a | | Driver.Packet | 946.464 | 909.312 | -37.152 | -3.925 | | Driver.Packet.dispatch | 313.908 | 305.053 | -8.855 | -2.821 | | Driver.Packet.draw | 135.362 | 126.623 | -8.739 | -6.456 | | Driver.Packet.memory_wait | 472.668 | 460.333 | -12.335 | -2.610 | | GpuMutex.wait.hook | 175.899 | n/a | n/a | n/a | | Graphics.Draw | 136.950 | n/a | n/a | n/a | | Recorder.WaitSerial | n/a | 67.996 | n/a | n/a | ## Worker busy time (%) | Metric | Baseline | Candidate | Change (pp) | Change (%) | | --- | ---: | ---: | ---: | ---: | | queue worker 0x0 | 99.537 | 99.543 | +0.006 | +0.006 | | queue worker 0x20 | 46.972 | 37.884 | -9.088 | -19.348 | | queue worker 0x28 | 47.116 | 49.230 | +2.114 | +4.487 | | queue worker 0x30 | 38.595 | 46.649 | +8.054 | +20.868 | | queue worker 0x38 | 63.942 | 63.510 | -0.432 | -0.676 | ## Graphics track (per present) | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | render passes | 188.807 | 233.207 | +44.400 | +23.516 | | continued draws | 1162.333 | 1058.880 | -103.453 | -8.900 | | barriers | 2541.473 | 2679.347 | +137.873 | +5.425 | | merged barriers | 362.933 | 364.707 | +1.773 | +0.489 | | copies | 405.967 | 407.460 | +1.493 | +0.368 | | copy MiB | 222.851 | 221.663 | -1.187 | -0.533 | </details> <details><summary><code>tools/trace_digest.py</code>, baseline</summary> **frames 2800:150** from present 2800: 150 presents, frame p50 316.4 / p90 354.1 / p99 439.8 / max 455.3 ms, GPU busy 190.7 ms per present Apple M5 Pro, KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc), Darwin 27.3.0, 3840x2160, commit d39ebf7cec89, dropped: no ```json {"commit":"d39ebf7cec89","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":48545.598},"presents":150,"frame_ms":{"p50":316.403,"p90":354.129,"p99":439.834,"max":455.281},"gpu_busy_ms_per_present":190.704,"worker_busy_pct":{"queue worker 0x0":99.537,"queue worker 0x20":46.972,"queue worker 0x38":63.942,"queue worker 0x28":47.116,"queue worker 0x30":38.595},"phase_totals_ms":{"Driver.Completion":1.306,"Driver.Dispatch":41094.31,"Driver.Dispatch.capture_resources":7959.406,"Driver.Dispatch.decode_key_device_setup":3.996,"Driver.Dispatch.lab_candidate":1.939,"Driver.Dispatch.lab_device":24.657,"Driver.Dispatch.lab_drain":5923.919,"Driver.Dispatch.lab_fill":4.294,"Driver.Dispatch.lab_hle":4.008,"Driver.Dispatch.lab_htile":2.536,"Driver.Dispatch.lab_indirect":3.587,"Driver.Dispatch.lab_msclear":2.467,"Driver.Dispatch.lab_partial":1.55,"Driver.Dispatch.lab_split":5.799,"Driver.Dispatch.lookup_cache":6055.296,"Driver.Dispatch.materialize":2174.08,"Driver.Dispatch.prepared_invocation":27.275,"Driver.Draw":20272.107,"Driver.Draw.device_setup":131.947,"Driver.Draw.draw_enqueued":15956.359,"Driver.Draw.post_compile_prepare":348.678,"Driver.Draw.prepare":621.843,"Driver.Draw.shader_compile_and_link":2962.783,"Driver.EndSubmission":1492.551,"Driver.Packet":141969.669,"Driver.Packet.device_lock":49.734,"Driver.Packet.dispatch":47086.159,"Driver.Packet.draw":20304.307,"Driver.Packet.execute":531.437,"Driver.Packet.flip_flush":39.782,"Driver.Packet.flush_between_packets":1704.751,"Driver.Packet.memory_wait":70900.215,"Driver.Packet.pipeline_drain":236.789,"Driver.Packet.pipeline_prepare":74.937,"Driver.Packet.prepare_memory":104.526,"Driver.Packet.rendering_wait":0.171,"Driver.Present":4156.354,"Driver.Present.acquire_image":23.033,"Driver.Present.device_setup":0.11,"Driver.Present.gpu_mutex_wait":2.995,"Driver.Present.inflight_wait":0.486,"Driver.Present.present_display_buffer":13.82,"Driver.Present.queue_present":11.951,"Driver.Present.release_and_callback":0.39,"Driver.Present.render_fence_wait":4099.542,"Driver.Present.resize":3.919,"Driver.Present.validate":0.034,"Driver.Rewind":309.931,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":136.646,"GpuMutex.wait.draw":3017.024,"GpuMutex.wait.end":1365.863,"GpuMutex.wait.fill":4.196,"GpuMutex.wait.flush":1556.514,"GpuMutex.wait.hook":26384.912,"GpuMutex.wait.indirect":23.865,"GpuMutex.wait.label":130.287,"GpuMutex.wait.other":59.035,"GpuMutex.wait.present":2.673,"Graphics.Draw":20542.466,"Graphics.Draw.draw_and_resource_release":7795.932,"Graphics.Draw.index_upload":11946.512,"Graphics.Draw.validate":347.228,"Graphics.Draw.vertex_upload":330.686,"Graphics.DrawWithRecipe":1322.869,"Graphics.DrawWithRecipe.draw_and_resource_release":1118.324,"Graphics.DrawWithRecipe.index_upload":176.4,"Graphics.DrawWithRecipe.validate":4.994,"Graphics.DrawWithRecipe.vertex_upload":19.76,"Graphics.Submit":0.022,"Graphics.Submit.command_end":0.01,"Graphics.Submit.queue_submit":0.011,"Graphics.Wait":10.523,"Graphics.Wait.fence_wait":10.289,"Recorder.Reap":139.682,"Recorder.Submit":1295.74,"Recorder.Sync":10968.37,"Recorder.WaitSerial":9947.133,"Resources.Complete":5964.761,"Resources.Prepare":1366.702,"Shader.DrawStage":2067.381,"Shader.DrawStage.capture_resources":882.322,"Shader.DrawStage.materialize":820.165,"Shader.DrawStage.prepared_invocation":348.362,"Shader.ResolveGraphicsStagesAbi":4.168,"VideoOut.Flip":4178.633,"VideoOut.Flip.completion_mutex_wait":0.51,"VideoOut.Flip.config_mutex_wait":0.013,"VideoOut.Flip.frame_limit":0.097,"VideoOut.Flip.notify_game":3.66,"VideoOut.Flip.present":4140.163,"VideoOut.Flip.validate":0.223,"VideoOut.Flip.vblank_wait":0.213,"VideoOut.Flip.window_prepare":4.989,"VideoOut.Flip.window_title":28.648,"VideoOut.Readiness":0.375,"VideoOut.Readiness.locks_validate":0.206,"Vulkan.Acquire":22.849,"Vulkan.Acquire.acquire_fence_wait":0.206,"Vulkan.Acquire.acquire_image":22.024,"Vulkan.Acquire.fence_reset":0.463,"Vulkan.Acquire.retired_swapchains":0.087,"Vulkan.ComputePipeline":73.132,"Vulkan.Dispatch":7087.961,"Vulkan.Dispatch.command_record":644.135,"Vulkan.Dispatch.shader_resources":6434.076,"Vulkan.DispatchRecipe":109.346,"Vulkan.DispatchRecipe.command_record":107.996,"Vulkan.DrawFromRecipe":1324.997,"Vulkan.Present":10.522,"Vulkan.Present.command_record_scale":8.65,"Vulkan.Present.pixel_upload":0.383,"Vulkan.Present.queue_submit":1.362,"Vulkan.QueuePresent":11.762,"Vulkan.QueuePresent.queue_present":8.477,"Vulkan.Retire":4099.483,"Vulkan.Retire.wait":4097.108},"top_phases_ms_per_frame":{"Driver.Packet":946.464,"Driver.Packet.memory_wait":472.668,"Driver.Packet.dispatch":313.908,"Driver.Dispatch":273.962,"GpuMutex.wait.hook":175.899,"Graphics.Draw":136.95,"Driver.Packet.draw":135.362,"Driver.Draw":135.147},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":8543,"Graphics.Barrier.dcc-clear":5964,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68434,"Graphics.Barrier.dispatch-trail":35689,"Graphics.Barrier.draw":68304,"Graphics.Barrier.fill":7245,"Graphics.Barrier.fill-clear":2788,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":67419,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1784,"Graphics.Barrier.staging-in":37859,"Graphics.Barrier.staging-out":17944,"Graphics.Barrier.storage-upload":16680,"Graphics.Barrier.storage-writeback":17767,"Graphics.BarrierMerged.dispatch-lead":9281,"Graphics.BarrierMerged.fill":3833,"Graphics.BarrierMerged.label-run":26,"Graphics.BarrierMerged.shadow-publish":1468,"Graphics.BarrierMerged.staging-in":17316,"Graphics.BarrierMerged.staging-out":17944,"Graphics.BarrierMerged.storage-writeback":4572,"Graphics.Copy":60895,"Graphics.Copy.bytes":35051367814,"Graphics.RenderPass":28321,"Graphics.RenderPass.Close.command":6848,"Graphics.RenderPass.Close.image":6898,"Graphics.RenderPass.Close.key":3374,"Graphics.RenderPass.Close.label":26,"Graphics.RenderPass.Close.new-batch":11082,"Graphics.RenderPass.Close.raw":17,"Graphics.RenderPass.Continued":174350},"trace_dropped":false,"trace":"aps5-trace-d39ebf7cec89-58640.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2898: 455.3 ms at 31732 ms: Driver.WorkerWait (queue worker 0x38) 455.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 455.3, Driver.WorkerWait (queue worker 0x30) 455.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 455.3 - present 2824: 439.8 ms at 8235 ms: Driver.WorkerWait (queue worker 0x20) 439.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 439.8, Driver.Packet (queue worker 0x30) 439.5, Driver.Packet (queue worker 0x0) 425.2 - present 2935: 400.6 ms at 43515 ms: Driver.WorkerWait (queue worker 0x28) 400.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 400.6, Driver.Packet (queue worker 0x20) 390.0, Driver.Packet (queue worker 0x0) 380.4 - present 2866: 400.5 ms at 21185 ms: Driver.WorkerWait (queue worker 0x38) 400.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 400.5, Driver.WorkerWait (queue worker 0x28) 400.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 400.5 - present 2827: 398.3 ms at 9344 ms: Driver.WorkerWait (queue worker 0x38) 398.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 398.3, Driver.WorkerWait (queue worker 0x28) 398.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 398.3 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 2898: 455.3 ms at 31732 ms, persistence 167.8 ms - present 2824: 439.8 ms at 8235 ms, persistence 152.3 ms - present 2935: 400.6 ms at 43515 ms, persistence 93.3 ms - present 2866: 400.5 ms at 21185 ms, persistence 91.6 ms - present 2827: 398.3 ms at 9344 ms, persistence 72.5 ms - present 2802: 377.0 ms at 736 ms, persistence 55.1 ms - present 2937: 349.6 ms at 44232 ms, persistence 32.7 ms - present 2885: 334.2 ms at 27623 ms, persistence 22.1 ms - present 2941: 337.0 ms at 45563 ms, persistence 21.4 ms - present 2924: 330.2 ms at 39988 ms, persistence 20.4 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.1 (0 %) | 323.5 | 0.0 | Recorder.Submit 0.0 | | queue worker 0x0 | 216.8 (67 %) | 90.3 (28 %) | 16.5 | 86.0 | Driver.Packet 304.4, Driver.Rewind 1.8 | | draw committer | 144.5 (45 %) | 21.6 (7 %) | 157.5 | 25.6 | Graphics.Draw 129.1, Vulkan.DrawFromRecipe 8.6 | | presenter | 0.6 (0 %) | 27.3 (8 %) | 295.7 | 0.0 | VideoOut.Flip 27.9, Driver.Present 0.1 | | title | 0.0 (0 %) | 0.5 (0 %) | 323.1 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x20 | 20.7 (6 %) | 298.7 (92 %) | 4.2 | 1.8 | Driver.Packet 149.4, Driver.EndSubmission 2.5 | | queue worker 0x38 | 35.2 (11 %) | 286.2 (88 %) | 2.2 | 3.8 | Driver.Packet 204.1, Driver.EndSubmission 2.6 | | title | 0.0 (0 %) | 0.5 (0 %) | 323.1 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.5 (0 %) | 323.1 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x28 | 18.6 (6 %) | 301.2 (93 %) | 3.8 | 1.8 | Driver.Packet 150.1, Driver.EndSubmission 2.3 | | title | 0.0 (0 %) | 0.5 (0 %) | 323.1 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x30 | 14.5 (4 %) | 307.4 (95 %) | 1.7 | 1.2 | Driver.Packet 121.1, Driver.EndSubmission 1.7 | | gpu | 190.5 (59 %) | 0.0 (0 %) | 133.1 | 0.0 | batch 190.5 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 929.1, Driver.WorkerWait 647.9, Driver.WorkerWait.idle_and_completion_poll 647.9, Driver.Packet.memory_wait 470.6, Driver.Packet.dispatch 313.3, Driver.Dispatch 273.3, batch 190.5, GpuMutex.wait.hook 175.8, Graphics.Draw 129.1, Driver.Packet.draw 124.6 **Longest waits** - Driver.WorkerWait (queue worker 0x30) 3713.0 ms at 15065 ms, present 2845 - Driver.WorkerWait (queue worker 0x30) 2788.4 ms at 28336 ms, present 2887 - Driver.WorkerWait (queue worker 0x20) 2675.2 ms at 6381 ms, present 2818 - Driver.WorkerWait (queue worker 0x28) 2349.2 ms at 1906 ms, present 2805 - Driver.WorkerWait (queue worker 0x30) 2254.5 ms at 12390 ms, present 2836 - Driver.WorkerWait (queue worker 0x20) 2123.8 ms at 24903 ms, present 2876 - Driver.WorkerWait (queue worker 0x20) 2037.9 ms at 9905 ms, present 2828 - Driver.WorkerWait (queue worker 0x28) 2036.6 ms at 20284 ms, present 2863 - Driver.WorkerWait (queue worker 0x30) 1827.0 ms at 9807 ms, present 2828 - Driver.WorkerWait (queue worker 0x28) 1651.7 ms at 12697 ms, present 2837 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 11657: 85.2 ms at 20893 ms, present 2865: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 14.1, Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Prepare (draw committer) 0.0 - batch 26226: 85.1 ms at 47641 ms, present 2947: GPU no ranges; recorded by Recorder.Sync (draw committer) 86.1, GpuMutex.wait.draw (draw committer) 16.7, Graphics.Draw (draw committer) 1.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.8 - batch 24778: 84.2 ms at 44992 ms, present 2939: GPU no ranges; recorded by Recorder.Sync (draw committer) 85.3, GpuMutex.wait.draw (draw committer) 14.1, Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.5 - batch 24957: 84.1 ms at 45319 ms, present 2940: GPU no ranges; recorded by Recorder.Sync (draw committer) 85.2, GpuMutex.wait.draw (draw committer) 13.8, Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.5 - batch 26043: 84.1 ms at 47301 ms, present 2946: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 16.0, Graphics.Draw (draw committer) 1.0, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Graphics.Draw.vertex_upload (draw committer) 0.0 </details> <details><summary><code>tools/trace_digest.py</code>, candidate</summary> **frames 2800:150** from present 2800: 150 presents, frame p50 304.7 / p90 336.2 / p99 382.2 / max 389.9 ms, GPU busy 179.1 ms per present Apple M5 Pro, KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc), Darwin 27.3.0, 3840x2160, commit 49105d912269, dropped: no ```json {"commit":"49105d912269","dirty":false,"env":{"APS5_ASYNC_PIPELINE_WORDS":"1","APS5_INDEX_IN_PLACE_BEHIND_WRITER":"1","APS5_LAB_CHUNK":"143e52400,143e56c00","APS5_LAB_FRAMELOG":"1","APS5_LAB_HOOKTIME":"1","APS5_LAB_SPLIT_FRAGMENT_SET":"1","APS5_LOOP_GUARD":"4096","APS5_NO_ADAPTIVE_STAGING":"1","APS5_PAD_SCRIPT":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"3145728","APS5_TRACE_FRAMES":"2800:150"},"gpu":"Apple M5 Pro","driver":"KosmicKrisp Mesa 27.0.0-devel (git-fc930002fc)","os":"Darwin 27.3.0","cpu":"VirtualApple @ 2.50GHz","cpu_threads":18,"memory_mib":49152,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"frames 2800:150","first_present":2800,"ms":46157.274},"presents":150,"frame_ms":{"p50":304.723,"p90":336.207,"p99":382.189,"max":389.934},"gpu_busy_ms_per_present":179.08,"worker_busy_pct":{"queue worker 0x0":99.543,"queue worker 0x20":37.884,"queue worker 0x28":49.23,"queue worker 0x38":63.51,"queue worker 0x30":46.649},"phase_totals_ms":{"Driver.Completion":1.081,"Driver.Dispatch":39591.809,"Driver.Dispatch.capture_resources":7584.924,"Driver.Dispatch.decode_key_device_setup":3.717,"Driver.Dispatch.lab_candidate":1.883,"Driver.Dispatch.lab_device":22.391,"Driver.Dispatch.lab_drain":5162.182,"Driver.Dispatch.lab_fill":3.968,"Driver.Dispatch.lab_hle":3.557,"Driver.Dispatch.lab_htile":2.292,"Driver.Dispatch.lab_indirect":3.409,"Driver.Dispatch.lab_msclear":2.266,"Driver.Dispatch.lab_partial":1.484,"Driver.Dispatch.lab_split":5.295,"Driver.Dispatch.lookup_cache":5512.459,"Driver.Dispatch.materialize":2373.021,"Driver.Dispatch.prepared_invocation":25.266,"Driver.Draw":18964.975,"Driver.Draw.device_setup":117.43,"Driver.Draw.draw_enqueued":5504.747,"Driver.Draw.post_compile_prepare":340.797,"Driver.Draw.prepare":567.044,"Driver.Draw.shader_compile_and_link":12179.167,"Driver.EndSubmission":277.879,"Driver.Packet":136396.854,"Driver.Packet.device_lock":46.299,"Driver.Packet.dispatch":45757.888,"Driver.Packet.draw":18993.443,"Driver.Packet.execute":390.092,"Driver.Packet.flip_flush":38.109,"Driver.Packet.flush_between_packets":1225.669,"Driver.Packet.memory_wait":69049.885,"Driver.Packet.pipeline_drain":229.004,"Driver.Packet.pipeline_prepare":68.229,"Driver.Packet.prepare_memory":97.463,"Driver.Packet.rendering_wait":0.147,"Driver.Present":4478.204,"Driver.Present.acquire_image":21.418,"Driver.Present.device_setup":0.134,"Driver.Present.gpu_mutex_wait":4.392,"Driver.Present.inflight_wait":0.41,"Driver.Present.present_display_buffer":13.188,"Driver.Present.queue_present":12.469,"Driver.Present.release_and_callback":0.461,"Driver.Present.render_fence_wait":4422.078,"Driver.Present.resize":3.547,"Driver.Present.validate":0.034,"Driver.Rewind":326.286,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":147.69,"GpuMutex.wait.draw":2828.828,"GpuMutex.wait.end":113.441,"GpuMutex.wait.fill":58.889,"GpuMutex.wait.flush":1082.0,"GpuMutex.wait.hook":4402.172,"GpuMutex.wait.indirect":16.232,"GpuMutex.wait.label":84.191,"GpuMutex.wait.other":95.222,"GpuMutex.wait.present":4.085,"Graphics.Draw":9438.076,"Graphics.Draw.draw_and_resource_release":8484.534,"Graphics.Draw.index_upload":237.455,"Graphics.Draw.validate":322.542,"Graphics.Draw.vertex_upload":301.295,"Graphics.DrawWithRecipe":643.314,"Graphics.DrawWithRecipe.draw_and_resource_release":620.175,"Graphics.DrawWithRecipe.index_upload":3.193,"Graphics.DrawWithRecipe.validate":3.207,"Graphics.DrawWithRecipe.vertex_upload":14.405,"Graphics.Submit":0.048,"Graphics.Submit.command_end":0.014,"Graphics.Submit.queue_submit":0.034,"Graphics.Wait":6.158,"Graphics.Wait.fence_wait":5.922,"Recorder.Reap":119.401,"Recorder.Submit":1186.896,"Recorder.Sync":820.615,"Recorder.WaitSerial":10199.435,"Resources.Complete":5823.088,"Resources.Prepare":1333.297,"Shader.DrawStage":2114.769,"Shader.DrawStage.capture_resources":821.093,"Shader.DrawStage.materialize":971.271,"Shader.DrawStage.prepared_invocation":306.747,"Shader.ResolveGraphicsStagesAbi":3.968,"VideoOut.Flip":4483.789,"VideoOut.Flip.completion_mutex_wait":0.513,"VideoOut.Flip.config_mutex_wait":0.012,"VideoOut.Flip.frame_limit":0.103,"VideoOut.Flip.notify_game":4.823,"VideoOut.Flip.present":4445.57,"VideoOut.Flip.validate":0.177,"VideoOut.Flip.vblank_wait":0.262,"VideoOut.Flip.window_prepare":4.149,"VideoOut.Flip.window_title":28.039,"VideoOut.Readiness":0.404,"VideoOut.Readiness.locks_validate":0.226,"Vulkan.Acquire":21.24,"Vulkan.Acquire.acquire_fence_wait":0.187,"Vulkan.Acquire.acquire_image":20.451,"Vulkan.Acquire.fence_reset":0.456,"Vulkan.Acquire.retired_swapchains":0.08,"Vulkan.Dispatch":6970.825,"Vulkan.Dispatch.command_record":626.482,"Vulkan.Dispatch.shader_resources":6335.01,"Vulkan.DispatchRecipe":100.917,"Vulkan.DispatchRecipe.command_record":99.642,"Vulkan.DrawFromRecipe":644.699,"Vulkan.Present":9.963,"Vulkan.Present.command_record_scale":8.188,"Vulkan.Present.pixel_upload":0.397,"Vulkan.Present.queue_submit":1.245,"Vulkan.QueuePresent":12.282,"Vulkan.QueuePresent.queue_present":8.332,"Vulkan.Retire":4422.019,"Vulkan.Retire.wait":4419.736},"top_phases_ms_per_frame":{"Driver.Packet":909.312,"Driver.Packet.memory_wait":460.333,"Driver.Packet.dispatch":305.053,"Driver.Dispatch":263.945,"Driver.Packet.draw":126.623,"Driver.Draw":126.433,"Driver.Draw.shader_compile_and_link":81.194,"Recorder.WaitSerial":67.996},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":9219,"Graphics.Barrier.dcc-clear":5968,"Graphics.Barrier.dcc-keys":3218,"Graphics.Barrier.dispatch-lead":68509,"Graphics.Barrier.dispatch-trail":35781,"Graphics.Barrier.draw":88556,"Graphics.Barrier.fill":7169,"Graphics.Barrier.fill-clear":2834,"Graphics.Barrier.indirect-args":20983,"Graphics.Barrier.label-run":66653,"Graphics.Barrier.present-blit":600,"Graphics.Barrier.shadow-publish":1803,"Graphics.Barrier.staging-in":38008,"Graphics.Barrier.staging-out":18001,"Graphics.Barrier.storage-upload":16828,"Graphics.Barrier.storage-writeback":17772,"Graphics.BarrierMerged.dispatch-lead":9308,"Graphics.BarrierMerged.fill":3835,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":1483,"Graphics.BarrierMerged.staging-in":17511,"Graphics.BarrierMerged.staging-out":18001,"Graphics.BarrierMerged.storage-writeback":4546,"Graphics.Copy":61119,"Graphics.Copy.bytes":34864607802,"Graphics.RenderPass":34981,"Graphics.RenderPass.Close.command":14139,"Graphics.RenderPass.Close.image":6808,"Graphics.RenderPass.Close.key":3296,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":10598,"Graphics.RenderPass.Close.raw":18,"Graphics.RenderPass.Continued":158832},"trace_dropped":false,"trace":"aps5-trace-49105d912269-87121.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2847: 389.9 ms at 14174 ms: Driver.WorkerWait (queue worker 0x20) 389.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 389.9, Driver.Packet (queue worker 0x28) 388.3, Driver.Packet (queue worker 0x0) 374.2 - present 2822: 382.2 ms at 5901 ms: Driver.WorkerWait (queue worker 0x20) 382.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 382.2, Driver.WorkerWait (queue worker 0x30) 382.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 382.2 - present 2889: 381.1 ms at 26856 ms: Driver.WorkerWait (queue worker 0x30) 381.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 381.1, Driver.Packet (queue worker 0x38) 379.8, Driver.Packet (queue worker 0x0) 359.0 - present 2888: 371.2 ms at 26485 ms: Driver.WorkerWait (queue worker 0x30) 371.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 371.2, Driver.Packet (queue worker 0x38) 370.4, Driver.Packet (queue worker 0x0) 349.3 - present 2892: 370.5 ms at 27901 ms: Driver.WorkerWait (queue worker 0x30) 370.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 370.5, Driver.Packet (queue worker 0x0) 351.6, Driver.Packet (queue worker 0x28) 340.3 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 2847: 389.9 ms at 14174 ms, persistence 145.2 ms - present 2889: 381.1 ms at 26856 ms, persistence 92.9 ms - present 2822: 382.2 ms at 5901 ms, persistence 63.1 ms - present 2812: 303.6 ms at 3262 ms, persistence 58.8 ms - present 2945: 344.6 ms at 44543 ms, persistence 50.7 ms - present 2892: 370.5 ms at 27901 ms, persistence 42.5 ms - present 2850: 337.8 ms at 15178 ms, persistence 42.1 ms - present 2909: 340.4 ms at 33438 ms, persistence 38.2 ms - present 2921: 326.6 ms at 37179 ms, persistence 26.9 ms - present 2880: 314.9 ms at 24111 ms, persistence 23.2 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.1 (0 %) | 307.7 | 0.0 | Recorder.Submit 0.0 | | queue worker 0x0 | 199.1 (65 %) | 92.7 (30 %) | 15.9 | 82.5 | Driver.Packet 289.0, Driver.Rewind 1.9 | | draw committer | 65.9 (21 %) | 20.2 (7 %) | 221.7 | 24.5 | Graphics.Draw 55.5, Recorder.Submit 5.9 | | presenter | 0.6 (0 %) | 29.5 (10 %) | 277.6 | 0.0 | VideoOut.Flip 29.9, Driver.Present 0.2 | | title | 0.0 (0 %) | 0.4 (0 %) | 307.3 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x20 | 27.9 (9 %) | 277.5 (90 %) | 2.3 | 1.2 | Driver.Packet 116.3, Driver.EndSubmission 0.2 | | queue worker 0x28 | 34.6 (11 %) | 270.0 (88 %) | 3.1 | 1.7 | Driver.Packet 151.2, Driver.EndSubmission 0.1 | | title | 0.0 (0 %) | 0.2 (0 %) | 307.5 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x38 | 50.3 (16 %) | 255.3 (83 %) | 2.1 | 3.6 | Driver.Packet 194.8, Driver.EndSubmission 0.3 | | title | 0.0 (0 %) | 0.4 (0 %) | 307.3 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x30 | 31.7 (10 %) | 270.6 (88 %) | 5.4 | 2.0 | Driver.Packet 143.1, Driver.EndSubmission 0.3 | | title | 0.0 (0 %) | 0.3 (0 %) | 307.4 | 0.0 | Recorder.Submit 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | gpu | 178.5 (58 %) | 0.0 (0 %) | 129.2 | 0.0 | batch 178.5 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 894.4, Driver.WorkerWait 611.6, Driver.WorkerWait.idle_and_completion_poll 611.6, Driver.Packet.memory_wait 460.3, Driver.Packet.dispatch 304.4, Driver.Dispatch 263.3, batch 178.5, Driver.Packet.draw 116.0, Driver.Draw 115.9, Driver.Draw.shader_compile_and_link 70.4 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 5956.2 ms at 5271 ms, present 2819 - Driver.WorkerWait (queue worker 0x30) 3276.9 ms at 26340 ms, present 2887 - Driver.WorkerWait (queue worker 0x20) 3062.1 ms at 31067 ms, present 2901 - Driver.WorkerWait (queue worker 0x20) 2413.9 ms at 39685 ms, present 2929 - Driver.WorkerWait (queue worker 0x28) 2289.0 ms at 38886 ms, present 2926 - Driver.WorkerWait (queue worker 0x30) 2020.6 ms at 14417 ms, present 2847 - Driver.WorkerWait (queue worker 0x30) 1834.7 ms at 34161 ms, present 2911 - Driver.WorkerWait (queue worker 0x38) 1817.0 ms at 29429 ms, present 2896 - Driver.WorkerWait (queue worker 0x20) 1693.3 ms at 12905 ms, present 2843 - Driver.WorkerWait (queue worker 0x30) 1658.7 ms at 16854 ms, present 2855 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 15449: 82.0 ms at 26953 ms, present 2889: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.4, Graphics.Draw (draw committer) 1.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.8 - batch 15808: 81.2 ms at 27656 ms, present 2891: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.8, Graphics.Draw (draw committer) 0.8, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Resources.Prepare (draw committer) 0.0 - batch 15635: 81.0 ms at 27327 ms, present 2890: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.4, Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Resources.Prepare (draw committer) 0.0 - batch 15264: 80.5 ms at 26575 ms, present 2888: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 13.9, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.1 - batch 15984: 80.4 ms at 28010 ms, present 2892: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 14.7, Graphics.Draw (draw committer) 1.8, Graphics.Draw.draw_and_resource_release (draw committer) 1.2, Resources.Prepare (draw committer) 0.1 </details> ### 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: Apple M5 Pro, MoltenVK (Vulkan SDK 1.4.363.0), macOS 27.3 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-25 01:08:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T01:08:13Z.

Review: COMMENTED


Reviewed — comments

The review covered all five changed files at head 4b3f8d440235f89b948a954efa843c6b34e141e8; no tests were run, and one edge case still takes the index-wait path.

What I ran

Read the prepared diff and changed lines at the pinned head. No build or test commands were run.

Results

Check Result Note
Diff and targeted code review passed Five changed files inspected
Build and tests not run No command execution available

Negative control

Not run; no tests were executed.

Findings

Blocking

None.

Non-blocking

  • With vertex attributes whose out-of-bounds select is 0 or 1, ZeroFetchVertex returns a clamp threshold. The new whole-range sentinel sets inputs.maxIndex to the maximum possible index, so the existing clamp branch can call FlushGpuWrites and read the index range on the CPU before this whole-range sizing is reached. Those draws can still wait for their index writer. Consider documenting this exception or handling the clamp without synchronously reading the indices. Changed line: core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2165. Pinned source

Not verified

The reported build, execution tests, Vulkan validation, and performance captures were author-reported and not independently run. core/libs/prx/libSceAgcDriver/tests/Recorder.cpp was read at the changed lines through the repository reader; the other changed files were read from the prepared diff and targeted source ranges. No changed files were excluded from review.

To get this to a good state

Nothing is required. Optional: clarify the zero-fetch clamp exception in the description or address that path.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6049997886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26775#pullrequestreview-6049997886). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T01:08:13Z. **Review:** COMMENTED --- # Reviewed — comments The review covered all five changed files at head `4b3f8d440235f89b948a954efa843c6b34e141e8`; no tests were run, and one edge case still takes the index-wait path. ## What I ran Read the prepared diff and changed lines at the pinned head. No build or test commands were run. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted code review | passed | Five changed files inspected | | Build and tests | not run | No command execution available | ## Negative control Not run; no tests were executed. ## Findings ### Blocking None. ### Non-blocking - With vertex attributes whose out-of-bounds select is 0 or 1, `ZeroFetchVertex` returns a clamp threshold. The new whole-range sentinel sets `inputs.maxIndex` to the maximum possible index, so the existing clamp branch can call `FlushGpuWrites` and read the index range on the CPU before this whole-range sizing is reached. Those draws can still wait for their index writer. Consider documenting this exception or handling the clamp without synchronously reading the indices. Changed line: `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2165`. [Pinned source](https://github.com/boykopovar/AnyPS5/blob/4b3f8d440235f89b948a954efa843c6b34e141e8/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2165) ## Not verified The reported build, execution tests, Vulkan validation, and performance captures were author-reported and not independently run. `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` was read at the changed lines through the repository reader; the other changed files were read from the prepared diff and targeted source ranges. No changed files were excluded from review. ## To get this to a good state Nothing is required. Optional: clarify the zero-fetch clamp exception in the description or address that path.
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!26775
No description provided.