perf(libc): remember readable image pages in the Windows unwinder #20735

Merged
slopezjur merged 1 commit from upstream-pr/20735 into main 2026-11-16 08:10:26 +00:00
slopezjur commented 2026-11-15 14:13:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopezjur on 2026-11-15T14:13:07Z.


What

On Windows the unwinder resolves each personality routine through ResolveImport, which checks with VirtualQuery that the import thunk and its slot are readable. That is two system calls per resolved address, three addresses per foreign frame and one per personality call, for every frame of both unwind phases. In a title that throws often inside host libraries this was most of the cost of a throw.

Readable now remembers a page that VirtualQuery reported readable when the page lies inside a loaded image, keyed by the image identity IndexFrames already uses (base, time stamp, checksum, image size) plus the page. Later unwinds through the same image make no system call.

  • An address outside a loaded image is queried every time, as before.
  • A page that is not readable is not remembered and is queried again.
  • Only the verdict is remembered. The thunk and slot bytes are read on every call, so a slot that is rebound later is still followed.
  • Limit: a page of a loaded image that was readable once is taken as still readable. A later VirtualProtect to no access on such a page would not be noticed.

New Windows test unwind_import_queries: it replaces libc's VirtualQuery import with a counter, throws and catches twice to warm up, then requires that 256 more throws make no query.

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Release.

Tests matching unwind|except|demangle|dynamic_cast|bad_optional|bad_any|filesystem_error|message_destructor|standard_error|terminate|rethrow|nested|typeinfo|cxa (231, including the driver image table tests), on main 6cd3f92560 and on this change based on it:

passed failed
main with the new test added 230 1 (unwind_import_queries: "repeated unwinds through one image do not query its pages again")
this PR 231 0

