perf(agc): lower the batched label flush deadline to 100 us #22800

Merged
slopezjur merged 1 commit from upstream-pr/22800 into main 2026-11-19 16:48:06 +00:00
slopezjur commented 2026-11-18 10:04:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopezjur on 2026-11-18T10:04:16Z.


What

With batched label submission, a pending label batch was recorded or submitted only once it was 1000 us old. Anything that polls a label in guest memory (a title spinning on its async-compute completion labels, another queue's WAIT_REG_MEM) could wait up to that deadline for a label that was already decoded. The batched default is now 100 us (DeferredLabels.cpp labelFlushDeadline). APS5_LABEL_FLUSH_US still overrides it, and the unbatched default stays 250 us. The ENVIRONMENT.md row is updated.

Tested

Windows 11, RTX 4080 SUPER (NVIDIA 621.24), Ryzen 7 7800X3D, Ghost of Yōtei (PPSA26344). Yōtei needs the bindless heap to get past the intro on main, so the build is main cb28e72762 + #20018 + #20519 + #21501 + #22424 + #21303 (plus local log-only diagnostics, off in these runs) with APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1. The arms differ only in APS5_LABEL_FLUSH_US=100 (this PR's default) against unset (main's 1000 us), interleaved, one process per run, 330 s each, warm caches.

Window main (1000 us) this PR (100 us)
PS Studio intro, t 2–18 s 28.82 fps 29.66 fps (30 fps flip cap)
Second intro segment, t 21–28 s 22.56 fps 23.43 fps, every run above every main run
DLC screen, t 220–320 s 5.083 fps 5.135 fps

5 runs for main, 5 for this PR in the intro and 4 on the DLC screen (load crashes excluded; they happen on both arms).

tools/trace_digest.py summaries, DLC screen (APS5_TRACE_SECONDS=270:5):

  • main: 26 presents, frame p50 199.3 / p90 204.6 / p99 206.2 ms, GPU busy 136.0 ms per present
  • this PR: 26 presents, frame p50 196.0 / p90 202.6 / p99 211.0 ms, GPU busy 136.4 ms per present

Summary lines (aps5-summary.jsonl), DLC screen with APS5_TRACE_SECONDS=270:5. main alone does not reach this screen in Ghost of Yōtei, so both arms are clean builds of the same local test stack (main cb28e72762 plus the open Yōtei PRs): 2c8544cf0d is the stack and ba33b7712b is the stack plus this commit, with the same switches. Second run of each arm on a warm shader cache:

{"commit":"2c8544cf0dbb","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1844,"ms":5022.483},"presents":26,"frame_ms":{"p50":191.779,"p90":202.474,"p99":206.919,"max":206.919},"gpu_busy_ms_per_present":133.383,"worker_busy_pct":{"queue worker 0x0":89.333,"queue worker 0x52":21.578,"queue worker 0x53":18.071,"queue worker 0x20":52.662,"queue worker 0x30":67.424,"queue worker 0x38":61.539,"queue worker 0x48":3.493,"queue worker 0x51":1.953,"queue worker 0x50":72.668},"phase_totals_ms":{"Driver.Completion":0.531,"Driver.Dispatch":6131.264,"Driver.Dispatch.capture_resources":776.950,"Driver.Dispatch.decode_key_device_setup":956.298,"Driver.Dispatch.lookup_cache":1444.371,"Driver.Dispatch.materialize":100.808,"Driver.Dispatch.prepared_invocation":28.268,"Driver.Draw":561.044,"Driver.Draw.device_setup":7.702,"Driver.Draw.draw_enqueued":136.143,"Driver.Draw.empty_indirect_skipped":0.464,"Driver.Draw.post_compile_prepare":7.064,"Driver.Draw.prepare":35.198,"Driver.Draw.shader_compile_and_link":371.837,"Driver.EndSubmission":75.651,"Driver.Packet":19447.193,"Driver.Packet.device_lock":7.323,"Driver.Packet.dispatch":8095.997,"Driver.Packet.draw":562.802,"Driver.Packet.execute":623.563,"Driver.Packet.flip_flush":1.049,"Driver.Packet.flush_between_packets":64.141,"Driver.Packet.memory_wait":9743.017,"Driver.Packet.pipeline_drain":132.574,"Driver.Packet.pipeline_prepare":11.520,"Driver.Packet.prepare_memory":170.320,"Driver.Packet.rendering_wait":0.030,"Driver.Present":410.135,"Driver.Present.acquire_image":0.286,"Driver.Present.bindless_wait":395.495,"Driver.Present.device_setup":0.017,"Driver.Present.gpu_mutex_wait":1.715,"Driver.Present.inflight_wait":0.040,"Driver.Present.present_display_buffer":4.224,"Driver.Present.queue_present":7.568,"Driver.Present.release_and_callback":0.022,"Driver.Present.render_fence_wait":0.702,"Driver.Present.resize":0.046,"Driver.Present.validate":0.007,"Driver.Suspend":0.058,"GpuMutex.wait.copy":75.219,"GpuMutex.wait.dispatch":972.357,"GpuMutex.wait.draw":99.923,"GpuMutex.wait.end":53.854,"GpuMutex.wait.fill":15.268,"GpuMutex.wait.flush":60.824,"GpuMutex.wait.hook":467.467,"GpuMutex.wait.indirect":48.982,"GpuMutex.wait.label":73.183,"GpuMutex.wait.other":19.762,"GpuMutex.wait.present":1.682,"Graphics.Draw":1020.666,"Graphics.Draw.draw_and_resource_release":852.035,"Graphics.Draw.index_upload":58.380,"Graphics.Draw.validate":14.288,"Graphics.Draw.vertex_upload":18.003,"Graphics.DrawWithRecipe":30.204,"Graphics.DrawWithRecipe.draw_and_resource_release":28.449,"Graphics.DrawWithRecipe.index_upload":0.022,"Graphics.DrawWithRecipe.validate":0.179,"Graphics.DrawWithRecipe.vertex_upload":0.129,"Graphics.Submit":0.253,"Graphics.Submit.command_end":0.023,"Graphics.Submit.queue_submit":0.227,"Graphics.Wait":27.683,"Graphics.Wait.fence_wait":27.129,"Recorder.Reap":40.882,"Recorder.Submit":72.402,"Recorder.Sync":99.139,"Recorder.WaitSerial":335.743,"Resources.Complete":539.217,"Resources.Prepare":168.990,"Shader.DrawStage":332.208,"Shader.DrawStage.capture_resources":253.738,"Shader.DrawStage.materialize":65.641,"Shader.DrawStage.prepared_invocation":11.923,"Shader.ResolveAbi":26.009,"Shader.ResolveGraphicsAbi":12.225,"Shader.ResolveGraphicsStagesAbi":29.982,"VideoOut.Flip":413.432,"VideoOut.Flip.completion_mutex_wait":0.022,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.009,"VideoOut.Flip.notify_game":0.084,"VideoOut.Flip.present":411.027,"VideoOut.Flip.validate":0.029,"VideoOut.Flip.vblank_wait":0.016,"VideoOut.Flip.window_prepare":0.030,"VideoOut.Flip.window_title":2.205,"VideoOut.Readiness":0.046,"VideoOut.Readiness.locks_validate":0.022,"Vulkan.Acquire":0.264,"Vulkan.Acquire.acquire_fence_wait":0.034,"Vulkan.Acquire.acquire_image":0.166,"Vulkan.Acquire.fence_reset":0.047,"Vulkan.Acquire.retired_swapchains":0.010,"Vulkan.BindlessPresentWait":395.457,"Vulkan.BindlessPresentWait.after_present_wait":51.474,"Vulkan.BindlessPresentWait.early_prepare":5.249,"Vulkan.BindlessPresentWait.finish_up_to":0.633,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.774,"Vulkan.BindlessPresentWait.present_serial":1.686,"Vulkan.BindlessPresentWait.wait_serial":335.491,"Vulkan.Dispatch":1359.236,"Vulkan.Dispatch.command_record":484.825,"Vulkan.Dispatch.shader_resources":867.880,"Vulkan.DispatchRecipe":89.505,"Vulkan.DispatchRecipe.command_record":89.160,"Vulkan.DrawFromRecipe":30.368,"Vulkan.Present":2.406,"Vulkan.Present.command_record_scale":0.717,"Vulkan.Present.pixel_upload":0.924,"Vulkan.Present.queue_submit":0.747,"Vulkan.QueuePresent":7.483,"Vulkan.QueuePresent.queue_present":7.451,"Vulkan.Retire":0.685,"Vulkan.Retire.wait":0.435},"top_phases_ms_per_frame":{"Driver.Packet":747.969,"Driver.Packet.memory_wait":374.731,"Driver.Packet.dispatch":311.384,"Driver.Dispatch":235.818,"Driver.Dispatch.lookup_cache":55.553,"Vulkan.Dispatch":52.278,"Graphics.Draw":39.256,"GpuMutex.wait.dispatch":37.398},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2196,"Graphics.Barrier.dcc-clear":676,"Graphics.Barrier.dcc-keys":520,"Graphics.Barrier.dispatch-lead":18018,"Graphics.Barrier.dispatch-trail":31702,"Graphics.Barrier.draw":9214,"Graphics.Barrier.fill":786,"Graphics.Barrier.fill-clear":676,"Graphics.Barrier.indirect-args":805,"Graphics.Barrier.input-mirror":297,"Graphics.Barrier.label-run":5738,"Graphics.Barrier.present-blit":52,"Graphics.Barrier.shadow-publish":1031,"Graphics.Barrier.staging-in":32726,"Graphics.Barrier.staging-out":16139,"Graphics.Barrier.storage-upload":8186,"Graphics.Barrier.storage-writeback":19580,"Graphics.Barrier.template-refresh":63,"Graphics.BarrierMerged.copy":764,"Graphics.BarrierMerged.dispatch-lead":15294,"Graphics.BarrierMerged.fill":374,"Graphics.BarrierMerged.label-run":81,"Graphics.BarrierMerged.shadow-publish":525,"Graphics.BarrierMerged.staging-in":15641,"Graphics.BarrierMerged.staging-out":16087,"Graphics.BarrierMerged.storage-writeback":2251,"Graphics.Copy":73563,"Graphics.Copy.bytes":32746908112,"Graphics.RenderPass":3558,"Graphics.RenderPass.Close.command":2966,"Graphics.RenderPass.Close.image":153,"Graphics.RenderPass.Close.key":116,"Graphics.RenderPass.Close.label":81,"Graphics.RenderPass.Close.new-batch":242,"Graphics.RenderPass.Continued":2731},"trace_dropped":false,"trace":"aps5-trace-2c8544cf0dbb-6204.json.gz"}
{"commit":"ba33b7712bfa","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1868,"ms":5150.493},"presents":27,"frame_ms":{"p50":191.083,"p90":195.094,"p99":198.948,"max":198.948},"gpu_busy_ms_per_present":135.511,"worker_busy_pct":{"queue worker 0x0":90.857,"queue worker 0x52":22.718,"queue worker 0x53":18.922,"queue worker 0x20":53.757,"queue worker 0x30":68.711,"queue worker 0x38":63.269,"queue worker 0x48":3.584,"queue worker 0x51":1.526,"queue worker 0x50":72.289},"phase_totals_ms":{"Driver.Completion":0.548,"Driver.Dispatch":6495.635,"Driver.Dispatch.capture_resources":934.003,"Driver.Dispatch.decode_key_device_setup":1004.187,"Driver.Dispatch.lookup_cache":1492.236,"Driver.Dispatch.materialize":106.014,"Driver.Dispatch.prepared_invocation":30.757,"Driver.Draw":603.276,"Driver.Draw.device_setup":7.720,"Driver.Draw.draw_enqueued":150.117,"Driver.Draw.empty_indirect_skipped":0.480,"Driver.Draw.post_compile_prepare":7.600,"Driver.Draw.prepare":38.501,"Driver.Draw.shader_compile_and_link":396.086,"Driver.EndSubmission":78.279,"Driver.Packet":20297.864,"Driver.Packet.device_lock":7.987,"Driver.Packet.dispatch":8370.366,"Driver.Packet.draw":605.098,"Driver.Packet.execute":585.278,"Driver.Packet.flip_flush":0.815,"Driver.Packet.flush_between_packets":149.290,"Driver.Packet.memory_wait":10224.428,"Driver.Packet.pipeline_drain":154.743,"Driver.Packet.pipeline_prepare":12.437,"Driver.Packet.prepare_memory":147.370,"Driver.Packet.rendering_wait":0.032,"Driver.Present":345.181,"Driver.Present.acquire_image":0.294,"Driver.Present.bindless_wait":328.192,"Driver.Present.device_setup":0.018,"Driver.Present.gpu_mutex_wait":1.686,"Driver.Present.inflight_wait":0.040,"Driver.Present.present_display_buffer":4.944,"Driver.Present.queue_present":9.576,"Driver.Present.release_and_callback":0.023,"Driver.Present.render_fence_wait":0.337,"Driver.Present.resize":0.049,"Driver.Present.validate":0.009,"Driver.Suspend":0.401,"GpuMutex.wait.copy":37.293,"GpuMutex.wait.dispatch":976.757,"GpuMutex.wait.draw":124.279,"GpuMutex.wait.end":28.517,"GpuMutex.wait.fill":16.279,"GpuMutex.wait.flush":98.437,"GpuMutex.wait.hook":708.361,"GpuMutex.wait.indirect":63.782,"GpuMutex.wait.label":96.378,"GpuMutex.wait.other":21.192,"GpuMutex.wait.present":1.650,"Graphics.Draw":1064.259,"Graphics.Draw.draw_and_resource_release":866.686,"Graphics.Draw.index_upload":78.179,"Graphics.Draw.validate":15.450,"Graphics.Draw.vertex_upload":17.281,"Graphics.DrawWithRecipe":32.898,"Graphics.DrawWithRecipe.draw_and_resource_release":30.899,"Graphics.DrawWithRecipe.index_upload":0.023,"Graphics.DrawWithRecipe.validate":0.201,"Graphics.DrawWithRecipe.vertex_upload":0.165,"Graphics.Submit":0.264,"Graphics.Submit.command_end":0.020,"Graphics.Submit.queue_submit":0.238,"Graphics.Wait":17.017,"Graphics.Wait.fence_wait":15.859,"Recorder.Reap":80.934,"Recorder.Submit":102.621,"Recorder.Sync":141.751,"Recorder.WaitSerial":266.595,"Resources.Complete":542.270,"Resources.Prepare":163.204,"Shader.DrawStage":333.992,"Shader.DrawStage.capture_resources":267.599,"Shader.DrawStage.materialize":52.529,"Shader.DrawStage.prepared_invocation":12.884,"Shader.ResolveAbi":29.070,"Shader.ResolveGraphicsAbi":14.151,"Shader.ResolveGraphicsStagesAbi":34.270,"VideoOut.Flip":348.936,"VideoOut.Flip.completion_mutex_wait":0.027,"VideoOut.Flip.config_mutex_wait":0.003,"VideoOut.Flip.frame_limit":0.013,"VideoOut.Flip.notify_game":0.133,"VideoOut.Flip.present":346.027,"VideoOut.Flip.validate":0.030,"VideoOut.Flip.vblank_wait":0.016,"VideoOut.Flip.window_prepare":0.031,"VideoOut.Flip.window_title":2.639,"VideoOut.Readiness":0.050,"VideoOut.Readiness.locks_validate":0.023,"Vulkan.Acquire":0.270,"Vulkan.Acquire.acquire_fence_wait":0.036,"Vulkan.Acquire.acquire_image":0.170,"Vulkan.Acquire.fence_reset":0.047,"Vulkan.Acquire.retired_swapchains":0.009,"Vulkan.BindlessPresentWait":328.155,"Vulkan.BindlessPresentWait.after_present_wait":54.808,"Vulkan.BindlessPresentWait.early_prepare":3.860,"Vulkan.BindlessPresentWait.finish_up_to":0.741,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.747,"Vulkan.BindlessPresentWait.present_serial":1.502,"Vulkan.BindlessPresentWait.wait_serial":266.345,"Vulkan.Dispatch":1402.506,"Vulkan.Dispatch.command_record":521.284,"Vulkan.Dispatch.shader_resources":873.841,"Vulkan.DispatchRecipe":114.394,"Vulkan.DispatchRecipe.command_record":113.952,"Vulkan.DrawFromRecipe":33.079,"Vulkan.Present":3.029,"Vulkan.Present.command_record_scale":0.935,"Vulkan.Present.pixel_upload":0.878,"Vulkan.Present.queue_submit":1.195,"Vulkan.QueuePresent":9.521,"Vulkan.QueuePresent.queue_present":9.490,"Vulkan.Retire":0.320,"Vulkan.Retire.wait":0.056},"top_phases_ms_per_frame":{"Driver.Packet":751.773,"Driver.Packet.memory_wait":378.683,"Driver.Packet.dispatch":310.014,"Driver.Dispatch":240.579,"Driver.Dispatch.lookup_cache":55.268,"Vulkan.Dispatch":51.945,"Graphics.Draw":39.417,"Driver.Dispatch.decode_key_device_setup":37.192},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2273,"Graphics.Barrier.dcc-clear":702,"Graphics.Barrier.dcc-keys":594,"Graphics.Barrier.dispatch-lead":19735,"Graphics.Barrier.dispatch-trail":35288,"Graphics.Barrier.draw":9510,"Graphics.Barrier.fill":774,"Graphics.Barrier.fill-clear":702,"Graphics.Barrier.indirect-args":836,"Graphics.Barrier.input-mirror":307,"Graphics.Barrier.label-run":6913,"Graphics.Barrier.present-blit":54,"Graphics.Barrier.shadow-publish":1068,"Graphics.Barrier.staging-in":36335,"Graphics.Barrier.staging-out":17841,"Graphics.Barrier.storage-upload":8547,"Graphics.Barrier.storage-writeback":20300,"Graphics.Barrier.template-refresh":74,"Graphics.BarrierMerged.copy":814,"Graphics.BarrierMerged.dispatch-lead":17225,"Graphics.BarrierMerged.fill":384,"Graphics.BarrierMerged.label-run":89,"Graphics.BarrierMerged.shadow-publish":520,"Graphics.BarrierMerged.staging-in":17143,"Graphics.BarrierMerged.staging-out":17787,"Graphics.BarrierMerged.storage-writeback":2108,"Graphics.Copy":80782,"Graphics.Copy.bytes":35688245012,"Graphics.RenderPass":3675,"Graphics.RenderPass.Close.command":2753,"Graphics.RenderPass.Close.image":150,"Graphics.RenderPass.Close.key":104,"Graphics.RenderPass.Close.label":89,"Graphics.RenderPass.Close.new-batch":579,"Graphics.RenderPass.Continued":2868},"trace_dropped":false,"trace":"aps5-trace-ba33b7712bfa-24996.json.gz"}

On this screen the change is within noise (frame p50 191.8 vs 191.1 ms, GPU busy 133.4 vs 135.5 ms per present), in line with the table above; the gain is in the intro segments.

Traces attached.

aps5-trace-c6410e05e8b2-10600.json.gz
aps5-trace-2c8544cf0dbb-6204.json.gz
aps5-trace-ba33b7712bfa-24996.json.gz

GPU tests: ctest -R "^(agc_|shader_)" -V on main 9b262cc4ee and on this branch, same machine and GPU, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer (Vulkan SDK 1.4.363 layer). 2002 tests each; the layer was inserted 1805 times in each log, no was not found but was requested line, 0 VUID- lines in either. main fails 3 and does not build 1 (agc_driver_stencil_plane_memory, agc_driver_store_over_untracked, agc_driver_msaa_dcc_unwatch; agc_driver_upload_cache_read_only_flush does not compile on Windows); this branch fails 2 of those 3 (agc_driver_store_over_untracked passed) and nothing else.

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: PPSA26344 #675
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 621.24, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5373852854 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22800). Originally posted by [slopezjur](https://github.com/slopezjur) on 2026-11-18T10:04:16Z. --- ### What With batched label submission, a pending label batch was recorded or submitted only once it was 1000 us old. Anything that polls a label in guest memory (a title spinning on its async-compute completion labels, another queue's `WAIT_REG_MEM`) could wait up to that deadline for a label that was already decoded. The batched default is now 100 us (`DeferredLabels.cpp` `labelFlushDeadline`). `APS5_LABEL_FLUSH_US` still overrides it, and the unbatched default stays 250 us. The `ENVIRONMENT.md` row is updated. ### Tested Windows 11, RTX 4080 SUPER (NVIDIA 621.24), Ryzen 7 7800X3D, Ghost of Yōtei (PPSA26344). Yōtei needs the bindless heap to get past the intro on `main`, so the build is `main` cb28e72762 + #20018 + #20519 + #21501 + #22424 + #21303 (plus local log-only diagnostics, off in these runs) with `APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1`. The arms differ only in `APS5_LABEL_FLUSH_US=100` (this PR's default) against unset (`main`'s 1000 us), interleaved, one process per run, 330 s each, warm caches. | Window | `main` (1000 us) | this PR (100 us) | |---|---|---| | PS Studio intro, t 2–18 s | 28.82 fps | 29.66 fps (30 fps flip cap) | | Second intro segment, t 21–28 s | 22.56 fps | 23.43 fps, every run above every `main` run | | DLC screen, t 220–320 s | 5.083 fps | 5.135 fps | 5 runs for `main`, 5 for this PR in the intro and 4 on the DLC screen (load crashes excluded; they happen on both arms). `tools/trace_digest.py` summaries, DLC screen (`APS5_TRACE_SECONDS=270:5`): - `main`: 26 presents, frame p50 199.3 / p90 204.6 / p99 206.2 ms, GPU busy 136.0 ms per present - this PR: 26 presents, frame p50 196.0 / p90 202.6 / p99 211.0 ms, GPU busy 136.4 ms per present Summary lines (`aps5-summary.jsonl`), DLC screen with `APS5_TRACE_SECONDS=270:5`. `main` alone does not reach this screen in Ghost of Yōtei, so both arms are clean builds of the same local test stack (`main` cb28e72762 plus the open Yōtei PRs): `2c8544cf0d` is the stack and `ba33b7712b` is the stack plus this commit, with the same switches. Second run of each arm on a warm shader cache: ```json {"commit":"2c8544cf0dbb","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1844,"ms":5022.483},"presents":26,"frame_ms":{"p50":191.779,"p90":202.474,"p99":206.919,"max":206.919},"gpu_busy_ms_per_present":133.383,"worker_busy_pct":{"queue worker 0x0":89.333,"queue worker 0x52":21.578,"queue worker 0x53":18.071,"queue worker 0x20":52.662,"queue worker 0x30":67.424,"queue worker 0x38":61.539,"queue worker 0x48":3.493,"queue worker 0x51":1.953,"queue worker 0x50":72.668},"phase_totals_ms":{"Driver.Completion":0.531,"Driver.Dispatch":6131.264,"Driver.Dispatch.capture_resources":776.950,"Driver.Dispatch.decode_key_device_setup":956.298,"Driver.Dispatch.lookup_cache":1444.371,"Driver.Dispatch.materialize":100.808,"Driver.Dispatch.prepared_invocation":28.268,"Driver.Draw":561.044,"Driver.Draw.device_setup":7.702,"Driver.Draw.draw_enqueued":136.143,"Driver.Draw.empty_indirect_skipped":0.464,"Driver.Draw.post_compile_prepare":7.064,"Driver.Draw.prepare":35.198,"Driver.Draw.shader_compile_and_link":371.837,"Driver.EndSubmission":75.651,"Driver.Packet":19447.193,"Driver.Packet.device_lock":7.323,"Driver.Packet.dispatch":8095.997,"Driver.Packet.draw":562.802,"Driver.Packet.execute":623.563,"Driver.Packet.flip_flush":1.049,"Driver.Packet.flush_between_packets":64.141,"Driver.Packet.memory_wait":9743.017,"Driver.Packet.pipeline_drain":132.574,"Driver.Packet.pipeline_prepare":11.520,"Driver.Packet.prepare_memory":170.320,"Driver.Packet.rendering_wait":0.030,"Driver.Present":410.135,"Driver.Present.acquire_image":0.286,"Driver.Present.bindless_wait":395.495,"Driver.Present.device_setup":0.017,"Driver.Present.gpu_mutex_wait":1.715,"Driver.Present.inflight_wait":0.040,"Driver.Present.present_display_buffer":4.224,"Driver.Present.queue_present":7.568,"Driver.Present.release_and_callback":0.022,"Driver.Present.render_fence_wait":0.702,"Driver.Present.resize":0.046,"Driver.Present.validate":0.007,"Driver.Suspend":0.058,"GpuMutex.wait.copy":75.219,"GpuMutex.wait.dispatch":972.357,"GpuMutex.wait.draw":99.923,"GpuMutex.wait.end":53.854,"GpuMutex.wait.fill":15.268,"GpuMutex.wait.flush":60.824,"GpuMutex.wait.hook":467.467,"GpuMutex.wait.indirect":48.982,"GpuMutex.wait.label":73.183,"GpuMutex.wait.other":19.762,"GpuMutex.wait.present":1.682,"Graphics.Draw":1020.666,"Graphics.Draw.draw_and_resource_release":852.035,"Graphics.Draw.index_upload":58.380,"Graphics.Draw.validate":14.288,"Graphics.Draw.vertex_upload":18.003,"Graphics.DrawWithRecipe":30.204,"Graphics.DrawWithRecipe.draw_and_resource_release":28.449,"Graphics.DrawWithRecipe.index_upload":0.022,"Graphics.DrawWithRecipe.validate":0.179,"Graphics.DrawWithRecipe.vertex_upload":0.129,"Graphics.Submit":0.253,"Graphics.Submit.command_end":0.023,"Graphics.Submit.queue_submit":0.227,"Graphics.Wait":27.683,"Graphics.Wait.fence_wait":27.129,"Recorder.Reap":40.882,"Recorder.Submit":72.402,"Recorder.Sync":99.139,"Recorder.WaitSerial":335.743,"Resources.Complete":539.217,"Resources.Prepare":168.990,"Shader.DrawStage":332.208,"Shader.DrawStage.capture_resources":253.738,"Shader.DrawStage.materialize":65.641,"Shader.DrawStage.prepared_invocation":11.923,"Shader.ResolveAbi":26.009,"Shader.ResolveGraphicsAbi":12.225,"Shader.ResolveGraphicsStagesAbi":29.982,"VideoOut.Flip":413.432,"VideoOut.Flip.completion_mutex_wait":0.022,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.009,"VideoOut.Flip.notify_game":0.084,"VideoOut.Flip.present":411.027,"VideoOut.Flip.validate":0.029,"VideoOut.Flip.vblank_wait":0.016,"VideoOut.Flip.window_prepare":0.030,"VideoOut.Flip.window_title":2.205,"VideoOut.Readiness":0.046,"VideoOut.Readiness.locks_validate":0.022,"Vulkan.Acquire":0.264,"Vulkan.Acquire.acquire_fence_wait":0.034,"Vulkan.Acquire.acquire_image":0.166,"Vulkan.Acquire.fence_reset":0.047,"Vulkan.Acquire.retired_swapchains":0.010,"Vulkan.BindlessPresentWait":395.457,"Vulkan.BindlessPresentWait.after_present_wait":51.474,"Vulkan.BindlessPresentWait.early_prepare":5.249,"Vulkan.BindlessPresentWait.finish_up_to":0.633,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.774,"Vulkan.BindlessPresentWait.present_serial":1.686,"Vulkan.BindlessPresentWait.wait_serial":335.491,"Vulkan.Dispatch":1359.236,"Vulkan.Dispatch.command_record":484.825,"Vulkan.Dispatch.shader_resources":867.880,"Vulkan.DispatchRecipe":89.505,"Vulkan.DispatchRecipe.command_record":89.160,"Vulkan.DrawFromRecipe":30.368,"Vulkan.Present":2.406,"Vulkan.Present.command_record_scale":0.717,"Vulkan.Present.pixel_upload":0.924,"Vulkan.Present.queue_submit":0.747,"Vulkan.QueuePresent":7.483,"Vulkan.QueuePresent.queue_present":7.451,"Vulkan.Retire":0.685,"Vulkan.Retire.wait":0.435},"top_phases_ms_per_frame":{"Driver.Packet":747.969,"Driver.Packet.memory_wait":374.731,"Driver.Packet.dispatch":311.384,"Driver.Dispatch":235.818,"Driver.Dispatch.lookup_cache":55.553,"Vulkan.Dispatch":52.278,"Graphics.Draw":39.256,"GpuMutex.wait.dispatch":37.398},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2196,"Graphics.Barrier.dcc-clear":676,"Graphics.Barrier.dcc-keys":520,"Graphics.Barrier.dispatch-lead":18018,"Graphics.Barrier.dispatch-trail":31702,"Graphics.Barrier.draw":9214,"Graphics.Barrier.fill":786,"Graphics.Barrier.fill-clear":676,"Graphics.Barrier.indirect-args":805,"Graphics.Barrier.input-mirror":297,"Graphics.Barrier.label-run":5738,"Graphics.Barrier.present-blit":52,"Graphics.Barrier.shadow-publish":1031,"Graphics.Barrier.staging-in":32726,"Graphics.Barrier.staging-out":16139,"Graphics.Barrier.storage-upload":8186,"Graphics.Barrier.storage-writeback":19580,"Graphics.Barrier.template-refresh":63,"Graphics.BarrierMerged.copy":764,"Graphics.BarrierMerged.dispatch-lead":15294,"Graphics.BarrierMerged.fill":374,"Graphics.BarrierMerged.label-run":81,"Graphics.BarrierMerged.shadow-publish":525,"Graphics.BarrierMerged.staging-in":15641,"Graphics.BarrierMerged.staging-out":16087,"Graphics.BarrierMerged.storage-writeback":2251,"Graphics.Copy":73563,"Graphics.Copy.bytes":32746908112,"Graphics.RenderPass":3558,"Graphics.RenderPass.Close.command":2966,"Graphics.RenderPass.Close.image":153,"Graphics.RenderPass.Close.key":116,"Graphics.RenderPass.Close.label":81,"Graphics.RenderPass.Close.new-batch":242,"Graphics.RenderPass.Continued":2731},"trace_dropped":false,"trace":"aps5-trace-2c8544cf0dbb-6204.json.gz"} {"commit":"ba33b7712bfa","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1868,"ms":5150.493},"presents":27,"frame_ms":{"p50":191.083,"p90":195.094,"p99":198.948,"max":198.948},"gpu_busy_ms_per_present":135.511,"worker_busy_pct":{"queue worker 0x0":90.857,"queue worker 0x52":22.718,"queue worker 0x53":18.922,"queue worker 0x20":53.757,"queue worker 0x30":68.711,"queue worker 0x38":63.269,"queue worker 0x48":3.584,"queue worker 0x51":1.526,"queue worker 0x50":72.289},"phase_totals_ms":{"Driver.Completion":0.548,"Driver.Dispatch":6495.635,"Driver.Dispatch.capture_resources":934.003,"Driver.Dispatch.decode_key_device_setup":1004.187,"Driver.Dispatch.lookup_cache":1492.236,"Driver.Dispatch.materialize":106.014,"Driver.Dispatch.prepared_invocation":30.757,"Driver.Draw":603.276,"Driver.Draw.device_setup":7.720,"Driver.Draw.draw_enqueued":150.117,"Driver.Draw.empty_indirect_skipped":0.480,"Driver.Draw.post_compile_prepare":7.600,"Driver.Draw.prepare":38.501,"Driver.Draw.shader_compile_and_link":396.086,"Driver.EndSubmission":78.279,"Driver.Packet":20297.864,"Driver.Packet.device_lock":7.987,"Driver.Packet.dispatch":8370.366,"Driver.Packet.draw":605.098,"Driver.Packet.execute":585.278,"Driver.Packet.flip_flush":0.815,"Driver.Packet.flush_between_packets":149.290,"Driver.Packet.memory_wait":10224.428,"Driver.Packet.pipeline_drain":154.743,"Driver.Packet.pipeline_prepare":12.437,"Driver.Packet.prepare_memory":147.370,"Driver.Packet.rendering_wait":0.032,"Driver.Present":345.181,"Driver.Present.acquire_image":0.294,"Driver.Present.bindless_wait":328.192,"Driver.Present.device_setup":0.018,"Driver.Present.gpu_mutex_wait":1.686,"Driver.Present.inflight_wait":0.040,"Driver.Present.present_display_buffer":4.944,"Driver.Present.queue_present":9.576,"Driver.Present.release_and_callback":0.023,"Driver.Present.render_fence_wait":0.337,"Driver.Present.resize":0.049,"Driver.Present.validate":0.009,"Driver.Suspend":0.401,"GpuMutex.wait.copy":37.293,"GpuMutex.wait.dispatch":976.757,"GpuMutex.wait.draw":124.279,"GpuMutex.wait.end":28.517,"GpuMutex.wait.fill":16.279,"GpuMutex.wait.flush":98.437,"GpuMutex.wait.hook":708.361,"GpuMutex.wait.indirect":63.782,"GpuMutex.wait.label":96.378,"GpuMutex.wait.other":21.192,"GpuMutex.wait.present":1.650,"Graphics.Draw":1064.259,"Graphics.Draw.draw_and_resource_release":866.686,"Graphics.Draw.index_upload":78.179,"Graphics.Draw.validate":15.450,"Graphics.Draw.vertex_upload":17.281,"Graphics.DrawWithRecipe":32.898,"Graphics.DrawWithRecipe.draw_and_resource_release":30.899,"Graphics.DrawWithRecipe.index_upload":0.023,"Graphics.DrawWithRecipe.validate":0.201,"Graphics.DrawWithRecipe.vertex_upload":0.165,"Graphics.Submit":0.264,"Graphics.Submit.command_end":0.020,"Graphics.Submit.queue_submit":0.238,"Graphics.Wait":17.017,"Graphics.Wait.fence_wait":15.859,"Recorder.Reap":80.934,"Recorder.Submit":102.621,"Recorder.Sync":141.751,"Recorder.WaitSerial":266.595,"Resources.Complete":542.270,"Resources.Prepare":163.204,"Shader.DrawStage":333.992,"Shader.DrawStage.capture_resources":267.599,"Shader.DrawStage.materialize":52.529,"Shader.DrawStage.prepared_invocation":12.884,"Shader.ResolveAbi":29.070,"Shader.ResolveGraphicsAbi":14.151,"Shader.ResolveGraphicsStagesAbi":34.270,"VideoOut.Flip":348.936,"VideoOut.Flip.completion_mutex_wait":0.027,"VideoOut.Flip.config_mutex_wait":0.003,"VideoOut.Flip.frame_limit":0.013,"VideoOut.Flip.notify_game":0.133,"VideoOut.Flip.present":346.027,"VideoOut.Flip.validate":0.030,"VideoOut.Flip.vblank_wait":0.016,"VideoOut.Flip.window_prepare":0.031,"VideoOut.Flip.window_title":2.639,"VideoOut.Readiness":0.050,"VideoOut.Readiness.locks_validate":0.023,"Vulkan.Acquire":0.270,"Vulkan.Acquire.acquire_fence_wait":0.036,"Vulkan.Acquire.acquire_image":0.170,"Vulkan.Acquire.fence_reset":0.047,"Vulkan.Acquire.retired_swapchains":0.009,"Vulkan.BindlessPresentWait":328.155,"Vulkan.BindlessPresentWait.after_present_wait":54.808,"Vulkan.BindlessPresentWait.early_prepare":3.860,"Vulkan.BindlessPresentWait.finish_up_to":0.741,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.747,"Vulkan.BindlessPresentWait.present_serial":1.502,"Vulkan.BindlessPresentWait.wait_serial":266.345,"Vulkan.Dispatch":1402.506,"Vulkan.Dispatch.command_record":521.284,"Vulkan.Dispatch.shader_resources":873.841,"Vulkan.DispatchRecipe":114.394,"Vulkan.DispatchRecipe.command_record":113.952,"Vulkan.DrawFromRecipe":33.079,"Vulkan.Present":3.029,"Vulkan.Present.command_record_scale":0.935,"Vulkan.Present.pixel_upload":0.878,"Vulkan.Present.queue_submit":1.195,"Vulkan.QueuePresent":9.521,"Vulkan.QueuePresent.queue_present":9.490,"Vulkan.Retire":0.320,"Vulkan.Retire.wait":0.056},"top_phases_ms_per_frame":{"Driver.Packet":751.773,"Driver.Packet.memory_wait":378.683,"Driver.Packet.dispatch":310.014,"Driver.Dispatch":240.579,"Driver.Dispatch.lookup_cache":55.268,"Vulkan.Dispatch":51.945,"Graphics.Draw":39.417,"Driver.Dispatch.decode_key_device_setup":37.192},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2273,"Graphics.Barrier.dcc-clear":702,"Graphics.Barrier.dcc-keys":594,"Graphics.Barrier.dispatch-lead":19735,"Graphics.Barrier.dispatch-trail":35288,"Graphics.Barrier.draw":9510,"Graphics.Barrier.fill":774,"Graphics.Barrier.fill-clear":702,"Graphics.Barrier.indirect-args":836,"Graphics.Barrier.input-mirror":307,"Graphics.Barrier.label-run":6913,"Graphics.Barrier.present-blit":54,"Graphics.Barrier.shadow-publish":1068,"Graphics.Barrier.staging-in":36335,"Graphics.Barrier.staging-out":17841,"Graphics.Barrier.storage-upload":8547,"Graphics.Barrier.storage-writeback":20300,"Graphics.Barrier.template-refresh":74,"Graphics.BarrierMerged.copy":814,"Graphics.BarrierMerged.dispatch-lead":17225,"Graphics.BarrierMerged.fill":384,"Graphics.BarrierMerged.label-run":89,"Graphics.BarrierMerged.shadow-publish":520,"Graphics.BarrierMerged.staging-in":17143,"Graphics.BarrierMerged.staging-out":17787,"Graphics.BarrierMerged.storage-writeback":2108,"Graphics.Copy":80782,"Graphics.Copy.bytes":35688245012,"Graphics.RenderPass":3675,"Graphics.RenderPass.Close.command":2753,"Graphics.RenderPass.Close.image":150,"Graphics.RenderPass.Close.key":104,"Graphics.RenderPass.Close.label":89,"Graphics.RenderPass.Close.new-batch":579,"Graphics.RenderPass.Continued":2868},"trace_dropped":false,"trace":"aps5-trace-ba33b7712bfa-24996.json.gz"} ``` On this screen the change is within noise (frame p50 191.8 vs 191.1 ms, GPU busy 133.4 vs 135.5 ms per present), in line with the table above; the gain is in the intro segments. Traces attached. [aps5-trace-c6410e05e8b2-10600.json.gz](https://github.com/user-attachments/files/35022276/aps5-trace-c6410e05e8b2-10600.json.gz) [aps5-trace-2c8544cf0dbb-6204.json.gz](https://github.com/user-attachments/files/35056444/aps5-trace-2c8544cf0dbb-6204.json.gz) [aps5-trace-ba33b7712bfa-24996.json.gz](https://github.com/user-attachments/files/35056460/aps5-trace-ba33b7712bfa-24996.json.gz) GPU tests: `ctest -R "^(agc_|shader_)" -V` on `main` 9b262cc4ee and on this branch, same machine and GPU, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer` (Vulkan SDK 1.4.363 layer). 2002 tests each; the layer was inserted 1805 times in each log, no `was not found but was requested` line, 0 `VUID-` lines in either. `main` fails 3 and does not build 1 (`agc_driver_stencil_plane_memory`, `agc_driver_store_over_untracked`, `agc_driver_msaa_dcc_unwatch`; `agc_driver_upload_cache_read_only_flush` does not compile on Windows); this branch fails 2 of those 3 (`agc_driver_store_over_untracked` passed) and nothing else. ### 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: PPSA26344 #675 - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 621.24, Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!22800
No description provided.