perf(agc): queue occlusion counter dumps behind pipelined draws instead of draining #6501

Merged
Nesyth merged 4 commits from upstream-pr/6501 into main 2026-11-04 08:31:19 +00:00
Nesyth commented 2026-10-15 17:45:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-15T17:45:07Z.


What

With pipelined draws, queue 0 drains the draw pipeline before every occlusion counter dump (EVENT_WRITE event 0x39): it waits until the committer has recorded every queued draw, then records the dump itself. A title that wraps its draws in occlusion queries pays that wait hundreds of times per frame.

This change queues the dump as an ordered commit item, as labels and DMA stores already are, so the committer records it right after the draws before it and queue 0 moves on.

  • The item runs what the drained path runs: deferred labels first, then DumpSamplesOnGpu. When that refuses, the item idles the device under the GPU mutex (as commitDmaStore does, instead of the drain's unlocked wait) and writes the counters on the CPU.
  • The item declares the 248 bytes it writes, so a later packet that reads them waits for it as for any queued store.
  • Stays on the drain path: a predicated dump, a dump while deferred labels are pending, and a dump to memory that is not accessible. APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1 drains for every dump, as before.
  • A new [sync] counter shows how many dumps were queued.
  • With APS5_DRAW_PIPELINE=1 (#6946) a dump still drains the draw finisher before it is queued, as every packet outside the finisher's list does. Queueing it through the finisher, as labels are, is a follow-up.

Tested

Windows 11 Pro 10.0.22631, Ryzen 7 7800X3D, RX 7900 XTX, WinLibs GCC 15.2.0, Release, on main aeeaefad9.

  • New test tests/execution/PipelinedSampleDump.cpp. One DCB holds a DMA fill over the dump slots, a begin dump, a draw, an end dump, a second query with no draw in it, and a fill over the last slot. The end dump has to count the draw's samples and the empty query none, every slot has to show the ready bit over the first fill, and the last fill has to land on top; all four dumps have to go through the queue. agc_driver_pipelined_sample_dump_drained runs it with the switch set and requires the same values with no dump queued. Recording the dump at once instead of in order makes the test fail. The cases that stay on the drain path are not covered by a test.
  • ctest -V of the pipeline, label, finisher and occlusion query tests (agc_driver_(pipelined|finisher_label|same_queue_label|draw_pipeline_trace|unimported_label|alias_copy_label), agc_sample_dumps, agc_predication_tests, agc_instrumentation_query_size_tests) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (SDK 1.4.363.0), ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1: 28 of 28 pass with this change and 26 of 26 on main aeeaefad9, the two new tests being the difference. Neither log reports the layer missing or a VUID-. agc_driver_pipelined_sample_dump also passes 10 runs in a row, and 3 runs with APS5_DRAW_PIPELINE=1.
  • The wider ctest -R "agc|shader" run (603 of 606) is from the previous base fa9365ca7 and was not repeated on aeeaefad9.

Linux: not run.

Ready or Not (PPSA18605)

The station lobby after Continue, standing still, 3840x2160. main aeeaefad9 against aeeaefad9 with this commit, only libSceAgcDriver swapped, caches warm, APS5_TRACE_SECONDS=80:15 with APS5_TRACE_EVENTS=1048576 and APS5_NO_PAD_INPUT=1, no other APS5_TRACE_* or APS5_PROFILE_* switch, log not redirected, nothing dropped. The window is earlier than the 160:10 used for this scene before: main aeeaefad9 aborts here 60 to 130 s after the station loads, in both builds, with storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented (as in #7017).

Six captures in the order main, change, change, main, main, change; captures 1, 4 and 6 are reruns of runs that aborted before their window closed:

capture build presents / 15 s frame p50 / p90 / p99 (ms) GPU busy per present (ms)
1 main 68 220.7 / 251.4 / 274.4 112.9
2 change 62 244.4 / 263.5 / 275.6 120.2
3 change 77 189.1 / 223.1 / 240.5 111.7
4 main 76 190.8 / 230.9 / 244.5 112.1
5 main 95 148.4 / 194.4 / 218.7 106.8
6 change 62 238.5 / 265.3 / 311.1 106.5

Queue worker 0x0 is 99 % busy in every capture. The sessions of this scene land in states that differ more than the two builds do: capture 1 shows the colour cast, in capture 2 the committer takes 161 ms per frame against about 100 and queue 0 waits 101 ms per frame for it in pipeline_drain, in capture 5 draws take 53 ms per frame against about 85, and in capture 6 Resources.Complete takes 86 ms per frame. Captures 3 and 4 landed in the same state: 77 against 76 presents, frame p50 189.1 against 190.8 ms, the same GPU time. An earlier batch, run without APS5_NO_PAD_INPUT so that host input could reach the title, gave 77 and 77 presents with this change against 74 and 74 on main in that state. So in this scene the change is worth a few percent at most, within the spread between sessions; the title stays bound by queue 0.

Summary lines of captures 4 (main) and 3 (this change):

{"commit":"aeeaefad9861","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":363,"ms":15046.637},"presents":76,"frame_ms":{"p50":190.821,"p90":230.904,"p99":244.505,"max":244.505},"gpu_busy_ms_per_present":112.133,"worker_busy_pct":{"queue worker 0x0":99.202,"queue worker 0x28":55.432},"top_phases_ms_per_frame":{"Driver.Packet":295.301,"Graphics.Draw":100.898,"Driver.Packet.memory_wait":91.445,"Graphics.Draw.draw_and_resource_release":89.841,"Driver.Packet.draw":84.155,"Driver.Draw":83.850,"Driver.Packet.dispatch":81.076,"Driver.Dispatch":75.728},"trace_dropped":false,"trace":"aps5-trace-aeeaefad9861-15348.json.gz"}
{"commit":"63555394784d","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":397,"ms":15090.547},"presents":77,"frame_ms":{"p50":189.057,"p90":223.123,"p99":240.484,"max":240.484},"gpu_busy_ms_per_present":111.664,"worker_busy_pct":{"queue worker 0x0":99.170,"queue worker 0x28":54.908},"top_phases_ms_per_frame":{"Driver.Packet":298.305,"Graphics.Draw":100.024,"Driver.Packet.memory_wait":95.833,"Graphics.Draw.draw_and_resource_release":88.919,"Driver.Packet.draw":85.473,"Driver.Draw":85.141,"Driver.Packet.dispatch":73.550,"Driver.Dispatch":68.578},"trace_dropped":false,"trace":"aps5-trace-63555394784d-34412.json.gz"}

Traces:
aps5-trace-aeeaefad9861-15348.json.gz
aps5-trace-63555394784d-34412.json.gz

tools/trace_digest.py, capture 4 (main)

seconds 80:15 from present 363: 76 presents, frame p50 190.8 / p90 230.9 / p99 244.5 / max 244.5 ms, GPU busy 112.1 ms per present
AMD Radeon RX 7900 XTX, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.22631, 3840x2160, commit aeeaefad98, dropped: no

{"commit":"aeeaefad9861","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":363,"ms":15046.637},"presents":76,"frame_ms":{"p50":190.821,"p90":230.904,"p99":244.505,"max":244.505},"gpu_busy_ms_per_present":112.133,"worker_busy_pct":{"queue worker 0x0":99.202,"queue worker 0x28":55.432},"top_phases_ms_per_frame":{"Driver.Packet":295.301,"Graphics.Draw":100.898,"Driver.Packet.memory_wait":91.445,"Graphics.Draw.draw_and_resource_release":89.841,"Driver.Packet.draw":84.155,"Driver.Draw":83.85,"Driver.Packet.dispatch":81.076,"Driver.Dispatch":75.728},"trace_dropped":false,"trace":"aps5-trace-aeeaefad9861-15348.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 407: 244.5 ms at 8637 ms: Driver.Packet (queue worker 0x0) 224.8, Graphics.Draw (draw committer) 136.6, Driver.Packet (queue worker 0x28) 131.0, Graphics.Draw.draw_and_resource_release (draw committer) 126.8
  • present 386: 242.5 ms at 4486 ms: Driver.Packet (queue worker 0x0) 224.2, Driver.Packet (queue worker 0x28) 128.4, batch (gpu) 116.8, Driver.Packet.draw (queue worker 0x0) 108.1
  • present 365: 235.5 ms at 374 ms: Driver.Packet (queue worker 0x0) 217.3, Driver.Packet (queue worker 0x28) 122.2, batch (gpu) 116.7, Graphics.Draw (draw committer) 103.0
  • present 438: 233.6 ms at 14813 ms: Driver.Packet (queue worker 0x0) 213.0, batch (gpu) 120.7, Graphics.Draw (draw committer) 119.8, Graphics.Draw.draw_and_resource_release (draw committer) 110.1
  • present 428: 233.0 ms at 12786 ms: Driver.Packet (queue worker 0x0) 215.0, Graphics.Draw (draw committer) 118.4, Driver.Packet (queue worker 0x28) 113.2, batch (gpu) 113.2

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 162.1 (82 %) 18.2 (9 %) 17.7 85.5 Driver.Packet 179.8, Driver.EndSubmission 0.5
draw committer 91.9 (46 %) 2.4 (1 %) 103.7 22.7 Graphics.Draw 90.1, Recorder.Submit 1.7
presenter 1.7 (1 %) 8.1 (4 %) 188.2 0.1 VideoOut.Flip 9.7, Driver.Present 0.1
queue worker 0x28 3.4 (2 %) 194.4 (98 %) 0.2 0.6 Driver.Packet 99.2, Driver.EndSubmission 10.3
gpu 112.2 (57 %) 0.0 (0 %) 85.8 0.0 batch 112.2

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 279.0, batch 112.2, Graphics.Draw 96.1, Driver.Packet.memory_wait 91.4, Driver.WorkerWait 88.2, Driver.WorkerWait.dequeue_order 88.2, Graphics.Draw.draw_and_resource_release 86.2, Driver.Packet.dispatch 80.8, Driver.Packet.draw 79.9, Driver.Draw 79.6

Longest waits

  • Driver.WorkerWait (queue worker 0x28) 108.7 ms at 14937 ms, present 438
  • Driver.WorkerWait (queue worker 0x28) 106.1 ms at 6382 ms, present 395
  • Driver.WorkerWait (queue worker 0x28) 105.7 ms at 1896 ms, present 372
  • Driver.WorkerWait (queue worker 0x28) 105.5 ms at 11516 ms, present 421
  • Driver.WorkerWait (queue worker 0x28) 104.8 ms at 13880 ms, present 433
  • Driver.WorkerWait (queue worker 0x28) 104.4 ms at 4623 ms, present 386
  • Driver.WorkerWait (queue worker 0x28) 104.0 ms at 14300 ms, present 435
  • Driver.WorkerWait (queue worker 0x28) 103.9 ms at 8776 ms, present 407
  • Driver.WorkerWait (queue worker 0x28) 103.1 ms at 7382 ms, present 400
  • Driver.WorkerWait (queue worker 0x28) 102.7 ms at 916 ms, present 367

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

  • batch 4553: 33.2 ms at 9410 ms, present 410: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.5, Driver.Packet (queue worker 0x0) 7.4, Driver.Packet.dispatch (queue worker 0x0) 7.2, Driver.Dispatch (queue worker 0x0) 7.2
  • batch 653: 33.1 ms at 1369 ms, present 369: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.4, Driver.Packet (queue worker 0x0) 7.1, Driver.Packet.dispatch (queue worker 0x0) 6.9, Driver.Dispatch (queue worker 0x0) 6.9
  • batch 7227: 33.1 ms at 15006 ms, present 438: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.3, Driver.Packet (queue worker 0x0) 7.6, Driver.Packet.dispatch (queue worker 0x0) 7.4, Driver.Dispatch (queue worker 0x0) 7.4
  • batch 4645: 33.1 ms at 9597 ms, present 411: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.3, Driver.Packet (queue worker 0x0) 7.4, Driver.Packet.dispatch (queue worker 0x0) 7.2, Driver.Dispatch (queue worker 0x0) 7.2
  • batch 4738: 33.0 ms at 9789 ms, present 412: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.2, Driver.Packet (queue worker 0x0) 7.6, Driver.Packet.dispatch (queue worker 0x0) 7.3, Driver.Dispatch (queue worker 0x0) 7.3
tools/trace_digest.py, capture 3 (this change)

seconds 80:15 from present 397: 77 presents, frame p50 189.1 / p90 223.1 / p99 240.5 / max 240.5 ms, GPU busy 111.7 ms per present
AMD Radeon RX 7900 XTX, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.22631, 3840x2160, commit 6355539478, dropped: no

{"commit":"63555394784d","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":397,"ms":15090.547},"presents":77,"frame_ms":{"p50":189.057,"p90":223.123,"p99":240.484,"max":240.484},"gpu_busy_ms_per_present":111.664,"worker_busy_pct":{"queue worker 0x0":99.17,"queue worker 0x28":54.908},"top_phases_ms_per_frame":{"Driver.Packet":298.305,"Graphics.Draw":100.024,"Driver.Packet.memory_wait":95.833,"Graphics.Draw.draw_and_resource_release":88.919,"Driver.Packet.draw":85.473,"Driver.Draw":85.141,"Driver.Packet.dispatch":73.55,"Driver.Dispatch":68.578},"trace_dropped":false,"trace":"aps5-trace-63555394784d-34412.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 432: 240.5 ms at 6890 ms: Driver.Packet (queue worker 0x0) 224.2, Driver.Packet (queue worker 0x28) 137.7, batch (gpu) 113.7, Driver.Packet.draw (queue worker 0x0) 111.5
  • present 453: 235.9 ms at 10970 ms: Driver.Packet (queue worker 0x0) 219.9, Driver.Packet (queue worker 0x28) 137.9, batch (gpu) 111.9, Driver.Packet.draw (queue worker 0x0) 111.6
  • present 411: 235.5 ms at 2754 ms: Driver.Packet (queue worker 0x0) 219.7, Driver.Packet (queue worker 0x28) 123.1, Graphics.Draw (draw committer) 118.0, batch (gpu) 115.7
  • present 425: 233.3 ms at 5519 ms: Driver.Packet (queue worker 0x0) 218.1, Driver.Packet (queue worker 0x28) 120.4, batch (gpu) 118.6, Driver.WorkerWait (queue worker 0x28) 111.0
  • present 418: 230.4 ms at 4127 ms: Driver.Packet (queue worker 0x0) 215.1, Driver.Packet (queue worker 0x28) 128.6, Driver.Packet.memory_wait (queue worker 0x28) 122.6, batch (gpu) 122.5

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 155.0 (79 %) 25.4 (13 %) 15.6 79.5 Driver.Packet 180.0, Driver.EndSubmission 0.5
draw committer 91.2 (47 %) 2.9 (1 %) 101.9 22.7 Graphics.Draw 89.2, Recorder.Submit 1.9
title 0.0 (0 %) 0.0 (0 %) 195.9 0.0
presenter 1.7 (1 %) 1.7 (1 %) 192.6 0.1 VideoOut.Flip 3.4, Driver.Present 0.0
queue worker 0x28 4.8 (2 %) 190.8 (97 %) 0.4 0.6 Driver.Packet 104.3, Driver.EndSubmission 3.2
gpu 111.6 (57 %) 0.0 (0 %) 84.4 0.0 batch 111.6

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 284.2, batch 111.6, Driver.Packet.memory_wait 95.8, Graphics.Draw 95.3, Driver.WorkerWait 88.2, Driver.WorkerWait.dequeue_order 88.2, Graphics.Draw.draw_and_resource_release 85.2, Driver.Packet.draw 80.4, Driver.Draw 80.1, Driver.Packet.dispatch 73.3

Longest waits

  • Driver.WorkerWait (queue worker 0x28) 111.0 ms at 5630 ms, present 425
  • Driver.WorkerWait (queue worker 0x28) 106.3 ms at 14424 ms, present 470
  • Driver.WorkerWait (queue worker 0x28) 106.0 ms at 500 ms, present 399
  • Driver.WorkerWait (queue worker 0x28) 102.9 ms at 14209 ms, present 469
  • Driver.WorkerWait (queue worker 0x28) 102.8 ms at 12421 ms, present 460
  • Driver.WorkerWait (queue worker 0x28) 102.7 ms at 13789 ms, present 467
  • Driver.WorkerWait (queue worker 0x28) 101.9 ms at 1494 ms, present 404
  • Driver.WorkerWait (queue worker 0x28) 101.6 ms at 2277 ms, present 408
  • Driver.WorkerWait (queue worker 0x28) 101.3 ms at 9739 ms, present 446
  • Driver.WorkerWait (queue worker 0x28) 100.9 ms at 7019 ms, present 432

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

  • batch 2667: 34.0 ms at 5701 ms, present 425: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 34.0, Driver.Packet (queue worker 0x0) 9.2, Driver.Packet.dispatch (queue worker 0x0) 8.2, Driver.Dispatch (queue worker 0x0) 8.2
  • batch 5906: 33.0 ms at 12484 ms, present 460: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.2, Driver.Packet (queue worker 0x0) 7.5, Driver.Packet.dispatch (queue worker 0x0) 7.3, Driver.Dispatch (queue worker 0x0) 7.3
  • batch 1282: 33.0 ms at 2714 ms, present 410: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.2, Driver.Packet (queue worker 0x0) 7.2, Driver.Packet.dispatch (queue worker 0x0) 7.0, Driver.Dispatch (queue worker 0x0) 7.0
  • batch 5541: 32.9 ms at 11714 ms, present 456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.1, Driver.Packet (queue worker 0x0) 7.6, Driver.Packet.dispatch (queue worker 0x0) 7.4, Driver.Dispatch (queue worker 0x0) 7.4
  • batch 915: 32.9 ms at 1945 ms, present 406: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.1, Driver.Packet (queue worker 0x0) 7.8, Driver.Packet.dispatch (queue worker 0x0) 7.6, Driver.Dispatch (queue worker 0x0) 7.6

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
  • 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
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 7900 XTX, AMD Software Adrenalin 26.8.1 (driver 32.0.31041.1004), Windows 11 Pro 10.0.22631
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4877483299 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501). Originally posted by [Nesyth](https://github.com/Nesyth) on 2026-10-15T17:45:07Z. --- ### What With pipelined draws, queue 0 drains the draw pipeline before every occlusion counter dump (`EVENT_WRITE` event 0x39): it waits until the committer has recorded every queued draw, then records the dump itself. A title that wraps its draws in occlusion queries pays that wait hundreds of times per frame. This change queues the dump as an ordered commit item, as labels and DMA stores already are, so the committer records it right after the draws before it and queue 0 moves on. - The item runs what the drained path runs: deferred labels first, then `DumpSamplesOnGpu`. When that refuses, the item idles the device under the GPU mutex (as `commitDmaStore` does, instead of the drain's unlocked wait) and writes the counters on the CPU. - The item declares the 248 bytes it writes, so a later packet that reads them waits for it as for any queued store. - Stays on the drain path: a predicated dump, a dump while deferred labels are pending, and a dump to memory that is not accessible. `APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1` drains for every dump, as before. - A new `[sync]` counter shows how many dumps were queued. - With `APS5_DRAW_PIPELINE=1` (#6946) a dump still drains the draw finisher before it is queued, as every packet outside the finisher's list does. Queueing it through the finisher, as labels are, is a follow-up. ### Tested Windows 11 Pro 10.0.22631, Ryzen 7 7800X3D, RX 7900 XTX, WinLibs GCC 15.2.0, Release, on `main` aeeaefad9. - New test `tests/execution/PipelinedSampleDump.cpp`. One DCB holds a DMA fill over the dump slots, a begin dump, a draw, an end dump, a second query with no draw in it, and a fill over the last slot. The end dump has to count the draw's samples and the empty query none, every slot has to show the ready bit over the first fill, and the last fill has to land on top; all four dumps have to go through the queue. `agc_driver_pipelined_sample_dump_drained` runs it with the switch set and requires the same values with no dump queued. Recording the dump at once instead of in order makes the test fail. The cases that stay on the drain path are not covered by a test. - `ctest -V` of the pipeline, label, finisher and occlusion query tests (`agc_driver_(pipelined|finisher_label|same_queue_label|draw_pipeline_trace|unimported_label|alias_copy_label)`, `agc_sample_dumps`, `agc_predication_tests`, `agc_instrumentation_query_size_tests`) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (SDK 1.4.363.0), `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`: 28 of 28 pass with this change and 26 of 26 on `main` aeeaefad9, the two new tests being the difference. Neither log reports the layer missing or a `VUID-`. `agc_driver_pipelined_sample_dump` also passes 10 runs in a row, and 3 runs with `APS5_DRAW_PIPELINE=1`. - The wider `ctest -R "agc|shader"` run (603 of 606) is from the previous base fa9365ca7 and was not repeated on aeeaefad9. Linux: not run. ### Ready or Not (PPSA18605) The station lobby after Continue, standing still, 3840x2160. `main` aeeaefad9 against aeeaefad9 with this commit, only `libSceAgcDriver` swapped, caches warm, `APS5_TRACE_SECONDS=80:15` with `APS5_TRACE_EVENTS=1048576` and `APS5_NO_PAD_INPUT=1`, no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch, log not redirected, nothing dropped. The window is earlier than the 160:10 used for this scene before: `main` aeeaefad9 aborts here 60 to 130 s after the station loads, in both builds, with `storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented` (as in #7017). Six captures in the order `main`, change, change, `main`, `main`, change; captures 1, 4 and 6 are reruns of runs that aborted before their window closed: | capture | build | presents / 15 s | frame p50 / p90 / p99 (ms) | GPU busy per present (ms) | |---|---|---:|---|---:| | 1 | `main` | 68 | 220.7 / 251.4 / 274.4 | 112.9 | | 2 | change | 62 | 244.4 / 263.5 / 275.6 | 120.2 | | 3 | change | 77 | 189.1 / 223.1 / 240.5 | 111.7 | | 4 | `main` | 76 | 190.8 / 230.9 / 244.5 | 112.1 | | 5 | `main` | 95 | 148.4 / 194.4 / 218.7 | 106.8 | | 6 | change | 62 | 238.5 / 265.3 / 311.1 | 106.5 | Queue worker 0x0 is 99 % busy in every capture. The sessions of this scene land in states that differ more than the two builds do: capture 1 shows the colour cast, in capture 2 the committer takes 161 ms per frame against about 100 and queue 0 waits 101 ms per frame for it in `pipeline_drain`, in capture 5 draws take 53 ms per frame against about 85, and in capture 6 `Resources.Complete` takes 86 ms per frame. Captures 3 and 4 landed in the same state: 77 against 76 presents, frame p50 189.1 against 190.8 ms, the same GPU time. An earlier batch, run without `APS5_NO_PAD_INPUT` so that host input could reach the title, gave 77 and 77 presents with this change against 74 and 74 on `main` in that state. So in this scene the change is worth a few percent at most, within the spread between sessions; the title stays bound by queue 0. Summary lines of captures 4 (`main`) and 3 (this change): ```json {"commit":"aeeaefad9861","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":363,"ms":15046.637},"presents":76,"frame_ms":{"p50":190.821,"p90":230.904,"p99":244.505,"max":244.505},"gpu_busy_ms_per_present":112.133,"worker_busy_pct":{"queue worker 0x0":99.202,"queue worker 0x28":55.432},"top_phases_ms_per_frame":{"Driver.Packet":295.301,"Graphics.Draw":100.898,"Driver.Packet.memory_wait":91.445,"Graphics.Draw.draw_and_resource_release":89.841,"Driver.Packet.draw":84.155,"Driver.Draw":83.850,"Driver.Packet.dispatch":81.076,"Driver.Dispatch":75.728},"trace_dropped":false,"trace":"aps5-trace-aeeaefad9861-15348.json.gz"} {"commit":"63555394784d","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":397,"ms":15090.547},"presents":77,"frame_ms":{"p50":189.057,"p90":223.123,"p99":240.484,"max":240.484},"gpu_busy_ms_per_present":111.664,"worker_busy_pct":{"queue worker 0x0":99.170,"queue worker 0x28":54.908},"top_phases_ms_per_frame":{"Driver.Packet":298.305,"Graphics.Draw":100.024,"Driver.Packet.memory_wait":95.833,"Graphics.Draw.draw_and_resource_release":88.919,"Driver.Packet.draw":85.473,"Driver.Draw":85.141,"Driver.Packet.dispatch":73.550,"Driver.Dispatch":68.578},"trace_dropped":false,"trace":"aps5-trace-63555394784d-34412.json.gz"} ``` Traces: [aps5-trace-aeeaefad9861-15348.json.gz](https://github.com/user-attachments/files/33911264/aps5-trace-aeeaefad9861-15348.json.gz) [aps5-trace-63555394784d-34412.json.gz](https://github.com/user-attachments/files/33911250/aps5-trace-63555394784d-34412.json.gz) <details><summary><code>tools/trace_digest.py</code>, capture 4 (<code>main</code>)</summary> **seconds 80:15** from present 363: 76 presents, frame p50 190.8 / p90 230.9 / p99 244.5 / max 244.5 ms, GPU busy 112.1 ms per present AMD Radeon RX 7900 XTX, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.22631, 3840x2160, commit aeeaefad9861, dropped: no ```json {"commit":"aeeaefad9861","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":363,"ms":15046.637},"presents":76,"frame_ms":{"p50":190.821,"p90":230.904,"p99":244.505,"max":244.505},"gpu_busy_ms_per_present":112.133,"worker_busy_pct":{"queue worker 0x0":99.202,"queue worker 0x28":55.432},"top_phases_ms_per_frame":{"Driver.Packet":295.301,"Graphics.Draw":100.898,"Driver.Packet.memory_wait":91.445,"Graphics.Draw.draw_and_resource_release":89.841,"Driver.Packet.draw":84.155,"Driver.Draw":83.85,"Driver.Packet.dispatch":81.076,"Driver.Dispatch":75.728},"trace_dropped":false,"trace":"aps5-trace-aeeaefad9861-15348.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 407: 244.5 ms at 8637 ms: Driver.Packet (queue worker 0x0) 224.8, Graphics.Draw (draw committer) 136.6, Driver.Packet (queue worker 0x28) 131.0, Graphics.Draw.draw_and_resource_release (draw committer) 126.8 - present 386: 242.5 ms at 4486 ms: Driver.Packet (queue worker 0x0) 224.2, Driver.Packet (queue worker 0x28) 128.4, batch (gpu) 116.8, Driver.Packet.draw (queue worker 0x0) 108.1 - present 365: 235.5 ms at 374 ms: Driver.Packet (queue worker 0x0) 217.3, Driver.Packet (queue worker 0x28) 122.2, batch (gpu) 116.7, Graphics.Draw (draw committer) 103.0 - present 438: 233.6 ms at 14813 ms: Driver.Packet (queue worker 0x0) 213.0, batch (gpu) 120.7, Graphics.Draw (draw committer) 119.8, Graphics.Draw.draw_and_resource_release (draw committer) 110.1 - present 428: 233.0 ms at 12786 ms: Driver.Packet (queue worker 0x0) 215.0, Graphics.Draw (draw committer) 118.4, Driver.Packet (queue worker 0x28) 113.2, batch (gpu) 113.2 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 162.1 (82 %) | 18.2 (9 %) | 17.7 | 85.5 | Driver.Packet 179.8, Driver.EndSubmission 0.5 | | draw committer | 91.9 (46 %) | 2.4 (1 %) | 103.7 | 22.7 | Graphics.Draw 90.1, Recorder.Submit 1.7 | | presenter | 1.7 (1 %) | 8.1 (4 %) | 188.2 | 0.1 | VideoOut.Flip 9.7, Driver.Present 0.1 | | queue worker 0x28 | 3.4 (2 %) | 194.4 (98 %) | 0.2 | 0.6 | Driver.Packet 99.2, Driver.EndSubmission 10.3 | | gpu | 112.2 (57 %) | 0.0 (0 %) | 85.8 | 0.0 | batch 112.2 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 279.0, batch 112.2, Graphics.Draw 96.1, Driver.Packet.memory_wait 91.4, Driver.WorkerWait 88.2, Driver.WorkerWait.dequeue_order 88.2, Graphics.Draw.draw_and_resource_release 86.2, Driver.Packet.dispatch 80.8, Driver.Packet.draw 79.9, Driver.Draw 79.6 **Longest waits** - Driver.WorkerWait (queue worker 0x28) 108.7 ms at 14937 ms, present 438 - Driver.WorkerWait (queue worker 0x28) 106.1 ms at 6382 ms, present 395 - Driver.WorkerWait (queue worker 0x28) 105.7 ms at 1896 ms, present 372 - Driver.WorkerWait (queue worker 0x28) 105.5 ms at 11516 ms, present 421 - Driver.WorkerWait (queue worker 0x28) 104.8 ms at 13880 ms, present 433 - Driver.WorkerWait (queue worker 0x28) 104.4 ms at 4623 ms, present 386 - Driver.WorkerWait (queue worker 0x28) 104.0 ms at 14300 ms, present 435 - Driver.WorkerWait (queue worker 0x28) 103.9 ms at 8776 ms, present 407 - Driver.WorkerWait (queue worker 0x28) 103.1 ms at 7382 ms, present 400 - Driver.WorkerWait (queue worker 0x28) 102.7 ms at 916 ms, present 367 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 4553: 33.2 ms at 9410 ms, present 410: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.5, Driver.Packet (queue worker 0x0) 7.4, Driver.Packet.dispatch (queue worker 0x0) 7.2, Driver.Dispatch (queue worker 0x0) 7.2 - batch 653: 33.1 ms at 1369 ms, present 369: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.4, Driver.Packet (queue worker 0x0) 7.1, Driver.Packet.dispatch (queue worker 0x0) 6.9, Driver.Dispatch (queue worker 0x0) 6.9 - batch 7227: 33.1 ms at 15006 ms, present 438: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.3, Driver.Packet (queue worker 0x0) 7.6, Driver.Packet.dispatch (queue worker 0x0) 7.4, Driver.Dispatch (queue worker 0x0) 7.4 - batch 4645: 33.1 ms at 9597 ms, present 411: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.3, Driver.Packet (queue worker 0x0) 7.4, Driver.Packet.dispatch (queue worker 0x0) 7.2, Driver.Dispatch (queue worker 0x0) 7.2 - batch 4738: 33.0 ms at 9789 ms, present 412: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.2, Driver.Packet (queue worker 0x0) 7.6, Driver.Packet.dispatch (queue worker 0x0) 7.3, Driver.Dispatch (queue worker 0x0) 7.3 </details> <details><summary><code>tools/trace_digest.py</code>, capture 3 (this change)</summary> **seconds 80:15** from present 397: 77 presents, frame p50 189.1 / p90 223.1 / p99 240.5 / max 240.5 ms, GPU busy 111.7 ms per present AMD Radeon RX 7900 XTX, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.22631, 3840x2160, commit 63555394784d, dropped: no ```json {"commit":"63555394784d","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"80:15"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.22631","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32373,"title_id":"PPSA18605","title":"Ready or Not","content_version":"01.001.008","resolution":"3840x2160","window":{"spec":"seconds 80:15","first_present":397,"ms":15090.547},"presents":77,"frame_ms":{"p50":189.057,"p90":223.123,"p99":240.484,"max":240.484},"gpu_busy_ms_per_present":111.664,"worker_busy_pct":{"queue worker 0x0":99.17,"queue worker 0x28":54.908},"top_phases_ms_per_frame":{"Driver.Packet":298.305,"Graphics.Draw":100.024,"Driver.Packet.memory_wait":95.833,"Graphics.Draw.draw_and_resource_release":88.919,"Driver.Packet.draw":85.473,"Driver.Draw":85.141,"Driver.Packet.dispatch":73.55,"Driver.Dispatch":68.578},"trace_dropped":false,"trace":"aps5-trace-63555394784d-34412.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 432: 240.5 ms at 6890 ms: Driver.Packet (queue worker 0x0) 224.2, Driver.Packet (queue worker 0x28) 137.7, batch (gpu) 113.7, Driver.Packet.draw (queue worker 0x0) 111.5 - present 453: 235.9 ms at 10970 ms: Driver.Packet (queue worker 0x0) 219.9, Driver.Packet (queue worker 0x28) 137.9, batch (gpu) 111.9, Driver.Packet.draw (queue worker 0x0) 111.6 - present 411: 235.5 ms at 2754 ms: Driver.Packet (queue worker 0x0) 219.7, Driver.Packet (queue worker 0x28) 123.1, Graphics.Draw (draw committer) 118.0, batch (gpu) 115.7 - present 425: 233.3 ms at 5519 ms: Driver.Packet (queue worker 0x0) 218.1, Driver.Packet (queue worker 0x28) 120.4, batch (gpu) 118.6, Driver.WorkerWait (queue worker 0x28) 111.0 - present 418: 230.4 ms at 4127 ms: Driver.Packet (queue worker 0x0) 215.1, Driver.Packet (queue worker 0x28) 128.6, Driver.Packet.memory_wait (queue worker 0x28) 122.6, batch (gpu) 122.5 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 155.0 (79 %) | 25.4 (13 %) | 15.6 | 79.5 | Driver.Packet 180.0, Driver.EndSubmission 0.5 | | draw committer | 91.2 (47 %) | 2.9 (1 %) | 101.9 | 22.7 | Graphics.Draw 89.2, Recorder.Submit 1.9 | | title | 0.0 (0 %) | 0.0 (0 %) | 195.9 | 0.0 | | | presenter | 1.7 (1 %) | 1.7 (1 %) | 192.6 | 0.1 | VideoOut.Flip 3.4, Driver.Present 0.0 | | queue worker 0x28 | 4.8 (2 %) | 190.8 (97 %) | 0.4 | 0.6 | Driver.Packet 104.3, Driver.EndSubmission 3.2 | | gpu | 111.6 (57 %) | 0.0 (0 %) | 84.4 | 0.0 | batch 111.6 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 284.2, batch 111.6, Driver.Packet.memory_wait 95.8, Graphics.Draw 95.3, Driver.WorkerWait 88.2, Driver.WorkerWait.dequeue_order 88.2, Graphics.Draw.draw_and_resource_release 85.2, Driver.Packet.draw 80.4, Driver.Draw 80.1, Driver.Packet.dispatch 73.3 **Longest waits** - Driver.WorkerWait (queue worker 0x28) 111.0 ms at 5630 ms, present 425 - Driver.WorkerWait (queue worker 0x28) 106.3 ms at 14424 ms, present 470 - Driver.WorkerWait (queue worker 0x28) 106.0 ms at 500 ms, present 399 - Driver.WorkerWait (queue worker 0x28) 102.9 ms at 14209 ms, present 469 - Driver.WorkerWait (queue worker 0x28) 102.8 ms at 12421 ms, present 460 - Driver.WorkerWait (queue worker 0x28) 102.7 ms at 13789 ms, present 467 - Driver.WorkerWait (queue worker 0x28) 101.9 ms at 1494 ms, present 404 - Driver.WorkerWait (queue worker 0x28) 101.6 ms at 2277 ms, present 408 - Driver.WorkerWait (queue worker 0x28) 101.3 ms at 9739 ms, present 446 - Driver.WorkerWait (queue worker 0x28) 100.9 ms at 7019 ms, present 432 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 2667: 34.0 ms at 5701 ms, present 425: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 34.0, Driver.Packet (queue worker 0x0) 9.2, Driver.Packet.dispatch (queue worker 0x0) 8.2, Driver.Dispatch (queue worker 0x0) 8.2 - batch 5906: 33.0 ms at 12484 ms, present 460: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.2, Driver.Packet (queue worker 0x0) 7.5, Driver.Packet.dispatch (queue worker 0x0) 7.3, Driver.Dispatch (queue worker 0x0) 7.3 - batch 1282: 33.0 ms at 2714 ms, present 410: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.2, Driver.Packet (queue worker 0x0) 7.2, Driver.Packet.dispatch (queue worker 0x0) 7.0, Driver.Dispatch (queue worker 0x0) 7.0 - batch 5541: 32.9 ms at 11714 ms, present 456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.1, Driver.Packet (queue worker 0x0) 7.6, Driver.Packet.dispatch (queue worker 0x0) 7.4, Driver.Dispatch (queue worker 0x0) 7.4 - batch 915: 32.9 ms at 1945 ms, present 406: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 33.1, Driver.Packet (queue worker 0x0) 7.8, Driver.Packet.dispatch (queue worker 0x0) 7.6, Driver.Dispatch (queue worker 0x0) 7.6 </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) - [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] Unblocks: none - [x] GPUs tested: AMD Radeon RX 7900 XTX, AMD Software Adrenalin 26.8.1 (driver 32.0.31041.1004), Windows 11 Pro 10.0.22631 - [x] AI-assisted: yes
Pacuka commented 2026-10-18 12:18:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pacuka on 2026-10-18T12:18:33Z.


Linux data point (the PR says Linux was not run): The Smurfs - Dreams (PPSA21607, Unreal Engine), CachyOS, RX 6650 XT / RADV Mesa 26.2.4, main 9f25d0bf5 + this PR + #6208 (APS5_PIPELINE_DMA=1) + unrelated local rendering fixes. Same spot in the Smurfs' Village, standing still, APS5_PROFILE_DRAW=1, A/B with APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1:

  • Drained: 14.5k packet drains per 10 s (3.6 s), 7.7k of them EVENT_WRITE (0x46); 79–81 presents per 10 s.
  • This PR: 6.7k drains (3.3–3.4 s), no EVENT_WRITE drains left; 75–78 presents per 10 s.

So it works here: no rendering differences, no aborts, and every dump drain is gone. There is no frame-rate win in this title, though. The draw pipeline is committer-bound (~110k commits per 10 s at ~79 us each), and the remaining drains (DISPATCH_DIRECT x3.8k, WAIT_REG_MEM x2.2k) wait for the same committer. The GPU is busy ~42 ms and idle ~85 ms per frame.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6249825352 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6249825352). Originally posted by [Pacuka](https://github.com/Pacuka) on 2026-10-18T12:18:33Z. --- Linux data point (the PR says Linux was not run): The Smurfs - Dreams (PPSA21607, Unreal Engine), CachyOS, RX 6650 XT / RADV Mesa 26.2.4, main 9f25d0bf5 + this PR + #6208 (`APS5_PIPELINE_DMA=1`) + unrelated local rendering fixes. Same spot in the Smurfs' Village, standing still, `APS5_PROFILE_DRAW=1`, A/B with `APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1`: - Drained: 14.5k packet drains per 10 s (3.6 s), 7.7k of them `EVENT_WRITE` (0x46); 79–81 presents per 10 s. - This PR: 6.7k drains (3.3–3.4 s), no `EVENT_WRITE` drains left; 75–78 presents per 10 s. So it works here: no rendering differences, no aborts, and every dump drain is gone. There is no frame-rate win in this title, though. The draw pipeline is committer-bound (~110k commits per 10 s at ~79 us each), and the remaining drains (`DISPATCH_DIRECT` x3.8k, `WAIT_REG_MEM` x2.2k) wait for the same committer. The GPU is busy ~42 ms and idle ~85 ms per frame. AI-assisted (Claude Code).
teepean commented 2026-10-18 21:45:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by teepean on 2026-10-18T21:45:58Z.


@Nesyth a Linux and NVIDIA data point, from a title that wraps most of its draws in occlusion queries: Stray (PPSA02100, Unreal Engine 4) at the same save, standing still. Linux 7.2 (CachyOS, scx_lavd scheduler), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), GCC 16.2.1, Release, 3840x2160; main 864729dc0 with and without this PR (327a2bb7f), stock settings, one run at a time, alternating.