The branch was then rebased onto main 178944e753, which does not touch the exception sources; the tests were not run again after the rebase. Not tested on Linux or macOS (the changed code is inside #ifdef _WIN32).

Ghost of Yōtei

PPSA26344 v02.002.000, DRS 1080p patch, Digital Deluxe "Press X" screen from a fresh save, warm shader cache, NVIDIA GeForce RTX 4080 SUPER (driver 621.14). Both rows use one build of main cc4e13836f merged with #20017, #20018 and #20519 (merge a13e0362e7, APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1); only libc.prx differs, built from the same merge with and without this commit. The digests print commit a13e0362e720 for both rows because that stamp comes from the driver.

Without profiling, four 330 s runs in the order base, change, base, change, presents between 180 s and 320 s:

libc run 1 run 2
main 2.33 fps 2.30 fps
this PR 2.76 fps 2.68 fps

With APS5_PROFILE_DRAW=1 and APS5_TRACE_SECONDS=270:5, one run each:

libc frame p50 GPU busy per present queue worker 0x30 busy per frame
main 472.8 ms (12 presents) 198.0 ms 180.9 ms
this PR 385.4 ms (13 presents) 187.4 ms 115.3 ms

The throws in this scene come from the per-draw image table path (DecodeTextureResource on invalid table elements); this PR makes each throw cheaper and does not remove them. A first traced run with this PR ended at 66 s with an access violation in the title's own code during the load; the rerun and the two untraced runs were clean. The load crash also happens on this title without this PR, and I did not investigate this occurrence. Not measured: other titles, other GPUs.

tools/trace_digest.py: main libc

seconds 270:5 from present 1248: 12 presents, frame p50 472.8 / p90 487.0 / p99 488.2 / max 488.2 ms, GPU busy 198.0 ms per present
NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit a13e0362e720, dropped: no

{"commit":"a13e0362e720","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_DRAW":"1","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.14","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\u014dtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1248,"ms":5355.302},"presents":12,"frame_ms":{"p50":472.813,"p90":487.046,"p99":488.21,"max":488.21},"gpu_busy_ms_per_present":198.009,"worker_busy_pct":{"queue worker 0x0":96.611,"queue worker 0x52":17.878,"queue worker 0x53":16.566,"queue worker 0x20":45.052,"queue worker 0x30":83.918,"queue worker 0x38":57.161,"queue worker 0x48":2.124,"queue worker 0x51":3.233,"queue worker 0x50":79.18},"phase_totals_ms":{"Driver.Completion":0.211,"Driver.Dispatch":6340.163,"Driver.Dispatch.capture_resources":1500.063,"Driver.Dispatch.decode_key_device_setup":43.134,"Driver.Dispatch.lookup_cache":963.435,"Driver.Dispatch.materialize":403.476,"Driver.Dispatch.prepared_invocation":15.407,"Driver.Draw":346.969,"Driver.Draw.device_setup":4.228,"Driver.Draw.draw_enqueued":55.65,"Driver.Draw.empty_indirect_skipped":0.243,"Driver.Draw.post_compile_prepare":1.967,"Driver.Draw.prepare":19.128,"Driver.Draw.shader_compile_and_link":264.238,"Driver.EndSubmission":16.869,"Driver.Packet":21496.417,"Driver.Packet.device_lock":3.722,"Driver.Packet.dispatch":8263.882,"Driver.Packet.draw":348.59,"Driver.Packet.execute":15.999,"Driver.Packet.flip_flush":0.665,"Driver.Packet.flush_between_packets":36.415,"Driver.Packet.memory_wait":12248.167,"Driver.Packet.pipeline_drain":147.633,"Driver.Packet.pipeline_prepare":6.762,"Driver.Packet.prepare_memory":409.924,"Driver.Packet.rendering_wait":0.014,"Driver.Present":106.194,"Driver.Present.acquire_image":0.142,"Driver.Present.bindless_wait":97.429,"Driver.Present.device_setup":0.008,"Driver.Present.gpu_mutex_wait":0.606,"Driver.Present.inflight_wait":0.023,"Driver.Present.present_display_buffer":1.996,"Driver.Present.queue_present":5.677,"Driver.Present.release_and_callback":0.011,"Driver.Present.render_fence_wait":0.257,"Driver.Present.resize":0.021,"Driver.Present.validate":0.004,"Driver.Suspend":0.061,"GpuMutex.wait.copy":1.21,"GpuMutex.wait.dispatch":977.563,"GpuMutex.wait.draw":68.472,"GpuMutex.wait.end":11.317,"GpuMutex.wait.fill":14.991,"GpuMutex.wait.flush":28.218,"GpuMutex.wait.hook":816.026,"GpuMutex.wait.indirect":27.333,"GpuMutex.wait.label":56.0,"GpuMutex.wait.other":0.801,"GpuMutex.wait.present":0.585,"Graphics.Draw":894.042,"Graphics.Draw.draw_and_resource_release":565.453,"Graphics.Draw.index_upload":186.546,"Graphics.Draw.validate":7.149,"Graphics.Draw.vertex_upload":92.876,"Graphics.DrawWithRecipe":17.92,"Graphics.DrawWithRecipe.draw_and_resource_release":17.027,"Graphics.DrawWithRecipe.index_upload":0.011,"Graphics.DrawWithRecipe.validate":0.112,"Graphics.DrawWithRecipe.vertex_upload":0.108,"Graphics.Submit":0.12,"Graphics.Submit.command_end":0.01,"Graphics.Submit.queue_submit":0.107,"Graphics.Wait":8.399,"Graphics.Wait.fence_wait":8.235,"Recorder.Reap":18.575,"Recorder.Submit":68.525,"Recorder.Sync":190.434,"Recorder.WaitSerial":97.887,"Resources.Complete":1291.992,"Resources.Prepare":111.763,"Shader.DrawStage":176.182,"Shader.DrawStage.capture_resources":152.786,"Shader.DrawStage.materialize":16.634,"Shader.DrawStage.prepared_invocation":6.158,"Shader.ResolveAbi":13.336,"Shader.ResolveGraphicsAbi":6.377,"Shader.ResolveGraphicsStagesAbi":15.385,"VideoOut.Flip":108.334,"VideoOut.Flip.completion_mutex_wait":0.013,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":0.047,"VideoOut.Flip.present":106.923,"VideoOut.Flip.validate":0.013,"VideoOut.Flip.vblank_wait":0.009,"VideoOut.Flip.window_prepare":0.015,"VideoOut.Flip.window_title":1.302,"VideoOut.Readiness":0.023,"VideoOut.Readiness.locks_validate":0.01,"Vulkan.Acquire":0.131,"Vulkan.Acquire.acquire_fence_wait":0.019,"Vulkan.Acquire.acquire_image":0.082,"Vulkan.Acquire.fence_reset":0.023,"Vulkan.Acquire.retired_swapchains":0.004,"Vulkan.BindlessPresentWait":97.411,"Vulkan.BindlessPresentWait.after_present_wait":24.55,"Vulkan.BindlessPresentWait.early_prepare":1.77,"Vulkan.BindlessPresentWait.finish_up_to":0.415,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.103,"Vulkan.BindlessPresentWait.present_serial":0.632,"Vulkan.BindlessPresentWait.wait_serial":54.438,"Vulkan.Dispatch":2084.78,"Vulkan.Dispatch.command_record":640.131,"Vulkan.Dispatch.shader_resources":1439.161,"Vulkan.DispatchRecipe":47.691,"Vulkan.DispatchRecipe.command_record":47.346,"Vulkan.DrawFromRecipe":18.013,"Vulkan.Present":1.161,"Vulkan.Present.command_record_scale":0.361,"Vulkan.Present.pixel_upload":0.423,"Vulkan.Present.queue_submit":0.368,"Vulkan.QueuePresent":5.659,"Vulkan.QueuePresent.queue_present":5.644,"Vulkan.Retire":0.251,"Vulkan.Retire.wait":0.115},"top_phases_ms_per_frame":{"Driver.Packet":1791.368,"Driver.Packet.memory_wait":1020.681,"Driver.Packet.dispatch":688.657,"Driver.Dispatch":528.347,"Vulkan.Dispatch":173.732,"Driver.Dispatch.capture_resources":125.005,"Vulkan.Dispatch.shader_resources":119.93,"Resources.Complete":107.666},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":783,"Graphics.Barrier.dcc-clear":312,"Graphics.Barrier.dcc-keys":240,"Graphics.Barrier.dispatch-lead":8738,"Graphics.Barrier.dispatch-trail":15800,"Graphics.Barrier.draw":4328,"Graphics.Barrier.fill":329,"Graphics.Barrier.fill-clear":312,"Graphics.Barrier.indirect-args":365,"Graphics.Barrier.label-run":1617,"Graphics.Barrier.present-blit":24,"Graphics.Barrier.shadow-publish":483,"Graphics.Barrier.staging-in":15961,"Graphics.Barrier.staging-out":7740,"Graphics.Barrier.storage-upload":3832,"Graphics.Barrier.storage-writeback":9134,"Graphics.Barrier.template-refresh":28,"Graphics.BarrierMerged.copy":151,"Graphics.BarrierMerged.dispatch-lead":7792,"Graphics.BarrierMerged.fill":151,"Graphics.BarrierMerged.label-run":17,"Graphics.BarrierMerged.shadow-publish":243,"Graphics.BarrierMerged.staging-in":7366,"Graphics.BarrierMerged.staging-out":7740,"Graphics.BarrierMerged.storage-writeback":984,"Graphics.Copy":31149,"Graphics.Copy.bytes":9602056144,"Graphics.RenderPass":1366,"Graphics.RenderPass.Close.command":950,"Graphics.RenderPass.Close.image":71,"Graphics.RenderPass.Close.key":44,"Graphics.RenderPass.Close.label":17,"Graphics.RenderPass.Close.new-batch":284,"Graphics.RenderPass.Continued":1475},"trace_dropped":false,"trace":"aps5-trace-a13e0362e720-12668.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1253: 488.2 ms at 2191 ms: Driver.WorkerWait (queue worker 0x48) 479.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 479.8, Driver.WorkerWait (queue worker 0x51) 472.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 472.7
  • present 1257: 487.0 ms at 3974 ms: Driver.WorkerWait (queue worker 0x48) 478.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 478.7, Driver.WorkerWait (queue worker 0x51) 471.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 471.1
  • present 1259: 480.0 ms at 4875 ms: Driver.Packet (queue worker 0x0) 459.5, Driver.Packet (queue worker 0x30) 406.6, Driver.Packet (queue worker 0x50) 377.3, Driver.Packet.memory_wait (queue worker 0x50) 348.2
  • present 1249: 479.3 ms at 422 ms: Driver.WorkerWait (queue worker 0x48) 469.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 469.9, Driver.WorkerWait (queue worker 0x51) 468.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 468.8
  • present 1255: 473.4 ms at 3100 ms: Driver.WorkerWait (queue worker 0x48) 465.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 465.1, Driver.WorkerWait (queue worker 0x51) 457.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 457.8

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

  • present 1253: 488.2 ms at 2191 ms, persistence 88.9 ms
  • present 1257: 487.0 ms at 3974 ms, persistence 86.1 ms
  • present 1249: 479.3 ms at 422 ms, persistence 80.0 ms
  • present 1259: 480.0 ms at 4875 ms, persistence 65.6 ms
  • present 1251: 472.8 ms at 1319 ms, persistence 55.0 ms
  • present 1255: 473.4 ms at 3100 ms, persistence 53.3 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 3.7 (1 %) 442.5 0.4 Shader.ResolveGraphicsStagesAbi 0.0, Recorder.Submit 0.0
queue worker 0x0 218.7 (49 %) 217.6 (49 %) 9.9 54.9 Driver.Packet 422.3, Driver.Completion 0.0
queue worker 0x52 6.0 (1 %) 408.5 (92 %) 31.8 0.8 Driver.Packet 79.3, Driver.EndSubmission 0.3
queue worker 0x53 1.0 (0 %) 413.1 (93 %) 32.1 0.2 Driver.Packet 73.5, Driver.EndSubmission 0.4
queue worker 0x20 113.7 (25 %) 310.4 (70 %) 22.1 8.1 Driver.Packet 200.4, Driver.EndSubmission 0.1
title 0.1 (0 %) 1.4 (0 %) 444.8 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 1.2 (0 %) 445.0 0.2 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 1.0 (0 %) 445.2 0.2 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x30 180.9 (41 %) 259.8 (58 %) 5.6 1.8 Driver.Packet 374.2, Driver.EndSubmission 0.0
queue worker 0x38 83.6 (19 %) 345.2 (77 %) 17.5 4.3 Driver.Packet 254.5, Driver.EndSubmission 0.1
queue worker 0x48 4.3 (1 %) 403.6 (90 %) 38.4 0.7 Driver.Packet 9.3, Driver.EndSubmission 0.1
draw committer 75.5 (17 %) 11.9 (3 %) 358.9 5.2 Graphics.Draw 73.4, Vulkan.DrawFromRecipe 1.5
presenter 0.8 (0 %) 8.2 (2 %) 437.2 0.1 VideoOut.Flip 9.0
title 0.1 (0 %) 0.9 (0 %) 445.3 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 1.0 (0 %) 445.2 0.2 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.9 (0 %) 445.3 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.9 (0 %) 445.3 0.2 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.1 (0 %) 1.1 (0 %) 445.1 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 1.1 (0 %) 445.1 0.2 Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 1.1 (0 %) 445.1 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x51 8.4 (2 %) 408.1 (91 %) 29.8 0.3 Driver.Packet 14.0, Driver.EndSubmission 0.4
queue worker 0x50 22.1 (5 %) 424.0 (95 %) 0.2 1.3 Driver.Packet 353.1
gpu 184.5 (41 %) 0.0 (0 %) 261.7 0.0 batch 183.5, draw 0.9

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 2047.0, Driver.WorkerWait.idle_and_completion_poll 2047.0, Driver.Packet 1780.6, Driver.Packet.memory_wait 1020.6, Driver.Packet.dispatch 684.5, Driver.Dispatch 522.9, batch 183.5, Vulkan.Dispatch 164.9, Driver.Dispatch.capture_resources 121.3, Vulkan.Dispatch.shader_resources 115.2

Longest waits

  • Driver.WorkerWait (queue worker 0x48) 475.8 ms at 2224 ms, present 1253
  • Driver.WorkerWait (queue worker 0x51) 467.1 ms at 529 ms, present 1249
  • Driver.WorkerWait (queue worker 0x48) 466.9 ms at 442 ms, present 1249
  • Driver.WorkerWait (queue worker 0x51) 464.6 ms at 1435 ms, present 1251
  • Driver.WorkerWait (queue worker 0x48) 462.3 ms at 4006 ms, present 1257
  • Driver.WorkerWait (queue worker 0x48) 461.2 ms at 1338 ms, present 1251
  • Driver.WorkerWait (queue worker 0x48) 460.4 ms at 3119 ms, present 1255
  • Driver.WorkerWait (queue worker 0x51) 452.7 ms at 3210 ms, present 1255
  • Driver.WorkerWait (queue worker 0x51) 446.6 ms at 4100 ms, present 1257
  • Driver.WorkerWait (queue worker 0x51) 446.6 ms at 2331 ms, present 1253

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

  • batch 76988: 17.1 ms at 4231 ms, present 1257: GPU staging-in 2.3, staging-out 2.1, dispatch-trail 1.6; recorded by Driver.Packet (queue worker 0x0) 2.9, Driver.Packet.dispatch (queue worker 0x0) 2.6, Driver.Dispatch (queue worker 0x0) 2.0, Vulkan.Dispatch (queue worker 0x0) 0.2
  • batch 77289: 17.0 ms at 5127 ms, present 1259: GPU staging-in 2.3, staging-out 2.1, dispatch-trail 1.6; recorded by Driver.Dispatch (queue worker 0x30) 19.6, Driver.Dispatch.materialize (queue worker 0x30) 11.5, Driver.Dispatch.capture_resources (queue worker 0x30) 7.7, Driver.Packet (queue worker 0x30) 7.1
  • batch 75792: 15.5 ms at 667 ms, present 1249: GPU staging-in 2.3, staging-out 2.1, dispatch-trail 1.3; recorded by Driver.Packet (queue worker 0x0) 2.5, Driver.Packet.dispatch (queue worker 0x0) 2.2, Driver.Dispatch (queue worker 0x0) 1.5, Vulkan.Dispatch (queue worker 0x0) 0.2
  • batch 76090: 14.6 ms at 1567 ms, present 1251: GPU staging-in 2.2, staging-out 2.1, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.6, Driver.Packet.dispatch (queue worker 0x0) 2.4, Driver.Dispatch (queue worker 0x0) 1.7, Vulkan.Dispatch (queue worker 0x0) 0.2
  • batch 76690: 14.2 ms at 3352 ms, present 1255: GPU staging-in 2.2, staging-out 2.0, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.2, Driver.Packet.dispatch (queue worker 0x0) 1.9, Driver.Dispatch (queue worker 0x0) 1.2, Vulkan.Dispatch (queue worker 0x0) 0.1
tools/trace_digest.py: this PR

seconds 270:5 from present 1309: 13 presents, frame p50 385.4 / p90 422.4 / p99 489.1 / max 489.1 ms, GPU busy 187.4 ms per present
NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit a13e0362e720, dropped: no

{"commit":"a13e0362e720","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_DRAW":"1","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.14","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\u014dtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1309,"ms":5156.774},"presents":13,"frame_ms":{"p50":385.433,"p90":422.364,"p99":489.128,"max":489.128},"gpu_busy_ms_per_present":187.418,"worker_busy_pct":{"queue worker 0x0":96.229,"queue worker 0x52":21.161,"queue worker 0x53":19.699,"queue worker 0x20":54.16,"queue worker 0x30":82.077,"queue worker 0x38":68.058,"queue worker 0x48":2.019,"queue worker 0x51":3.748,"queue worker 0x50":74.875},"phase_totals_ms":{"Driver.Completion":0.227,"Driver.Dispatch":6302.331,"Driver.Dispatch.capture_resources":1708.396,"Driver.Dispatch.decode_key_device_setup":49.325,"Driver.Dispatch.lookup_cache":1175.748,"Driver.Dispatch.materialize":465.572,"Driver.Dispatch.prepared_invocation":16.034,"Driver.Draw":466.642,"Driver.Draw.device_setup":4.95,"Driver.Draw.draw_enqueued":62.781,"Driver.Draw.empty_indirect_skipped":0.293,"Driver.Draw.post_compile_prepare":2.217,"Driver.Draw.prepare":20.312,"Driver.Draw.shader_compile_and_link":374.294,"Driver.EndSubmission":10.697,"Driver.Packet":21751.912,"Driver.Packet.device_lock":4.037,"Driver.Packet.dispatch":8289.008,"Driver.Packet.draw":468.328,"Driver.Packet.execute":16.765,"Driver.Packet.flip_flush":0.688,"Driver.Packet.flush_between_packets":41.704,"Driver.Packet.memory_wait":12348.959,"Driver.Packet.pipeline_drain":167.43,"Driver.Packet.pipeline_prepare":6.689,"Driver.Packet.prepare_memory":391.354,"Driver.Packet.rendering_wait":0.014,"Driver.Present":110.404,"Driver.Present.acquire_image":0.153,"Driver.Present.bindless_wait":100.088,"Driver.Present.device_setup":0.008,"Driver.Present.gpu_mutex_wait":0.858,"Driver.Present.inflight_wait":0.027,"Driver.Present.present_display_buffer":2.747,"Driver.Present.queue_present":6.125,"Driver.Present.release_and_callback":0.012,"Driver.Present.render_fence_wait":0.35,"Driver.Present.resize":0.024,"Driver.Present.validate":0.003,"Driver.Suspend":0.1,"GpuMutex.wait.copy":1.321,"GpuMutex.wait.dispatch":1096.839,"GpuMutex.wait.draw":72.598,"GpuMutex.wait.end":4.502,"GpuMutex.wait.fill":13.321,"GpuMutex.wait.flush":30.776,"GpuMutex.wait.hook":1000.201,"GpuMutex.wait.indirect":31.964,"GpuMutex.wait.label":44.356,"GpuMutex.wait.other":5.466,"GpuMutex.wait.present":0.835,"Graphics.Draw":973.376,"Graphics.Draw.draw_and_resource_release":567.018,"Graphics.Draw.index_upload":206.014,"Graphics.Draw.validate":8.316,"Graphics.Draw.vertex_upload":143.644,"Graphics.DrawWithRecipe":19.345,"Graphics.DrawWithRecipe.draw_and_resource_release":18.331,"Graphics.DrawWithRecipe.index_upload":0.012,"Graphics.DrawWithRecipe.validate":0.133,"Graphics.DrawWithRecipe.vertex_upload":0.083,"Graphics.Submit":0.17,"Graphics.Submit.command_end":0.022,"Graphics.Submit.queue_submit":0.144,"Graphics.Wait":9.936,"Graphics.Wait.fence_wait":9.741,"Recorder.Reap":18.042,"Recorder.Submit":79.742,"Recorder.Sync":241.667,"Recorder.WaitSerial":89.788,"Resources.Complete":515.464,"Resources.Prepare":123.264,"Shader.DrawStage":250.059,"Shader.DrawStage.capture_resources":220.69,"Shader.DrawStage.materialize":18.136,"Shader.DrawStage.prepared_invocation":10.55,"Shader.ResolveAbi":13.252,"Shader.ResolveGraphicsAbi":6.445,"Shader.ResolveGraphicsStagesAbi":18.32,"VideoOut.Flip":112.404,"VideoOut.Flip.completion_mutex_wait":0.012,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":0.048,"VideoOut.Flip.present":111.133,"VideoOut.Flip.validate":0.015,"VideoOut.Flip.vblank_wait":0.007,"VideoOut.Flip.window_prepare":0.016,"VideoOut.Flip.window_title":1.161,"VideoOut.Readiness":0.025,"VideoOut.Readiness.locks_validate":0.011,"Vulkan.Acquire":0.14,"Vulkan.Acquire.acquire_fence_wait":0.021,"Vulkan.Acquire.acquire_image":0.086,"Vulkan.Acquire.fence_reset":0.025,"Vulkan.Acquire.retired_swapchains":0.004,"Vulkan.BindlessPresentWait":100.069,"Vulkan.BindlessPresentWait.after_present_wait":29.108,"Vulkan.BindlessPresentWait.early_prepare":5.768,"Vulkan.BindlessPresentWait.finish_up_to":2.862,"Vulkan.BindlessPresentWait.gpu_mutex_wait":1.657,"Vulkan.BindlessPresentWait.present_serial":0.621,"Vulkan.BindlessPresentWait.wait_serial":41.547,"Vulkan.Dispatch":1367.365,"Vulkan.Dispatch.command_record":713.712,"Vulkan.Dispatch.shader_resources":647.654,"Vulkan.DispatchRecipe":88.471,"Vulkan.DispatchRecipe.command_record":87.884,"Vulkan.DrawFromRecipe":19.459,"Vulkan.Present":1.755,"Vulkan.Present.command_record_scale":0.452,"Vulkan.Present.pixel_upload":0.668,"Vulkan.Present.queue_submit":0.596,"Vulkan.QueuePresent":6.088,"Vulkan.QueuePresent.queue_present":6.071,"Vulkan.Retire":0.345,"Vulkan.Retire.wait":0.194},"top_phases_ms_per_frame":{"Driver.Packet":1673.224,"Driver.Packet.memory_wait":949.92,"Driver.Packet.dispatch":637.616,"Driver.Dispatch":484.795,"Driver.Dispatch.capture_resources":131.415,"Vulkan.Dispatch":105.182,"Driver.Dispatch.lookup_cache":90.442,"GpuMutex.wait.dispatch":84.372},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":863,"Graphics.Barrier.dcc-clear":338,"Graphics.Barrier.dcc-keys":260,"Graphics.Barrier.dispatch-lead":9707,"Graphics.Barrier.dispatch-trail":17666,"Graphics.Barrier.draw":4742,"Graphics.Barrier.fill":351,"Graphics.Barrier.fill-clear":338,"Graphics.Barrier.indirect-args":398,"Graphics.Barrier.label-run":1688,"Graphics.Barrier.present-blit":26,"Graphics.Barrier.shadow-publish":518,"Graphics.Barrier.staging-in":17566,"Graphics.Barrier.staging-out":8556,"Graphics.Barrier.storage-upload":4103,"Graphics.Barrier.storage-writeback":9622,"Graphics.Barrier.template-refresh":34,"Graphics.BarrierMerged.copy":172,"Graphics.BarrierMerged.dispatch-lead":8755,"Graphics.BarrierMerged.fill":171,"Graphics.BarrierMerged.label-run":18,"Graphics.BarrierMerged.shadow-publish":266,"Graphics.BarrierMerged.staging-in":8188,"Graphics.BarrierMerged.staging-out":8556,"Graphics.BarrierMerged.storage-writeback":1069,"Graphics.Copy":34748,"Graphics.Copy.bytes":10674752112,"Graphics.RenderPass":1498,"Graphics.RenderPass.Close.command":1080,"Graphics.RenderPass.Close.image":74,"Graphics.RenderPass.Close.key":50,"Graphics.RenderPass.Close.label":18,"Graphics.RenderPass.Close.new-batch":276,"Graphics.RenderPass.Continued":1601},"trace_dropped":false,"trace":"aps5-trace-a13e0362e720-26764.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1310: 489.1 ms at 401 ms: Driver.WorkerWait (queue worker 0x48) 481.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 481.0, Driver.WorkerWait (queue worker 0x51) 478.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 478.1
  • present 1315: 422.4 ms at 2429 ms: Driver.WorkerWait (queue worker 0x48) 413.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 413.9, Driver.WorkerWait (queue worker 0x51) 405.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 405.7
  • present 1312: 406.3 ms at 1258 ms: Driver.WorkerWait (queue worker 0x48) 398.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 398.4, Driver.WorkerWait (queue worker 0x51) 382.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 382.7
  • present 1309: 401.1 ms at 0 ms: Driver.WorkerWait (queue worker 0x48) 392.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 392.4, Driver.WorkerWait (queue worker 0x51) 384.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 384.2
  • present 1318: 395.2 ms at 3619 ms: Driver.WorkerWait (queue worker 0x48) 386.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 386.8, Driver.WorkerWait (queue worker 0x51) 379.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 379.0

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

  • present 1310: 489.1 ms at 401 ms, persistence 121.7 ms
  • present 1315: 422.4 ms at 2429 ms, persistence 54.9 ms
  • present 1312: 406.3 ms at 1258 ms, persistence 23.9 ms
  • present 1318: 395.2 ms at 3619 ms, persistence 16.8 ms
  • present 1321: 385.4 ms at 4771 ms, persistence 10.9 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 5.4 (1 %) 391.3 0.4 Shader.ResolveGraphicsStagesAbi 0.0, Recorder.Submit 0.0
queue worker 0x0 220.7 (56 %) 166.0 (42 %) 10.0 56.5 Driver.Packet 372.8, Driver.Suspend 0.0
queue worker 0x52 5.8 (1 %) 369.9 (93 %) 20.9 0.8 Driver.Packet 83.6, Driver.EndSubmission 0.3
queue worker 0x53 0.9 (0 %) 374.1 (94 %) 21.8 0.2 Driver.Packet 78.0, Driver.EndSubmission 0.1
queue worker 0x20 117.4 (30 %) 266.9 (67 %) 12.4 8.3 Driver.Packet 214.2, Driver.EndSubmission 0.1
title 0.1 (0 %) 0.8 (0 %) 395.7 0.2 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 1.4 (0 %) 395.2 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 1.2 (0 %) 395.4 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
queue worker 0x30 115.3 (29 %) 277.5 (70 %) 3.9 1.8 Driver.Packet 325.3, Driver.EndSubmission 0.0
queue worker 0x38 89.7 (23 %) 298.3 (75 %) 8.7 4.0 Driver.Packet 269.3, Driver.EndSubmission 0.1
queue worker 0x48 4.7 (1 %) 364.6 (92 %) 27.4 0.7 Driver.Packet 7.9, Driver.EndSubmission 0.1
draw committer 75.7 (19 %) 11.3 (3 %) 309.7 5.6 Graphics.Draw 73.8, Vulkan.DrawFromRecipe 1.5
presenter 0.9 (0 %) 7.8 (2 %) 388.0 0.1 VideoOut.Flip 8.6
title 0.0 (0 %) 1.5 (0 %) 395.1 0.2 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.1 (0 %) 2.3 (1 %) 394.3 0.2 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 1.2 (0 %) 395.4 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.8 (0 %) 395.9 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.9 (0 %) 395.7 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.9 (0 %) 395.8 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 1.5 (0 %) 395.1 0.3 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
queue worker 0x51 9.9 (3 %) 367.3 (93 %) 19.4 0.3 Driver.Packet 14.6, Driver.EndSubmission 0.2
queue worker 0x50 18.7 (5 %) 377.7 (95 %) 0.3 1.4 Driver.Packet 296.8
gpu 186.4 (47 %) 0.0 (0 %) 210.3 0.0 batch 186.4, label-run 0.0

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 1782.0, Driver.WorkerWait.idle_and_completion_poll 1782.0, Driver.Packet 1662.4, Driver.Packet.memory_wait 949.8, Driver.Packet.dispatch 633.3, Driver.Dispatch 479.4, batch 186.4, Driver.Dispatch.capture_resources 127.9, Vulkan.Dispatch 96.5, Driver.Dispatch.lookup_cache 87.8

Longest waits

  • Driver.WorkerWait (queue worker 0x48) 484.3 ms at 418 ms, present 1310
  • Driver.WorkerWait (queue worker 0x51) 473.1 ms at 109 ms, present 1309
  • Driver.WorkerWait (queue worker 0x51) 403.6 ms at 2150 ms, present 1314
  • Driver.WorkerWait (queue worker 0x51) 398.6 ms at 4496 ms, present 1320
  • Driver.WorkerWait (queue worker 0x48) 395.3 ms at 2062 ms, present 1314
  • Driver.WorkerWait (queue worker 0x51) 393.2 ms at 593 ms, present 1310
  • Driver.WorkerWait (queue worker 0x48) 392.6 ms at 2466 ms, present 1315
  • Driver.WorkerWait (queue worker 0x48) 390.2 ms at 3635 ms, present 1318
  • Driver.WorkerWait (queue worker 0x48) 389.6 ms at 20 ms, present 1309
  • Driver.WorkerWait (queue worker 0x48) 385.3 ms at 2866 ms, present 1316

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

  • batch 87042: 17.3 ms at 4644 ms, present 1320: GPU staging-in 2.3, staging-out 2.1, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.9, Driver.Packet.dispatch (queue worker 0x0) 2.5, Driver.Dispatch (queue worker 0x0) 1.8, Vulkan.Dispatch (queue worker 0x0) 0.2
  • batch 86439: 15.4 ms at 3100 ms, present 1316: GPU staging-in 2.3, staging-out 2.2, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.4, Driver.Packet.dispatch (queue worker 0x0) 2.3, Driver.Dispatch (queue worker 0x0) 1.7, Vulkan.Dispatch (queue worker 0x0) 0.1
  • batch 85548: 14.9 ms at 747 ms, present 1310: GPU staging-out 2.3, staging-in 2.2, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 6.0, Driver.Packet.draw (queue worker 0x0) 3.9, Driver.Draw (queue worker 0x0) 3.9, Driver.Draw.shader_compile_and_link (queue worker 0x0) 3.6
  • batch 85842: 14.9 ms at 1524 ms, present 1312: GPU staging-in 2.5, staging-out 2.1, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.7, Driver.Packet.dispatch (queue worker 0x0) 2.4, Driver.Dispatch (queue worker 0x0) 1.9, Driver.Packet.draw (queue worker 0x0) 0.2
  • batch 86137: 14.8 ms at 2306 ms, present 1314: GPU staging-in 2.6, staging-out 2.2, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.9, Driver.Packet.dispatch (queue worker 0x0) 2.5, Driver.Dispatch (queue worker 0x0) 2.0, Vulkan.Dispatch (queue worker 0x0) 0.3

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: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5323562200 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20735). Originally posted by [slopezjur](https://github.com/slopezjur) on 2026-11-15T14:13:07Z. --- ### What On Windows the unwinder resolves each personality routine through `ResolveImport`, which checks with `VirtualQuery` that the import thunk and its slot are readable. That is two system calls per resolved address, three addresses per foreign frame and one per personality call, for every frame of both unwind phases. In a title that throws often inside host libraries this was most of the cost of a throw. `Readable` now remembers a page that `VirtualQuery` reported readable when the page lies inside a loaded image, keyed by the image identity `IndexFrames` already uses (base, time stamp, checksum, image size) plus the page. Later unwinds through the same image make no system call. - An address outside a loaded image is queried every time, as before. - A page that is not readable is not remembered and is queried again. - Only the verdict is remembered. The thunk and slot bytes are read on every call, so a slot that is rebound later is still followed. - Limit: a page of a loaded image that was readable once is taken as still readable. A later `VirtualProtect` to no access on such a page would not be noticed. New Windows test `unwind_import_queries`: it replaces libc's `VirtualQuery` import with a counter, throws and catches twice to warm up, then requires that 256 more throws make no query. ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Release. Tests matching `unwind|except|demangle|dynamic_cast|bad_optional|bad_any|filesystem_error|message_destructor|standard_error|terminate|rethrow|nested|typeinfo|cxa` (231, including the driver image table tests), on `main` 6cd3f92560 and on this change based on it: | | passed | failed | |---|---|---| | `main` with the new test added | 230 | 1 (`unwind_import_queries`: "repeated unwinds through one image do not query its pages again") | | this PR | 231 | 0 | The branch was then rebased onto `main` 178944e753, which does not touch the exception sources; the tests were not run again after the rebase. Not tested on Linux or macOS (the changed code is inside `#ifdef _WIN32`). #### Ghost of Yōtei PPSA26344 v02.002.000, DRS 1080p patch, Digital Deluxe "Press X" screen from a fresh save, warm shader cache, NVIDIA GeForce RTX 4080 SUPER (driver 621.14). Both rows use one build of `main` cc4e13836f merged with #20017, #20018 and #20519 (merge `a13e0362e7`, `APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1`); only `libc.prx` differs, built from the same merge with and without this commit. The digests print commit `a13e0362e720` for both rows because that stamp comes from the driver. Without profiling, four 330 s runs in the order base, change, base, change, presents between 180 s and 320 s: | libc | run 1 | run 2 | |---|---|---| | `main` | 2.33 fps | 2.30 fps | | this PR | 2.76 fps | 2.68 fps | With `APS5_PROFILE_DRAW=1` and `APS5_TRACE_SECONDS=270:5`, one run each: | libc | frame p50 | GPU busy per present | queue worker 0x30 busy per frame | |---|---|---|---| | `main` | 472.8 ms (12 presents) | 198.0 ms | 180.9 ms | | this PR | 385.4 ms (13 presents) | 187.4 ms | 115.3 ms | The throws in this scene come from the per-draw image table path (`DecodeTextureResource` on invalid table elements); this PR makes each throw cheaper and does not remove them. A first traced run with this PR ended at 66 s with an access violation in the title's own code during the load; the rerun and the two untraced runs were clean. The load crash also happens on this title without this PR, and I did not investigate this occurrence. Not measured: other titles, other GPUs. <details> <summary><code>tools/trace_digest.py</code>: <code>main</code> libc</summary> **seconds 270:5** from present 1248: 12 presents, frame p50 472.8 / p90 487.0 / p99 488.2 / max 488.2 ms, GPU busy 198.0 ms per present NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit a13e0362e720, dropped: no ```json {"commit":"a13e0362e720","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_DRAW":"1","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.14","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\u014dtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1248,"ms":5355.302},"presents":12,"frame_ms":{"p50":472.813,"p90":487.046,"p99":488.21,"max":488.21},"gpu_busy_ms_per_present":198.009,"worker_busy_pct":{"queue worker 0x0":96.611,"queue worker 0x52":17.878,"queue worker 0x53":16.566,"queue worker 0x20":45.052,"queue worker 0x30":83.918,"queue worker 0x38":57.161,"queue worker 0x48":2.124,"queue worker 0x51":3.233,"queue worker 0x50":79.18},"phase_totals_ms":{"Driver.Completion":0.211,"Driver.Dispatch":6340.163,"Driver.Dispatch.capture_resources":1500.063,"Driver.Dispatch.decode_key_device_setup":43.134,"Driver.Dispatch.lookup_cache":963.435,"Driver.Dispatch.materialize":403.476,"Driver.Dispatch.prepared_invocation":15.407,"Driver.Draw":346.969,"Driver.Draw.device_setup":4.228,"Driver.Draw.draw_enqueued":55.65,"Driver.Draw.empty_indirect_skipped":0.243,"Driver.Draw.post_compile_prepare":1.967,"Driver.Draw.prepare":19.128,"Driver.Draw.shader_compile_and_link":264.238,"Driver.EndSubmission":16.869,"Driver.Packet":21496.417,"Driver.Packet.device_lock":3.722,"Driver.Packet.dispatch":8263.882,"Driver.Packet.draw":348.59,"Driver.Packet.execute":15.999,"Driver.Packet.flip_flush":0.665,"Driver.Packet.flush_between_packets":36.415,"Driver.Packet.memory_wait":12248.167,"Driver.Packet.pipeline_drain":147.633,"Driver.Packet.pipeline_prepare":6.762,"Driver.Packet.prepare_memory":409.924,"Driver.Packet.rendering_wait":0.014,"Driver.Present":106.194,"Driver.Present.acquire_image":0.142,"Driver.Present.bindless_wait":97.429,"Driver.Present.device_setup":0.008,"Driver.Present.gpu_mutex_wait":0.606,"Driver.Present.inflight_wait":0.023,"Driver.Present.present_display_buffer":1.996,"Driver.Present.queue_present":5.677,"Driver.Present.release_and_callback":0.011,"Driver.Present.render_fence_wait":0.257,"Driver.Present.resize":0.021,"Driver.Present.validate":0.004,"Driver.Suspend":0.061,"GpuMutex.wait.copy":1.21,"GpuMutex.wait.dispatch":977.563,"GpuMutex.wait.draw":68.472,"GpuMutex.wait.end":11.317,"GpuMutex.wait.fill":14.991,"GpuMutex.wait.flush":28.218,"GpuMutex.wait.hook":816.026,"GpuMutex.wait.indirect":27.333,"GpuMutex.wait.label":56.0,"GpuMutex.wait.other":0.801,"GpuMutex.wait.present":0.585,"Graphics.Draw":894.042,"Graphics.Draw.draw_and_resource_release":565.453,"Graphics.Draw.index_upload":186.546,"Graphics.Draw.validate":7.149,"Graphics.Draw.vertex_upload":92.876,"Graphics.DrawWithRecipe":17.92,"Graphics.DrawWithRecipe.draw_and_resource_release":17.027,"Graphics.DrawWithRecipe.index_upload":0.011,"Graphics.DrawWithRecipe.validate":0.112,"Graphics.DrawWithRecipe.vertex_upload":0.108,"Graphics.Submit":0.12,"Graphics.Submit.command_end":0.01,"Graphics.Submit.queue_submit":0.107,"Graphics.Wait":8.399,"Graphics.Wait.fence_wait":8.235,"Recorder.Reap":18.575,"Recorder.Submit":68.525,"Recorder.Sync":190.434,"Recorder.WaitSerial":97.887,"Resources.Complete":1291.992,"Resources.Prepare":111.763,"Shader.DrawStage":176.182,"Shader.DrawStage.capture_resources":152.786,"Shader.DrawStage.materialize":16.634,"Shader.DrawStage.prepared_invocation":6.158,"Shader.ResolveAbi":13.336,"Shader.ResolveGraphicsAbi":6.377,"Shader.ResolveGraphicsStagesAbi":15.385,"VideoOut.Flip":108.334,"VideoOut.Flip.completion_mutex_wait":0.013,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":0.047,"VideoOut.Flip.present":106.923,"VideoOut.Flip.validate":0.013,"VideoOut.Flip.vblank_wait":0.009,"VideoOut.Flip.window_prepare":0.015,"VideoOut.Flip.window_title":1.302,"VideoOut.Readiness":0.023,"VideoOut.Readiness.locks_validate":0.01,"Vulkan.Acquire":0.131,"Vulkan.Acquire.acquire_fence_wait":0.019,"Vulkan.Acquire.acquire_image":0.082,"Vulkan.Acquire.fence_reset":0.023,"Vulkan.Acquire.retired_swapchains":0.004,"Vulkan.BindlessPresentWait":97.411,"Vulkan.BindlessPresentWait.after_present_wait":24.55,"Vulkan.BindlessPresentWait.early_prepare":1.77,"Vulkan.BindlessPresentWait.finish_up_to":0.415,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.103,"Vulkan.BindlessPresentWait.present_serial":0.632,"Vulkan.BindlessPresentWait.wait_serial":54.438,"Vulkan.Dispatch":2084.78,"Vulkan.Dispatch.command_record":640.131,"Vulkan.Dispatch.shader_resources":1439.161,"Vulkan.DispatchRecipe":47.691,"Vulkan.DispatchRecipe.command_record":47.346,"Vulkan.DrawFromRecipe":18.013,"Vulkan.Present":1.161,"Vulkan.Present.command_record_scale":0.361,"Vulkan.Present.pixel_upload":0.423,"Vulkan.Present.queue_submit":0.368,"Vulkan.QueuePresent":5.659,"Vulkan.QueuePresent.queue_present":5.644,"Vulkan.Retire":0.251,"Vulkan.Retire.wait":0.115},"top_phases_ms_per_frame":{"Driver.Packet":1791.368,"Driver.Packet.memory_wait":1020.681,"Driver.Packet.dispatch":688.657,"Driver.Dispatch":528.347,"Vulkan.Dispatch":173.732,"Driver.Dispatch.capture_resources":125.005,"Vulkan.Dispatch.shader_resources":119.93,"Resources.Complete":107.666},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":783,"Graphics.Barrier.dcc-clear":312,"Graphics.Barrier.dcc-keys":240,"Graphics.Barrier.dispatch-lead":8738,"Graphics.Barrier.dispatch-trail":15800,"Graphics.Barrier.draw":4328,"Graphics.Barrier.fill":329,"Graphics.Barrier.fill-clear":312,"Graphics.Barrier.indirect-args":365,"Graphics.Barrier.label-run":1617,"Graphics.Barrier.present-blit":24,"Graphics.Barrier.shadow-publish":483,"Graphics.Barrier.staging-in":15961,"Graphics.Barrier.staging-out":7740,"Graphics.Barrier.storage-upload":3832,"Graphics.Barrier.storage-writeback":9134,"Graphics.Barrier.template-refresh":28,"Graphics.BarrierMerged.copy":151,"Graphics.BarrierMerged.dispatch-lead":7792,"Graphics.BarrierMerged.fill":151,"Graphics.BarrierMerged.label-run":17,"Graphics.BarrierMerged.shadow-publish":243,"Graphics.BarrierMerged.staging-in":7366,"Graphics.BarrierMerged.staging-out":7740,"Graphics.BarrierMerged.storage-writeback":984,"Graphics.Copy":31149,"Graphics.Copy.bytes":9602056144,"Graphics.RenderPass":1366,"Graphics.RenderPass.Close.command":950,"Graphics.RenderPass.Close.image":71,"Graphics.RenderPass.Close.key":44,"Graphics.RenderPass.Close.label":17,"Graphics.RenderPass.Close.new-batch":284,"Graphics.RenderPass.Continued":1475},"trace_dropped":false,"trace":"aps5-trace-a13e0362e720-12668.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1253: 488.2 ms at 2191 ms: Driver.WorkerWait (queue worker 0x48) 479.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 479.8, Driver.WorkerWait (queue worker 0x51) 472.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 472.7 - present 1257: 487.0 ms at 3974 ms: Driver.WorkerWait (queue worker 0x48) 478.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 478.7, Driver.WorkerWait (queue worker 0x51) 471.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 471.1 - present 1259: 480.0 ms at 4875 ms: Driver.Packet (queue worker 0x0) 459.5, Driver.Packet (queue worker 0x30) 406.6, Driver.Packet (queue worker 0x50) 377.3, Driver.Packet.memory_wait (queue worker 0x50) 348.2 - present 1249: 479.3 ms at 422 ms: Driver.WorkerWait (queue worker 0x48) 469.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 469.9, Driver.WorkerWait (queue worker 0x51) 468.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 468.8 - present 1255: 473.4 ms at 3100 ms: Driver.WorkerWait (queue worker 0x48) 465.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 465.1, Driver.WorkerWait (queue worker 0x51) 457.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 457.8 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 1253: 488.2 ms at 2191 ms, persistence 88.9 ms - present 1257: 487.0 ms at 3974 ms, persistence 86.1 ms - present 1249: 479.3 ms at 422 ms, persistence 80.0 ms - present 1259: 480.0 ms at 4875 ms, persistence 65.6 ms - present 1251: 472.8 ms at 1319 ms, persistence 55.0 ms - present 1255: 473.4 ms at 3100 ms, persistence 53.3 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.1 (0 %) | 3.7 (1 %) | 442.5 | 0.4 | Shader.ResolveGraphicsStagesAbi 0.0, Recorder.Submit 0.0 | | queue worker 0x0 | 218.7 (49 %) | 217.6 (49 %) | 9.9 | 54.9 | Driver.Packet 422.3, Driver.Completion 0.0 | | queue worker 0x52 | 6.0 (1 %) | 408.5 (92 %) | 31.8 | 0.8 | Driver.Packet 79.3, Driver.EndSubmission 0.3 | | queue worker 0x53 | 1.0 (0 %) | 413.1 (93 %) | 32.1 | 0.2 | Driver.Packet 73.5, Driver.EndSubmission 0.4 | | queue worker 0x20 | 113.7 (25 %) | 310.4 (70 %) | 22.1 | 8.1 | Driver.Packet 200.4, Driver.EndSubmission 0.1 | | title | 0.1 (0 %) | 1.4 (0 %) | 444.8 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 1.2 (0 %) | 445.0 | 0.2 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 1.0 (0 %) | 445.2 | 0.2 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x30 | 180.9 (41 %) | 259.8 (58 %) | 5.6 | 1.8 | Driver.Packet 374.2, Driver.EndSubmission 0.0 | | queue worker 0x38 | 83.6 (19 %) | 345.2 (77 %) | 17.5 | 4.3 | Driver.Packet 254.5, Driver.EndSubmission 0.1 | | queue worker 0x48 | 4.3 (1 %) | 403.6 (90 %) | 38.4 | 0.7 | Driver.Packet 9.3, Driver.EndSubmission 0.1 | | draw committer | 75.5 (17 %) | 11.9 (3 %) | 358.9 | 5.2 | Graphics.Draw 73.4, Vulkan.DrawFromRecipe 1.5 | | presenter | 0.8 (0 %) | 8.2 (2 %) | 437.2 | 0.1 | VideoOut.Flip 9.0 | | title | 0.1 (0 %) | 0.9 (0 %) | 445.3 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 1.0 (0 %) | 445.2 | 0.2 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.9 (0 %) | 445.3 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.9 (0 %) | 445.3 | 0.2 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.1 (0 %) | 1.1 (0 %) | 445.1 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.0 (0 %) | 1.1 (0 %) | 445.1 | 0.2 | Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 1.1 (0 %) | 445.1 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | queue worker 0x51 | 8.4 (2 %) | 408.1 (91 %) | 29.8 | 0.3 | Driver.Packet 14.0, Driver.EndSubmission 0.4 | | queue worker 0x50 | 22.1 (5 %) | 424.0 (95 %) | 0.2 | 1.3 | Driver.Packet 353.1 | | gpu | 184.5 (41 %) | 0.0 (0 %) | 261.7 | 0.0 | batch 183.5, draw 0.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 2047.0, Driver.WorkerWait.idle_and_completion_poll 2047.0, Driver.Packet 1780.6, Driver.Packet.memory_wait 1020.6, Driver.Packet.dispatch 684.5, Driver.Dispatch 522.9, batch 183.5, Vulkan.Dispatch 164.9, Driver.Dispatch.capture_resources 121.3, Vulkan.Dispatch.shader_resources 115.2 **Longest waits** - Driver.WorkerWait (queue worker 0x48) 475.8 ms at 2224 ms, present 1253 - Driver.WorkerWait (queue worker 0x51) 467.1 ms at 529 ms, present 1249 - Driver.WorkerWait (queue worker 0x48) 466.9 ms at 442 ms, present 1249 - Driver.WorkerWait (queue worker 0x51) 464.6 ms at 1435 ms, present 1251 - Driver.WorkerWait (queue worker 0x48) 462.3 ms at 4006 ms, present 1257 - Driver.WorkerWait (queue worker 0x48) 461.2 ms at 1338 ms, present 1251 - Driver.WorkerWait (queue worker 0x48) 460.4 ms at 3119 ms, present 1255 - Driver.WorkerWait (queue worker 0x51) 452.7 ms at 3210 ms, present 1255 - Driver.WorkerWait (queue worker 0x51) 446.6 ms at 4100 ms, present 1257 - Driver.WorkerWait (queue worker 0x51) 446.6 ms at 2331 ms, present 1253 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 76988: 17.1 ms at 4231 ms, present 1257: GPU staging-in 2.3, staging-out 2.1, dispatch-trail 1.6; recorded by Driver.Packet (queue worker 0x0) 2.9, Driver.Packet.dispatch (queue worker 0x0) 2.6, Driver.Dispatch (queue worker 0x0) 2.0, Vulkan.Dispatch (queue worker 0x0) 0.2 - batch 77289: 17.0 ms at 5127 ms, present 1259: GPU staging-in 2.3, staging-out 2.1, dispatch-trail 1.6; recorded by Driver.Dispatch (queue worker 0x30) 19.6, Driver.Dispatch.materialize (queue worker 0x30) 11.5, Driver.Dispatch.capture_resources (queue worker 0x30) 7.7, Driver.Packet (queue worker 0x30) 7.1 - batch 75792: 15.5 ms at 667 ms, present 1249: GPU staging-in 2.3, staging-out 2.1, dispatch-trail 1.3; recorded by Driver.Packet (queue worker 0x0) 2.5, Driver.Packet.dispatch (queue worker 0x0) 2.2, Driver.Dispatch (queue worker 0x0) 1.5, Vulkan.Dispatch (queue worker 0x0) 0.2 - batch 76090: 14.6 ms at 1567 ms, present 1251: GPU staging-in 2.2, staging-out 2.1, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.6, Driver.Packet.dispatch (queue worker 0x0) 2.4, Driver.Dispatch (queue worker 0x0) 1.7, Vulkan.Dispatch (queue worker 0x0) 0.2 - batch 76690: 14.2 ms at 3352 ms, present 1255: GPU staging-in 2.2, staging-out 2.0, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.2, Driver.Packet.dispatch (queue worker 0x0) 1.9, Driver.Dispatch (queue worker 0x0) 1.2, Vulkan.Dispatch (queue worker 0x0) 0.1 </details> <details> <summary><code>tools/trace_digest.py</code>: this PR</summary> **seconds 270:5** from present 1309: 13 presents, frame p50 385.4 / p90 422.4 / p99 489.1 / max 489.1 ms, GPU busy 187.4 ms per present NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit a13e0362e720, dropped: no ```json {"commit":"a13e0362e720","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_DRAW":"1","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.14","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\u014dtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1309,"ms":5156.774},"presents":13,"frame_ms":{"p50":385.433,"p90":422.364,"p99":489.128,"max":489.128},"gpu_busy_ms_per_present":187.418,"worker_busy_pct":{"queue worker 0x0":96.229,"queue worker 0x52":21.161,"queue worker 0x53":19.699,"queue worker 0x20":54.16,"queue worker 0x30":82.077,"queue worker 0x38":68.058,"queue worker 0x48":2.019,"queue worker 0x51":3.748,"queue worker 0x50":74.875},"phase_totals_ms":{"Driver.Completion":0.227,"Driver.Dispatch":6302.331,"Driver.Dispatch.capture_resources":1708.396,"Driver.Dispatch.decode_key_device_setup":49.325,"Driver.Dispatch.lookup_cache":1175.748,"Driver.Dispatch.materialize":465.572,"Driver.Dispatch.prepared_invocation":16.034,"Driver.Draw":466.642,"Driver.Draw.device_setup":4.95,"Driver.Draw.draw_enqueued":62.781,"Driver.Draw.empty_indirect_skipped":0.293,"Driver.Draw.post_compile_prepare":2.217,"Driver.Draw.prepare":20.312,"Driver.Draw.shader_compile_and_link":374.294,"Driver.EndSubmission":10.697,"Driver.Packet":21751.912,"Driver.Packet.device_lock":4.037,"Driver.Packet.dispatch":8289.008,"Driver.Packet.draw":468.328,"Driver.Packet.execute":16.765,"Driver.Packet.flip_flush":0.688,"Driver.Packet.flush_between_packets":41.704,"Driver.Packet.memory_wait":12348.959,"Driver.Packet.pipeline_drain":167.43,"Driver.Packet.pipeline_prepare":6.689,"Driver.Packet.prepare_memory":391.354,"Driver.Packet.rendering_wait":0.014,"Driver.Present":110.404,"Driver.Present.acquire_image":0.153,"Driver.Present.bindless_wait":100.088,"Driver.Present.device_setup":0.008,"Driver.Present.gpu_mutex_wait":0.858,"Driver.Present.inflight_wait":0.027,"Driver.Present.present_display_buffer":2.747,"Driver.Present.queue_present":6.125,"Driver.Present.release_and_callback":0.012,"Driver.Present.render_fence_wait":0.35,"Driver.Present.resize":0.024,"Driver.Present.validate":0.003,"Driver.Suspend":0.1,"GpuMutex.wait.copy":1.321,"GpuMutex.wait.dispatch":1096.839,"GpuMutex.wait.draw":72.598,"GpuMutex.wait.end":4.502,"GpuMutex.wait.fill":13.321,"GpuMutex.wait.flush":30.776,"GpuMutex.wait.hook":1000.201,"GpuMutex.wait.indirect":31.964,"GpuMutex.wait.label":44.356,"GpuMutex.wait.other":5.466,"GpuMutex.wait.present":0.835,"Graphics.Draw":973.376,"Graphics.Draw.draw_and_resource_release":567.018,"Graphics.Draw.index_upload":206.014,"Graphics.Draw.validate":8.316,"Graphics.Draw.vertex_upload":143.644,"Graphics.DrawWithRecipe":19.345,"Graphics.DrawWithRecipe.draw_and_resource_release":18.331,"Graphics.DrawWithRecipe.index_upload":0.012,"Graphics.DrawWithRecipe.validate":0.133,"Graphics.DrawWithRecipe.vertex_upload":0.083,"Graphics.Submit":0.17,"Graphics.Submit.command_end":0.022,"Graphics.Submit.queue_submit":0.144,"Graphics.Wait":9.936,"Graphics.Wait.fence_wait":9.741,"Recorder.Reap":18.042,"Recorder.Submit":79.742,"Recorder.Sync":241.667,"Recorder.WaitSerial":89.788,"Resources.Complete":515.464,"Resources.Prepare":123.264,"Shader.DrawStage":250.059,"Shader.DrawStage.capture_resources":220.69,"Shader.DrawStage.materialize":18.136,"Shader.DrawStage.prepared_invocation":10.55,"Shader.ResolveAbi":13.252,"Shader.ResolveGraphicsAbi":6.445,"Shader.ResolveGraphicsStagesAbi":18.32,"VideoOut.Flip":112.404,"VideoOut.Flip.completion_mutex_wait":0.012,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":0.048,"VideoOut.Flip.present":111.133,"VideoOut.Flip.validate":0.015,"VideoOut.Flip.vblank_wait":0.007,"VideoOut.Flip.window_prepare":0.016,"VideoOut.Flip.window_title":1.161,"VideoOut.Readiness":0.025,"VideoOut.Readiness.locks_validate":0.011,"Vulkan.Acquire":0.14,"Vulkan.Acquire.acquire_fence_wait":0.021,"Vulkan.Acquire.acquire_image":0.086,"Vulkan.Acquire.fence_reset":0.025,"Vulkan.Acquire.retired_swapchains":0.004,"Vulkan.BindlessPresentWait":100.069,"Vulkan.BindlessPresentWait.after_present_wait":29.108,"Vulkan.BindlessPresentWait.early_prepare":5.768,"Vulkan.BindlessPresentWait.finish_up_to":2.862,"Vulkan.BindlessPresentWait.gpu_mutex_wait":1.657,"Vulkan.BindlessPresentWait.present_serial":0.621,"Vulkan.BindlessPresentWait.wait_serial":41.547,"Vulkan.Dispatch":1367.365,"Vulkan.Dispatch.command_record":713.712,"Vulkan.Dispatch.shader_resources":647.654,"Vulkan.DispatchRecipe":88.471,"Vulkan.DispatchRecipe.command_record":87.884,"Vulkan.DrawFromRecipe":19.459,"Vulkan.Present":1.755,"Vulkan.Present.command_record_scale":0.452,"Vulkan.Present.pixel_upload":0.668,"Vulkan.Present.queue_submit":0.596,"Vulkan.QueuePresent":6.088,"Vulkan.QueuePresent.queue_present":6.071,"Vulkan.Retire":0.345,"Vulkan.Retire.wait":0.194},"top_phases_ms_per_frame":{"Driver.Packet":1673.224,"Driver.Packet.memory_wait":949.92,"Driver.Packet.dispatch":637.616,"Driver.Dispatch":484.795,"Driver.Dispatch.capture_resources":131.415,"Vulkan.Dispatch":105.182,"Driver.Dispatch.lookup_cache":90.442,"GpuMutex.wait.dispatch":84.372},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":863,"Graphics.Barrier.dcc-clear":338,"Graphics.Barrier.dcc-keys":260,"Graphics.Barrier.dispatch-lead":9707,"Graphics.Barrier.dispatch-trail":17666,"Graphics.Barrier.draw":4742,"Graphics.Barrier.fill":351,"Graphics.Barrier.fill-clear":338,"Graphics.Barrier.indirect-args":398,"Graphics.Barrier.label-run":1688,"Graphics.Barrier.present-blit":26,"Graphics.Barrier.shadow-publish":518,"Graphics.Barrier.staging-in":17566,"Graphics.Barrier.staging-out":8556,"Graphics.Barrier.storage-upload":4103,"Graphics.Barrier.storage-writeback":9622,"Graphics.Barrier.template-refresh":34,"Graphics.BarrierMerged.copy":172,"Graphics.BarrierMerged.dispatch-lead":8755,"Graphics.BarrierMerged.fill":171,"Graphics.BarrierMerged.label-run":18,"Graphics.BarrierMerged.shadow-publish":266,"Graphics.BarrierMerged.staging-in":8188,"Graphics.BarrierMerged.staging-out":8556,"Graphics.BarrierMerged.storage-writeback":1069,"Graphics.Copy":34748,"Graphics.Copy.bytes":10674752112,"Graphics.RenderPass":1498,"Graphics.RenderPass.Close.command":1080,"Graphics.RenderPass.Close.image":74,"Graphics.RenderPass.Close.key":50,"Graphics.RenderPass.Close.label":18,"Graphics.RenderPass.Close.new-batch":276,"Graphics.RenderPass.Continued":1601},"trace_dropped":false,"trace":"aps5-trace-a13e0362e720-26764.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1310: 489.1 ms at 401 ms: Driver.WorkerWait (queue worker 0x48) 481.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 481.0, Driver.WorkerWait (queue worker 0x51) 478.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 478.1 - present 1315: 422.4 ms at 2429 ms: Driver.WorkerWait (queue worker 0x48) 413.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 413.9, Driver.WorkerWait (queue worker 0x51) 405.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 405.7 - present 1312: 406.3 ms at 1258 ms: Driver.WorkerWait (queue worker 0x48) 398.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 398.4, Driver.WorkerWait (queue worker 0x51) 382.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 382.7 - present 1309: 401.1 ms at 0 ms: Driver.WorkerWait (queue worker 0x48) 392.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 392.4, Driver.WorkerWait (queue worker 0x51) 384.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 384.2 - present 1318: 395.2 ms at 3619 ms: Driver.WorkerWait (queue worker 0x48) 386.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 386.8, Driver.WorkerWait (queue worker 0x51) 379.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x51) 379.0 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 1310: 489.1 ms at 401 ms, persistence 121.7 ms - present 1315: 422.4 ms at 2429 ms, persistence 54.9 ms - present 1312: 406.3 ms at 1258 ms, persistence 23.9 ms - present 1318: 395.2 ms at 3619 ms, persistence 16.8 ms - present 1321: 385.4 ms at 4771 ms, persistence 10.9 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.1 (0 %) | 5.4 (1 %) | 391.3 | 0.4 | Shader.ResolveGraphicsStagesAbi 0.0, Recorder.Submit 0.0 | | queue worker 0x0 | 220.7 (56 %) | 166.0 (42 %) | 10.0 | 56.5 | Driver.Packet 372.8, Driver.Suspend 0.0 | | queue worker 0x52 | 5.8 (1 %) | 369.9 (93 %) | 20.9 | 0.8 | Driver.Packet 83.6, Driver.EndSubmission 0.3 | | queue worker 0x53 | 0.9 (0 %) | 374.1 (94 %) | 21.8 | 0.2 | Driver.Packet 78.0, Driver.EndSubmission 0.1 | | queue worker 0x20 | 117.4 (30 %) | 266.9 (67 %) | 12.4 | 8.3 | Driver.Packet 214.2, Driver.EndSubmission 0.1 | | title | 0.1 (0 %) | 0.8 (0 %) | 395.7 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 1.4 (0 %) | 395.2 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.0 (0 %) | 1.2 (0 %) | 395.4 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | queue worker 0x30 | 115.3 (29 %) | 277.5 (70 %) | 3.9 | 1.8 | Driver.Packet 325.3, Driver.EndSubmission 0.0 | | queue worker 0x38 | 89.7 (23 %) | 298.3 (75 %) | 8.7 | 4.0 | Driver.Packet 269.3, Driver.EndSubmission 0.1 | | queue worker 0x48 | 4.7 (1 %) | 364.6 (92 %) | 27.4 | 0.7 | Driver.Packet 7.9, Driver.EndSubmission 0.1 | | draw committer | 75.7 (19 %) | 11.3 (3 %) | 309.7 | 5.6 | Graphics.Draw 73.8, Vulkan.DrawFromRecipe 1.5 | | presenter | 0.9 (0 %) | 7.8 (2 %) | 388.0 | 0.1 | VideoOut.Flip 8.6 | | title | 0.0 (0 %) | 1.5 (0 %) | 395.1 | 0.2 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.1 (0 %) | 2.3 (1 %) | 394.3 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveGraphicsAbi 0.0 | | title | 0.0 (0 %) | 1.2 (0 %) | 395.4 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.0 (0 %) | 0.8 (0 %) | 395.9 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.0 (0 %) | 0.9 (0 %) | 395.7 | 0.2 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.0 (0 %) | 0.9 (0 %) | 395.8 | 0.1 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 1.5 (0 %) | 395.1 | 0.3 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | queue worker 0x51 | 9.9 (3 %) | 367.3 (93 %) | 19.4 | 0.3 | Driver.Packet 14.6, Driver.EndSubmission 0.2 | | queue worker 0x50 | 18.7 (5 %) | 377.7 (95 %) | 0.3 | 1.4 | Driver.Packet 296.8 | | gpu | 186.4 (47 %) | 0.0 (0 %) | 210.3 | 0.0 | batch 186.4, label-run 0.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 1782.0, Driver.WorkerWait.idle_and_completion_poll 1782.0, Driver.Packet 1662.4, Driver.Packet.memory_wait 949.8, Driver.Packet.dispatch 633.3, Driver.Dispatch 479.4, batch 186.4, Driver.Dispatch.capture_resources 127.9, Vulkan.Dispatch 96.5, Driver.Dispatch.lookup_cache 87.8 **Longest waits** - Driver.WorkerWait (queue worker 0x48) 484.3 ms at 418 ms, present 1310 - Driver.WorkerWait (queue worker 0x51) 473.1 ms at 109 ms, present 1309 - Driver.WorkerWait (queue worker 0x51) 403.6 ms at 2150 ms, present 1314 - Driver.WorkerWait (queue worker 0x51) 398.6 ms at 4496 ms, present 1320 - Driver.WorkerWait (queue worker 0x48) 395.3 ms at 2062 ms, present 1314 - Driver.WorkerWait (queue worker 0x51) 393.2 ms at 593 ms, present 1310 - Driver.WorkerWait (queue worker 0x48) 392.6 ms at 2466 ms, present 1315 - Driver.WorkerWait (queue worker 0x48) 390.2 ms at 3635 ms, present 1318 - Driver.WorkerWait (queue worker 0x48) 389.6 ms at 20 ms, present 1309 - Driver.WorkerWait (queue worker 0x48) 385.3 ms at 2866 ms, present 1316 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 87042: 17.3 ms at 4644 ms, present 1320: GPU staging-in 2.3, staging-out 2.1, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.9, Driver.Packet.dispatch (queue worker 0x0) 2.5, Driver.Dispatch (queue worker 0x0) 1.8, Vulkan.Dispatch (queue worker 0x0) 0.2 - batch 86439: 15.4 ms at 3100 ms, present 1316: GPU staging-in 2.3, staging-out 2.2, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.4, Driver.Packet.dispatch (queue worker 0x0) 2.3, Driver.Dispatch (queue worker 0x0) 1.7, Vulkan.Dispatch (queue worker 0x0) 0.1 - batch 85548: 14.9 ms at 747 ms, present 1310: GPU staging-out 2.3, staging-in 2.2, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 6.0, Driver.Packet.draw (queue worker 0x0) 3.9, Driver.Draw (queue worker 0x0) 3.9, Driver.Draw.shader_compile_and_link (queue worker 0x0) 3.6 - batch 85842: 14.9 ms at 1524 ms, present 1312: GPU staging-in 2.5, staging-out 2.1, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.7, Driver.Packet.dispatch (queue worker 0x0) 2.4, Driver.Dispatch (queue worker 0x0) 1.9, Driver.Packet.draw (queue worker 0x0) 0.2 - batch 86137: 14.8 ms at 2306 ms, present 1314: GPU staging-in 2.6, staging-out 2.2, draw 0.8; recorded by Driver.Packet (queue worker 0x0) 2.9, Driver.Packet.dispatch (queue worker 0x0) 2.5, Driver.Dispatch (queue worker 0x0) 2.0, Vulkan.Dispatch (queue worker 0x0) 0.3 </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: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-15 14:16:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T14:16:37Z.

Review: COMMENTED


Reviewed — no blocking findings

The changed implementation and test sources were read, but checks were not run in this review.

What I ran

Head: 40b179dd6cab62299e013db1d59f19f860749710. No commands or tests were run. Read the prepared description, commits, manifest, diff, and all three changed files; no changed files were excluded.

Results

Check Result Note
Source review passed All changed files read
Tests not run Windows test results are author-reported
Performance evidence not verified Captures are author-reported

Findings

Blocking

None found in the code read.

Non-blocking

None.

Not verified

I did not run the Windows test suite or reproduce the reported performance captures. Linux and macOS behavior was not tested; the changed code is guarded by _WIN32. The description reports tests on Windows 11 with WinLibs GCC 15.2.0 r7 and performance captures on Windows with an RTX 4080 SUPER; those results were not run or independently confirmed here.

To get this to a good state

Nothing is required. Optional: run the Windows unwind_import_queries test on this head and attach the result.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5911194114 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20735#pullrequestreview-5911194114). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T14:16:37Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The changed implementation and test sources were read, but checks were not run in this review. ## What I ran Head: `40b179dd6cab62299e013db1d59f19f860749710`. No commands or tests were run. Read the prepared description, commits, manifest, diff, and all three changed files; no changed files were excluded. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | All changed files read | | Tests | not run | Windows test results are author-reported | | Performance evidence | not verified | Captures are author-reported | ## Findings ### Blocking None found in the code read. ### Non-blocking None. ## Not verified I did not run the Windows test suite or reproduce the reported performance captures. Linux and macOS behavior was not tested; the changed code is guarded by `_WIN32`. The description reports tests on Windows 11 with WinLibs GCC 15.2.0 r7 and performance captures on Windows with an RTX 4080 SUPER; those results were not run or independently confirmed here. ## To get this to a good state Nothing is required. Optional: run the Windows `unwind_import_queries` test on this head and attach the result.
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!20735
No description provided.