perf(agc): take guest memory caller samples only under APS5_PROFILE_DRAW #27117

Merged
oneandonlydean merged 2 commits from upstream-pr/27117 into main 2026-11-25 21:03:02 +00:00
oneandonlydean commented 2026-11-25 04:42:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-11-25T04:42:41Z.


What

GuestMemory::Read, ReadCommitted and the write path sample their caller on every 256th read and every 16th write: the sample resolves the return address with dladdr and takes a mutex on the calling thread. The samples are read in one place, the [guestmem] line, which is printed only under APS5_PROFILE_DRAW. CountReadCaller and CountWriteCaller now return at once without that switch. With the switch set the line is unchanged.

Why: at the PPSA21564 hub, CPU samples of the queue 0 worker (perf, 2999 Hz, 20 s, two arms, on another build of this week with a 49.8 ms frame) put 1.4 to 1.5 ms of its 43.5 ms of CPU per frame in this counter, most of it under the vertex stage decode. Every thread that reads guest memory pays the same way.

Tested

The 13 guest memory tests pass on Linux: guest_memory, guest_memory_lifetime, guest_memory_resource, guest_memory_pool_stats, guest_icu_copy_guest_memory, agc_driver_depth_bits_guest_memory and the seven agc_driver_guest_memory_lifetime* tests.

Linux, RTX 4090 (24 GB), i9-14900KF, 3840x2160, one exclusive window with nothing else on the machine.

PPSA21564 01.007.000, -lvl hub_crashsite from a save, no input, no profile. main (9ca3cec822) against cc25449add, 240 s arms, order main, PR, PR, main after a warm-up arm. Mean frame p50 of the last five 10 s rows of each arm; the floor of this scene is 1.0 ms.

Arm Frame p50 Spread of the five rows Presents per 10 s GPU busy per present Driver.Draw per present
main (warm-up) 57.81 ms 0.76 ms 173 46.1 ms 36.1 ms
main 58.03 ms 0.89 ms 169 46.3 ms 37.7 ms
this PR 57.31 ms 0.50 ms 174 46.0 ms 35.0 ms
this PR 57.08 ms 0.37 ms 175 46.0 ms 34.7 ms
main 57.48 ms 0.66 ms 174 46.1 ms 35.3 ms

main 57.76 ms, this PR 57.20 ms: 0.56 ms less (1.0 %), which is below the floor, so at the frame this is neutral. Both PR arms are faster than all three main arms, the warm-up included, and the worker's draw stage is 34.7 and 35.0 ms per present against 35.3 to 37.7 ms. The main arms differ from each other by 2.4 ms on that stage, so this round gives the direction and not the size; the CPU samples above are the better estimate of the size. The dumped frames show the hub in all five arms.

