perf: Squirrel with a Gun (PPSA22102) spawn runs at ~1 FPS while streaming #7947

Open
opened 2026-10-19 15:42:23 +00:00 by Rajkamalcode · 4 comments
Rajkamalcode commented 2026-10-19 15:42:23 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-19T15:42:23Z.


Title and scene: PPSA22102 (Squirrel with a Gun, 01.000.000), in-game at the save-game spawn (tutorial area), 3840x2160 fullscreen, title default settings (sg.ResolutionQuality=100). The window covers frames after entering the world while the scene is still streaming in.

What is slow: The spawn streams content for several minutes after the save loads; during that time frames take about one second (p50 912 ms in the 30 s capture, p50 1007 ms in the 60 s companion). The same spot runs about 7-8x faster once streaming has finished (observed in earlier sessions on this machine, ~129 ms / 7.7 FPS, not part of these traces). To reproduce: load the tutorial save and watch the first minutes in the world.

Build: cbdf973fd568 (dirty) - the local fix-branch tree (carries the AGC storage write-back fix now in #7912 and the libc fixes of #7905/#7906; not a clean main build).

Summary lines (aps5-summary.jsonl, as written):

{"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"420:30"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 420:30","first_present":1478,"ms":30352.574},"presents":33,"frame_ms":{"p50":912.259,"p90":957.413,"p99":1011.518,"max":1011.518},"gpu_busy_ms_per_present":466.738,"worker_busy_pct":{"queue worker 0x0":99.417,"queue worker 0x20":73.199},"top_phases_ms_per_frame":{"Driver.Packet":1568.918,"Driver.Packet.dispatch":657.776,"Driver.Dispatch":626.474,"Resources.Complete":482.625,"Vulkan.Dispatch":444.434,"Vulkan.Dispatch.shader_resources":434.223,"Driver.Packet.draw":295.828,"Driver.Draw":295.118},"trace_dropped":false,"trace":"aps5-trace-cbdf973fd568-8088.json.gz"}
{"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"400:60"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 400:60","first_present":1408,"ms":60750.495},"presents":61,"frame_ms":{"p50":1007.266,"p90":1060.045,"p99":1122.899,"max":1122.899},"gpu_busy_ms_per_present":500.482,"worker_busy_pct":{"queue worker 0x0":99.442,"queue worker 0x20":73.132},"top_phases_ms_per_frame":{"Driver.Packet":1702.738,"Driver.Packet.dispatch":667.573,"Driver.Dispatch":637.094,"Resources.Complete":541.802,"Vulkan.Dispatch":476.701,"Vulkan.Dispatch.shader_resources":466.601,"Driver.Packet.memory_wait":330.269,"Graphics.Draw":281.439},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":36.995,"events_lost":168532,"totals_full":false}},"trace":"aps5-trace-cbdf973fd568-20912.json.gz"}

Traces

  • aps5-trace-cbdf973fd568-8088.json.gz - primary capture, 30 s window, no dropped events.
  • aps5-trace-cbdf973fd568-20912.json.gz - companion capture, 60 s window; trace_dropped on queue worker 0x0 after 37 s (its totals are complete; a prefix of its event slices was dropped before the buffer filled).

Digest - python tools/trace_digest.py <trace> - primary capture (30 s):

seconds 420:30 from present 1478: 33 presents, frame p50 912.3 / p90 957.4 / p99 1011.5 / max 1011.5 ms, GPU busy 466.7 ms per present
NVIDIA GeForce RTX 3070, NVIDIA 610.88, Windows 10.0.22635, 3840x2160, commit cbdf973fd568 (dirty), dropped: no

{"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"420:30"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 420:30","first_present":1478,"ms":30352.574},"presents":33,"frame_ms":{"p50":912.259,"p90":957.413,"p99":1011.518,"max":1011.518},"gpu_busy_ms_per_present":466.738,"worker_busy_pct":{"queue worker 0x0":99.417,"queue worker 0x20":73.199},"top_phases_ms_per_frame":{"Driver.Packet":1568.918,"Driver.Packet.dispatch":657.776,"Driver.Dispatch":626.474,"Resources.Complete":482.625,"Vulkan.Dispatch":444.434,"Vulkan.Dispatch.shader_resources":434.223,"Driver.Packet.draw":295.828,"Driver.Draw":295.118},"trace_dropped":false,"trace":"aps5-trace-cbdf973fd568-8088.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1501: 1011.5 ms at 21105 ms: Driver.Packet (queue worker 0x0) 986.4, Driver.Packet (queue worker 0x20) 681.0, batch (gpu) 478.7, Driver.Packet.dispatch (queue worker 0x20) 416.6
  • present 1484: 978.9 ms at 5542 ms: Driver.Packet (queue worker 0x0) 953.6, Driver.Packet (queue worker 0x20) 685.3, batch (gpu) 482.5, Driver.Packet.dispatch (queue worker 0x20) 464.9
  • present 1489: 976.9 ms at 10127 ms: Driver.Packet (queue worker 0x0) 953.2, Driver.Packet (queue worker 0x20) 705.9, Driver.Packet.dispatch (queue worker 0x20) 498.1, Driver.Dispatch (queue worker 0x20) 479.3
  • present 1481: 957.4 ms at 2759 ms: Driver.Packet (queue worker 0x0) 932.0, Driver.Packet (queue worker 0x20) 686.9, batch (gpu) 482.6, Driver.Packet.dispatch (queue worker 0x20) 465.7
  • present 1503: 948.7 ms at 23029 ms: Driver.Packet (queue worker 0x0) 925.4, Driver.Packet (queue worker 0x20) 676.5, batch (gpu) 471.5, Driver.Packet.dispatch (queue worker 0x20) 426.7

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 726.4 (79 %) 170.8 (19 %) 22.6 92.9 Driver.Packet 893.8, Driver.EndSubmission 3.4
draw committer 237.5 (26 %) 140.0 (15 %) 542.3 13.9 Graphics.Draw 191.4, Recorder.Submit 44.6
title 0.0 (0 %) 0.0 (0 %) 919.7 0.0 Shader.ResolveGraphicsStagesAbi 0.0
presenter 0.9 (0 %) 0.8 (0 %) 918.1 0.1 VideoOut.Flip 1.7, Driver.Present 0.0
queue worker 0x20 370.4 (40 %) 545.8 (59 %) 3.5 12.9 Driver.Packet 655.2, Driver.EndSubmission 15.1
gpu 466.1 (51 %) 0.0 (0 %) 453.7 0.0 batch 466.1

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 1549.0, Driver.Packet.dispatch 657.1, Driver.Dispatch 625.4, Resources.Complete 480.5, batch 466.1, Vulkan.Dispatch 443.3, Vulkan.Dispatch.shader_resources 432.1, Driver.Packet.draw 293.5, Driver.Draw 292.8, Driver.WorkerWait 245.8

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 307.7 ms at 21804 ms, present 1501
  • Driver.WorkerWait (queue worker 0x20) 271.5 ms at 6244 ms, present 1484
  • Driver.WorkerWait (queue worker 0x20) 255.4 ms at 8985 ms, present 1487
  • Driver.WorkerWait (queue worker 0x20) 255.1 ms at 29202 ms, present 1509
  • Driver.WorkerWait (queue worker 0x20) 255.0 ms at 22769 ms, present 1502
  • Driver.WorkerWait (queue worker 0x20) 254.0 ms at 17217 ms, present 1496
  • Driver.WorkerWait (queue worker 0x20) 253.9 ms at 12676 ms, present 1491
  • Driver.WorkerWait (queue worker 0x20) 253.5 ms at 663 ms, present 1478
  • Driver.WorkerWait (queue worker 0x20) 252.7 ms at 7171 ms, present 1485
  • Driver.WorkerWait (queue worker 0x20) 251.5 ms at 3461 ms, present 1481

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

  • batch 4674: 71.9 ms at 19779 ms, present 1499: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 6.0, Driver.Packet.dispatch (queue worker 0x20) 6.0, Driver.Dispatch (queue worker 0x20) 5.6, Vulkan.Dispatch (queue worker 0x20) 4.3
  • batch 767: 71.1 ms at 3264 ms, present 1481: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 94.5, Driver.Packet.dispatch (queue worker 0x20) 93.6, Driver.Dispatch (queue worker 0x20) 93.5, Driver.Dispatch.capture_resources (queue worker 0x20) 79.6
  • batch 3807: 70.2 ms at 16145 ms, present 1495: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 43.4, Graphics.Draw (draw committer) 2.5, Graphics.Draw.validate (draw committer) 1.2, Graphics.Draw.draw_and_resource_release (draw committer) 1.0
  • batch 3380: 69.4 ms at 14351 ms, present 1493: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 19.0, Driver.Packet.draw (queue worker 0x0) 18.3, Driver.Draw (queue worker 0x0) 18.3, Driver.Draw.gpu_mutex_wait (queue worker 0x0) 14.7
  • batch 6665: 68.6 ms at 28135 ms, present 1508: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 16.5, Driver.Packet.draw (queue worker 0x0) 16.3, Driver.Draw (queue worker 0x0) 16.3, Driver.Draw.gpu_mutex_wait (queue worker 0x0) 14.8