With APS5_PROFILE_DRAW=1, one run each, mean of the last 8 windows of 10 s:

0x46 drains / 10 s all packet drains / 10 s (wait) commits / 10 s, µs each on the committer
main 117,776 125,500 (1,713 ms) 370k, 18.1
this PR 0 8,085 (697 ms) 503k, 14.8

Frame p50 from trace summaries (APS5_TRACE_SECONDS=185:20, no other variables): main 170.5, 172.6, 165.0 and 171.2 ms; this PR 167.8, 171.1 and 157.7 ms. A fourth run of this PR hit the #5372 import race (about 1 fps for the whole window) and is left out. The profiled pair above: 168.4 and 155.3 ms.

So queue 0 no longer drains for the dumps, and its drain wait falls by about 1 s per 10 s, but the frame time falls by less than that (about 2.5 %, within the spread between runs). In this scene queue worker 0 is about 97 % busy and the committer, which now also records the dumps, goes from about 67 to 74 % busy, so the two threads still pace each other. I didn't compare frame dumps for this PR.

With #6946 on top, the queued dumps drain that PR's draw finisher instead, because its keepsDrawPipeline still treats 0x46 sample dumps as drains. The numbers are on #6946: https://github.com/boykopovar/AnyPS5/pull/6946#issuecomment-6255512105