aps5-summary.jsonl, main 9ca3cec822 (last row of the first main arm)
{"commit":"9ca3cec82242","dirty":false,"env":{"APS5_DUMP_FRAMES":"20","APS5_DUMP_FRAMES_EVERY":"100","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 610.57.04","os":"Linux 7.2.3-1-cachyos","cpu":"Intel(R) Core(TM) i9-14900KF","cpu_threads":32,"memory_mib":64118,"title_id":"PPSA21564","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":2932,"ms":10006.512},"interval_start_s":197.816,"interval_end_s":207.823,"presents":172,"frame_ms":{"p50":58.35,"p90":60.27,"p99":61.917,"max":62.587},"gpu_busy_ms_per_present":46.55,"worker_busy_pct":{"queue worker 0x0":98.634,"queue worker 0x40":99.926,"queue worker 0x48":86.607,"queue worker 0x46":1.049},"phase_totals_ms":{"Driver.Completion":15.289,"Driver.Dispatch":2027.054,"Driver.Dispatch.capture_resources":147.603,"Driver.Dispatch.decode_key_device_setup":884.056,"Driver.Dispatch.lookup_cache":37.849,"Driver.Dispatch.materialize":4.955,"Driver.Dispatch.prepared_invocation":3.665,"Driver.Draw":6310.622,"Driver.Draw.device_setup":253.463,"Driver.Draw.draw_enqueued":786.847,"Driver.Draw.post_compile_prepare":77.307,"Driver.Draw.prepare":518.733,"Driver.Draw.shader_compile_and_link":3921.149,"Driver.EndSubmission":22.499,"Driver.Packet":28602.409,"Driver.Packet.device_lock":43.714,"Driver.Packet.dispatch":2044.439,"Driver.Packet.draw":6349.523,"Driver.Packet.execute":420.904,"Driver.Packet.flip_flush":1.887,"Driver.Packet.flush_between_packets":169.522,"Driver.Packet.memory_wait":16367.913,"Driver.Packet.pipeline_drain":199.225,"Driver.Packet.pipeline_prepare":65.0,"Driver.Packet.prepare_memory":2799.12,"Driver.Packet.rendering_wait":0.206,"Driver.Present":299.101,"Driver.Present.acquire_image":4.464,"Driver.Present.device_setup":0.083,"Driver.Present.gpu_mutex_wait":0.176,"Driver.Present.inflight_wait":0.27,"Driver.Present.present_display_buffer":8.688,"Driver.Present.queue_present":68.478,"Driver.Present.release_and_callback":0.123,"Driver.Present.render_fence_wait":216.502,"Driver.Present.resize":0.212,"Driver.Present.validate":0.047,"Driver.Suspend":0.039,"GpuMutex.wait.dispatch":73.051,"GpuMutex.wait.draw":147.331,"GpuMutex.wait.end":9.641,"GpuMutex.wait.fill":2.009,"GpuMutex.wait.flush":7.683,"GpuMutex.wait.hook":4.696,"GpuMutex.wait.indirect":2.153,"GpuMutex.wait.label":84.005,"GpuMutex.wait.present":0.007,"GpuMutex.wait.wait":1.182,"Graphics.Draw":4925.014,"Graphics.Draw.draw_and_resource_release":3933.496,"Graphics.Draw.index_upload":334.007,"Graphics.Draw.validate":377.468,"Graphics.Draw.vertex_upload":237.37,"Graphics.DrawWithRecipe":812.456,"Graphics.DrawWithRecipe.draw_and_resource_release":791.393,"Graphics.DrawWithRecipe.index_upload":3.859,"Graphics.DrawWithRecipe.validate":5.87,"Graphics.DrawWithRecipe.vertex_upload":9.369,"Recorder.Reap":101.918,"Recorder.Submit":205.338,"Recorder.WaitSerial":2055.798,"Resources.Complete":139.74,"Resources.Prepare":46.875,"Shader.DrawStage":3066.435,"Shader.DrawStage.capture_resources":2080.707,"Shader.DrawStage.materialize":661.308,"Shader.DrawStage.prepared_invocation":297.826,"Shader.ResolveAbi":26.949,"Shader.ResolveGraphicsAbi":11.032,"Shader.ResolveGraphicsStagesAbi":205.116,"VideoOut.Flip":301.651,"VideoOut.Flip.completion_mutex_wait":0.087,"VideoOut.Flip.config_mutex_wait":0.012,"VideoOut.Flip.frame_limit":0.06,"VideoOut.Flip.notify_game":0.986,"VideoOut.Flip.present":299.772,"VideoOut.Flip.validate":0.126,"VideoOut.Flip.vblank_wait":0.069,"VideoOut.Flip.window_prepare":0.206,"VideoOut.Flip.window_title":0.279,"VideoOut.Readiness":0.256,"VideoOut.Readiness.locks_validate":0.144,"Vulkan.Acquire":4.09,"Vulkan.Acquire.acquire_fence_wait":0.793,"Vulkan.Acquire.acquire_image":2.27,"Vulkan.Acquire.fence_reset":0.968,"Vulkan.Acquire.retired_swapchains":0.026,"Vulkan.Dispatch":627.208,"Vulkan.Dispatch.command_record":85.07,"Vulkan.Dispatch.shader_resources":538.606,"Vulkan.DispatchRecipe":67.156,"Vulkan.DispatchRecipe.command_record":66.796,"Vulkan.DrawFromRecipe":815.594,"Vulkan.Present":6.252,"Vulkan.Present.command_record_scale":4.28,"Vulkan.Present.pixel_upload":0.288,"Vulkan.Present.queue_submit":1.588,"Vulkan.QueuePresent":68.289,"Vulkan.QueuePresent.queue_present":68.143,"Vulkan.Retire":216.434,"Vulkan.Retire.wait":214.92},"top_phases_ms_per_frame":{"Driver.Packet":166.293,"Driver.Packet.memory_wait":95.162,"Driver.Packet.draw":36.916,"Driver.Draw":36.69,"Graphics.Draw":28.634,"Graphics.Draw.draw_and_resource_release":22.869,"Driver.Draw.shader_compile_and_link":22.797,"Shader.DrawStage":17.828},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2205,"Graphics.Barrier.dcc-clear":2064,"Graphics.Barrier.dcc-keys":2064,"Graphics.Barrier.dispatch-lead":17972,"Graphics.Barrier.dispatch-trail":16340,"Graphics.Barrier.draw":65349,"Graphics.Barrier.fill":6240,"Graphics.Barrier.fill-clear":3096,"Graphics.Barrier.indirect-args":1548,"Graphics.Barrier.label-run":122969,"Graphics.Barrier.present-blit":344,"Graphics.Barrier.shadow-publish":2236,"Graphics.Barrier.staging-in":39334,"Graphics.Barrier.staging-out":18196,"Graphics.Barrier.storage-upload":9976,"Graphics.Barrier.storage-writeback":19264,"Graphics.BarrierMerged.dispatch-lead":1464,"Graphics.BarrierMerged.fill":1652,"Graphics.BarrierMerged.label-run":159,"Graphics.BarrierMerged.shadow-publish":1204,"Graphics.BarrierMerged.staging-in":15598,"Graphics.BarrierMerged.staging-out":18196,"Graphics.BarrierMerged.storage-writeback":3507,"Graphics.Copy":41366,"Graphics.Copy.bytes":28270213904,"Graphics.RenderPass":30356,"Graphics.RenderPass.Close.command":19318,"Graphics.RenderPass.Close.image":936,"Graphics.RenderPass.Close.key":1120,"Graphics.RenderPass.Close.label":159,"Graphics.RenderPass.Close.new-batch":8823,"Graphics.RenderPass.Continued":356764},"trace_dropped":false,"trace":""}
aps5-summary.jsonl, cc25449add (last row of the first PR arm)
{"commit":"cc25449add3d","dirty":false,"env":{"APS5_DUMP_FRAMES":"20","APS5_DUMP_FRAMES_EVERY":"100","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 610.57.04","os":"Linux 7.2.3-1-cachyos","cpu":"Intel(R) Core(TM) i9-14900KF","cpu_threads":32,"memory_mib":64118,"title_id":"PPSA21564","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":2992,"ms":10019.394},"interval_start_s":200.065,"interval_end_s":210.085,"presents":176,"frame_ms":{"p50":56.966,"p90":58.68,"p99":61.146,"max":61.276},"gpu_busy_ms_per_present":45.613,"worker_busy_pct":{"queue worker 0x0":98.713,"queue worker 0x40":99.945,"queue worker 0x48":87.312,"queue worker 0x46":1.021},"phase_totals_ms":{"Driver.Completion":16.605,"Driver.Dispatch":2089.131,"Driver.Dispatch.capture_resources":114.373,"Driver.Dispatch.decode_key_device_setup":928.69,"Driver.Dispatch.lookup_cache":36.788,"Driver.Dispatch.materialize":4.436,"Driver.Dispatch.prepared_invocation":3.443,"Driver.Draw":6029.321,"Driver.Draw.device_setup":252.769,"Driver.Draw.draw_enqueued":780.339,"Driver.Draw.post_compile_prepare":75.3,"Driver.Draw.prepare":507.922,"Driver.Draw.shader_compile_and_link":3640.329,"Driver.EndSubmission":22.267,"Driver.Packet":28715.763,"Driver.Packet.device_lock":44.898,"Driver.Packet.dispatch":2106.063,"Driver.Packet.draw":6067.07,"Driver.Packet.execute":421.09,"Driver.Packet.flip_flush":1.839,"Driver.Packet.flush_between_packets":174.487,"Driver.Packet.memory_wait":16619.437,"Driver.Packet.pipeline_drain":195.988,"Driver.Packet.pipeline_prepare":65.336,"Driver.Packet.prepare_memory":2880.113,"Driver.Packet.rendering_wait":0.197,"Driver.Present":250.839,"Driver.Present.acquire_image":4.352,"Driver.Present.device_setup":0.076,"Driver.Present.gpu_mutex_wait":0.158,"Driver.Present.inflight_wait":0.268,"Driver.Present.present_display_buffer":8.583,"Driver.Present.queue_present":68.318,"Driver.Present.release_and_callback":0.106,"Driver.Present.render_fence_wait":168.669,"Driver.Present.resize":0.207,"Driver.Present.validate":0.043,"Driver.Suspend":0.038,"GpuMutex.wait.dispatch":72.486,"GpuMutex.wait.draw":126.444,"GpuMutex.wait.end":9.076,"GpuMutex.wait.fill":1.914,"GpuMutex.wait.flush":7.95,"GpuMutex.wait.hook":3.495,"GpuMutex.wait.indirect":0.869,"GpuMutex.wait.label":74.01,"GpuMutex.wait.present":0.001,"GpuMutex.wait.wait":1.914,"Graphics.Draw":4830.409,"Graphics.Draw.draw_and_resource_release":3861.331,"Graphics.Draw.index_upload":324.466,"Graphics.Draw.validate":367.74,"Graphics.Draw.vertex_upload":234.694,"Graphics.DrawWithRecipe":893.571,"Graphics.DrawWithRecipe.draw_and_resource_release":870.705,"Graphics.DrawWithRecipe.index_upload":4.171,"Graphics.DrawWithRecipe.validate":6.495,"Graphics.DrawWithRecipe.vertex_upload":10.16,"Recorder.Reap":98.206,"Recorder.Submit":200.662,"Recorder.WaitSerial":2110.302,"Resources.Complete":137.645,"Resources.Prepare":44.112,"Shader.DrawStage":3003.844,"Shader.DrawStage.capture_resources":2059.106,"Shader.DrawStage.materialize":624.852,"Shader.DrawStage.prepared_invocation":293.486,"Shader.ResolveAbi":27.259,"Shader.ResolveGraphicsAbi":11.309,"Shader.ResolveGraphicsStagesAbi":207.938,"VideoOut.Flip":253.307,"VideoOut.Flip.completion_mutex_wait":0.077,"VideoOut.Flip.config_mutex_wait":0.014,"VideoOut.Flip.frame_limit":0.06,"VideoOut.Flip.notify_game":0.974,"VideoOut.Flip.present":251.49,"VideoOut.Flip.validate":0.115,"VideoOut.Flip.vblank_wait":0.069,"VideoOut.Flip.window_prepare":0.203,"VideoOut.Flip.window_title":0.248,"VideoOut.Readiness":0.233,"VideoOut.Readiness.locks_validate":0.134,"Vulkan.Acquire":4.026,"Vulkan.Acquire.acquire_fence_wait":0.781,"Vulkan.Acquire.acquire_image":2.23,"Vulkan.Acquire.fence_reset":0.93,"Vulkan.Acquire.retired_swapchains":0.049,"Vulkan.Dispatch":685.738,"Vulkan.Dispatch.command_record":82.411,"Vulkan.Dispatch.shader_resources":601.249,"Vulkan.DispatchRecipe":71.597,"Vulkan.DispatchRecipe.command_record":71.28,"Vulkan.DrawFromRecipe":897.11,"Vulkan.Present":6.114,"Vulkan.Present.command_record_scale":4.143,"Vulkan.Present.pixel_upload":0.314,"Vulkan.Present.queue_submit":1.579,"Vulkan.QueuePresent":68.122,"Vulkan.QueuePresent.queue_present":67.974,"Vulkan.Retire":168.601,"Vulkan.Retire.wait":167.222},"top_phases_ms_per_frame":{"Driver.Packet":163.158,"Driver.Packet.memory_wait":94.429,"Driver.Packet.draw":34.472,"Driver.Draw":34.258,"Graphics.Draw":27.446,"Graphics.Draw.draw_and_resource_release":21.939,"Driver.Draw.shader_compile_and_link":20.684,"Shader.DrawStage":17.067},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2163,"Graphics.Barrier.dcc-clear":2112,"Graphics.Barrier.dcc-keys":2112,"Graphics.Barrier.dispatch-lead":18391,"Graphics.Barrier.dispatch-trail":16720,"Graphics.Barrier.draw":64484,"Graphics.Barrier.fill":6309,"Graphics.Barrier.fill-clear":3168,"Graphics.Barrier.indirect-args":1584,"Graphics.Barrier.label-run":125242,"Graphics.Barrier.present-blit":352,"Graphics.Barrier.shadow-publish":2288,"Graphics.Barrier.staging-in":40329,"Graphics.Barrier.staging-out":18618,"Graphics.Barrier.storage-upload":10208,"Graphics.Barrier.storage-writeback":19712,"Graphics.BarrierMerged.dispatch-lead":1497,"Graphics.BarrierMerged.fill":1697,"Graphics.BarrierMerged.label-run":130,"Graphics.BarrierMerged.shadow-publish":1232,"Graphics.BarrierMerged.staging-in":15877,"Graphics.BarrierMerged.staging-out":18618,"Graphics.BarrierMerged.storage-writeback":3670,"Graphics.Copy":42287,"Graphics.Copy.bytes":28907988628,"Graphics.RenderPass":29908,"Graphics.RenderPass.Close.command":19373,"Graphics.RenderPass.Close.image":873,"Graphics.RenderPass.Close.key":1173,"Graphics.RenderPass.Close.label":130,"Graphics.RenderPass.Close.new-batch":8359,"Graphics.RenderPass.Continued":362819},"trace_dropped":false,"trace":""}