Companion capture (60 s):

seconds 400:60 from present 1408: 61 presents, frame p50 1007.3 / p90 1060.0 / p99 1122.9 / max 1122.9 ms, GPU busy 500.5 ms per present
NVIDIA GeForce RTX 3070, NVIDIA 610.88, Windows 10.0.22635, 3840x2160, commit cbdf973fd568 (dirty), dropped: yes

{"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"400:60"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 400:60","first_present":1408,"ms":60750.495},"presents":61,"frame_ms":{"p50":1007.266,"p90":1060.045,"p99":1122.899,"max":1122.899},"gpu_busy_ms_per_present":500.482,"worker_busy_pct":{"queue worker 0x0":99.442,"queue worker 0x20":73.132},"top_phases_ms_per_frame":{"Driver.Packet":1702.738,"Driver.Packet.dispatch":667.573,"Driver.Dispatch":637.094,"Resources.Complete":541.802,"Vulkan.Dispatch":476.701,"Vulkan.Dispatch.shader_resources":466.601,"Driver.Packet.memory_wait":330.269,"Graphics.Draw":281.439},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":36.995,"events_lost":168532,"totals_full":false}},"trace":"aps5-trace-cbdf973fd568-20912.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1427: 1122.9 ms at 18905 ms: Driver.Packet (queue worker 0x0) 1091.6, Driver.Packet (queue worker 0x20) 834.7, batch (gpu) 540.5, Driver.Packet.dispatch (queue worker 0x20) 457.1
  • present 1445: 1082.0 ms at 36744 ms: Driver.Packet (queue worker 0x20) 786.4, batch (gpu) 537.5, Driver.Packet.dispatch (queue worker 0x20) 413.0, Driver.Dispatch (queue worker 0x20) 388.8
  • present 1415: 1073.4 ms at 6781 ms: Driver.Packet (queue worker 0x0) 1032.3, Driver.Packet (queue worker 0x20) 798.1, batch (gpu) 520.1, Driver.Packet.dispatch (queue worker 0x20) 394.7
  • present 1423: 1064.7 ms at 14841 ms: Driver.Packet (queue worker 0x0) 1041.4, Driver.Packet (queue worker 0x20) 776.5, batch (gpu) 544.1, Driver.Packet.dispatch (queue worker 0x20) 411.3
  • present 1439: 1064.2 ms at 30799 ms: Driver.Packet (queue worker 0x0) 1038.0, Driver.Packet (queue worker 0x20) 794.6, batch (gpu) 536.7, Driver.Packet.dispatch (queue worker 0x20) 442.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 511.3 (51 %) 81.4 (8 %) 403.3 58.5 Driver.Packet 589.6, Driver.EndSubmission 3.1
draw committer 267.0 (27 %) 165.5 (17 %) 563.4 14.4 Graphics.Draw 229.5, Recorder.Submit 36.5
title 0.1 (0 %) 0.0 (0 %) 995.9 0.0 Shader.ResolveGraphicsStagesAbi 0.1
presenter 0.7 (0 %) 0.6 (0 %) 994.5 0.1 VideoOut.Flip 1.4, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 995.9 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x20 335.9 (34 %) 656.6 (66 %) 3.4 13.2 Driver.Packet 713.9, Driver.EndSubmission 11.5
gpu 499.7 (50 %) 0.0 (0 %) 496.2 0.0 batch 499.7

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 1303.5, Driver.Packet.dispatch 563.0, Driver.Dispatch 535.1, batch 499.7, Resources.Complete 463.5, Vulkan.Dispatch 397.4, Vulkan.Dispatch.shader_resources 388.6, Driver.Packet.memory_wait 309.6, Driver.WorkerWait 267.0, Driver.WorkerWait.dequeue_order 266.9

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 330.3 ms at 60416 ms, present 1468
  • Driver.WorkerWait (queue worker 0x20) 300.2 ms at 55499 ms, present 1463
  • Driver.WorkerWait (queue worker 0x20) 299.9 ms at 13526 ms, present 1421
  • Driver.WorkerWait (queue worker 0x20) 292.0 ms at 38573 ms, present 1446
  • Driver.WorkerWait (queue worker 0x20) 287.6 ms at 57498 ms, present 1465
  • Driver.WorkerWait (queue worker 0x20) 285.1 ms at 18615 ms, present 1426
  • Driver.WorkerWait (queue worker 0x20) 284.0 ms at 48521 ms, present 1456
  • Driver.WorkerWait (queue worker 0x20) 284.0 ms at 14550 ms, present 1422
  • Driver.WorkerWait (queue worker 0x20) 282.0 ms at 46548 ms, present 1454
  • Driver.WorkerWait (queue worker 0x20) 280.7 ms at 20696 ms, present 1428

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

  • batch 6968: 71.4 ms at 31397 ms, present 1439: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 10.8, Driver.Packet.dispatch (queue worker 0x20) 10.5, Driver.Dispatch (queue worker 0x20) 10.4, Vulkan.Dispatch (queue worker 0x20) 7.4
  • batch 8963: 66.4 ms at 40428 ms, present 1448: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 13.0, Driver.Packet.dispatch (queue worker 0x20) 12.3, Driver.Dispatch (queue worker 0x20) 8.5, Vulkan.Dispatch (queue worker 0x20) 5.4
  • batch 4334: 65.6 ms at 19574 ms, present 1427: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 84.2, Driver.Packet.dispatch (queue worker 0x20) 83.5, Driver.Dispatch (queue worker 0x20) 83.4, Vulkan.Dispatch (queue worker 0x20) 80.0
  • batch 3000: 64.6 ms at 13362 ms, present 1421: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 83.3, Driver.Packet.dispatch (queue worker 0x20) 83.3, Driver.Dispatch (queue worker 0x20) 83.1, Vulkan.Dispatch (queue worker 0x20) 79.7
  • batch 6071: 64.4 ms at 27481 ms, present 1435: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 13.3, Driver.Packet.dispatch (queue worker 0x20) 13.2, Driver.Dispatch (queue worker 0x20) 10.2, Vulkan.Dispatch (queue worker 0x20) 8.5

Capture protocol

  • The caches were warm (the scene ran once and the title was restarted): the shader and pipeline caches were already warm from several earlier sessions today; this capture is a fresh title start on those caches.
  • No other APS5_TRACE_* or APS5_PROFILE_* switch was set and the log was not redirected: the only variables set are the two shown in the summary lines; APS5_PAD_INPUT_FILE supplies recorded controller presses to get through the intro (no presses fall inside the captured windows).
  • Captures compared here come from the same machine, scene and settings: both traces are from the same machine, same save spawn, same resolution and settings.