AI-assisted: yes (analysis and text with Claude Code; the runs are from my machine).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255533973 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6255533973). Originally posted by [teepean](https://github.com/teepean) on 2026-10-18T21:45:58Z. --- @Nesyth a Linux and NVIDIA data point, from a title that wraps most of its draws in occlusion queries: Stray (PPSA02100, Unreal Engine 4) at the same save, standing still. Linux 7.2 (CachyOS, scx_lavd scheduler), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), GCC 16.2.1, Release, 3840x2160; `main` 864729dc0 with and without this PR (327a2bb7f), stock settings, one run at a time, alternating. With `APS5_PROFILE_DRAW=1`, one run each, mean of the last 8 windows of 10 s: | | 0x46 drains / 10 s | all packet drains / 10 s (wait) | commits / 10 s, µs each on the committer | |---|---|---|---| | `main` | 117,776 | 125,500 (1,713 ms) | 370k, 18.1 | | this PR | 0 | 8,085 (697 ms) | 503k, 14.8 | Frame p50 from trace summaries (`APS5_TRACE_SECONDS=185:20`, no other variables): `main` 170.5, 172.6, 165.0 and 171.2 ms; this PR 167.8, 171.1 and 157.7 ms. A fourth run of this PR hit the #5372 import race (about 1 fps for the whole window) and is left out. The profiled pair above: 168.4 and 155.3 ms. So queue 0 no longer drains for the dumps, and its drain wait falls by about 1 s per 10 s, but the frame time falls by less than that (about 2.5 %, within the spread between runs). In this scene queue worker 0 is about 97 % busy and the committer, which now also records the dumps, goes from about 67 to 74 % busy, so the two threads still pace each other. I didn't compare frame dumps for this PR. With #6946 on top, the queued dumps drain that PR's draw finisher instead, because its `keepsDrawPipeline` still treats 0x46 sample dumps as drains. The numbers are on #6946: https://github.com/boykopovar/AnyPS5/pull/6946#issuecomment-6255512105 AI-assisted: yes (analysis and text with Claude Code; the runs are from my machine).
JJenkx commented 2026-10-19 03:06:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T03:06:45Z.


Linux validation of #6501 at 327a2bb7f7ed36b3d2d02d1221a72ece2bad4918, integrated into a local Crimson Spires composition based on main c8e3fcb703852e0b256f708fdf47360ee895625a (also includes existing title prerequisites and #6616). This is not a clean main-versus-PR comparison.

Both agc_driver_pipelined_sample_dump variants pass without skips on RX 6650 XT/RADV and lavapipe (2/2 per driver). Two warm native runs also reach the first driving/dialogue scene and close normally. Their sampled screenshots show no obvious new rendering issue; this does not establish full gameplay correctness.

Same compiled integration 328ecb92f21f885e706ebf7f3f57b1163569c07f, 3840×2160 internal rendering, same scripted input, official 20-second trace at 90 seconds after first present. A sets APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1; B leaves it unset. Linux 7.2.9, RADV Mesa 26.2.4, RX 6650 XT. No trace events dropped.

Measurement A: drained B: queued
Presents 173 184
Capture (ms) 20026.672 20036.923
Frame p50 (ms) 83.907 84.684
Frame p90 (ms) 287.949 239.905
Frame p99 (ms) 337.433 282.557
GPU busy per present (ms) 83.393 84.089

One sequential pair only: median and GPU time are essentially unchanged, with lower tail times in B. This is exploratory evidence, not a repeatable FPS improvement claim. Screenshots have the same dialogue/scene, but the animated road/camera are not frame-identical. Windows and other titles were not tested here.

Official trace_digest summary records
{"commit": "328ecb92f21f", "dirty": false, "env": {"APS5_DRAW_CACHE_ENTRIES": "4096", "APS5_HOST_IMPORT_MIB": "16384", "APS5_PAD_INPUT_FILE": "<path>", "APS5_PIPELINED_DRAWS": "1", "APS5_PIPELINE_DRAIN_SAMPLE_DUMPS": "1", "APS5_PLAYGO_UNLISTED_CHUNKS": "installed", "APS5_TRACE_EVENTS": "524288", "APS5_TRACE_SECONDS": "90:20"}, "gpu": "AMD Radeon RX 6650 XT (RADV NAVI23)", "driver": "radv Mesa 26.2.4-arch1.1", "os": "Linux 7.2.9-arch1-1", "resolution": "3840x2160", "window": {"spec": "seconds 90:20", "first_present": 1443, "ms": 20026.672}, "presents": 173, "frame_ms": {"p50": 83.907, "p90": 287.949, "p99": 337.433, "max": 338.387}, "gpu_busy_ms_per_present": 83.393, "worker_busy_pct": {"queue worker 0x0": 95.946, "queue worker 0x20": 80.474}, "top_phases_ms_per_frame": {"Driver.Packet": 203.751, "Driver.Packet.memory_wait": 88.588, "Driver.Packet.prepare_memory": 45.645, "Graphics.Draw": 44.02, "Graphics.Draw.draw_and_resource_release": 41.747, "Driver.Packet.device_lock": 29.938, "Driver.Packet.draw": 25.95, "Driver.Draw": 25.805}, "trace_dropped": false, "trace": "aps5-trace-328ecb92f21f-3903990.json.gz"}
{"commit": "328ecb92f21f", "dirty": false, "env": {"APS5_DRAW_CACHE_ENTRIES": "4096", "APS5_HOST_IMPORT_MIB": "16384", "APS5_PAD_INPUT_FILE": "<path>", "APS5_PIPELINED_DRAWS": "1", "APS5_PLAYGO_UNLISTED_CHUNKS": "installed", "APS5_TRACE_EVENTS": "524288", "APS5_TRACE_SECONDS": "90:20"}, "gpu": "AMD Radeon RX 6650 XT (RADV NAVI23)", "driver": "radv Mesa 26.2.4-arch1.1", "os": "Linux 7.2.9-arch1-1", "resolution": "3840x2160", "window": {"spec": "seconds 90:20", "first_present": 1207, "ms": 20036.923}, "presents": 184, "frame_ms": {"p50": 84.684, "p90": 239.905, "p99": 282.557, "max": 295.386}, "gpu_busy_ms_per_present": 84.089, "worker_busy_pct": {"queue worker 0x0": 95.924, "queue worker 0x20": 86.563}, "top_phases_ms_per_frame": {"Driver.Packet": 198.278, "Driver.Packet.memory_wait": 88.679, "Driver.Packet.prepare_memory": 45.905, "Graphics.Draw": 36.954, "Graphics.Draw.draw_and_resource_release": 34.672, "Driver.Packet.device_lock": 24.974, "Driver.Packet.draw": 23.21, "Driver.Draw": 23.063}, "trace_dropped": false, "trace": "aps5-trace-328ecb92f21f-3948830.json.gz"}

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6258767333 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6258767333). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-19T03:06:45Z. --- Linux validation of #6501 at `327a2bb7f7ed36b3d2d02d1221a72ece2bad4918`, integrated into a local Crimson Spires composition based on main `c8e3fcb703852e0b256f708fdf47360ee895625a` (also includes existing title prerequisites and #6616). This is not a clean main-versus-PR comparison. Both `agc_driver_pipelined_sample_dump` variants pass without skips on RX 6650 XT/RADV and lavapipe (2/2 per driver). Two warm native runs also reach the first driving/dialogue scene and close normally. Their sampled screenshots show no obvious new rendering issue; this does not establish full gameplay correctness. Same compiled integration `328ecb92f21f885e706ebf7f3f57b1163569c07f`, 3840×2160 internal rendering, same scripted input, official 20-second trace at 90 seconds after first present. A sets `APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1`; B leaves it unset. Linux 7.2.9, RADV Mesa 26.2.4, RX 6650 XT. No trace events dropped. | Measurement | A: drained | B: queued | |---|---:|---:| | Presents | 173 | 184 | | Capture (ms) | 20026.672 | 20036.923 | | Frame p50 (ms) | 83.907 | 84.684 | | Frame p90 (ms) | 287.949 | 239.905 | | Frame p99 (ms) | 337.433 | 282.557 | | GPU busy per present (ms) | 83.393 | 84.089 | One sequential pair only: median and GPU time are essentially unchanged, with lower tail times in B. This is exploratory evidence, not a repeatable FPS improvement claim. Screenshots have the same dialogue/scene, but the animated road/camera are not frame-identical. Windows and other titles were not tested here. <details><summary>Official trace_digest summary records</summary> ```json {"commit": "328ecb92f21f", "dirty": false, "env": {"APS5_DRAW_CACHE_ENTRIES": "4096", "APS5_HOST_IMPORT_MIB": "16384", "APS5_PAD_INPUT_FILE": "<path>", "APS5_PIPELINED_DRAWS": "1", "APS5_PIPELINE_DRAIN_SAMPLE_DUMPS": "1", "APS5_PLAYGO_UNLISTED_CHUNKS": "installed", "APS5_TRACE_EVENTS": "524288", "APS5_TRACE_SECONDS": "90:20"}, "gpu": "AMD Radeon RX 6650 XT (RADV NAVI23)", "driver": "radv Mesa 26.2.4-arch1.1", "os": "Linux 7.2.9-arch1-1", "resolution": "3840x2160", "window": {"spec": "seconds 90:20", "first_present": 1443, "ms": 20026.672}, "presents": 173, "frame_ms": {"p50": 83.907, "p90": 287.949, "p99": 337.433, "max": 338.387}, "gpu_busy_ms_per_present": 83.393, "worker_busy_pct": {"queue worker 0x0": 95.946, "queue worker 0x20": 80.474}, "top_phases_ms_per_frame": {"Driver.Packet": 203.751, "Driver.Packet.memory_wait": 88.588, "Driver.Packet.prepare_memory": 45.645, "Graphics.Draw": 44.02, "Graphics.Draw.draw_and_resource_release": 41.747, "Driver.Packet.device_lock": 29.938, "Driver.Packet.draw": 25.95, "Driver.Draw": 25.805}, "trace_dropped": false, "trace": "aps5-trace-328ecb92f21f-3903990.json.gz"} {"commit": "328ecb92f21f", "dirty": false, "env": {"APS5_DRAW_CACHE_ENTRIES": "4096", "APS5_HOST_IMPORT_MIB": "16384", "APS5_PAD_INPUT_FILE": "<path>", "APS5_PIPELINED_DRAWS": "1", "APS5_PLAYGO_UNLISTED_CHUNKS": "installed", "APS5_TRACE_EVENTS": "524288", "APS5_TRACE_SECONDS": "90:20"}, "gpu": "AMD Radeon RX 6650 XT (RADV NAVI23)", "driver": "radv Mesa 26.2.4-arch1.1", "os": "Linux 7.2.9-arch1-1", "resolution": "3840x2160", "window": {"spec": "seconds 90:20", "first_present": 1207, "ms": 20036.923}, "presents": 184, "frame_ms": {"p50": 84.684, "p90": 239.905, "p99": 282.557, "max": 295.386}, "gpu_busy_ms_per_present": 84.089, "worker_busy_pct": {"queue worker 0x0": 95.924, "queue worker 0x20": 86.563}, "top_phases_ms_per_frame": {"Driver.Packet": 198.278, "Driver.Packet.memory_wait": 88.679, "Driver.Packet.prepare_memory": 45.905, "Graphics.Draw": 36.954, "Graphics.Draw.draw_and_resource_release": 34.672, "Driver.Packet.device_lock": 24.974, "Driver.Packet.draw": 23.21, "Driver.Draw": 23.063}, "trace_dropped": false, "trace": "aps5-trace-328ecb92f21f-3948830.json.gz"} ``` </details> AI-assisted: yes.
m335671 commented 2026-10-19 12:23:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by m335671 on 2026-10-19T12:23:33Z.