The title name field is left out of both lines.

The numbers and the tests are of cc25449add, the first commit here. The head differs from it by removed code comments only.

Not tested here: Windows, AMD and Intel GPUs.

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: NVIDIA RTX 4090, driver 610.57.04, Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5485311151 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27117). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-11-25T04:42:41Z. --- ### What `GuestMemory::Read`, `ReadCommitted` and the write path sample their caller on every 256th read and every 16th write: the sample resolves the return address with `dladdr` and takes a mutex on the calling thread. The samples are read in one place, the `[guestmem]` line, which is printed only under `APS5_PROFILE_DRAW`. `CountReadCaller` and `CountWriteCaller` now return at once without that switch. With the switch set the line is unchanged. Why: at the PPSA21564 hub, CPU samples of the queue 0 worker (perf, 2999 Hz, 20 s, two arms, on another build of this week with a 49.8 ms frame) put 1.4 to 1.5 ms of its 43.5 ms of CPU per frame in this counter, most of it under the vertex stage decode. Every thread that reads guest memory pays the same way. ### Tested The 13 guest memory tests pass on Linux: `guest_memory`, `guest_memory_lifetime`, `guest_memory_resource`, `guest_memory_pool_stats`, `guest_icu_copy_guest_memory`, `agc_driver_depth_bits_guest_memory` and the seven `agc_driver_guest_memory_lifetime*` tests. Linux, RTX 4090 (24 GB), i9-14900KF, 3840x2160, one exclusive window with nothing else on the machine. **PPSA21564 01.007.000, `-lvl hub_crashsite` from a save, no input, no profile.** `main` (9ca3cec822) against cc25449add, 240 s arms, order `main`, PR, PR, `main` after a warm-up arm. Mean frame p50 of the last five 10 s rows of each arm; the floor of this scene is 1.0 ms. | Arm | Frame p50 | Spread of the five rows | Presents per 10 s | GPU busy per present | `Driver.Draw` per present | |---|---|---|---|---|---| | `main` (warm-up) | 57.81 ms | 0.76 ms | 173 | 46.1 ms | 36.1 ms | | `main` | 58.03 ms | 0.89 ms | 169 | 46.3 ms | 37.7 ms | | this PR | 57.31 ms | 0.50 ms | 174 | 46.0 ms | 35.0 ms | | this PR | 57.08 ms | 0.37 ms | 175 | 46.0 ms | 34.7 ms | | `main` | 57.48 ms | 0.66 ms | 174 | 46.1 ms | 35.3 ms | `main` 57.76 ms, this PR 57.20 ms: 0.56 ms less (1.0 %), which is below the floor, so at the frame this is neutral. Both PR arms are faster than all three `main` arms, the warm-up included, and the worker's draw stage is 34.7 and 35.0 ms per present against 35.3 to 37.7 ms. The `main` arms differ from each other by 2.4 ms on that stage, so this round gives the direction and not the size; the CPU samples above are the better estimate of the size. The dumped frames show the hub in all five arms. <details><summary>aps5-summary.jsonl, main 9ca3cec822 (last row of the first main arm)</summary> ```json {"commit":"9ca3cec82242","dirty":false,"env":{"APS5_DUMP_FRAMES":"20","APS5_DUMP_FRAMES_EVERY":"100","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 610.57.04","os":"Linux 7.2.3-1-cachyos","cpu":"Intel(R) Core(TM) i9-14900KF","cpu_threads":32,"memory_mib":64118,"title_id":"PPSA21564","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":2932,"ms":10006.512},"interval_start_s":197.816,"interval_end_s":207.823,"presents":172,"frame_ms":{"p50":58.35,"p90":60.27,"p99":61.917,"max":62.587},"gpu_busy_ms_per_present":46.55,"worker_busy_pct":{"queue worker 0x0":98.634,"queue worker 0x40":99.926,"queue worker 0x48":86.607,"queue worker 0x46":1.049},"phase_totals_ms":{"Driver.Completion":15.289,"Driver.Dispatch":2027.054,"Driver.Dispatch.capture_resources":147.603,"Driver.Dispatch.decode_key_device_setup":884.056,"Driver.Dispatch.lookup_cache":37.849,"Driver.Dispatch.materialize":4.955,"Driver.Dispatch.prepared_invocation":3.665,"Driver.Draw":6310.622,"Driver.Draw.device_setup":253.463,"Driver.Draw.draw_enqueued":786.847,"Driver.Draw.post_compile_prepare":77.307,"Driver.Draw.prepare":518.733,"Driver.Draw.shader_compile_and_link":3921.149,"Driver.EndSubmission":22.499,"Driver.Packet":28602.409,"Driver.Packet.device_lock":43.714,"Driver.Packet.dispatch":2044.439,"Driver.Packet.draw":6349.523,"Driver.Packet.execute":420.904,"Driver.Packet.flip_flush":1.887,"Driver.Packet.flush_between_packets":169.522,"Driver.Packet.memory_wait":16367.913,"Driver.Packet.pipeline_drain":199.225,"Driver.Packet.pipeline_prepare":65.0,"Driver.Packet.prepare_memory":2799.12,"Driver.Packet.rendering_wait":0.206,"Driver.Present":299.101,"Driver.Present.acquire_image":4.464,"Driver.Present.device_setup":0.083,"Driver.Present.gpu_mutex_wait":0.176,"Driver.Present.inflight_wait":0.27,"Driver.Present.present_display_buffer":8.688,"Driver.Present.queue_present":68.478,"Driver.Present.release_and_callback":0.123,"Driver.Present.render_fence_wait":216.502,"Driver.Present.resize":0.212,"Driver.Present.validate":0.047,"Driver.Suspend":0.039,"GpuMutex.wait.dispatch":73.051,"GpuMutex.wait.draw":147.331,"GpuMutex.wait.end":9.641,"GpuMutex.wait.fill":2.009,"GpuMutex.wait.flush":7.683,"GpuMutex.wait.hook":4.696,"GpuMutex.wait.indirect":2.153,"GpuMutex.wait.label":84.005,"GpuMutex.wait.present":0.007,"GpuMutex.wait.wait":1.182,"Graphics.Draw":4925.014,"Graphics.Draw.draw_and_resource_release":3933.496,"Graphics.Draw.index_upload":334.007,"Graphics.Draw.validate":377.468,"Graphics.Draw.vertex_upload":237.37,"Graphics.DrawWithRecipe":812.456,"Graphics.DrawWithRecipe.draw_and_resource_release":791.393,"Graphics.DrawWithRecipe.index_upload":3.859,"Graphics.DrawWithRecipe.validate":5.87,"Graphics.DrawWithRecipe.vertex_upload":9.369,"Recorder.Reap":101.918,"Recorder.Submit":205.338,"Recorder.WaitSerial":2055.798,"Resources.Complete":139.74,"Resources.Prepare":46.875,"Shader.DrawStage":3066.435,"Shader.DrawStage.capture_resources":2080.707,"Shader.DrawStage.materialize":661.308,"Shader.DrawStage.prepared_invocation":297.826,"Shader.ResolveAbi":26.949,"Shader.ResolveGraphicsAbi":11.032,"Shader.ResolveGraphicsStagesAbi":205.116,"VideoOut.Flip":301.651,"VideoOut.Flip.completion_mutex_wait":0.087,"VideoOut.Flip.config_mutex_wait":0.012,"VideoOut.Flip.frame_limit":0.06,"VideoOut.Flip.notify_game":0.986,"VideoOut.Flip.present":299.772,"VideoOut.Flip.validate":0.126,"VideoOut.Flip.vblank_wait":0.069,"VideoOut.Flip.window_prepare":0.206,"VideoOut.Flip.window_title":0.279,"VideoOut.Readiness":0.256,"VideoOut.Readiness.locks_validate":0.144,"Vulkan.Acquire":4.09,"Vulkan.Acquire.acquire_fence_wait":0.793,"Vulkan.Acquire.acquire_image":2.27,"Vulkan.Acquire.fence_reset":0.968,"Vulkan.Acquire.retired_swapchains":0.026,"Vulkan.Dispatch":627.208,"Vulkan.Dispatch.command_record":85.07,"Vulkan.Dispatch.shader_resources":538.606,"Vulkan.DispatchRecipe":67.156,"Vulkan.DispatchRecipe.command_record":66.796,"Vulkan.DrawFromRecipe":815.594,"Vulkan.Present":6.252,"Vulkan.Present.command_record_scale":4.28,"Vulkan.Present.pixel_upload":0.288,"Vulkan.Present.queue_submit":1.588,"Vulkan.QueuePresent":68.289,"Vulkan.QueuePresent.queue_present":68.143,"Vulkan.Retire":216.434,"Vulkan.Retire.wait":214.92},"top_phases_ms_per_frame":{"Driver.Packet":166.293,"Driver.Packet.memory_wait":95.162,"Driver.Packet.draw":36.916,"Driver.Draw":36.69,"Graphics.Draw":28.634,"Graphics.Draw.draw_and_resource_release":22.869,"Driver.Draw.shader_compile_and_link":22.797,"Shader.DrawStage":17.828},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2205,"Graphics.Barrier.dcc-clear":2064,"Graphics.Barrier.dcc-keys":2064,"Graphics.Barrier.dispatch-lead":17972,"Graphics.Barrier.dispatch-trail":16340,"Graphics.Barrier.draw":65349,"Graphics.Barrier.fill":6240,"Graphics.Barrier.fill-clear":3096,"Graphics.Barrier.indirect-args":1548,"Graphics.Barrier.label-run":122969,"Graphics.Barrier.present-blit":344,"Graphics.Barrier.shadow-publish":2236,"Graphics.Barrier.staging-in":39334,"Graphics.Barrier.staging-out":18196,"Graphics.Barrier.storage-upload":9976,"Graphics.Barrier.storage-writeback":19264,"Graphics.BarrierMerged.dispatch-lead":1464,"Graphics.BarrierMerged.fill":1652,"Graphics.BarrierMerged.label-run":159,"Graphics.BarrierMerged.shadow-publish":1204,"Graphics.BarrierMerged.staging-in":15598,"Graphics.BarrierMerged.staging-out":18196,"Graphics.BarrierMerged.storage-writeback":3507,"Graphics.Copy":41366,"Graphics.Copy.bytes":28270213904,"Graphics.RenderPass":30356,"Graphics.RenderPass.Close.command":19318,"Graphics.RenderPass.Close.image":936,"Graphics.RenderPass.Close.key":1120,"Graphics.RenderPass.Close.label":159,"Graphics.RenderPass.Close.new-batch":8823,"Graphics.RenderPass.Continued":356764},"trace_dropped":false,"trace":""} ``` </details> <details><summary>aps5-summary.jsonl, cc25449add (last row of the first PR arm)</summary> ```json {"commit":"cc25449add3d","dirty":false,"env":{"APS5_DUMP_FRAMES":"20","APS5_DUMP_FRAMES_EVERY":"100","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 610.57.04","os":"Linux 7.2.3-1-cachyos","cpu":"Intel(R) Core(TM) i9-14900KF","cpu_threads":32,"memory_mib":64118,"title_id":"PPSA21564","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":2992,"ms":10019.394},"interval_start_s":200.065,"interval_end_s":210.085,"presents":176,"frame_ms":{"p50":56.966,"p90":58.68,"p99":61.146,"max":61.276},"gpu_busy_ms_per_present":45.613,"worker_busy_pct":{"queue worker 0x0":98.713,"queue worker 0x40":99.945,"queue worker 0x48":87.312,"queue worker 0x46":1.021},"phase_totals_ms":{"Driver.Completion":16.605,"Driver.Dispatch":2089.131,"Driver.Dispatch.capture_resources":114.373,"Driver.Dispatch.decode_key_device_setup":928.69,"Driver.Dispatch.lookup_cache":36.788,"Driver.Dispatch.materialize":4.436,"Driver.Dispatch.prepared_invocation":3.443,"Driver.Draw":6029.321,"Driver.Draw.device_setup":252.769,"Driver.Draw.draw_enqueued":780.339,"Driver.Draw.post_compile_prepare":75.3,"Driver.Draw.prepare":507.922,"Driver.Draw.shader_compile_and_link":3640.329,"Driver.EndSubmission":22.267,"Driver.Packet":28715.763,"Driver.Packet.device_lock":44.898,"Driver.Packet.dispatch":2106.063,"Driver.Packet.draw":6067.07,"Driver.Packet.execute":421.09,"Driver.Packet.flip_flush":1.839,"Driver.Packet.flush_between_packets":174.487,"Driver.Packet.memory_wait":16619.437,"Driver.Packet.pipeline_drain":195.988,"Driver.Packet.pipeline_prepare":65.336,"Driver.Packet.prepare_memory":2880.113,"Driver.Packet.rendering_wait":0.197,"Driver.Present":250.839,"Driver.Present.acquire_image":4.352,"Driver.Present.device_setup":0.076,"Driver.Present.gpu_mutex_wait":0.158,"Driver.Present.inflight_wait":0.268,"Driver.Present.present_display_buffer":8.583,"Driver.Present.queue_present":68.318,"Driver.Present.release_and_callback":0.106,"Driver.Present.render_fence_wait":168.669,"Driver.Present.resize":0.207,"Driver.Present.validate":0.043,"Driver.Suspend":0.038,"GpuMutex.wait.dispatch":72.486,"GpuMutex.wait.draw":126.444,"GpuMutex.wait.end":9.076,"GpuMutex.wait.fill":1.914,"GpuMutex.wait.flush":7.95,"GpuMutex.wait.hook":3.495,"GpuMutex.wait.indirect":0.869,"GpuMutex.wait.label":74.01,"GpuMutex.wait.present":0.001,"GpuMutex.wait.wait":1.914,"Graphics.Draw":4830.409,"Graphics.Draw.draw_and_resource_release":3861.331,"Graphics.Draw.index_upload":324.466,"Graphics.Draw.validate":367.74,"Graphics.Draw.vertex_upload":234.694,"Graphics.DrawWithRecipe":893.571,"Graphics.DrawWithRecipe.draw_and_resource_release":870.705,"Graphics.DrawWithRecipe.index_upload":4.171,"Graphics.DrawWithRecipe.validate":6.495,"Graphics.DrawWithRecipe.vertex_upload":10.16,"Recorder.Reap":98.206,"Recorder.Submit":200.662,"Recorder.WaitSerial":2110.302,"Resources.Complete":137.645,"Resources.Prepare":44.112,"Shader.DrawStage":3003.844,"Shader.DrawStage.capture_resources":2059.106,"Shader.DrawStage.materialize":624.852,"Shader.DrawStage.prepared_invocation":293.486,"Shader.ResolveAbi":27.259,"Shader.ResolveGraphicsAbi":11.309,"Shader.ResolveGraphicsStagesAbi":207.938,"VideoOut.Flip":253.307,"VideoOut.Flip.completion_mutex_wait":0.077,"VideoOut.Flip.config_mutex_wait":0.014,"VideoOut.Flip.frame_limit":0.06,"VideoOut.Flip.notify_game":0.974,"VideoOut.Flip.present":251.49,"VideoOut.Flip.validate":0.115,"VideoOut.Flip.vblank_wait":0.069,"VideoOut.Flip.window_prepare":0.203,"VideoOut.Flip.window_title":0.248,"VideoOut.Readiness":0.233,"VideoOut.Readiness.locks_validate":0.134,"Vulkan.Acquire":4.026,"Vulkan.Acquire.acquire_fence_wait":0.781,"Vulkan.Acquire.acquire_image":2.23,"Vulkan.Acquire.fence_reset":0.93,"Vulkan.Acquire.retired_swapchains":0.049,"Vulkan.Dispatch":685.738,"Vulkan.Dispatch.command_record":82.411,"Vulkan.Dispatch.shader_resources":601.249,"Vulkan.DispatchRecipe":71.597,"Vulkan.DispatchRecipe.command_record":71.28,"Vulkan.DrawFromRecipe":897.11,"Vulkan.Present":6.114,"Vulkan.Present.command_record_scale":4.143,"Vulkan.Present.pixel_upload":0.314,"Vulkan.Present.queue_submit":1.579,"Vulkan.QueuePresent":68.122,"Vulkan.QueuePresent.queue_present":67.974,"Vulkan.Retire":168.601,"Vulkan.Retire.wait":167.222},"top_phases_ms_per_frame":{"Driver.Packet":163.158,"Driver.Packet.memory_wait":94.429,"Driver.Packet.draw":34.472,"Driver.Draw":34.258,"Graphics.Draw":27.446,"Graphics.Draw.draw_and_resource_release":21.939,"Driver.Draw.shader_compile_and_link":20.684,"Shader.DrawStage":17.067},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2163,"Graphics.Barrier.dcc-clear":2112,"Graphics.Barrier.dcc-keys":2112,"Graphics.Barrier.dispatch-lead":18391,"Graphics.Barrier.dispatch-trail":16720,"Graphics.Barrier.draw":64484,"Graphics.Barrier.fill":6309,"Graphics.Barrier.fill-clear":3168,"Graphics.Barrier.indirect-args":1584,"Graphics.Barrier.label-run":125242,"Graphics.Barrier.present-blit":352,"Graphics.Barrier.shadow-publish":2288,"Graphics.Barrier.staging-in":40329,"Graphics.Barrier.staging-out":18618,"Graphics.Barrier.storage-upload":10208,"Graphics.Barrier.storage-writeback":19712,"Graphics.BarrierMerged.dispatch-lead":1497,"Graphics.BarrierMerged.fill":1697,"Graphics.BarrierMerged.label-run":130,"Graphics.BarrierMerged.shadow-publish":1232,"Graphics.BarrierMerged.staging-in":15877,"Graphics.BarrierMerged.staging-out":18618,"Graphics.BarrierMerged.storage-writeback":3670,"Graphics.Copy":42287,"Graphics.Copy.bytes":28907988628,"Graphics.RenderPass":29908,"Graphics.RenderPass.Close.command":19373,"Graphics.RenderPass.Close.image":873,"Graphics.RenderPass.Close.key":1173,"Graphics.RenderPass.Close.label":130,"Graphics.RenderPass.Close.new-batch":8359,"Graphics.RenderPass.Continued":362819},"trace_dropped":false,"trace":""} ``` </details> The `title` name field is left out of both lines. The numbers and the tests are of cc25449add, the first commit here. The head differs from it by removed code comments only. Not tested here: Windows, AMD and Intel GPUs. ### Checklist - [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: NVIDIA RTX 4090, driver 610.57.04, Linux - [x] AI-assisted: yes
MarcZX10 commented 2026-11-25 05:00:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T05:00:14Z.