Reporter's analysis (AI-assisted - kept separate from the measured data above)

  • The captured windows split nearly evenly: ~470-500 ms of GPU batch time and ~500 ms of CPU-side queue work per ~0.9-1.0 s frame, with almost no overlap slack.
  • Queue worker 0x20 spends 66 % of the frame in Driver.WorkerWait.dequeue_order (waiting on the neighbouring worker) and 34 % executing Driver.Packet.dispatch (the summary's top phase, ~660 ms/frame), dominated by Vulkan.Dispatch.shader_resources (~390-435 ms/frame).
  • Queue worker 0x0 carries Driver.Packet (~590 ms/frame largest slice) with ~403 ms/frame in sub-20 us slices (many tiny writes/packets) plus Driver.Packet.memory_wait (~310 ms/frame).
  • The title threads and the presenter are idle for ~995 ms of the frame; the draw committer is ~27 % busy. The GPU is only ~50 % busy while frames take ~1 s.
  • Reading: the wall looks like serialization between packet execution, compute-dispatch resource preparation and GPU batches rather than raw GPU fill. This is interpretation, not measured data - the trace above is the evidence.

aps5-trace-cbdf973fd568-8088.json.gz
aps5-trace-cbdf973fd568-20912.json.gz

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5926956634 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7947). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-19T15:42:23Z. --- **Title and scene:** `PPSA22102` (Squirrel with a Gun, 01.000.000), in-game at the save-game spawn (tutorial area), 3840x2160 fullscreen, title default settings (`sg.ResolutionQuality=100`). The window covers frames after entering the world while the scene is still streaming in. **What is slow:** The spawn streams content for several minutes after the save loads; during that time frames take about one second (p50 912 ms in the 30 s capture, p50 1007 ms in the 60 s companion). The same spot runs about 7-8x faster once streaming has finished (observed in earlier sessions on this machine, ~129 ms / 7.7 FPS, not part of these traces). To reproduce: load the tutorial save and watch the first minutes in the world. **Build:** `cbdf973fd568` (dirty) - the local fix-branch tree (carries the AGC storage write-back fix now in #7912 and the libc fixes of #7905/#7906; not a clean `main` build). **Summary lines** (`aps5-summary.jsonl`, as written): ```json {"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"420:30"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 420:30","first_present":1478,"ms":30352.574},"presents":33,"frame_ms":{"p50":912.259,"p90":957.413,"p99":1011.518,"max":1011.518},"gpu_busy_ms_per_present":466.738,"worker_busy_pct":{"queue worker 0x0":99.417,"queue worker 0x20":73.199},"top_phases_ms_per_frame":{"Driver.Packet":1568.918,"Driver.Packet.dispatch":657.776,"Driver.Dispatch":626.474,"Resources.Complete":482.625,"Vulkan.Dispatch":444.434,"Vulkan.Dispatch.shader_resources":434.223,"Driver.Packet.draw":295.828,"Driver.Draw":295.118},"trace_dropped":false,"trace":"aps5-trace-cbdf973fd568-8088.json.gz"} ``` ```json {"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"400:60"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 400:60","first_present":1408,"ms":60750.495},"presents":61,"frame_ms":{"p50":1007.266,"p90":1060.045,"p99":1122.899,"max":1122.899},"gpu_busy_ms_per_present":500.482,"worker_busy_pct":{"queue worker 0x0":99.442,"queue worker 0x20":73.132},"top_phases_ms_per_frame":{"Driver.Packet":1702.738,"Driver.Packet.dispatch":667.573,"Driver.Dispatch":637.094,"Resources.Complete":541.802,"Vulkan.Dispatch":476.701,"Vulkan.Dispatch.shader_resources":466.601,"Driver.Packet.memory_wait":330.269,"Graphics.Draw":281.439},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":36.995,"events_lost":168532,"totals_full":false}},"trace":"aps5-trace-cbdf973fd568-20912.json.gz"} ``` **Traces** - `aps5-trace-cbdf973fd568-8088.json.gz` - primary capture, 30 s window, no dropped events. - `aps5-trace-cbdf973fd568-20912.json.gz` - companion capture, 60 s window; `trace_dropped` on queue worker 0x0 after 37 s (its totals are complete; a prefix of its event slices was dropped before the buffer filled). **Digest** - `python tools/trace_digest.py <trace>` - primary capture (30 s): **seconds 420:30** from present 1478: 33 presents, frame p50 912.3 / p90 957.4 / p99 1011.5 / max 1011.5 ms, GPU busy 466.7 ms per present NVIDIA GeForce RTX 3070, NVIDIA 610.88, Windows 10.0.22635, 3840x2160, commit cbdf973fd568 (dirty), dropped: no ```json {"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"420:30"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 420:30","first_present":1478,"ms":30352.574},"presents":33,"frame_ms":{"p50":912.259,"p90":957.413,"p99":1011.518,"max":1011.518},"gpu_busy_ms_per_present":466.738,"worker_busy_pct":{"queue worker 0x0":99.417,"queue worker 0x20":73.199},"top_phases_ms_per_frame":{"Driver.Packet":1568.918,"Driver.Packet.dispatch":657.776,"Driver.Dispatch":626.474,"Resources.Complete":482.625,"Vulkan.Dispatch":444.434,"Vulkan.Dispatch.shader_resources":434.223,"Driver.Packet.draw":295.828,"Driver.Draw":295.118},"trace_dropped":false,"trace":"aps5-trace-cbdf973fd568-8088.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1501: 1011.5 ms at 21105 ms: Driver.Packet (queue worker 0x0) 986.4, Driver.Packet (queue worker 0x20) 681.0, batch (gpu) 478.7, Driver.Packet.dispatch (queue worker 0x20) 416.6 - present 1484: 978.9 ms at 5542 ms: Driver.Packet (queue worker 0x0) 953.6, Driver.Packet (queue worker 0x20) 685.3, batch (gpu) 482.5, Driver.Packet.dispatch (queue worker 0x20) 464.9 - present 1489: 976.9 ms at 10127 ms: Driver.Packet (queue worker 0x0) 953.2, Driver.Packet (queue worker 0x20) 705.9, Driver.Packet.dispatch (queue worker 0x20) 498.1, Driver.Dispatch (queue worker 0x20) 479.3 - present 1481: 957.4 ms at 2759 ms: Driver.Packet (queue worker 0x0) 932.0, Driver.Packet (queue worker 0x20) 686.9, batch (gpu) 482.6, Driver.Packet.dispatch (queue worker 0x20) 465.7 - present 1503: 948.7 ms at 23029 ms: Driver.Packet (queue worker 0x0) 925.4, Driver.Packet (queue worker 0x20) 676.5, batch (gpu) 471.5, Driver.Packet.dispatch (queue worker 0x20) 426.7 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 726.4 (79 %) | 170.8 (19 %) | 22.6 | 92.9 | Driver.Packet 893.8, Driver.EndSubmission 3.4 | | draw committer | 237.5 (26 %) | 140.0 (15 %) | 542.3 | 13.9 | Graphics.Draw 191.4, Recorder.Submit 44.6 | | title | 0.0 (0 %) | 0.0 (0 %) | 919.7 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | presenter | 0.9 (0 %) | 0.8 (0 %) | 918.1 | 0.1 | VideoOut.Flip 1.7, Driver.Present 0.0 | | queue worker 0x20 | 370.4 (40 %) | 545.8 (59 %) | 3.5 | 12.9 | Driver.Packet 655.2, Driver.EndSubmission 15.1 | | gpu | 466.1 (51 %) | 0.0 (0 %) | 453.7 | 0.0 | batch 466.1 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 1549.0, Driver.Packet.dispatch 657.1, Driver.Dispatch 625.4, Resources.Complete 480.5, batch 466.1, Vulkan.Dispatch 443.3, Vulkan.Dispatch.shader_resources 432.1, Driver.Packet.draw 293.5, Driver.Draw 292.8, Driver.WorkerWait 245.8 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 307.7 ms at 21804 ms, present 1501 - Driver.WorkerWait (queue worker 0x20) 271.5 ms at 6244 ms, present 1484 - Driver.WorkerWait (queue worker 0x20) 255.4 ms at 8985 ms, present 1487 - Driver.WorkerWait (queue worker 0x20) 255.1 ms at 29202 ms, present 1509 - Driver.WorkerWait (queue worker 0x20) 255.0 ms at 22769 ms, present 1502 - Driver.WorkerWait (queue worker 0x20) 254.0 ms at 17217 ms, present 1496 - Driver.WorkerWait (queue worker 0x20) 253.9 ms at 12676 ms, present 1491 - Driver.WorkerWait (queue worker 0x20) 253.5 ms at 663 ms, present 1478 - Driver.WorkerWait (queue worker 0x20) 252.7 ms at 7171 ms, present 1485 - Driver.WorkerWait (queue worker 0x20) 251.5 ms at 3461 ms, present 1481 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 4674: 71.9 ms at 19779 ms, present 1499: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 6.0, Driver.Packet.dispatch (queue worker 0x20) 6.0, Driver.Dispatch (queue worker 0x20) 5.6, Vulkan.Dispatch (queue worker 0x20) 4.3 - batch 767: 71.1 ms at 3264 ms, present 1481: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 94.5, Driver.Packet.dispatch (queue worker 0x20) 93.6, Driver.Dispatch (queue worker 0x20) 93.5, Driver.Dispatch.capture_resources (queue worker 0x20) 79.6 - batch 3807: 70.2 ms at 16145 ms, present 1495: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 43.4, Graphics.Draw (draw committer) 2.5, Graphics.Draw.validate (draw committer) 1.2, Graphics.Draw.draw_and_resource_release (draw committer) 1.0 - batch 3380: 69.4 ms at 14351 ms, present 1493: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 19.0, Driver.Packet.draw (queue worker 0x0) 18.3, Driver.Draw (queue worker 0x0) 18.3, Driver.Draw.gpu_mutex_wait (queue worker 0x0) 14.7 - batch 6665: 68.6 ms at 28135 ms, present 1508: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 16.5, Driver.Packet.draw (queue worker 0x0) 16.3, Driver.Draw (queue worker 0x0) 16.3, Driver.Draw.gpu_mutex_wait (queue worker 0x0) 14.8 Companion capture (60 s): **seconds 400:60** from present 1408: 61 presents, frame p50 1007.3 / p90 1060.0 / p99 1122.9 / max 1122.9 ms, GPU busy 500.5 ms per present NVIDIA GeForce RTX 3070, NVIDIA 610.88, Windows 10.0.22635, 3840x2160, commit cbdf973fd568 (dirty), dropped: yes ```json {"commit":"cbdf973fd568","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"400:60"},"gpu":"NVIDIA GeForce RTX 3070","driver":"NVIDIA 610.88","os":"Windows 10.0.22635","resolution":"3840x2160","window":{"spec":"seconds 400:60","first_present":1408,"ms":60750.495},"presents":61,"frame_ms":{"p50":1007.266,"p90":1060.045,"p99":1122.899,"max":1122.899},"gpu_busy_ms_per_present":500.482,"worker_busy_pct":{"queue worker 0x0":99.442,"queue worker 0x20":73.132},"top_phases_ms_per_frame":{"Driver.Packet":1702.738,"Driver.Packet.dispatch":667.573,"Driver.Dispatch":637.094,"Resources.Complete":541.802,"Vulkan.Dispatch":476.701,"Vulkan.Dispatch.shader_resources":466.601,"Driver.Packet.memory_wait":330.269,"Graphics.Draw":281.439},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":36.995,"events_lost":168532,"totals_full":false}},"trace":"aps5-trace-cbdf973fd568-20912.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1427: 1122.9 ms at 18905 ms: Driver.Packet (queue worker 0x0) 1091.6, Driver.Packet (queue worker 0x20) 834.7, batch (gpu) 540.5, Driver.Packet.dispatch (queue worker 0x20) 457.1 - present 1445: 1082.0 ms at 36744 ms: Driver.Packet (queue worker 0x20) 786.4, batch (gpu) 537.5, Driver.Packet.dispatch (queue worker 0x20) 413.0, Driver.Dispatch (queue worker 0x20) 388.8 - present 1415: 1073.4 ms at 6781 ms: Driver.Packet (queue worker 0x0) 1032.3, Driver.Packet (queue worker 0x20) 798.1, batch (gpu) 520.1, Driver.Packet.dispatch (queue worker 0x20) 394.7 - present 1423: 1064.7 ms at 14841 ms: Driver.Packet (queue worker 0x0) 1041.4, Driver.Packet (queue worker 0x20) 776.5, batch (gpu) 544.1, Driver.Packet.dispatch (queue worker 0x20) 411.3 - present 1439: 1064.2 ms at 30799 ms: Driver.Packet (queue worker 0x0) 1038.0, Driver.Packet (queue worker 0x20) 794.6, batch (gpu) 536.7, Driver.Packet.dispatch (queue worker 0x20) 442.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 511.3 (51 %) | 81.4 (8 %) | 403.3 | 58.5 | Driver.Packet 589.6, Driver.EndSubmission 3.1 | | draw committer | 267.0 (27 %) | 165.5 (17 %) | 563.4 | 14.4 | Graphics.Draw 229.5, Recorder.Submit 36.5 | | title | 0.1 (0 %) | 0.0 (0 %) | 995.9 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.1 | | presenter | 0.7 (0 %) | 0.6 (0 %) | 994.5 | 0.1 | VideoOut.Flip 1.4, Driver.Present 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 995.9 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x20 | 335.9 (34 %) | 656.6 (66 %) | 3.4 | 13.2 | Driver.Packet 713.9, Driver.EndSubmission 11.5 | | gpu | 499.7 (50 %) | 0.0 (0 %) | 496.2 | 0.0 | batch 499.7 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 1303.5, Driver.Packet.dispatch 563.0, Driver.Dispatch 535.1, batch 499.7, Resources.Complete 463.5, Vulkan.Dispatch 397.4, Vulkan.Dispatch.shader_resources 388.6, Driver.Packet.memory_wait 309.6, Driver.WorkerWait 267.0, Driver.WorkerWait.dequeue_order 266.9 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 330.3 ms at 60416 ms, present 1468 - Driver.WorkerWait (queue worker 0x20) 300.2 ms at 55499 ms, present 1463 - Driver.WorkerWait (queue worker 0x20) 299.9 ms at 13526 ms, present 1421 - Driver.WorkerWait (queue worker 0x20) 292.0 ms at 38573 ms, present 1446 - Driver.WorkerWait (queue worker 0x20) 287.6 ms at 57498 ms, present 1465 - Driver.WorkerWait (queue worker 0x20) 285.1 ms at 18615 ms, present 1426 - Driver.WorkerWait (queue worker 0x20) 284.0 ms at 48521 ms, present 1456 - Driver.WorkerWait (queue worker 0x20) 284.0 ms at 14550 ms, present 1422 - Driver.WorkerWait (queue worker 0x20) 282.0 ms at 46548 ms, present 1454 - Driver.WorkerWait (queue worker 0x20) 280.7 ms at 20696 ms, present 1428 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 6968: 71.4 ms at 31397 ms, present 1439: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 10.8, Driver.Packet.dispatch (queue worker 0x20) 10.5, Driver.Dispatch (queue worker 0x20) 10.4, Vulkan.Dispatch (queue worker 0x20) 7.4 - batch 8963: 66.4 ms at 40428 ms, present 1448: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 13.0, Driver.Packet.dispatch (queue worker 0x20) 12.3, Driver.Dispatch (queue worker 0x20) 8.5, Vulkan.Dispatch (queue worker 0x20) 5.4 - batch 4334: 65.6 ms at 19574 ms, present 1427: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 84.2, Driver.Packet.dispatch (queue worker 0x20) 83.5, Driver.Dispatch (queue worker 0x20) 83.4, Vulkan.Dispatch (queue worker 0x20) 80.0 - batch 3000: 64.6 ms at 13362 ms, present 1421: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 83.3, Driver.Packet.dispatch (queue worker 0x20) 83.3, Driver.Dispatch (queue worker 0x20) 83.1, Vulkan.Dispatch (queue worker 0x20) 79.7 - batch 6071: 64.4 ms at 27481 ms, present 1435: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 13.3, Driver.Packet.dispatch (queue worker 0x20) 13.2, Driver.Dispatch (queue worker 0x20) 10.2, Vulkan.Dispatch (queue worker 0x20) 8.5 **Capture protocol** - [x] The caches were warm (the scene ran once and the title was restarted): the shader and pipeline caches were already warm from several earlier sessions today; this capture is a fresh title start on those caches. - [x] No other `APS5_TRACE_*` or `APS5_PROFILE_*` switch was set and the log was not redirected: the only variables set are the two shown in the summary lines; `APS5_PAD_INPUT_FILE` supplies recorded controller presses to get through the intro (no presses fall inside the captured windows). - [x] Captures compared here come from the same machine, scene and settings: both traces are from the same machine, same save spawn, same resolution and settings. **Reporter's analysis (AI-assisted - kept separate from the measured data above)** - The captured windows split nearly evenly: ~470-500 ms of GPU batch time and ~500 ms of CPU-side queue work per ~0.9-1.0 s frame, with almost no overlap slack. - Queue worker 0x20 spends 66 % of the frame in `Driver.WorkerWait.dequeue_order` (waiting on the neighbouring worker) and 34 % executing `Driver.Packet.dispatch` (the summary's top phase, ~660 ms/frame), dominated by `Vulkan.Dispatch.shader_resources` (~390-435 ms/frame). - Queue worker 0x0 carries `Driver.Packet` (~590 ms/frame largest slice) with ~403 ms/frame in sub-20 us slices (many tiny writes/packets) plus `Driver.Packet.memory_wait` (~310 ms/frame). - The title threads and the presenter are idle for ~995 ms of the frame; the draw committer is ~27 % busy. The GPU is only ~50 % busy while frames take ~1 s. - Reading: the wall looks like serialization between packet execution, compute-dispatch resource preparation and GPU batches rather than raw GPU fill. This is interpretation, not measured data - the trace above is the evidence. [aps5-trace-cbdf973fd568-8088.json.gz](https://github.com/user-attachments/files/33674160/aps5-trace-cbdf973fd568-8088.json.gz) [aps5-trace-cbdf973fd568-20912.json.gz](https://github.com/user-attachments/files/33674159/aps5-trace-cbdf973fd568-20912.json.gz)
Rajkamalcode commented 2026-10-19 16:48:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-19T16:48:01Z.


Addendum: queue-worker 0 stacks (sampler)

The trace above has a blind spot for queue worker 0 itself: nearly all of its work happens in sub-20 µs slices, so the profile shows that it is busy but not where. To fill that in I re-ran the same spawn area with the driver's worker sampler enabled, replaying the same pad input.

Sampler settings, for the record:

  • APS5_SAMPLE_WORKER=<file> — queue worker 0, sampled every timer tick (in practice ~64 Hz on this machine; # samples=38278 over ~10 min, 5,619 distinct stacks, 15 truncated walks, mean suspension 96 µs)
  • APS5_PAD_INPUT_FILE=<file> — same menu/pad replay as the captures
  • no trace switches set

The sampler suspends the worker for every walk, so these are attribution numbers, not timing numbers.

Self time by module (leaf frame)

module share
ntdll.dll 73.7 %
libSceAgcDriver.prx 9.7 %
win32u.dll (WDDM calls, entered from nvoglv64) 5.4 %
nvoglv64.dll 3.7 %
ucrtbase.dll 3.3 %
libwinpthread-1.dll 2.5 %
libc.prx 0.5 %
vulkan-1.dll 0.4 %
libstdc++-6.dll 0.4 %
other 0.4 %

About three quarters of this worker's wall time is parked in kernel waits. Grouping the samples by the nearest driver frame above the wait:

wait site (nearest driver frame) wall share what it waits on
DriverDetail::DrawPipeline::Enqueue 14.9 % queue room: the committed-items list is full (idle.wait in Enqueue)
DriverDetail::DrawPipeline::Drain ~17 % the pipeline becoming empty (idle.wait in Drain, plus libstdc++ futures)
Graphics::Recorder::finish / SyncThrough / Sync 12.3 % GPU fences, inside nvoglv64 waits
GuestMemory::GpuMutexType::lock 8.6 % LockSpinning<std::recursive_mutex> contention
DriverDetail::waitMemory 2.7 % PollSleep() — the sleep half of the memory wait (the trace's memory_wait phase)
Graphics::StorageTexture::release() / dtor 2.4 % freeing Vulkan images through the WDDM path (win32u)
allocation/creation paths (makeSlab, Texture ctor, BufferPool::AllocateMemory, createView) 2.1 % driver-side allocation waits
Graphics::Recorder::Submit 1.5 % nvoglv64 submit-path wait

Driver CPU work — 9.7 % self, 28.7 % inclusive under DriverDetail::Driver::execute. The dominant CPU path is resource preparation for dispatches:

  • VulkanDevice::dispatch 21.9 % inclusive, essentially all of it ShaderResources::Complete() (21.9 %); the sampled PCs concentrate in buildComplete() and resolveImageBinding(). This is the trace's dispatch.shader_resources phase, and it is CPU, not GPU wait. The dispatch resource cache is not the problem here: the [rescache] counters from these runs report ~99 % hits (12,990 hits / 148 misses), so this is the completion cost of the deferred compute builds.
  • Draw/dispatch entry points: draw 15.0 %, dispatch 13.4 %, dispatchIndirect 12.2 %.
  • Housekeeping: ResourceCache::RemoveImage is the hottest single self frame (0.7 % across offsets), followed by AllKeysEqual, dropReleasedTextures, and ShaderRecompiler::Specialization::prune/fold.
  • Allocation churn shows up on both sides: creation paths above, and StorageTexture::release() in the waits. The run log also has the device-local heap at 6,705 of 6,700 MiB with 1,597,440 bytes placed in host memory across 2,048 allocations, so part of this is spill rather than steady state.

What this adds to the trace story

  • The trace's sub-20 µs "busy" slices are largely these wake-check-sleep loops rather than packet execution: PollSleep, LockSpinning, and the pipeline condition variables wake often and do little between wakes.
  • Two waits were invisible in the trace and are actionable inside the driver: the draw-pipeline back-pressure in Enqueue (~15 %) and the GPU-mutex contention in GuestMemory::GpuMutexType::lock (~9 %). Pipeline depth and the single committer thread are the first thing to look at; the GPU mutex is worth a look from whoever owns the guest-memory write tracking.
  • The GPU-fence waits (~12 %) and the NVIDIA allocation/free costs (~4 %) are expected side effects of the streaming load, not obvious driver waste.

Caveats: the sampler window is the whole ~10 min run, while the trace window sat inside a stall, so absolute shares are not directly comparable — the trace's "busy" fraction and the sampler's wait fraction describe the same worker in different phases. graphics-hook64.dll (OBS capture hook) is loaded in the process and appears in ~1.7 % of chains; it should be excluded for future runs. RVA→symbol mapping used libSceAgcDriver.prx with PE timestamp 0x6ad60e21 — the binary in the game's libs/ directory.

Raw collapsed stacks (speedscope/flamegraph format, RVAs plus the module table headers) are attached below.

(AI-generated analysis, labeled per docs/dev/GAME_TESTING.md; raw data attached.)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272389448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7947#issuecomment-6272389448). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-19T16:48:01Z. --- ### Addendum: queue-worker 0 stacks (sampler) The trace above has a blind spot for queue worker 0 itself: nearly all of its work happens in sub-20 µs slices, so the profile shows *that* it is busy but not *where*. To fill that in I re-ran the same spawn area with the driver's worker sampler enabled, replaying the same pad input. Sampler settings, for the record: - `APS5_SAMPLE_WORKER=<file>` — queue worker 0, sampled every timer tick (in practice ~64 Hz on this machine; `# samples=38278` over ~10 min, 5,619 distinct stacks, 15 truncated walks, mean suspension 96 µs) - `APS5_PAD_INPUT_FILE=<file>` — same menu/pad replay as the captures - no trace switches set The sampler suspends the worker for every walk, so these are attribution numbers, not timing numbers. **Self time by module (leaf frame)** | module | share | |---|---| | ntdll.dll | 73.7 % | | libSceAgcDriver.prx | 9.7 % | | win32u.dll (WDDM calls, entered from nvoglv64) | 5.4 % | | nvoglv64.dll | 3.7 % | | ucrtbase.dll | 3.3 % | | libwinpthread-1.dll | 2.5 % | | libc.prx | 0.5 % | | vulkan-1.dll | 0.4 % | | libstdc++-6.dll | 0.4 % | | other | 0.4 % | About three quarters of this worker's wall time is parked in kernel waits. Grouping the samples by the nearest driver frame above the wait: | wait site (nearest driver frame) | wall share | what it waits on | |---|---|---| | `DriverDetail::DrawPipeline::Enqueue` | 14.9 % | queue room: the committed-items list is full (`idle.wait` in `Enqueue`) | | `DriverDetail::DrawPipeline::Drain` | ~17 % | the pipeline becoming empty (`idle.wait` in `Drain`, plus libstdc++ futures) | | `Graphics::Recorder::finish` / `SyncThrough` / `Sync` | 12.3 % | GPU fences, inside nvoglv64 waits | | `GuestMemory::GpuMutexType::lock` | 8.6 % | `LockSpinning<std::recursive_mutex>` contention | | `DriverDetail::waitMemory` | 2.7 % | `PollSleep()` — the sleep half of the memory wait (the trace's `memory_wait` phase) | | `Graphics::StorageTexture::release()` / dtor | 2.4 % | freeing Vulkan images through the WDDM path (win32u) | | allocation/creation paths (`makeSlab`, `Texture` ctor, `BufferPool::AllocateMemory`, `createView`) | 2.1 % | driver-side allocation waits | | `Graphics::Recorder::Submit` | 1.5 % | nvoglv64 submit-path wait | **Driver CPU work** — 9.7 % self, 28.7 % inclusive under `DriverDetail::Driver::execute`. The dominant CPU path is resource preparation for dispatches: - `VulkanDevice::dispatch` 21.9 % inclusive, essentially all of it `ShaderResources::Complete()` (21.9 %); the sampled PCs concentrate in `buildComplete()` and `resolveImageBinding()`. This is the trace's `dispatch.shader_resources` phase, and it is CPU, not GPU wait. The dispatch resource cache is not the problem here: the `[rescache]` counters from these runs report ~99 % hits (12,990 hits / 148 misses), so this is the completion cost of the deferred compute builds. - Draw/dispatch entry points: `draw` 15.0 %, `dispatch` 13.4 %, `dispatchIndirect` 12.2 %. - Housekeeping: `ResourceCache::RemoveImage` is the hottest single self frame (0.7 % across offsets), followed by `AllKeysEqual`, `dropReleasedTextures`, and `ShaderRecompiler::Specialization::prune/fold`. - Allocation churn shows up on both sides: creation paths above, and `StorageTexture::release()` in the waits. The run log also has the device-local heap at 6,705 of 6,700 MiB with 1,597,440 bytes placed in host memory across 2,048 allocations, so part of this is spill rather than steady state. **What this adds to the trace story** - The trace's sub-20 µs "busy" slices are largely these wake-check-sleep loops rather than packet execution: `PollSleep`, `LockSpinning`, and the pipeline condition variables wake often and do little between wakes. - Two waits were invisible in the trace and are actionable inside the driver: the **draw-pipeline back-pressure in `Enqueue` (~15 %)** and the **GPU-mutex contention in `GuestMemory::GpuMutexType::lock` (~9 %)**. Pipeline depth and the single committer thread are the first thing to look at; the GPU mutex is worth a look from whoever owns the guest-memory write tracking. - The GPU-fence waits (~12 %) and the NVIDIA allocation/free costs (~4 %) are expected side effects of the streaming load, not obvious driver waste. Caveats: the sampler window is the whole ~10 min run, while the trace window sat inside a stall, so absolute shares are not directly comparable — the trace's "busy" fraction and the sampler's wait fraction describe the same worker in different phases. `graphics-hook64.dll` (OBS capture hook) is loaded in the process and appears in ~1.7 % of chains; it should be excluded for future runs. RVA→symbol mapping used `libSceAgcDriver.prx` with PE timestamp `0x6ad60e21` — the binary in the game's `libs/` directory. Raw collapsed stacks (speedscope/flamegraph format, RVAs plus the module table headers) are attached below. *(AI-generated analysis, labeled per `docs/dev/GAME_TESTING.md`; raw data attached.)*
Rajkamalcode commented 2026-10-19 16:50:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-19T16:50:53Z.


swag-worker-samples.collapsed.txt

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272450009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7947#issuecomment-6272450009). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-19T16:50:53Z. --- [swag-worker-samples.collapsed.txt](https://github.com/user-attachments/files/33676338/swag-worker-samples.collapsed.txt)
Rajkamalcode commented 2026-10-19 17:23:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-19T17:23:32Z.


Heavy-state profile, and a drain-removal A/B (6-minute runs at the 1 FPS spot, RTX 3070, Windows 11)

Four runs on the same save with the same pad-file entry (APS5_PROFILE_DRAW=1, no trace capture, window closed at +360 s). Values are per 10 s windows in the steady part of the run (2nd-6th minute), which is the ~1 FPS state.

run env presents / 10 s commits / 10 s us per commit Enqueue room wait / draw packet drains / 10 s 0x50 (DMA) drains
7 baseline 11-12 21-22k 215-240 83-99 us 10.4-11.0k (2.5-2.8 s) ~2.1k
13 baseline 5-8 8.9-11.3k 360-520 126-226 us 4.3-5.3k (1.8-2.7 s) 0.9-1.1k
14 APS5_PIPELINE_DMA=1 10-11 22-24k 185-230 92-116 us 7.2-8.0k (1.5-1.9 s) 0
15 baseline 9-10 16.5-17k 250-260 96-105 us 7.7-8.2k (2.1-2.2 s) 1.7k

Drain removal alone does not move this title. Run 14 removes the DMA drains (0x50 -> 0, ~1.7-2.1k fewer packet drains per 10 s) and the frame rate stays inside the baseline spread (9-12 presents / 10 s; run 7 and run 15 are both baselines at opposite ends of it). The drain waits are symptom, not gate: the committer keeps working while queue 0 waits, and the frame is set by the recording chain below. This matches the Sword of the Sea data point in #7895, where pipelined DMA and dispatch drains moved the wait but not the frame time. Run 13 is a degradation mode (same workload, 5-8 presents, GPU busy rising to 750 ms) that looks driven by VRAM/streaming pressure rather than by drain count.

Where the committer's time goes

Draw-side [draws] totals in the last window of each run (draws recorded per 10 s):

phase run 14 (9,800 draws) run 15 (8,607 draws)
readTarget 1,020 ms 1,147 ms
resources 889 ms (bindings 636) 815 ms (bindings 592)
record 294 ms 268 ms
vertex 145 ms 121 ms
prepare / lookup / pipeline 83 / 81 / 41 ms 64 / 73 / 36 ms

Per kind: template hit 79 us, full build 1,437-1,792 us, address-based (BDA) build 122-149 us. The single draw committer records ~2,000 commits per frame at ~205-250 us each (22-24k commits / 10 s at 11 presents), i.e. ~400-430 ms of the ~0.9 s frame on one thread, and the GPU is busy only 414-487 ms of it (426-579 ms idle gaps). ~13k of the 22k commits per 10 s are non-draw items (labels/stores/fills) sharing the same committer.

readTarget is the largest single draw-side phase. Each resident-target lookup runs StorageTexture::Refresh: CompletePendingCpuWrites, FlushPending, CollectWrites over the surface, the DCC key scan, then UnchangedSince. In these runs there were 9,281-10,661 resident lookups per 10 s; only 190-219 of them were >= 1 ms, but those consumed 853-988 ms of the 1,020-1,147 ms. 4.4-4.9M pages were walked per 10 s (most draws are partial-scissor: 7.7-9.4k partial vs 0.9-1.3k full, and the walk still covers the surface). The committer's collect memo is invalidated whenever the queue worker passes a CPU-visible ordering point: Driver::bumpEpoch advances DrawPipeline::EpochToken (WaitStatistics.cpp:36) and the committer's FollowEpoch bumps its own collect epoch (DrawPipeline.cpp:63), so the next target refresh after a bump re-walks. This is ~85-100 ms per frame on its own.

Resource builds are the second-largest. [resources] cumulative in run 15: 156,187 builds, stage B 140.3 s, of which images 123.0 s (~0.79 ms per build in image resolution), stage A 13.8 s, upload 16.5 s. On the draw side, 1,181-1,294 builds per 10 s at 1.4-1.8 ms each (~90-110 ms per frame), while the 5.8-6.7k template hits cost 79 us each (~35 ms per frame).

Texture churn. [texture] over a run: 44-94k storage images created, 600 GB-1.29 TB of image memory churned (create 52-87 s CPU, GPU-side write-back 34-57 s), 142-227k reused, 38-74k direct uploads. With 8 GB of VRAM this is the background pressure behind the run 13 spiral and the "GPU busy grows over the run" behaviour already noted for this title.

Reading

The frame at this spot is a serial recording chain: ~2,000 commits/frame on one committer, a third of the draw time in per-draw resource completion and the target-refresh page walk, plus the queue worker's packet work and waits; the GPU idles about half the frame and drain waits are downstream symptoms. This is the same shape as #7895 (parallel draw preparation/recording) and the generic findings in #6754. The concrete levers the numbers point to, in order: (1) get draw recording/preparation off the single committer, (2) make per-draw resource completion cheaper (the images stage and 1.4-1.8 ms builds), (3) share or avoid the committer's target-refresh page walks after ordering points, (4) keep more of the streamed images resident.

AI-assisted: the runs, the log mining and this text were produced by an AI-assisted workflow on the reporter's machine. Raw per-10 s logs and the extracted tables can be shared on request.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273075351 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7947#issuecomment-6273075351). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-19T17:23:32Z. --- ## Heavy-state profile, and a drain-removal A/B (6-minute runs at the 1 FPS spot, RTX 3070, Windows 11) Four runs on the same save with the same pad-file entry (`APS5_PROFILE_DRAW=1`, no trace capture, window closed at +360 s). Values are per 10 s windows in the steady part of the run (2nd-6th minute), which is the ~1 FPS state. | run | env | presents / 10 s | commits / 10 s | us per commit | Enqueue room wait / draw | packet drains / 10 s | 0x50 (DMA) drains | |---|---|---|---|---|---|---|---| | 7 | baseline | 11-12 | 21-22k | 215-240 | 83-99 us | 10.4-11.0k (2.5-2.8 s) | ~2.1k | | 13 | baseline | 5-8 | 8.9-11.3k | 360-520 | 126-226 us | 4.3-5.3k (1.8-2.7 s) | 0.9-1.1k | | 14 | `APS5_PIPELINE_DMA=1` | 10-11 | 22-24k | 185-230 | 92-116 us | 7.2-8.0k (1.5-1.9 s) | **0** | | 15 | baseline | 9-10 | 16.5-17k | 250-260 | 96-105 us | 7.7-8.2k (2.1-2.2 s) | 1.7k | **Drain removal alone does not move this title.** Run 14 removes the DMA drains (0x50 -> 0, ~1.7-2.1k fewer packet drains per 10 s) and the frame rate stays inside the baseline spread (9-12 presents / 10 s; run 7 and run 15 are both baselines at opposite ends of it). The drain waits are symptom, not gate: the committer keeps working while queue 0 waits, and the frame is set by the recording chain below. This matches the Sword of the Sea data point in #7895, where pipelined DMA and dispatch drains moved the wait but not the frame time. Run 13 is a degradation mode (same workload, 5-8 presents, GPU busy rising to 750 ms) that looks driven by VRAM/streaming pressure rather than by drain count. ### Where the committer's time goes Draw-side `[draws]` totals in the last window of each run (draws recorded per 10 s): | phase | run 14 (9,800 draws) | run 15 (8,607 draws) | |---|---|---| | readTarget | 1,020 ms | 1,147 ms | | resources | 889 ms (bindings 636) | 815 ms (bindings 592) | | record | 294 ms | 268 ms | | vertex | 145 ms | 121 ms | | prepare / lookup / pipeline | 83 / 81 / 41 ms | 64 / 73 / 36 ms | Per kind: template hit 79 us, full build 1,437-1,792 us, address-based (BDA) build 122-149 us. The single draw committer records ~2,000 commits per frame at ~205-250 us each (22-24k commits / 10 s at 11 presents), i.e. **~400-430 ms of the ~0.9 s frame on one thread**, and the GPU is busy only 414-487 ms of it (426-579 ms idle gaps). ~13k of the 22k commits per 10 s are non-draw items (labels/stores/fills) sharing the same committer. **readTarget is the largest single draw-side phase.** Each resident-target lookup runs `StorageTexture::Refresh`: `CompletePendingCpuWrites`, `FlushPending`, `CollectWrites` over the surface, the DCC key scan, then `UnchangedSince`. In these runs there were 9,281-10,661 resident lookups per 10 s; only 190-219 of them were >= 1 ms, but those consumed 853-988 ms of the 1,020-1,147 ms. 4.4-4.9M pages were walked per 10 s (most draws are partial-scissor: 7.7-9.4k partial vs 0.9-1.3k full, and the walk still covers the surface). The committer's collect memo is invalidated whenever the queue worker passes a CPU-visible ordering point: `Driver::bumpEpoch` advances `DrawPipeline::EpochToken` (`WaitStatistics.cpp:36`) and the committer's `FollowEpoch` bumps its own collect epoch (`DrawPipeline.cpp:63`), so the next target refresh after a bump re-walks. This is ~85-100 ms per frame on its own. **Resource builds are the second-largest.** `[resources]` cumulative in run 15: 156,187 builds, stage B 140.3 s, of which images 123.0 s (~0.79 ms per build in image resolution), stage A 13.8 s, upload 16.5 s. On the draw side, 1,181-1,294 builds per 10 s at 1.4-1.8 ms each (~90-110 ms per frame), while the 5.8-6.7k template hits cost 79 us each (~35 ms per frame). **Texture churn.** `[texture]` over a run: 44-94k storage images created, 600 GB-1.29 TB of image memory churned (create 52-87 s CPU, GPU-side write-back 34-57 s), 142-227k reused, 38-74k direct uploads. With 8 GB of VRAM this is the background pressure behind the run 13 spiral and the "GPU busy grows over the run" behaviour already noted for this title. ### Reading The frame at this spot is a serial recording chain: ~2,000 commits/frame on one committer, a third of the draw time in per-draw resource completion and the target-refresh page walk, plus the queue worker's packet work and waits; the GPU idles about half the frame and drain waits are downstream symptoms. This is the same shape as #7895 (parallel draw preparation/recording) and the generic findings in #6754. The concrete levers the numbers point to, in order: (1) get draw recording/preparation off the single committer, (2) make per-draw resource completion cheaper (the images stage and 1.4-1.8 ms builds), (3) share or avoid the committer's target-refresh page walks after ordering points, (4) keep more of the streamed images resident. AI-assisted: the runs, the log mining and this text were produced by an AI-assisted workflow on the reporter's machine. Raw per-10 s logs and the extracted tables can be shared on request.
Rajkamalcode commented 2026-10-20 04:40:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-20T04:40:12Z.


Follow-up: stock-settings determinism, per-frame timeline, worker sampler (runs 24-26)

Same title and spawn as above: PPSA22102 (Squirrel with a Gun, 01.000.000), tutorial save, 3840x2160, title defaults (stock gameusersettings.ini 0156186E, sg.ResolutionQuality=100, all scalability groups 3), build cbdf973fd568 (dirty), driver prx 5AB0413B. Shader caches warm.

The input is now a deterministic pad schedule instead of a hand-driven replay: reset to 0 0 1, then sequence 1-4 Cross (16384) for 1000 ms at 15/30/45/60 s (APS5_PAD_INPUT_FILE). Three 360 s runs: two baselines with APS5_PROFILE_DRAW=1, trace APS5_TRACE_SECONDS=60:30, APS5_TRACE_SUMMARY_EVERY=10; one worker-sampler run with APS5_SAMPLE_WORKER and no trace.

Measured: the two baseline runs agree on the scene and workload

Tail 20 ten-second windows (steady part of each run):

metric run24 run25 diff
presents / 10 s 9 10 +11.1%
draws / 10 s 7,409 8,302.5 +12.1%
draws / present 823.22 830.25 +0.9%
commits / 10 s 14,603.5 16,059 +10.0%
commit us 300.9 284.55 -5.4%
commit us / draw 593.09 550.39 -7.2%
readTarget us / draw 152.25 119.04 -21.8%
resources us / draw 127.53 119.68 -6.2%
record us / draw 32.26 31.65 -1.9%

Trace summary, steady intervals 120-345 s (medians):

metric run24 run25 diff
frame p50 1,135.3 ms 1,141.0 ms +0.5%
frame p90 1,334.5 ms 1,306.0 ms -2.1%
GPU busy / present 485.5 ms 444.0 ms -8.5%
queue worker 0x0 busy 99.4% 99.4% 0

run24 lost trace events on queue worker 0x0 (events_lost 11,541) but totals_full is false, so the summary totals are valid; run25 is clean.

The readTarget spread is not input timing or scene drift: the slow-lookup count is 199.5 vs 190, the slow time is 982.8 vs 832 ms, and per-slow-lookup cost is 4,926 vs 4,379 us. A single-pair readTarget A/B is not trustworthy at this spread; a readTarget comparison needs paired runs and normalization by slow lookups. The scene/workload gate itself passes (draws/present 0.9%, commit us/draw 7.2%, trace p50 0.5%).

Measured: per-frame timeline (run24/run25 traces, 60:30 window)

Method: Chrome-trace complete slices grouped by thread; for each interval between Driver.Present events, union of the queue-worker, draw-committer, and GPU-track slices, plus pairwise overlaps. 31 frames (run24) and 28 frames (run25).

median run24 run25
frame 912.2 ms 1,005.5 ms
worker busy 873.0 ms (97.1%) 977.9 ms (97.6%)
committer busy 388.6 ms (44.2%) 435.0 ms (43.3%)
GPU busy 422.8 ms (45.1%) 411.4 ms (41.0%)
worker ∩ committer 376.0 ms (96.7% of committer) 425.6 ms (97.9%)
worker ∩ GPU 404.5 ms (95.6% of GPU) 399.4 ms (97.1%)
committer ∩ GPU 166.4 ms 182.5 ms

The trace-window p50 (912/1005 ms) reproduces the earlier 912/1007 ms observation; the 120-345 s steady tail is heavier (1,135/1,141 ms p50) as the spawn streams in.

Worker trace scopes (ms/frame):

scope run24 run25
Driver.Packet 917.4 1,073.7
Driver.Packet.dispatch 303.0 351.3
Driver.Dispatch 297.5 344.2
Driver.Packet.draw 266.4 292.8
Driver.Draw 265.3 291.6
Vulkan.Dispatch 230.7 280.2
Vulkan.Dispatch.shader_resources 224.1 273.0
Resources.Complete 216.5 266.3
Driver.Packet.device_lock 211.1 251.5
Driver.Draw.draw_enqueued 142.6 156.4
Driver.Draw.shader_compile_and_link 53.2 -
Driver.Packet.prepare_memory 51.7 64.9

Committer trace scopes (ms/frame):

scope run24 run25
Graphics.Draw 248.9 268.7
Graphics.Draw.draw_and_resource_release 213.9 232.4
GpuMutex.wait.draw 113.1 105.6
Resources.Complete 64.4 64.9
Recorder.Submit 41.2 55.5
GpuMutex.wait.label 22.1 27.4
Resources.Prepare 13.5 15.1

Measured: worker sampler at stock (run26)

APS5_SAMPLE_WORKER on queue worker 0x0, no trace, same pad schedule. Final window 22,952 samples; a 17,933-sample mid-run window was also taken. Worker busy 99.9%.

worker scope (inclusive) final mid2
ShaderResources::Complete (via VulkanDevice::dispatch) 24.1% 23.2%
DrawPipeline::Drain 18.6% 18.4%
DrawPipeline::Enqueue 16.4% 16.2%
ShaderResources::buildComplete (via Driver::draw) 13.6% 12.8%
Recorder::finish -> CompletePendingCpuWrites -> UploadFinish 10.2% 9.8%
ShaderResources::resolveImageBinding 10.0% 9.6%
cachedStorageTexture 8.4% 7.8%
GpuMutex::lock 7.0% 6.4%
Recorder::SyncThrough 6.8% 6.3%
VulkanDevice::Draw 5.1% 4.9%

The sampler suspends the worker for each walk, so these are attribution numbers, not timing numbers.

Diagnostic: low-settings profile (not a default-settings result)

These runs intentionally lowered the in-game settings to make the committer the wall and inspect the producer path. They are diagnostic only and are not part of the default-settings claim above.

  • run22: ~2.15 FPS steady, rising to 3.4 FPS; readTarget 1,348.7 ms/10 s; resources 1,159.2 (bindings 512-588, upload 277-331); record 494.9; commits 32.6k at 114.1 us.
  • run23 (with the committer sampler PR): 25-26 presents/10 s plateau (3.4 FPS highs); readTarget 1,567.6 ms with 14,676 resident lookups, 292 of them >= 1 ms = 1,160.1 ms; resources 1,547.3 (bindings 1,064.0, upload 171.5, descriptors 45.1, other 266.2); record 427.5; 32,991 commits/10 s at 120.6 us; recorder sync waits 60.2 s total (pending write 38.6 s, other 25.5 s, idle 4.3 s); storage-image create 37.5 s cumulative.
  • Committer sampler on run23: 22,947 samples, 88.4% wait in DrawPipeline::run (12,616 + 7,659), commitDraw 6,284, refreshResidentTarget 2,412, ShaderResources ctor/buildComplete/resolveImageBinding 1,151/999/958, fprintf 1,323 (5.8% of samples).

AI-generated analysis (separate from the measured data above)

  • The default frame is worker-bound, not GPU-bound and not a serial chain: the worker is 97.1/97.6% busy, the committer 44.2/43.3%, the GPU 45.1/41.0%, and 96.7-97.9% of the committer and 95.6-97.1% of the GPU busy time overlaps the worker. The worker's single thread sets the floor; the other two have headroom.
  • Resources.Complete (~24%), device_lock (~23%), and draw_enqueued (~16%) are the largest named worker costs. The committer's 29%/24% GpuMutex.wait.draw says the shared GpuMutex is a first-order contention point, not just a symptom. This profile supports the maintainer-directed prepare/record split (move the enqueue/prepare work to the committer with headroom) and GpuMutex sharding; a split alone that still serializes on the same lock would leave the wait in place.
  • The low-settings committer starvation is consistent with this: when the producer path is the wall, the committer waits; at default settings the worker still sets the frame while the committer runs concurrently.
  • I have a sampler check of the #6187+#6209 stack queued; I will report the result in that PR rather than duplicate the analysis here.

Artifacts

gh cannot attach files from the CLI, so I will add these in a follow-up drag-and-drop:

  • swag-run26-worker.collapsed.txt (worker sampler stacks, 22,952 samples)
  • timeline-run24.txt, timeline-run25.txt (per-frame overlap tables and scope lists)
  • swag-run24-err.log, swag-run25-err.log (full 360 s logs)
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6283526827 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7947#issuecomment-6283526827). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-20T04:40:12Z. --- ## Follow-up: stock-settings determinism, per-frame timeline, worker sampler (runs 24-26) Same title and spawn as above: `PPSA22102` (Squirrel with a Gun, 01.000.000), tutorial save, 3840x2160, **title defaults** (stock `gameusersettings.ini` `0156186E`, `sg.ResolutionQuality=100`, all scalability groups 3), build `cbdf973fd568` (dirty), driver prx `5AB0413B`. Shader caches warm. The input is now a deterministic pad schedule instead of a hand-driven replay: reset to `0 0 1`, then sequence 1-4 Cross (`16384`) for 1000 ms at 15/30/45/60 s (`APS5_PAD_INPUT_FILE`). Three 360 s runs: two baselines with `APS5_PROFILE_DRAW=1`, trace `APS5_TRACE_SECONDS=60:30`, `APS5_TRACE_SUMMARY_EVERY=10`; one worker-sampler run with `APS5_SAMPLE_WORKER` and no trace. ### Measured: the two baseline runs agree on the scene and workload Tail 20 ten-second windows (steady part of each run): | metric | run24 | run25 | diff | |---|---:|---:|---:| | presents / 10 s | 9 | 10 | +11.1% | | draws / 10 s | 7,409 | 8,302.5 | +12.1% | | **draws / present** | **823.22** | **830.25** | **+0.9%** | | commits / 10 s | 14,603.5 | 16,059 | +10.0% | | commit us | 300.9 | 284.55 | -5.4% | | **commit us / draw** | **593.09** | **550.39** | **-7.2%** | | readTarget us / draw | 152.25 | 119.04 | -21.8% | | resources us / draw | 127.53 | 119.68 | -6.2% | | record us / draw | 32.26 | 31.65 | -1.9% | Trace summary, steady intervals 120-345 s (medians): | metric | run24 | run25 | diff | |---|---:|---:|---:| | frame p50 | 1,135.3 ms | 1,141.0 ms | +0.5% | | frame p90 | 1,334.5 ms | 1,306.0 ms | -2.1% | | GPU busy / present | 485.5 ms | 444.0 ms | -8.5% | | queue worker 0x0 busy | 99.4% | 99.4% | 0 | `run24` lost trace events on queue worker 0x0 (`events_lost` 11,541) but `totals_full` is false, so the summary totals are valid; `run25` is clean. The `readTarget` spread is not input timing or scene drift: the slow-lookup count is 199.5 vs 190, the slow time is 982.8 vs 832 ms, and per-slow-lookup cost is 4,926 vs 4,379 us. A single-pair `readTarget` A/B is not trustworthy at this spread; a readTarget comparison needs paired runs and normalization by slow lookups. The scene/workload gate itself passes (draws/present 0.9%, commit us/draw 7.2%, trace p50 0.5%). ### Measured: per-frame timeline (run24/run25 traces, 60:30 window) Method: Chrome-trace complete slices grouped by thread; for each interval between `Driver.Present` events, union of the queue-worker, draw-committer, and GPU-track slices, plus pairwise overlaps. 31 frames (run24) and 28 frames (run25). | median | run24 | run25 | |---|---:|---:| | frame | 912.2 ms | 1,005.5 ms | | worker busy | 873.0 ms (97.1%) | 977.9 ms (97.6%) | | committer busy | 388.6 ms (44.2%) | 435.0 ms (43.3%) | | GPU busy | 422.8 ms (45.1%) | 411.4 ms (41.0%) | | worker ∩ committer | 376.0 ms (96.7% of committer) | 425.6 ms (97.9%) | | worker ∩ GPU | 404.5 ms (95.6% of GPU) | 399.4 ms (97.1%) | | committer ∩ GPU | 166.4 ms | 182.5 ms | The trace-window p50 (912/1005 ms) reproduces the earlier 912/1007 ms observation; the 120-345 s steady tail is heavier (1,135/1,141 ms p50) as the spawn streams in. Worker trace scopes (ms/frame): | scope | run24 | run25 | |---|---:|---:| | Driver.Packet | 917.4 | 1,073.7 | | Driver.Packet.dispatch | 303.0 | 351.3 | | Driver.Dispatch | 297.5 | 344.2 | | Driver.Packet.draw | 266.4 | 292.8 | | Driver.Draw | 265.3 | 291.6 | | Vulkan.Dispatch | 230.7 | 280.2 | | Vulkan.Dispatch.shader_resources | 224.1 | 273.0 | | **Resources.Complete** | **216.5** | **266.3** | | **Driver.Packet.device_lock** | **211.1** | **251.5** | | Driver.Draw.draw_enqueued | 142.6 | 156.4 | | Driver.Draw.shader_compile_and_link | 53.2 | - | | Driver.Packet.prepare_memory | 51.7 | 64.9 | Committer trace scopes (ms/frame): | scope | run24 | run25 | |---|---:|---:| | Graphics.Draw | 248.9 | 268.7 | | Graphics.Draw.draw_and_resource_release | 213.9 | 232.4 | | **GpuMutex.wait.draw** | **113.1** | **105.6** | | Resources.Complete | 64.4 | 64.9 | | Recorder.Submit | 41.2 | 55.5 | | GpuMutex.wait.label | 22.1 | 27.4 | | Resources.Prepare | 13.5 | 15.1 | ### Measured: worker sampler at stock (run26) `APS5_SAMPLE_WORKER` on queue worker 0x0, no trace, same pad schedule. Final window 22,952 samples; a 17,933-sample mid-run window was also taken. Worker busy 99.9%. | worker scope (inclusive) | final | mid2 | |---|---:|---:| | `ShaderResources::Complete` (via `VulkanDevice::dispatch`) | **24.1%** | 23.2% | | `DrawPipeline::Drain` | 18.6% | 18.4% | | `DrawPipeline::Enqueue` | 16.4% | 16.2% | | `ShaderResources::buildComplete` (via `Driver::draw`) | 13.6% | 12.8% | | `Recorder::finish` -> `CompletePendingCpuWrites` -> `UploadFinish` | 10.2% | 9.8% | | `ShaderResources::resolveImageBinding` | 10.0% | 9.6% | | `cachedStorageTexture` | 8.4% | 7.8% | | `GpuMutex::lock` | 7.0% | 6.4% | | `Recorder::SyncThrough` | 6.8% | 6.3% | | `VulkanDevice::Draw` | 5.1% | 4.9% | The sampler suspends the worker for each walk, so these are attribution numbers, not timing numbers. ### Diagnostic: low-settings profile (not a default-settings result) These runs intentionally lowered the in-game settings to make the committer the wall and inspect the producer path. They are diagnostic only and are not part of the default-settings claim above. - run22: ~2.15 FPS steady, rising to 3.4 FPS; readTarget 1,348.7 ms/10 s; resources 1,159.2 (bindings 512-588, upload 277-331); record 494.9; commits 32.6k at 114.1 us. - run23 (with the committer sampler PR): 25-26 presents/10 s plateau (3.4 FPS highs); readTarget 1,567.6 ms with 14,676 resident lookups, 292 of them >= 1 ms = 1,160.1 ms; resources 1,547.3 (bindings 1,064.0, upload 171.5, descriptors 45.1, other 266.2); record 427.5; 32,991 commits/10 s at 120.6 us; recorder sync waits 60.2 s total (pending write 38.6 s, other 25.5 s, idle 4.3 s); storage-image create 37.5 s cumulative. - Committer sampler on run23: 22,947 samples, 88.4% wait in `DrawPipeline::run` (12,616 + 7,659), `commitDraw` 6,284, `refreshResidentTarget` 2,412, `ShaderResources` ctor/buildComplete/resolveImageBinding 1,151/999/958, `fprintf` 1,323 (5.8% of samples). ### AI-generated analysis (separate from the measured data above) - The default frame is worker-bound, not GPU-bound and not a serial chain: the worker is 97.1/97.6% busy, the committer 44.2/43.3%, the GPU 45.1/41.0%, and 96.7-97.9% of the committer and 95.6-97.1% of the GPU busy time overlaps the worker. The worker's single thread sets the floor; the other two have headroom. - `Resources.Complete` (~24%), `device_lock` (~23%), and `draw_enqueued` (~16%) are the largest named worker costs. The committer's 29%/24% `GpuMutex.wait.draw` says the shared GpuMutex is a first-order contention point, not just a symptom. This profile supports the maintainer-directed prepare/record split (move the enqueue/prepare work to the committer with headroom) and GpuMutex sharding; a split alone that still serializes on the same lock would leave the wait in place. - The low-settings committer starvation is consistent with this: when the producer path is the wall, the committer waits; at default settings the worker still sets the frame while the committer runs concurrently. - I have a sampler check of the #6187+#6209 stack queued; I will report the result in that PR rather than duplicate the analysis here. ### Artifacts `gh` cannot attach files from the CLI, so I will add these in a follow-up drag-and-drop: - `swag-run26-worker.collapsed.txt` (worker sampler stacks, 22,952 samples) - `timeline-run24.txt`, `timeline-run25.txt` (per-frame overlap tables and scope lists) - `swag-run24-err.log`, `swag-run25-err.log` (full 360 s logs)
Sign in to join this conversation.
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#7947
No description provided.