Windows / NVIDIA / Unreal Engine 5 data point: Sword of the Sea (PPSA25344), Windows 11 26200, RTX 4070 12 GB, NVIDIA 617.42, Ryzen 9 7900, 3840x2160.

Build: main 36f60df9e + #6763 + this PR (327a2bb7f), merged locally. There were two textual conflicts with current main, and I kept both sides of each:

  • PacketExecution.cpp: main's !submission.flips.contains(cursor) and this PR's enqueueSampleDumpPacket(...), in the same condition;
  • CMakeLists.txt: two independent test registrations.

On that merge agc_driver_pipelined_sample_dump and agc_driver_pipelined_sample_dump_drained pass. A/B on the same binary:

  • baseline: APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1;
  • candidate: this PR's default.

Both runs used APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_TRACE_SUMMARY_EVERY=10 APS5_THREAD_PRIORITY=high and a warm shader cache, over the same path: title screen, opening cinematic, then about 1 min in game. Both had a Discord stream running.

The mechanism works. This title issues a sample dump about every draw. In the opening cinematic ([draw] pipelined, per 10 s):

drained (baseline) queued (this PR)
packet drains ~147 000 (~2.3 s) ~8 700 (~1.5 s)
of which 0x46 (sample dumps) ~140 000 0
commits ~190 000 at ~19 µs ~344 000 at ~13 µs