Review: APPROVED


Reviewed — looks good

The change gates caller stack sampling on the same cached APS5_PROFILE_DRAW setting used by guest memory profiling, and the added code is consistent with that behavior.

What I ran

  • Reviewed head 5c42b37d968aff7f7945bc83dc0f75be6e3bb0a7; base is main.
  • Read the PR description, commit list, manifest, diff, and all seven added lines in GuestMemory.cpp, plus the touched sampling helper and its read/write call sites.
  • No commands or tests were run.

Results

Check Result Note
Diff and call-site review passed Sampling is gated
Tests not run No execution performed

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • The 13 guest memory tests and performance measurements described by the author were not run as part of this review.
  • No other files were changed; the only changed file listed as reviewed in the manifest was core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6052089726 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27117#pullrequestreview-6052089726). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T05:00:14Z. **Review:** APPROVED --- # Reviewed — looks good The change gates caller stack sampling on the same cached `APS5_PROFILE_DRAW` setting used by guest memory profiling, and the added code is consistent with that behavior. ## What I ran - Reviewed head `5c42b37d968aff7f7945bc83dc0f75be6e3bb0a7`; base is `main`. - Read the PR description, commit list, manifest, diff, and all seven added lines in `GuestMemory.cpp`, plus the touched sampling helper and its read/write call sites. - No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and call-site review | passed | Sampling is gated | | Tests | not run | No execution performed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - The 13 guest memory tests and performance measurements described by the author were not run as part of this review. - No other files were changed; the only changed file listed as reviewed in the manifest was `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!27117
No description provided.