But the frame time does not move, because this title stays CPU-bound on queue 0. The figures are medians over each scene's 10 s summary intervals:

Scene frame p50 (drained → queued) queue worker 0x0 busy
Title screen 72.4 → 72.8 ms ~98 % in both
Opening cinematic 234.6 → 254.4 ms ~99 % in both
In game 418.0 → 406.0 ms ~98 % in both

Between identical runs of this title I measure about ±6 % of noise in the cinematic, so all three rows are within noise. In the summaries, the worker time the drains no longer take reappears in Driver.Packet.draw: +11.6 ms per frame in the cinematic and +19.5 ms in game. Driver.Packet.dispatch drops by 9.7 ms in the cinematic. My guess is that queue 0 and the committer now meet on the same locks more often, but I have not traced that.

tools/performance_compare.py, in-game interval (baseline = drained, candidate = queued)
Metric Baseline Candidate Change Change (%)
frame_ms.p50 417.978 405.986 -11.992 -2.869
frame_ms.p90 437.835 421.754 -16.081 -3.673
gpu_busy_ms_per_present 161.773 173.682 +11.909 +7.362
Driver.Packet 725.609 713.618 -11.991 -1.653
Driver.Packet.draw 179.815 199.323 +19.508 +10.849
Driver.Packet.dispatch 141.742 139.234 -2.508 -1.769
Driver.Packet.memory_wait 262.408 271.092 +8.684 +3.309

So on this title the PR removes a real serialization point (sample-dump drains go from ~140k to 0 per 10 s). The frame rate is bound by the single queue-0 worker plus the single committer. I'll post the wider picture in #5436.

AI-assisted: yes (Claude Code). The build, the runs and this comment were done and written by Claude Code on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6267119210 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6267119210). Originally posted by [m335671](https://github.com/m335671) on 2026-10-19T12:23:33Z. --- Windows / NVIDIA / Unreal Engine 5 data point: Sword of the Sea (PPSA25344), Windows 11 26200, RTX 4070 12 GB, NVIDIA 617.42, Ryzen 9 7900, 3840x2160. **Build:** `main` `36f60df9e` + #6763 + this PR (`327a2bb7f`), merged locally. There were two textual conflicts with current `main`, and I kept both sides of each: - `PacketExecution.cpp`: `main`'s `!submission.flips.contains(cursor)` and this PR's `enqueueSampleDumpPacket(...)`, in the same condition; - `CMakeLists.txt`: two independent test registrations. On that merge `agc_driver_pipelined_sample_dump` and `agc_driver_pipelined_sample_dump_drained` pass. A/B on the same binary: - baseline: `APS5_PIPELINE_DRAIN_SAMPLE_DUMPS=1`; - candidate: this PR's default. Both runs used `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_TRACE_SUMMARY_EVERY=10 APS5_THREAD_PRIORITY=high` and a warm shader cache, over the same path: title screen, opening cinematic, then about 1 min in game. Both had a Discord stream running. **The mechanism works.** This title issues a sample dump about every draw. In the opening cinematic (`[draw] pipelined`, per 10 s): | | drained (baseline) | queued (this PR) | | --- | ---: | ---: | | packet drains | ~147 000 (~2.3 s) | ~8 700 (~1.5 s) | | of which `0x46` (sample dumps) | ~140 000 | 0 | | commits | ~190 000 at ~19 µs | ~344 000 at ~13 µs | **But the frame time does not move**, because this title stays CPU-bound on queue 0. The figures are medians over each scene's 10 s summary intervals: | Scene | frame p50 (drained → queued) | `queue worker 0x0` busy | | --- | --- | --- | | Title screen | 72.4 → 72.8 ms | ~98 % in both | | Opening cinematic | 234.6 → 254.4 ms | ~99 % in both | | In game | 418.0 → 406.0 ms | ~98 % in both | Between identical runs of this title I measure about ±6 % of noise in the cinematic, so all three rows are within noise. In the summaries, the worker time the drains no longer take reappears in `Driver.Packet.draw`: +11.6 ms per frame in the cinematic and +19.5 ms in game. `Driver.Packet.dispatch` drops by 9.7 ms in the cinematic. My guess is that queue 0 and the committer now meet on the same locks more often, but I have not traced that. <details> <summary><code>tools/performance_compare.py</code>, in-game interval (baseline = drained, candidate = queued)</summary> | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | frame_ms.p50 | 417.978 | 405.986 | -11.992 | -2.869 | | frame_ms.p90 | 437.835 | 421.754 | -16.081 | -3.673 | | gpu_busy_ms_per_present | 161.773 | 173.682 | +11.909 | +7.362 | | Driver.Packet | 725.609 | 713.618 | -11.991 | -1.653 | | Driver.Packet.draw | 179.815 | 199.323 | +19.508 | +10.849 | | Driver.Packet.dispatch | 141.742 | 139.234 | -2.508 | -1.769 | | Driver.Packet.memory_wait | 262.408 | 271.092 | +8.684 | +3.309 | </details> So on this title the PR removes a real serialization point (sample-dump drains go from ~140k to 0 per 10 s). The frame rate is bound by the single queue-0 worker plus the single committer. I'll post the wider picture in #5436. AI-assisted: yes (Claude Code). The build, the runs and this comment were done and written by Claude Code on my machine.
Rajkamalcode commented 2026-10-19 17:45:45 +00:00 (Migrated from github.com)

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


Windows / NVIDIA / SWAG data point (Squirrel with a Gun, PPSA22102, Unreal Engine, RTX 3070 8 GB, Windows 11)

Build: cherry-pick of 327a2bb7f onto a local base (448cf78c6, the AGC storage write-back fix #7912 - the same base my other SWAG runs used), not a rebase to main. The same two conflicts as @m335671, resolved the same way (kept both sides in PacketExecution.cpp, both test registrations in CMakeLists.txt).

Tests: agc_driver_pipelined_sample_dump and agc_driver_pipelined_sample_dump_drained pass on Windows/NVIDIA (2/2, no skip, RTX 3070).

A/B: same save and scripted input; 6-minute runs in the title's heavy state (~1 FPS, 0.9-1.1 s frames); APS5_PROFILE_DRAW=1 only. Baseline is the driver build this title had been running on (same source base, pre-PR); the steady-state baseline band across three earlier runs on this save is 9-12 presents/10 s.

per 10 s, steady baseline (pre-PR) this PR (queued)
presents 9-10 9-10
[draw] commits 16.5-17k at ~250-260 us 17.9-19.4k at ~210-247 us
Enqueue room wait / draw 96-105 us 71-115 us
packet drains 7.7-8.2k (2.1-2.2 s) 3.7-4.0k (2.1-2.3 s)
of which 0x46 3.3-3.4k 0
GPU busy / idle per frame 487 / 579 ms 543 / 643 ms

The mechanism works here too: 0x46 drains go to zero and packet drains drop by about half, with no correctness issue seen in the run. Frame time stays in the same 9-10 presents band - this title's heavy state is bound by the single committer's recording chain (readTarget ~1,020 ms and resource builds ~945 ms per 10 s of a ~0.9 s frame), not by sample-dump drains, so no FPS change was expected. Commit count per 10 s rises while per-commit cost falls, consistent with @m335671's observation that queue 0 and the committer meet on the same locks more often.

Run environment

Profile logs from APS5_PROFILE_DRAW=1, 360 s each, steady windows from the 2nd-6th minute:

  • [draw] PR window: 19424 commits at 214.9 us each ... waiting 74.3 us per draw for room; drains: packet 3962 (2339.6 ms); packet drains by opcode: 0x50 x1603 0x15 x1111 0x3c x954 0x16 x241 0x10 x26
  • [draw] baseline window: 16640 commits at 251.2 us each ... waiting 96.6 us per draw for room; drains: packet 7798 (2176.4 ms); packet drains by opcode: 0x46 x3384 0x50 x1728 0x15 x1183 ...
  • [draws] PR window: 7668 draws over 10 s ... readTarget=1016.5ms (8999 resident lookups, 193 of them >= 1 ms = 852.4 ... pages walked 3750210), resources=945.0ms, record=233.7ms
  • [sync] PR tail: 786 device drains by packet: DMA_DATA=786 (this counter is device drains; the 0x46 sample dumps are what stopped draining).

AI-assisted: yes (the build, the runs and this text were produced by an AI-assisted workflow on the reporter's machine).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273512073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6273512073). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-19T17:45:45Z. --- **Windows / NVIDIA / SWAG data point** (Squirrel with a Gun, PPSA22102, Unreal Engine, RTX 3070 8 GB, Windows 11) Build: cherry-pick of `327a2bb7f` onto a local base (`448cf78c6`, the AGC storage write-back fix #7912 - the same base my other SWAG runs used), not a rebase to `main`. The same two conflicts as @m335671, resolved the same way (kept both sides in `PacketExecution.cpp`, both test registrations in `CMakeLists.txt`). Tests: `agc_driver_pipelined_sample_dump` and `agc_driver_pipelined_sample_dump_drained` pass on Windows/NVIDIA (2/2, no skip, RTX 3070). A/B: same save and scripted input; 6-minute runs in the title's heavy state (~1 FPS, 0.9-1.1 s frames); `APS5_PROFILE_DRAW=1` only. Baseline is the driver build this title had been running on (same source base, pre-PR); the steady-state baseline band across three earlier runs on this save is 9-12 presents/10 s. | per 10 s, steady | baseline (pre-PR) | this PR (queued) | |---|---:|---:| | presents | 9-10 | 9-10 | | `[draw]` commits | 16.5-17k at ~250-260 us | 17.9-19.4k at ~210-247 us | | Enqueue room wait / draw | 96-105 us | 71-115 us | | packet drains | 7.7-8.2k (2.1-2.2 s) | 3.7-4.0k (2.1-2.3 s) | | of which `0x46` | 3.3-3.4k | **0** | | GPU busy / idle per frame | 487 / 579 ms | 543 / 643 ms | **The mechanism works here too**: `0x46` drains go to zero and packet drains drop by about half, with no correctness issue seen in the run. Frame time stays in the same 9-10 presents band - this title's heavy state is bound by the single committer's recording chain (`readTarget` ~1,020 ms and resource builds ~945 ms per 10 s of a ~0.9 s frame), not by sample-dump drains, so no FPS change was expected. Commit count per 10 s rises while per-commit cost falls, consistent with @m335671's observation that queue 0 and the committer meet on the same locks more often. <details><summary>Run environment</summary> Profile logs from `APS5_PROFILE_DRAW=1`, 360 s each, steady windows from the 2nd-6th minute: - `[draw]` PR window: `19424 commits at 214.9 us each ... waiting 74.3 us per draw for room; drains: packet 3962 (2339.6 ms); packet drains by opcode: 0x50 x1603 0x15 x1111 0x3c x954 0x16 x241 0x10 x26` - `[draw]` baseline window: `16640 commits at 251.2 us each ... waiting 96.6 us per draw for room; drains: packet 7798 (2176.4 ms); packet drains by opcode: 0x46 x3384 0x50 x1728 0x15 x1183 ...` - `[draws]` PR window: `7668 draws over 10 s ... readTarget=1016.5ms (8999 resident lookups, 193 of them >= 1 ms = 852.4 ... pages walked 3750210), resources=945.0ms, record=233.7ms` - `[sync]` PR tail: `786 device drains by packet: DMA_DATA=786` (this counter is device drains; the 0x46 sample dumps are what stopped draining). </details> AI-assisted: yes (the build, the runs and this text were produced by an AI-assisted workflow on the reporter's machine).
milescoviello commented 2026-10-20 15:05:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T15:05:40Z.


An Unreal title data point on Linux: Super Meat Boy 3D (PPSA31162), level 1-1, RTX 4070 Ti (NVIDIA 595.99.02), Ubuntu 24.04, Release.

Setup: main 30fda0a03a against the same main with this PR merged (327a2bb7f). I resolved the conflicts by keeping both sides: the extra flips check in PacketExecution.cpp, both test registrations, both counters. Each run starts from a fresh boot. A script waits for the game's own Load map complete lines (menu, slot 1, world map, level 1), settles for 30 s in the level and then counts presents for 60 s with APS5_PROFILE_DRAW=1. Each build had its own shader cache, and the second run of each is warm.

Build Presents per 10 s in the level EVENT_WRITE 0x39 drains per 10 s Draw commits on the committer
main (2 runs) 16–19 48,000–57,000 63–75 µs each
main + this PR (2 runs) 45–52 0 10.5 µs each

That's about 2.9×. With this PR the GPU is busy about 100 ms per frame, out of about 190 ms. On main it's 135 ms out of 590 ms, and the draw pipeline averages 1.3 items queued, against about 5 with the PR.

One note for comparison. This title bundles its own libc.prx, and #7897 alone gives about the same gain here (51 presents per 10 s), through a different cost: it brings the per-commit time down to 16 µs while the dumps still drain. With both PRs merged I measured 48 and 32 presents per 10 s in two runs, so I saw no further gain from combining them. I haven't explained the lower second run.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6294042684 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6294042684). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-20T15:05:40Z. --- An Unreal title data point on Linux: Super Meat Boy 3D (PPSA31162), level 1-1, RTX 4070 Ti (NVIDIA 595.99.02), Ubuntu 24.04, Release. Setup: `main` 30fda0a03a against the same `main` with this PR merged (`327a2bb7f`). I resolved the conflicts by keeping both sides: the extra `flips` check in `PacketExecution.cpp`, both test registrations, both counters. Each run starts from a fresh boot. A script waits for the game's own `Load map complete` lines (menu, slot 1, world map, level 1), settles for 30 s in the level and then counts presents for 60 s with `APS5_PROFILE_DRAW=1`. Each build had its own shader cache, and the second run of each is warm. | Build | Presents per 10 s in the level | `EVENT_WRITE` 0x39 drains per 10 s | Draw commits on the committer | |---|---|---|---| | `main` (2 runs) | 16–19 | 48,000–57,000 | 63–75 µs each | | `main` + this PR (2 runs) | 45–52 | 0 | 10.5 µs each | That's about 2.9×. With this PR the GPU is busy about 100 ms per frame, out of about 190 ms. On `main` it's 135 ms out of 590 ms, and the draw pipeline averages 1.3 items queued, against about 5 with the PR. One note for comparison. This title bundles its own `libc.prx`, and #7897 alone gives about the same gain here (51 presents per 10 s), through a different cost: it brings the per-commit time down to 16 µs while the dumps still drain. With both PRs merged I measured 48 and 32 presents per 10 s in two runs, so I saw no further gain from combining them. I haven't explained the lower second run. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-20 19:25:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T19:25:22Z.


@Nesyth thanks for this. It now conflicts with current main in code, not just adjacent lines: SynchronizationStatistics.hpp/.cpp and PacketExecution.cpp (plus CMakeLists.txt). Could you rebase it onto current main? Once it's rebased we'll run CI and measure it against main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6299389270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6501#issuecomment-6299389270). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T19:25:22Z. --- @Nesyth thanks for this. It now conflicts with current `main` in code, not just adjacent lines: `SynchronizationStatistics.hpp`/`.cpp` and `PacketExecution.cpp` (plus `CMakeLists.txt`). Could you rebase it onto current `main`? Once it's rebased we'll run CI and measure it against `main`.
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!6501
No description provided.