perf(agc): write DMA_DATA fills of an idle GDS without draining #9385

Merged
savvaniss merged 7 commits from upstream-pr/9385 into main 2026-11-02 07:57:36 +00:00
savvaniss commented 2026-10-21 20:04:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T20:04:32Z.


What

Evidence.

  • Exception: CUSA03312 runs only on #6977's PS4 branch, ps4/limbo-gpu, not on current main. On the intake exception, oneandonlydean confirmed on #6977 that a repro and speed A/B taken from ps4/limbo-gpu with and without the change is fine, with the branch commit named (comment). The CUSA03312 A/B below was taken on 93eeee0141, an earlier head of ps4/limbo-gpu, plus 62 PS4 commits from Get-fix/AnyPS5 pull requests.
  • Upstream main: panicDa3m0n measured ASTRO BOT (PPSA21567) on main, without and with this pull request (RTX 4070 Ti SUPER, Windows 11). At Crash Site it issues about 15 of these GDS fills per present, and main drains the device for each: 910 to 946 drains per 10 s on 8499ea52e5, 815 to 854 on d3efe3af99. With the first version and with 22c6df78e8 there were none (first version, 22c6df78e8).
  • Astro's Playroom: Raghav314 measured Astro's Playroom (PPSA01325) on #9508's head 5547aa11ef with #9400 and #8887 merged (RTX 4090, Linux): 16,961 device drains without this pull request, 0 with it (comment). Its frame rate did not change, as that scene's frame time goes elsewhere.
  • Speed on main: not shown. panicDa3m0n's alternated A/Bs at Crash Site, four rounds each:
    • The first version, which recorded each GDS fill as a GPU store, was slower in every round: frame p50 +10.0 ms on average.
    • 22c6df78e8, which wrote the fills on the CPU, was neutral on average: frame p50 −10.9, +18.6, +1.7 and −7.9 ms per round, mean +0.4 ms. Its second round (run 4) was 18.6 ms slower, with Driver.Packet.memory_wait +40 ms and Vulkan.Dispatch.shader_resources +31 ms per present.
    • In its profiled run, the CPU writes waited on pending GPU work: 11,482 pending write recorder syncs waiting 20.4 s, against 5,806 waiting 4.3 s on main.
    • This head is meant to cover that case. It takes the fast path only when no recorded GPU work is pending over the GDS, and otherwise drains as main does (below). Other testers have now measured it; their results are below.

A/Bs of this head (2938322773), by other testers:

  • LeoFeitosa, Windows, RTX 5070 Ti, heavy scene of the ASTRO BOT opening (PPSA21564), on main 1089f2bbfd with #11307: Recorder.WaitSerial falls from 12.8 and 14.7 ms per frame to 0.6 ms, with no wait above 5 ms. Frame rate is level, because that scene is bound by the queue workers' CPU work (comment).
  • Gonic0, Apple M5 Pro with MoltenVK, ASTRO BOT opening, on main plus the open PRs that platform needs: device drains fall 89 % and the recorder's total GPU wait 19 %. Each run with this pull request is ahead of both runs without it, over two rounds (comment). At the title card, device drains per 10 s fall from 1,232 to 1,591 to 163 to 167, and frame p50 is 1.1 to 2.2 ms lower in every round (comment).
  • TechLevelZero's NVIDIA CI on this head reports no new test failures (comment).

A DMA_DATA whose destination is the GDS (DST_SEL 1) drained the device every time. Pm4::ResolveStore refused any GDS destination, so preparePacketMemory fell through to the device drain (storesDrained).

  • ResolveStore resolves a GDS destination to the GDS's host block, GdsAddress() plus the offset, which is where Execute already writes it.
  • When no recorded GPU work, pending storage texture store or unit shadow covers the bytes a DMA_DATA into the GDS writes, preparePacketMemory does not drain the device for it, and Execute writes it on the CPU through GuestMemory::Write. Every dispatch that uses the GDS binds the block as a writable guest buffer, so a dispatch that has not finished counts as pending. When such work is pending, the packet drains the device and is written as on main.
  • enqueueDmaPacket queues an immediate-data fill of the GDS in the draw pipeline under the same condition, and the queued item writes it on the CPU, in order with what was queued before it.
  • Since ce6865fc0d, main queues queue-0 DMA_DATA by default, and keepsDrawPipeline keeps the pipeline for every DMA_DATA into the GDS and for a copy out of it into free memory. With fills queued, such a copy could run ahead of a fill queued before it. A GDS source or destination is now checked against the queued writes at its GDS address, as a memory range already is, so the copy drains the pipeline only when a queued fill writes the bytes it reads or writes.
  • The GDS is never the target of a recorded GPU store, so after a fill it holds no pending store for later dispatches or reads to wait for, as on main. The first version recorded the fill as a GPU store; on ASTRO BOT that made frames slower than the drain it replaced.
  • main 366dd4e6b7 is merged in. It removed the APS5_PIPELINE_DMA switch, so this pull request's gate on that switch in enqueueDmaPacket and its ARCHITECTURE and ENVIRONMENT rows are gone. The branch merges cleanly with main 64a318c6bc.

Found on the Unity player of Boggle and Trivial Pursuit Live! (CUSA03312, on #6977's PS4 branch). Each frame it clears 64 bytes at GDS offset 0 about 200 times with DMA_DATA c4104000 00000000 00000000 00000000 00000000 00000040 (SRC_SEL 2, data 0; DST_SEL 1). On an RX 9070 XT, 3,400 device drains per second made prepare_memory, Recorder.WaitSerial and device_lock most of each frame.

Tested

Windows 11 Pro 26300, RX 9070 XT (AMD proprietary driver 26.8.1), ANYPS5_GPU=AMD.

  • agc_driver_gds_dma_fill execution test, at 2938322773:
    • after recorded GPU work that does not use the GDS, an immediate fill of the GDS drains neither the device nor the draw pipeline and is not recorded as a GPU store, and a GDS-to-memory copy reads it;
    • three rounds of a fill followed by a ds_append/ds_consume dispatch that uses the GDS: each dispatch reads its fill's value, with no drain and no GPU store over the GDS;
    • a DMA_DATA copy from memory into the GDS, then the same dispatch: it reads the copied value, with no drain and no GPU store;
    • with the draw pipeline held on another range, the fill is queued over the GDS range behind the held item, without a 0x50 pipeline drain, and a later copy reads it;
    • with the pipeline held and a fill queued, a GDS-to-memory copy drains the pipeline and reads the fill, and a memory-to-GDS copy drains it and is not overwritten by the fill;
    • a dispatch that uses the GDS, a fill and a second such dispatch in one submission with no wait between them: the second dispatch reads the fill, the GDS counters (3032, 2968, 3032) show that the first dispatch's atomics landed before the fill, and the fill took main's device drain.
  • agc_driver_pm4 expects the GDS destination to resolve at its GDS offset, for a copy and for an immediate fill.
  • Each part is needed. Each mutation below fails 3 of 3 runs, with no VUID- line:
    • Without the change (PacketMemory.cpp, PacketExecution.cpp and Pm4.cpp from main): agc_driver_pm4 stops at "DMA_DATA to GDS did not resolve as a store at its GDS offset", and agc_driver_gds_dma_fill at "an immediate DMA_DATA fill of GDS drained the device".
    • Without the ResolveStore half: agc_driver_pm4 as above, and agc_driver_gds_dma_fill at "an immediate DMA_DATA fill of GDS was not queued behind the held draw pipeline item".
    • With the queued fill recorded on the GPU instead of written on the CPU: "the fill of GDS after recorded work was recorded as a GPU store over the GDS".
    • Without the preparePacketMemory branch: "a DMA_DATA copy into the GDS was recorded as a GPU store over the GDS".
    • Without the GDS source check in keepsDrawPipeline: "a GDS to memory copy did not see the fill queued in the draw pipeline" in two runs, "a GDS to memory copy behind a fill of GDS queued in the draw pipeline read the GDS before the fill" in one.
    • With main's unconditional keep for a GDS destination: "a memory to GDS copy behind a fill of GDS queued in the draw pipeline was overwritten by the fill".
    • With the fast path taken whether or not GPU work is pending (in preparePacketMemory, in enqueueDmaPacket, or in both): "a fill behind a dispatch still using the GDS did not drain the device as main does".
    • Control for the new test's ordering checks: with the fast path taken regardless, and the queued fill copied in with memcpy instead of GuestMemory::Write, it stops at "the dispatch before the fill read 3000, not the earlier fill's 500".
  • Focused tests on main 366dd4e6b7 and on this branch 2938322773, with ANYPS5_GPU=AMD, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:
    • The set: agc_driver, agc_driver_small_copy_sync, agc_driver_pm4 with its 13 agc_driver_pm4_* mode tests, agc_driver_gds_append_consume, agc_driver_pipelined_dma, agc_driver_pipelined_dispatch, agc_driver_pipelined_metadata_pass and agc_driver_queued_index_read_order.
    • main passes 21 of 21. This branch passes the same tests plus agc_driver_gds_dma_fill, 22 of 22, and agc_driver_gds_dma_fill alone 3 of 3 runs.
    • Every log selects the RX 9070 XT; none has a VUID- line or the missing-layer message.
  • Earlier versions, not re-run on this head:
    • A driver-path loop of a GDS fill and a GDS-using dispatch, 12 s per build (not committed), with APS5_PROFILE_DRAW=1. main ran 9,985 iterations per second with 119,872 device drains; the first version 25,106 per second with none; 22c6df78e8 10,119 per second with none, each fill waiting for the previous dispatch's pending write over the GDS.
    • In that loop every fill finds the GDS busy, so this head takes main's drain there.
  • Game with 22c6df78e8 ported (CUSA03312 on #6977's branch, same machine and settings as the tables below): Boggle's round 852 to 900 presents per 15 s, p50 16.7 ms; Trivial Pursuit Live!'s question stage 338 to 341 presents per 15 s, p50 44.1 to 45.9 ms. This head has not been run in a game. The tables and traces below were taken with the first version.
  • Game, not on upstream main: CUSA03312 runs only on #6977's PS4 integration branch. Both builds are that branch with the PS4 fixes from Get-fix/AnyPS5, without and with this change ported, APS5_TRACE_SUMMARY_EVERY=15, builds alternated on the same machine with a warm shader cache (Boggle: without, then with; TP: with, then without):
Scene Without the change With the change
Boggle, a round (letter grid) 225 and 238 presents per 15 s, p50 66.3 and 62.9 ms (~15.5 fps) 895 and 898 presents per 15 s, p50 16.7 ms (vsync, ~60 fps)
Trivial Pursuit Live!, the question stage 96 and 111 presents per 15 s, p50 147.5 and 136.8 ms (~7 fps) 380 and 364 presents per 15 s, p50 41.4 and 41.3 ms (~25 fps)

The worker's per-frame time without the change was prepare_memory 57 ms, device_lock 56 ms and Recorder.WaitSerial 40 ms (TP); with the change prepare_memory is 3 ms and device_lock under 1 ms. The ResolveStore half alone gave ~45 fps (Boggle) and ~17 fps (TP). Risk and Monopoly Plus run as before with the change (Risk's board 20 fps, Monopoly's board 4 to 5 fps).

tools/trace_digest.py of the summary files (last windows are the measured scene)

Boggle, without the change:

| # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase |
| 10 | 135-150 | 225 | 66.3 | 73.3 | 86.2 | 106.3 | 12.9 | 99 % | Driver.Packet 65.9 |
| 11 | 150-165 | 238 | 62.9 | 67.3 | 73.3 | 82.6 | 12.9 | 98 % | Driver.Packet 62.0 |

Boggle, with the change:

| # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase |
| 10 | 135-150 | 895 | 16.7 | 16.9 | 21.9 | 24.8 | 5.7 | 93 % | Driver.Packet 15.6 |
| 11 | 150-165 | 898 | 16.7 | 16.9 | 20.0 | 27.3 | 5.7 | 93 % | Driver.Packet 15.6 |

Trivial Pursuit Live!, without the change:

| # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase |
| 15 | 210-226 | 96 | 147.5 | 197.1 | 705.4 | 705.4 | 22.3 | 99 % | Driver.Packet 155.3 |
| 16 | 226-241 | 111 | 136.8 | 142.4 | 146.9 | 147.5 | 21.6 | 99 % | Driver.Packet 133.9 |

Trivial Pursuit Live!, with the change:

| # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase |
| 15 | 210-225 | 380 | 41.4 | 53.6 | 57.4 | 374.2 | 12.3 | 87 % | Driver.Packet 34.3 |
| 16 | 225-240 | 364 | 41.3 | 42.5 | 46.8 | 49.8 | 12.8 | 89 % | Driver.Packet 36.6 |

Overlap (tools/pr_overlap.py --branch against current main): #7978 changes preparePacketMemory's signature on the line after this pull request's new helper in PacketMemory.cpp, so the two conflict on adjacent lines; whichever merges second keeps both. #6549, #6960 and 14 other open pull requests share files with this one but conflict with main themselves, so the tool could not compare them. When last compared, #6549's and #6960's changes to Pm4.cpp, tests/Pm4.cpp and PacketMemory.cpp merged automatically with this branch. This pull request adds no debt entry.

Trace captures (first version). One APS5_TRACE_SECONDS window per build in the same scenes, with no other APS5_TRACE_* or APS5_PROFILE_* switch, warm caches, builds alternated. Neither is upstream main. The base is adcc2b2b59: #6977 at 93eeee0141 plus 62 PS4 commits from Get-fix/AnyPS5. The change is 7cee08fdaf: the same plus this pull request's commit and a local logging switch (APS5_LOG_DRAINED_STORES), which was off in these runs. Full tracing slows the base more than the change.

Scene, 15 s window Base adcc2b2b59 Change 7cee08fdaf
Boggle round (APS5_TRACE_SECONDS=150:15) 121 presents, p50 124.1 ms 899 presents, p50 16.7 ms
Trivial Pursuit Live! question stage (225:15) 109 presents, p50 137.6 ms 342 presents, p50 43.4 ms

The traces (aps5-trace-adcc2b2b59da-37996, aps5-trace-7cee08fdaf5c-9772, aps5-trace-adcc2b2b59da-33612, aps5-trace-7cee08fdaf5c-20504, 2.2 to 2.7 MB each) will be attached in a comment, since they cannot be uploaded from the command line.

Boggle, base: tools/trace_digest.py

seconds 150:15 from present 7214: 121 presents, frame p50 124.1 / p90 133.0 / p99 148.6 / max 160.9 ms, GPU busy 12.2 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit adcc2b2b59da, dropped: no

{"commit":"adcc2b2b59da","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 150:15","first_present":7214,"ms":15090.566},"presents":121,"frame_ms":{"p50":124.11,"p90":133.032,"p99":148.561,"max":160.859},"gpu_busy_ms_per_present":12.249,"worker_busy_pct":{"queue worker 0x0":98.961},"top_phases_ms_per_frame":{"Driver.Packet":123.332,"Driver.Packet.prepare_memory":51.144,"Driver.Packet.device_lock":50.182,"Recorder.WaitSerial":28.385,"Recorder.Submit":16.596,"Driver.Packet.draw":12.678,"Driver.Draw":12.387,"Driver.Draw.shader_compile_and_link":6.243},"trace_dropped":false,"trace":"aps5-trace-adcc2b2b59da-37996.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 7292: 160.9 ms at 9780 ms: Driver.Packet (queue worker 0x0) 154.4, Driver.Packet.device_lock (queue worker 0x0) 88.4, Driver.Packet.prepare_memory (queue worker 0x0) 51.1, Recorder.WaitSerial (queue worker 0x0) 28.1
  • present 7297: 148.6 ms at 10415 ms: Driver.Packet (queue worker 0x0) 142.3, Driver.Packet.device_lock (queue worker 0x0) 61.5, Driver.Packet.prepare_memory (queue worker 0x0) 60.9, Recorder.WaitSerial (queue worker 0x0) 40.5
  • present 7259: 142.5 ms at 5652 ms: Driver.Packet (queue worker 0x0) 136.3, Driver.Packet.device_lock (queue worker 0x0) 51.9, Driver.Packet.prepare_memory (queue worker 0x0) 51.5, Recorder.WaitSerial (queue worker 0x0) 28.5
  • present 7291: 139.1 ms at 9641 ms: Driver.Packet (queue worker 0x0) 132.8, Driver.Packet.prepare_memory (queue worker 0x0) 63.5, Driver.Packet.device_lock (queue worker 0x0) 48.9, Recorder.WaitSerial (queue worker 0x0) 31.4
  • present 7217: 137.2 ms at 398 ms: Driver.Packet (queue worker 0x0) 130.8, Driver.Packet.prepare_memory (queue worker 0x0) 53.4, Driver.Packet.device_lock (queue worker 0x0) 50.8, Recorder.WaitSerial (queue worker 0x0) 30.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 89.3 (72 %) 29.2 (23 %) 6.2 22.3 Driver.Packet 118.4, Driver.EndSubmission 0.1
presenter 0.5 (0 %) 0.2 (0 %) 124.0 0.0 Driver.Present 0.7
gpu 12.4 (10 %) 0.0 (0 %) 112.4 0.0 batch 12.4

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 118.4, Driver.Packet.prepare_memory 50.0, Driver.Packet.device_lock 49.5, Recorder.WaitSerial 28.3, Recorder.Submit 16.6, Driver.Packet.draw 12.7, Driver.Draw 12.4, batch 12.4, Driver.Draw.shader_compile_and_link 4.7, Shader.DrawStage 3.5

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 13.2 ms at 10407 ms, present 7296
  • Recorder.WaitSerial (queue worker 0x0) 11.4 ms at 10481 ms, present 7297
  • Recorder.WaitSerial (queue worker 0x0) 9.3 ms at 8913 ms, present 7285
  • Recorder.WaitSerial (queue worker 0x0) 7.3 ms at 4726 ms, present 7251
  • Recorder.WaitSerial (queue worker 0x0) 5.9 ms at 11015 ms, present 7301
  • Driver.Packet.memory_wait (queue worker 0x0) 5.7 ms at 4401 ms, present 7249
  • Driver.Packet.memory_wait (queue worker 0x0) 5.7 ms at 10809 ms, present 7299
  • Vulkan.Acquire.acquire_fence_wait (presenter) 4.8 ms at 4401 ms, present 7249
  • Recorder.WaitSerial (queue worker 0x0) 4.7 ms at 6244 ms, present 7263
  • Recorder.WaitSerial (queue worker 0x0) 4.5 ms at 4387 ms, present 7248

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

  • batch 25498: 4.0 ms at 13868 ms, present 7325: GPU no ranges; recorded by no CPU slices
  • batch 24562: 1.0 ms at 13349 ms, present 7321: GPU no ranges; recorded by no CPU slices
  • batch 14062: 1.0 ms at 7711 ms, present 7275: GPU no ranges; recorded by no CPU slices
  • batch 27523: 1.0 ms at 14962 ms, present 7334: GPU no ranges; recorded by no CPU slices
  • batch 4171: 1.0 ms at 2287 ms, present 7232: GPU no ranges; recorded by no CPU slices
Boggle, change: tools/trace_digest.py

seconds 150:15 from present 8803: 899 presents, frame p50 16.7 / p90 16.9 / p99 19.3 / max 22.9 ms, GPU busy 6.2 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit 7cee08fdaf5c, dropped: no

{"commit":"7cee08fdaf5c","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 150:15","first_present":8803,"ms":15014.807},"presents":899,"frame_ms":{"p50":16.684,"p90":16.88,"p99":19.328,"max":22.911},"gpu_busy_ms_per_present":6.204,"worker_busy_pct":{"queue worker 0x0":92.909},"top_phases_ms_per_frame":{"Driver.Packet":15.511,"Driver.Packet.draw":3.693,"Driver.Draw":3.599,"Driver.Packet.memory_wait":3.059,"Driver.Draw.shader_compile_and_link":1.54,"Driver.Packet.device_lock":0.753,"Driver.Draw.prepare":0.741,"Driver.Packet.flush_between_packets":0.657},"trace_dropped":false,"trace":"aps5-trace-7cee08fdaf5c-9772.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 9489: 22.9 ms at 11445 ms: Driver.Packet (queue worker 0x0) 16.5, batch (gpu) 6.3, Driver.Packet.draw (queue worker 0x0) 3.1, Driver.Draw (queue worker 0x0) 3.0
  • present 8835: 22.7 ms at 534 ms: Driver.Packet (queue worker 0x0) 16.8, batch (gpu) 6.3, Driver.Packet.draw (queue worker 0x0) 2.8, Driver.Draw (queue worker 0x0) 2.6
  • present 8947: 22.4 ms at 2402 ms: Driver.Packet (queue worker 0x0) 16.4, Driver.Packet.device_lock (queue worker 0x0) 7.0, batch (gpu) 6.3, Driver.Packet.draw (queue worker 0x0) 2.2
  • present 9551: 22.1 ms at 12482 ms: Driver.Packet (queue worker 0x0) 16.7, Driver.Packet.draw (queue worker 0x0) 9.0, Driver.Draw (queue worker 0x0) 8.8, batch (gpu) 6.4
  • present 9547: 21.1 ms at 12413 ms: Driver.Packet (queue worker 0x0) 14.4, Driver.Packet.device_lock (queue worker 0x0) 6.9, batch (gpu) 6.4, Driver.Packet.draw (queue worker 0x0) 2.1

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 7.2 (43 %) 3.6 (22 %) 5.9 14.8 Driver.Packet 10.2, Driver.EndSubmission 0.0
presenter 0.3 (2 %) 0.1 (1 %) 16.3 0.0 Driver.Present 0.5
gpu 6.2 (37 %) 0.0 (0 %) 10.5 0.0 batch 6.2

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 10.2, batch 6.2, Driver.Packet.memory_wait 3.1, Driver.Packet.draw 1.7, Driver.Draw 1.7, Driver.Draw.shader_compile_and_link 0.6, Driver.WorkerWait 0.6, Driver.WorkerWait.idle_and_completion_poll 0.6, Driver.Present 0.5, Driver.Packet.dispatch 0.4

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 5.8 ms at 7421 ms, present 9247
  • Driver.Packet.memory_wait (queue worker 0x0) 5.2 ms at 4216 ms, present 9055
  • Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 6869 ms, present 9214
  • Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 5752 ms, present 9147
  • Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 8238 ms, present 9296
  • Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 14744 ms, present 9685
  • Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 8221 ms, present 9295
  • Driver.Packet.memory_wait (queue worker 0x0) 4.9 ms at 13176 ms, present 9591
  • Driver.Packet.memory_wait (queue worker 0x0) 4.9 ms at 10907 ms, present 9456
  • Driver.Packet.memory_wait (queue worker 0x0) 4.9 ms at 6652 ms, present 9201

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

  • batch 7885: 3.9 ms at 10432 ms, present 9428: GPU no ranges; recorded by no CPU slices
  • batch 11154: 3.3 ms at 14617 ms, present 9678: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.1, Driver.Packet.draw (queue worker 0x0) 0.2, Driver.Draw (queue worker 0x0) 0.2, Driver.Packet.dispatch (queue worker 0x0) 0.1
  • batch 82: 3.2 ms at 102 ms, present 8809: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 6.9, Driver.Packet.draw (queue worker 0x0) 1.4, Driver.Draw (queue worker 0x0) 1.3, Driver.Draw.shader_compile_and_link (queue worker 0x0) 0.4
  • batch 7116: 3.2 ms at 9394 ms, present 9366: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 6.9, Driver.Packet.draw (queue worker 0x0) 1.2, Driver.Draw (queue worker 0x0) 1.1, Driver.Packet.dispatch (queue worker 0x0) 0.4
  • batch 11403: 3.2 ms at 14950 ms, present 9698: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 6.2, Driver.Packet.draw (queue worker 0x0) 3.1, Driver.Draw (queue worker 0x0) 3.0, Driver.Draw.shader_compile_and_link (queue worker 0x0) 1.5
Trivial Pursuit Live!, base: tools/trace_digest.py

seconds 225:15 from present 9509: 109 presents, frame p50 137.6 / p90 148.3 / p99 155.6 / max 163.4 ms, GPU busy 21.7 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit adcc2b2b59da, dropped: yes

{"commit":"adcc2b2b59da","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"225:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 225:15","first_present":9509,"ms":15078.636},"presents":109,"frame_ms":{"p50":137.63,"p90":148.251,"p99":155.588,"max":163.418},"gpu_busy_ms_per_present":21.696,"worker_busy_pct":{"queue worker 0x0":98.7},"top_phases_ms_per_frame":{"Driver.Packet":136.52,"Driver.Packet.prepare_memory":57.689,"Driver.Packet.device_lock":57.006,"Recorder.WaitSerial":40.242,"Driver.Packet.draw":13.309,"Driver.Draw":13.105,"Recorder.Submit":12.863,"Driver.Draw.shader_compile_and_link":8.5},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":11.278,"events_lost":91737,"totals_full":false}},"trace":"aps5-trace-adcc2b2b59da-33612.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 9559: 163.4 ms at 6801 ms: Driver.Packet (queue worker 0x0) 154.6, Driver.Packet.device_lock (queue worker 0x0) 67.1, Driver.Packet.prepare_memory (queue worker 0x0) 63.4, Recorder.WaitSerial (queue worker 0x0) 42.0
  • present 9560: 155.6 ms at 6965 ms: Driver.Packet (queue worker 0x0) 146.8, Driver.Packet.device_lock (queue worker 0x0) 63.9, Driver.Packet.prepare_memory (queue worker 0x0) 62.4, Recorder.WaitSerial (queue worker 0x0) 41.7
  • present 9561: 153.7 ms at 7120 ms: Driver.Packet (queue worker 0x0) 144.9, Driver.Packet.device_lock (queue worker 0x0) 62.8, Driver.Packet.prepare_memory (queue worker 0x0) 61.4, Recorder.WaitSerial (queue worker 0x0) 41.9
  • present 9563: 153.6 ms at 7426 ms: Driver.Packet (queue worker 0x0) 144.1, Driver.Packet.device_lock (queue worker 0x0) 63.7, Driver.Packet.prepare_memory (queue worker 0x0) 61.5, Recorder.WaitSerial (queue worker 0x0) 41.8
  • present 9564: 152.9 ms at 7579 ms: Driver.Packet (queue worker 0x0) 143.4, Driver.Packet.device_lock (queue worker 0x0) 63.7, Driver.Packet.prepare_memory (queue worker 0x0) 60.0, Recorder.WaitSerial (queue worker 0x0) 40.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 66.9 (48 %) 30.5 (22 %) 40.9 28.9 Driver.Packet 96.9, Driver.EndSubmission 0.0
presenter 0.3 (0 %) 0.1 (0 %) 138.0 0.0 Driver.Present 0.4
gpu 21.7 (16 %) 0.0 (0 %) 116.6 0.0 batch 21.7

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 96.9, Driver.Packet.prepare_memory 42.4, Driver.Packet.device_lock 42.2, Recorder.WaitSerial 30.0, batch 21.7, Recorder.Submit 9.4, Driver.Packet.draw 8.4, Driver.Draw 8.2, Driver.Draw.shader_compile_and_link 4.3, Driver.Packet.dispatch 1.4

Longest waits

  • Recorder.WaitSerial (queue worker 0x0) 3.7 ms at 8697 ms, present 9571
  • Recorder.WaitSerial (queue worker 0x0) 3.7 ms at 1904 ms, present 9522
  • Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 260 ms, present 9510
  • Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 1210 ms, present 9517
  • Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 5670 ms, present 9550
  • Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 8844 ms, present 9572
  • Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 2296 ms, present 9525
  • Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 6773 ms, present 9558
  • Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 10279 ms, present 9582
  • Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 3607 ms, present 9535

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

  • batch 5566: 3.6 ms at 1904 ms, present 9522: GPU no ranges; recorded by no CPU slices
  • batch 16697: 3.6 ms at 5670 ms, present 9550: GPU no ranges; recorded by no CPU slices
  • batch 34277: 3.6 ms at 11802 ms, present 9593: GPU no ranges; recorded by no CPU slices
  • batch 25254: 3.5 ms at 8697 ms, present 9571: GPU no ranges; recorded by no CPU slices
  • batch 25669: 3.5 ms at 8844 ms, present 9572: GPU no ranges; recorded by no CPU slices
Trivial Pursuit Live!, change: tools/trace_digest.py

seconds 225:15 from present 11292: 342 presents, frame p50 43.4 / p90 47.6 / p99 49.7 / max 88.7 ms, GPU busy 13.5 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit 7cee08fdaf5c, dropped: yes

{"commit":"7cee08fdaf5c","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"225:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 225:15","first_present":11292,"ms":15019.167},"presents":342,"frame_ms":{"p50":43.392,"p90":47.551,"p99":49.736,"max":88.679},"gpu_busy_ms_per_present":13.451,"worker_busy_pct":{"queue worker 0x0":88.944},"top_phases_ms_per_frame":{"Driver.Packet":39.054,"Driver.Packet.draw":13.238,"Driver.Draw":13.045,"Driver.Draw.shader_compile_and_link":6.969,"Shader.DrawStage":3.961,"Driver.Draw.draw_enqueued":3.126,"Driver.Present":3.019,"Driver.Draw.prepare":2.232},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":9.555,"events_lost":138618,"totals_full":false}},"trace":"aps5-trace-7cee08fdaf5c-20504.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 11540: 88.7 ms at 10983 ms: batch (gpu) 17.3, Driver.Present (presenter) 3.8, Driver.Present.acquire_image (presenter) 2.9, Vulkan.Acquire (presenter) 2.9
  • present 11462: 53.9 ms at 7626 ms: Driver.Packet (queue worker 0x0) 42.0, batch (gpu) 20.6, Driver.Packet.draw (queue worker 0x0) 12.9, Driver.Draw (queue worker 0x0) 12.6
  • present 11329: 51.7 ms at 1714 ms: Driver.Packet (queue worker 0x0) 39.6, batch (gpu) 15.8, Driver.Packet.draw (queue worker 0x0) 14.5, Driver.Draw (queue worker 0x0) 14.2
  • present 11321: 49.7 ms at 1322 ms: Driver.Packet (queue worker 0x0) 37.4, batch (gpu) 14.9, Driver.Packet.draw (queue worker 0x0) 12.6, Driver.Draw (queue worker 0x0) 12.3
  • present 11294: 49.5 ms at 87 ms: Driver.Packet (queue worker 0x0) 37.6, Driver.Packet.draw (queue worker 0x0) 15.0, Driver.Draw (queue worker 0x0) 14.7, batch (gpu) 10.4

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 20.1 (46 %) 2.2 (5 %) 21.6 20.1 Driver.Packet 20.1, Driver.EndSubmission 0.0
presenter 0.3 (1 %) 2.7 (6 %) 40.9 0.0 Driver.Present 3.0
gpu 13.5 (31 %) 0.0 (0 %) 30.5 0.0 batch 13.5

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 20.1, batch 13.5, Driver.Packet.draw 6.8, Driver.Draw 6.6, Driver.Present 3.0, Driver.Draw.shader_compile_and_link 2.8, Driver.WorkerWait 2.2, Driver.WorkerWait.idle_and_completion_poll 2.2, Driver.Present.acquire_image 1.8, Vulkan.Acquire 1.8

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 4.7 ms at 2390 ms, present 11342
  • Driver.WorkerWait (queue worker 0x0) 4.6 ms at 9156 ms, present 11497
  • Driver.WorkerWait (queue worker 0x0) 4.4 ms at 1226 ms, present 11318
  • Driver.WorkerWait (queue worker 0x0) 4.3 ms at 2529 ms, present 11345
  • Driver.WorkerWait (queue worker 0x0) 4.3 ms at 1912 ms, present 11332
  • Driver.WorkerWait (queue worker 0x0) 4.2 ms at 2248 ms, present 11339
  • Driver.WorkerWait (queue worker 0x0) 4.2 ms at 5621 ms, present 11415
  • Driver.WorkerWait (queue worker 0x0) 4.2 ms at 9463 ms, present 11504
  • Driver.WorkerWait (queue worker 0x0) 4.2 ms at 1863 ms, present 11331
  • Driver.WorkerWait (queue worker 0x0) 4.2 ms at 9199 ms, present 11498

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

  • batch 6280: 8.7 ms at 7667 ms, present 11462: GPU no ranges; recorded by no CPU slices
  • batch 11165: 5.8 ms at 13689 ms, present 11602: GPU no ranges; recorded by no CPU slices
  • batch 6986: 5.5 ms at 8503 ms, present 11482: GPU no ranges; recorded by no CPU slices
  • batch 4066: 5.4 ms at 4954 ms, present 11400: GPU no ranges; recorded by no CPU slices
  • batch 8333: 5.4 ms at 10163 ms, present 11520: GPU no ranges; recorded by no CPU slices

One of five Trivial Pursuit runs with the change stopped about 218 s in on a libc heap error: a freed ALLOC_GFX chunk overwritten with 0xff, reported through the unimplemented sceKernelPrintBacktraceWithModuleInfo. One of five runs without the change ended without a message at a similar point. Whether this pull request makes the heap error more likely is not known yet; it is being looked at separately.

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
  • Fixes: none
  • Unblocks: none (CUSA03312 #7198 on #6977's branch ran faster with earlier versions; this head is not measured there)
  • GPUs tested: AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4957624567 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9385). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-21T20:04:32Z. --- ### What **Evidence.** - **Exception:** CUSA03312 runs only on #6977's PS4 branch, `ps4/limbo-gpu`, not on current `main`. On the intake exception, oneandonlydean confirmed on #6977 that a repro and speed A/B taken from `ps4/limbo-gpu` with and without the change is fine, with the branch commit named ([comment](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6347967400)). The CUSA03312 A/B below was taken on `93eeee0141`, an earlier head of `ps4/limbo-gpu`, plus 62 PS4 commits from Get-fix/AnyPS5 pull requests. - **Upstream `main`:** panicDa3m0n measured ASTRO BOT (PPSA21567) on `main`, without and with this pull request (RTX 4070 Ti SUPER, Windows 11). At Crash Site it issues about 15 of these GDS fills per present, and `main` drains the device for each: 910 to 946 drains per 10 s on `8499ea52e5`, 815 to 854 on `d3efe3af99`. With the first version and with `22c6df78e8` there were none ([first version](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6350108527), [`22c6df78e8`](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6353394378)). - **Astro's Playroom:** Raghav314 measured Astro's Playroom (PPSA01325) on #9508's head `5547aa11ef` with #9400 and #8887 merged (RTX 4090, Linux): 16,961 device drains without this pull request, 0 with it ([comment](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6348468024)). Its frame rate did not change, as that scene's frame time goes elsewhere. - **Speed on `main`: not shown.** panicDa3m0n's alternated A/Bs at Crash Site, four rounds each: - The first version, which recorded each GDS fill as a GPU store, was slower in every round: frame p50 +10.0 ms on average. - `22c6df78e8`, which wrote the fills on the CPU, was neutral on average: frame p50 −10.9, +18.6, +1.7 and −7.9 ms per round, mean +0.4 ms. Its second round (run 4) was 18.6 ms slower, with `Driver.Packet.memory_wait` +40 ms and `Vulkan.Dispatch.shader_resources` +31 ms per present. - In its profiled run, the CPU writes waited on pending GPU work: 11,482 `pending write` recorder syncs waiting 20.4 s, against 5,806 waiting 4.3 s on `main`. - This head is meant to cover that case. It takes the fast path only when no recorded GPU work is pending over the GDS, and otherwise drains as `main` does (below). Other testers have now measured it; their results are below. **A/Bs of this head (`2938322773`), by other testers:** - **LeoFeitosa**, Windows, RTX 5070 Ti, heavy scene of the ASTRO BOT opening (PPSA21564), on `main` `1089f2bbfd` with #11307: `Recorder.WaitSerial` falls from 12.8 and 14.7 ms per frame to 0.6 ms, with no wait above 5 ms. Frame rate is level, because that scene is bound by the queue workers' CPU work ([comment](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6465978291)). - **Gonic0**, Apple M5 Pro with MoltenVK, ASTRO BOT opening, on `main` plus the open PRs that platform needs: device drains fall 89 % and the recorder's total GPU wait 19 %. Each run with this pull request is ahead of both runs without it, over two rounds ([comment](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6505529661)). At the title card, device drains per 10 s fall from 1,232 to 1,591 to 163 to 167, and frame p50 is 1.1 to 2.2 ms lower in every round ([comment](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6461495691)). - **TechLevelZero**'s NVIDIA CI on this head reports no new test failures ([comment](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6504801041)). A `DMA_DATA` whose destination is the GDS (DST_SEL 1) drained the device every time. `Pm4::ResolveStore` refused any GDS destination, so `preparePacketMemory` fell through to the device drain (`storesDrained`). - `ResolveStore` resolves a GDS destination to the GDS's host block, `GdsAddress()` plus the offset, which is where `Execute` already writes it. - When no recorded GPU work, pending storage texture store or unit shadow covers the bytes a `DMA_DATA` into the GDS writes, `preparePacketMemory` does not drain the device for it, and `Execute` writes it on the CPU through `GuestMemory::Write`. Every dispatch that uses the GDS binds the block as a writable guest buffer, so a dispatch that has not finished counts as pending. When such work is pending, the packet drains the device and is written as on `main`. - `enqueueDmaPacket` queues an immediate-data fill of the GDS in the draw pipeline under the same condition, and the queued item writes it on the CPU, in order with what was queued before it. - Since ce6865fc0d, `main` queues queue-0 `DMA_DATA` by default, and `keepsDrawPipeline` keeps the pipeline for every `DMA_DATA` into the GDS and for a copy out of it into free memory. With fills queued, such a copy could run ahead of a fill queued before it. A GDS source or destination is now checked against the queued writes at its GDS address, as a memory range already is, so the copy drains the pipeline only when a queued fill writes the bytes it reads or writes. - The GDS is never the target of a recorded GPU store, so after a fill it holds no pending store for later dispatches or reads to wait for, as on `main`. The first version recorded the fill as a GPU store; on ASTRO BOT that made frames slower than the drain it replaced. - `main` `366dd4e6b7` is merged in. It removed the `APS5_PIPELINE_DMA` switch, so this pull request's gate on that switch in `enqueueDmaPacket` and its ARCHITECTURE and ENVIRONMENT rows are gone. The branch merges cleanly with `main` `64a318c6bc`. Found on the Unity player of Boggle and Trivial Pursuit Live! (CUSA03312, on #6977's PS4 branch). Each frame it clears 64 bytes at GDS offset 0 about 200 times with `DMA_DATA c4104000 00000000 00000000 00000000 00000000 00000040` (SRC_SEL 2, data 0; DST_SEL 1). On an RX 9070 XT, 3,400 device drains per second made `prepare_memory`, `Recorder.WaitSerial` and `device_lock` most of each frame. ### Tested Windows 11 Pro 26300, RX 9070 XT (AMD proprietary driver 26.8.1), `ANYPS5_GPU=AMD`. - `agc_driver_gds_dma_fill` execution test, at `2938322773`: - after recorded GPU work that does not use the GDS, an immediate fill of the GDS drains neither the device nor the draw pipeline and is not recorded as a GPU store, and a GDS-to-memory copy reads it; - three rounds of a fill followed by a `ds_append`/`ds_consume` dispatch that uses the GDS: each dispatch reads its fill's value, with no drain and no GPU store over the GDS; - a `DMA_DATA` copy from memory into the GDS, then the same dispatch: it reads the copied value, with no drain and no GPU store; - with the draw pipeline held on another range, the fill is queued over the GDS range behind the held item, without a 0x50 pipeline drain, and a later copy reads it; - with the pipeline held and a fill queued, a GDS-to-memory copy drains the pipeline and reads the fill, and a memory-to-GDS copy drains it and is not overwritten by the fill; - a dispatch that uses the GDS, a fill and a second such dispatch in one submission with no wait between them: the second dispatch reads the fill, the GDS counters (3032, 2968, 3032) show that the first dispatch's atomics landed before the fill, and the fill took `main`'s device drain. - `agc_driver_pm4` expects the GDS destination to resolve at its GDS offset, for a copy and for an immediate fill. - Each part is needed. Each mutation below fails 3 of 3 runs, with no `VUID-` line: - Without the change (`PacketMemory.cpp`, `PacketExecution.cpp` and `Pm4.cpp` from `main`): `agc_driver_pm4` stops at "DMA_DATA to GDS did not resolve as a store at its GDS offset", and `agc_driver_gds_dma_fill` at "an immediate DMA_DATA fill of GDS drained the device". - Without the `ResolveStore` half: `agc_driver_pm4` as above, and `agc_driver_gds_dma_fill` at "an immediate DMA_DATA fill of GDS was not queued behind the held draw pipeline item". - With the queued fill recorded on the GPU instead of written on the CPU: "the fill of GDS after recorded work was recorded as a GPU store over the GDS". - Without the `preparePacketMemory` branch: "a DMA_DATA copy into the GDS was recorded as a GPU store over the GDS". - Without the GDS source check in `keepsDrawPipeline`: "a GDS to memory copy did not see the fill queued in the draw pipeline" in two runs, "a GDS to memory copy behind a fill of GDS queued in the draw pipeline read the GDS before the fill" in one. - With `main`'s unconditional keep for a GDS destination: "a memory to GDS copy behind a fill of GDS queued in the draw pipeline was overwritten by the fill". - With the fast path taken whether or not GPU work is pending (in `preparePacketMemory`, in `enqueueDmaPacket`, or in both): "a fill behind a dispatch still using the GDS did not drain the device as main does". - Control for the new test's ordering checks: with the fast path taken regardless, and the queued fill copied in with `memcpy` instead of `GuestMemory::Write`, it stops at "the dispatch before the fill read 3000, not the earlier fill's 500". - Focused tests on `main` `366dd4e6b7` and on this branch `2938322773`, with `ANYPS5_GPU=AMD`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: - The set: `agc_driver`, `agc_driver_small_copy_sync`, `agc_driver_pm4` with its 13 `agc_driver_pm4_*` mode tests, `agc_driver_gds_append_consume`, `agc_driver_pipelined_dma`, `agc_driver_pipelined_dispatch`, `agc_driver_pipelined_metadata_pass` and `agc_driver_queued_index_read_order`. - `main` passes 21 of 21. This branch passes the same tests plus `agc_driver_gds_dma_fill`, 22 of 22, and `agc_driver_gds_dma_fill` alone 3 of 3 runs. - Every log selects the RX 9070 XT; none has a `VUID-` line or the missing-layer message. - Earlier versions, not re-run on this head: - A driver-path loop of a GDS fill and a GDS-using dispatch, 12 s per build (not committed), with `APS5_PROFILE_DRAW=1`. `main` ran 9,985 iterations per second with 119,872 device drains; the first version 25,106 per second with none; `22c6df78e8` 10,119 per second with none, each fill waiting for the previous dispatch's pending write over the GDS. - In that loop every fill finds the GDS busy, so this head takes `main`'s drain there. - Game with `22c6df78e8` ported (CUSA03312 on #6977's branch, same machine and settings as the tables below): Boggle's round 852 to 900 presents per 15 s, p50 16.7 ms; Trivial Pursuit Live!'s question stage 338 to 341 presents per 15 s, p50 44.1 to 45.9 ms. This head has not been run in a game. The tables and traces below were taken with the first version. - Game, not on upstream `main`: CUSA03312 runs only on #6977's PS4 integration branch. Both builds are that branch with the PS4 fixes from Get-fix/AnyPS5, without and with this change ported, `APS5_TRACE_SUMMARY_EVERY=15`, builds alternated on the same machine with a warm shader cache (Boggle: without, then with; TP: with, then without): | Scene | Without the change | With the change | | --- | --- | --- | | Boggle, a round (letter grid) | 225 and 238 presents per 15 s, p50 66.3 and 62.9 ms (~15.5 fps) | 895 and 898 presents per 15 s, p50 16.7 ms (vsync, ~60 fps) | | Trivial Pursuit Live!, the question stage | 96 and 111 presents per 15 s, p50 147.5 and 136.8 ms (~7 fps) | 380 and 364 presents per 15 s, p50 41.4 and 41.3 ms (~25 fps) | The worker's per-frame time without the change was `prepare_memory` 57 ms, `device_lock` 56 ms and `Recorder.WaitSerial` 40 ms (TP); with the change `prepare_memory` is 3 ms and `device_lock` under 1 ms. The `ResolveStore` half alone gave ~45 fps (Boggle) and ~17 fps (TP). Risk and Monopoly Plus run as before with the change (Risk's board 20 fps, Monopoly's board 4 to 5 fps). <details><summary><code>tools/trace_digest.py</code> of the summary files (last windows are the measured scene)</summary> Boggle, without the change: ``` | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | | 10 | 135-150 | 225 | 66.3 | 73.3 | 86.2 | 106.3 | 12.9 | 99 % | Driver.Packet 65.9 | | 11 | 150-165 | 238 | 62.9 | 67.3 | 73.3 | 82.6 | 12.9 | 98 % | Driver.Packet 62.0 | ``` Boggle, with the change: ``` | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | | 10 | 135-150 | 895 | 16.7 | 16.9 | 21.9 | 24.8 | 5.7 | 93 % | Driver.Packet 15.6 | | 11 | 150-165 | 898 | 16.7 | 16.9 | 20.0 | 27.3 | 5.7 | 93 % | Driver.Packet 15.6 | ``` Trivial Pursuit Live!, without the change: ``` | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | | 15 | 210-226 | 96 | 147.5 | 197.1 | 705.4 | 705.4 | 22.3 | 99 % | Driver.Packet 155.3 | | 16 | 226-241 | 111 | 136.8 | 142.4 | 146.9 | 147.5 | 21.6 | 99 % | Driver.Packet 133.9 | ``` Trivial Pursuit Live!, with the change: ``` | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | | 15 | 210-225 | 380 | 41.4 | 53.6 | 57.4 | 374.2 | 12.3 | 87 % | Driver.Packet 34.3 | | 16 | 225-240 | 364 | 41.3 | 42.5 | 46.8 | 49.8 | 12.8 | 89 % | Driver.Packet 36.6 | ``` </details> Overlap (`tools/pr_overlap.py --branch` against current `main`): #7978 changes `preparePacketMemory`'s signature on the line after this pull request's new helper in `PacketMemory.cpp`, so the two conflict on adjacent lines; whichever merges second keeps both. #6549, #6960 and 14 other open pull requests share files with this one but conflict with `main` themselves, so the tool could not compare them. When last compared, #6549's and #6960's changes to `Pm4.cpp`, `tests/Pm4.cpp` and `PacketMemory.cpp` merged automatically with this branch. This pull request adds no debt entry. **Trace captures (first version).** One `APS5_TRACE_SECONDS` window per build in the same scenes, with no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch, warm caches, builds alternated. Neither is upstream `main`. The base is `adcc2b2b59`: #6977 at `93eeee0141` plus 62 PS4 commits from Get-fix/AnyPS5. The change is `7cee08fdaf`: the same plus this pull request's commit and a local logging switch (`APS5_LOG_DRAINED_STORES`), which was off in these runs. Full tracing slows the base more than the change. | Scene, 15 s window | Base `adcc2b2b59` | Change `7cee08fdaf` | | --- | --- | --- | | Boggle round (`APS5_TRACE_SECONDS=150:15`) | 121 presents, p50 124.1 ms | 899 presents, p50 16.7 ms | | Trivial Pursuit Live! question stage (`225:15`) | 109 presents, p50 137.6 ms | 342 presents, p50 43.4 ms | The traces (`aps5-trace-adcc2b2b59da-37996`, `aps5-trace-7cee08fdaf5c-9772`, `aps5-trace-adcc2b2b59da-33612`, `aps5-trace-7cee08fdaf5c-20504`, 2.2 to 2.7 MB each) will be attached in a comment, since they cannot be uploaded from the command line. <details><summary>Boggle, base: <code>tools/trace_digest.py</code></summary> **seconds 150:15** from present 7214: 121 presents, frame p50 124.1 / p90 133.0 / p99 148.6 / max 160.9 ms, GPU busy 12.2 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit adcc2b2b59da, dropped: no ```json {"commit":"adcc2b2b59da","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 150:15","first_present":7214,"ms":15090.566},"presents":121,"frame_ms":{"p50":124.11,"p90":133.032,"p99":148.561,"max":160.859},"gpu_busy_ms_per_present":12.249,"worker_busy_pct":{"queue worker 0x0":98.961},"top_phases_ms_per_frame":{"Driver.Packet":123.332,"Driver.Packet.prepare_memory":51.144,"Driver.Packet.device_lock":50.182,"Recorder.WaitSerial":28.385,"Recorder.Submit":16.596,"Driver.Packet.draw":12.678,"Driver.Draw":12.387,"Driver.Draw.shader_compile_and_link":6.243},"trace_dropped":false,"trace":"aps5-trace-adcc2b2b59da-37996.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 7292: 160.9 ms at 9780 ms: Driver.Packet (queue worker 0x0) 154.4, Driver.Packet.device_lock (queue worker 0x0) 88.4, Driver.Packet.prepare_memory (queue worker 0x0) 51.1, Recorder.WaitSerial (queue worker 0x0) 28.1 - present 7297: 148.6 ms at 10415 ms: Driver.Packet (queue worker 0x0) 142.3, Driver.Packet.device_lock (queue worker 0x0) 61.5, Driver.Packet.prepare_memory (queue worker 0x0) 60.9, Recorder.WaitSerial (queue worker 0x0) 40.5 - present 7259: 142.5 ms at 5652 ms: Driver.Packet (queue worker 0x0) 136.3, Driver.Packet.device_lock (queue worker 0x0) 51.9, Driver.Packet.prepare_memory (queue worker 0x0) 51.5, Recorder.WaitSerial (queue worker 0x0) 28.5 - present 7291: 139.1 ms at 9641 ms: Driver.Packet (queue worker 0x0) 132.8, Driver.Packet.prepare_memory (queue worker 0x0) 63.5, Driver.Packet.device_lock (queue worker 0x0) 48.9, Recorder.WaitSerial (queue worker 0x0) 31.4 - present 7217: 137.2 ms at 398 ms: Driver.Packet (queue worker 0x0) 130.8, Driver.Packet.prepare_memory (queue worker 0x0) 53.4, Driver.Packet.device_lock (queue worker 0x0) 50.8, Recorder.WaitSerial (queue worker 0x0) 30.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 89.3 (72 %) | 29.2 (23 %) | 6.2 | 22.3 | Driver.Packet 118.4, Driver.EndSubmission 0.1 | | presenter | 0.5 (0 %) | 0.2 (0 %) | 124.0 | 0.0 | Driver.Present 0.7 | | gpu | 12.4 (10 %) | 0.0 (0 %) | 112.4 | 0.0 | batch 12.4 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 118.4, Driver.Packet.prepare_memory 50.0, Driver.Packet.device_lock 49.5, Recorder.WaitSerial 28.3, Recorder.Submit 16.6, Driver.Packet.draw 12.7, Driver.Draw 12.4, batch 12.4, Driver.Draw.shader_compile_and_link 4.7, Shader.DrawStage 3.5 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 13.2 ms at 10407 ms, present 7296 - Recorder.WaitSerial (queue worker 0x0) 11.4 ms at 10481 ms, present 7297 - Recorder.WaitSerial (queue worker 0x0) 9.3 ms at 8913 ms, present 7285 - Recorder.WaitSerial (queue worker 0x0) 7.3 ms at 4726 ms, present 7251 - Recorder.WaitSerial (queue worker 0x0) 5.9 ms at 11015 ms, present 7301 - Driver.Packet.memory_wait (queue worker 0x0) 5.7 ms at 4401 ms, present 7249 - Driver.Packet.memory_wait (queue worker 0x0) 5.7 ms at 10809 ms, present 7299 - Vulkan.Acquire.acquire_fence_wait (presenter) 4.8 ms at 4401 ms, present 7249 - Recorder.WaitSerial (queue worker 0x0) 4.7 ms at 6244 ms, present 7263 - Recorder.WaitSerial (queue worker 0x0) 4.5 ms at 4387 ms, present 7248 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 25498: 4.0 ms at 13868 ms, present 7325: GPU no ranges; recorded by no CPU slices - batch 24562: 1.0 ms at 13349 ms, present 7321: GPU no ranges; recorded by no CPU slices - batch 14062: 1.0 ms at 7711 ms, present 7275: GPU no ranges; recorded by no CPU slices - batch 27523: 1.0 ms at 14962 ms, present 7334: GPU no ranges; recorded by no CPU slices - batch 4171: 1.0 ms at 2287 ms, present 7232: GPU no ranges; recorded by no CPU slices </details> <details><summary>Boggle, change: <code>tools/trace_digest.py</code></summary> **seconds 150:15** from present 8803: 899 presents, frame p50 16.7 / p90 16.9 / p99 19.3 / max 22.9 ms, GPU busy 6.2 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit 7cee08fdaf5c, dropped: no ```json {"commit":"7cee08fdaf5c","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 150:15","first_present":8803,"ms":15014.807},"presents":899,"frame_ms":{"p50":16.684,"p90":16.88,"p99":19.328,"max":22.911},"gpu_busy_ms_per_present":6.204,"worker_busy_pct":{"queue worker 0x0":92.909},"top_phases_ms_per_frame":{"Driver.Packet":15.511,"Driver.Packet.draw":3.693,"Driver.Draw":3.599,"Driver.Packet.memory_wait":3.059,"Driver.Draw.shader_compile_and_link":1.54,"Driver.Packet.device_lock":0.753,"Driver.Draw.prepare":0.741,"Driver.Packet.flush_between_packets":0.657},"trace_dropped":false,"trace":"aps5-trace-7cee08fdaf5c-9772.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 9489: 22.9 ms at 11445 ms: Driver.Packet (queue worker 0x0) 16.5, batch (gpu) 6.3, Driver.Packet.draw (queue worker 0x0) 3.1, Driver.Draw (queue worker 0x0) 3.0 - present 8835: 22.7 ms at 534 ms: Driver.Packet (queue worker 0x0) 16.8, batch (gpu) 6.3, Driver.Packet.draw (queue worker 0x0) 2.8, Driver.Draw (queue worker 0x0) 2.6 - present 8947: 22.4 ms at 2402 ms: Driver.Packet (queue worker 0x0) 16.4, Driver.Packet.device_lock (queue worker 0x0) 7.0, batch (gpu) 6.3, Driver.Packet.draw (queue worker 0x0) 2.2 - present 9551: 22.1 ms at 12482 ms: Driver.Packet (queue worker 0x0) 16.7, Driver.Packet.draw (queue worker 0x0) 9.0, Driver.Draw (queue worker 0x0) 8.8, batch (gpu) 6.4 - present 9547: 21.1 ms at 12413 ms: Driver.Packet (queue worker 0x0) 14.4, Driver.Packet.device_lock (queue worker 0x0) 6.9, batch (gpu) 6.4, Driver.Packet.draw (queue worker 0x0) 2.1 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 7.2 (43 %) | 3.6 (22 %) | 5.9 | 14.8 | Driver.Packet 10.2, Driver.EndSubmission 0.0 | | presenter | 0.3 (2 %) | 0.1 (1 %) | 16.3 | 0.0 | Driver.Present 0.5 | | gpu | 6.2 (37 %) | 0.0 (0 %) | 10.5 | 0.0 | batch 6.2 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 10.2, batch 6.2, Driver.Packet.memory_wait 3.1, Driver.Packet.draw 1.7, Driver.Draw 1.7, Driver.Draw.shader_compile_and_link 0.6, Driver.WorkerWait 0.6, Driver.WorkerWait.idle_and_completion_poll 0.6, Driver.Present 0.5, Driver.Packet.dispatch 0.4 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 5.8 ms at 7421 ms, present 9247 - Driver.Packet.memory_wait (queue worker 0x0) 5.2 ms at 4216 ms, present 9055 - Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 6869 ms, present 9214 - Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 5752 ms, present 9147 - Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 8238 ms, present 9296 - Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 14744 ms, present 9685 - Driver.Packet.memory_wait (queue worker 0x0) 5.0 ms at 8221 ms, present 9295 - Driver.Packet.memory_wait (queue worker 0x0) 4.9 ms at 13176 ms, present 9591 - Driver.Packet.memory_wait (queue worker 0x0) 4.9 ms at 10907 ms, present 9456 - Driver.Packet.memory_wait (queue worker 0x0) 4.9 ms at 6652 ms, present 9201 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 7885: 3.9 ms at 10432 ms, present 9428: GPU no ranges; recorded by no CPU slices - batch 11154: 3.3 ms at 14617 ms, present 9678: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.1, Driver.Packet.draw (queue worker 0x0) 0.2, Driver.Draw (queue worker 0x0) 0.2, Driver.Packet.dispatch (queue worker 0x0) 0.1 - batch 82: 3.2 ms at 102 ms, present 8809: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 6.9, Driver.Packet.draw (queue worker 0x0) 1.4, Driver.Draw (queue worker 0x0) 1.3, Driver.Draw.shader_compile_and_link (queue worker 0x0) 0.4 - batch 7116: 3.2 ms at 9394 ms, present 9366: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 6.9, Driver.Packet.draw (queue worker 0x0) 1.2, Driver.Draw (queue worker 0x0) 1.1, Driver.Packet.dispatch (queue worker 0x0) 0.4 - batch 11403: 3.2 ms at 14950 ms, present 9698: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 6.2, Driver.Packet.draw (queue worker 0x0) 3.1, Driver.Draw (queue worker 0x0) 3.0, Driver.Draw.shader_compile_and_link (queue worker 0x0) 1.5 </details> <details><summary>Trivial Pursuit Live!, base: <code>tools/trace_digest.py</code></summary> **seconds 225:15** from present 9509: 109 presents, frame p50 137.6 / p90 148.3 / p99 155.6 / max 163.4 ms, GPU busy 21.7 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit adcc2b2b59da, dropped: yes ```json {"commit":"adcc2b2b59da","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"225:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 225:15","first_present":9509,"ms":15078.636},"presents":109,"frame_ms":{"p50":137.63,"p90":148.251,"p99":155.588,"max":163.418},"gpu_busy_ms_per_present":21.696,"worker_busy_pct":{"queue worker 0x0":98.7},"top_phases_ms_per_frame":{"Driver.Packet":136.52,"Driver.Packet.prepare_memory":57.689,"Driver.Packet.device_lock":57.006,"Recorder.WaitSerial":40.242,"Driver.Packet.draw":13.309,"Driver.Draw":13.105,"Recorder.Submit":12.863,"Driver.Draw.shader_compile_and_link":8.5},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":11.278,"events_lost":91737,"totals_full":false}},"trace":"aps5-trace-adcc2b2b59da-33612.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 9559: 163.4 ms at 6801 ms: Driver.Packet (queue worker 0x0) 154.6, Driver.Packet.device_lock (queue worker 0x0) 67.1, Driver.Packet.prepare_memory (queue worker 0x0) 63.4, Recorder.WaitSerial (queue worker 0x0) 42.0 - present 9560: 155.6 ms at 6965 ms: Driver.Packet (queue worker 0x0) 146.8, Driver.Packet.device_lock (queue worker 0x0) 63.9, Driver.Packet.prepare_memory (queue worker 0x0) 62.4, Recorder.WaitSerial (queue worker 0x0) 41.7 - present 9561: 153.7 ms at 7120 ms: Driver.Packet (queue worker 0x0) 144.9, Driver.Packet.device_lock (queue worker 0x0) 62.8, Driver.Packet.prepare_memory (queue worker 0x0) 61.4, Recorder.WaitSerial (queue worker 0x0) 41.9 - present 9563: 153.6 ms at 7426 ms: Driver.Packet (queue worker 0x0) 144.1, Driver.Packet.device_lock (queue worker 0x0) 63.7, Driver.Packet.prepare_memory (queue worker 0x0) 61.5, Recorder.WaitSerial (queue worker 0x0) 41.8 - present 9564: 152.9 ms at 7579 ms: Driver.Packet (queue worker 0x0) 143.4, Driver.Packet.device_lock (queue worker 0x0) 63.7, Driver.Packet.prepare_memory (queue worker 0x0) 60.0, Recorder.WaitSerial (queue worker 0x0) 40.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 66.9 (48 %) | 30.5 (22 %) | 40.9 | 28.9 | Driver.Packet 96.9, Driver.EndSubmission 0.0 | | presenter | 0.3 (0 %) | 0.1 (0 %) | 138.0 | 0.0 | Driver.Present 0.4 | | gpu | 21.7 (16 %) | 0.0 (0 %) | 116.6 | 0.0 | batch 21.7 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 96.9, Driver.Packet.prepare_memory 42.4, Driver.Packet.device_lock 42.2, Recorder.WaitSerial 30.0, batch 21.7, Recorder.Submit 9.4, Driver.Packet.draw 8.4, Driver.Draw 8.2, Driver.Draw.shader_compile_and_link 4.3, Driver.Packet.dispatch 1.4 **Longest waits** - Recorder.WaitSerial (queue worker 0x0) 3.7 ms at 8697 ms, present 9571 - Recorder.WaitSerial (queue worker 0x0) 3.7 ms at 1904 ms, present 9522 - Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 260 ms, present 9510 - Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 1210 ms, present 9517 - Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 5670 ms, present 9550 - Recorder.WaitSerial (queue worker 0x0) 3.6 ms at 8844 ms, present 9572 - Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 2296 ms, present 9525 - Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 6773 ms, present 9558 - Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 10279 ms, present 9582 - Recorder.WaitSerial (queue worker 0x0) 3.5 ms at 3607 ms, present 9535 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 5566: 3.6 ms at 1904 ms, present 9522: GPU no ranges; recorded by no CPU slices - batch 16697: 3.6 ms at 5670 ms, present 9550: GPU no ranges; recorded by no CPU slices - batch 34277: 3.6 ms at 11802 ms, present 9593: GPU no ranges; recorded by no CPU slices - batch 25254: 3.5 ms at 8697 ms, present 9571: GPU no ranges; recorded by no CPU slices - batch 25669: 3.5 ms at 8844 ms, present 9572: GPU no ranges; recorded by no CPU slices </details> <details><summary>Trivial Pursuit Live!, change: <code>tools/trace_digest.py</code></summary> **seconds 225:15** from present 11292: 342 presents, frame p50 43.4 / p90 47.6 / p99 49.7 / max 88.7 ms, GPU busy 13.5 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit 7cee08fdaf5c, dropped: yes ```json {"commit":"7cee08fdaf5c","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"225:15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 225:15","first_present":11292,"ms":15019.167},"presents":342,"frame_ms":{"p50":43.392,"p90":47.551,"p99":49.736,"max":88.679},"gpu_busy_ms_per_present":13.451,"worker_busy_pct":{"queue worker 0x0":88.944},"top_phases_ms_per_frame":{"Driver.Packet":39.054,"Driver.Packet.draw":13.238,"Driver.Draw":13.045,"Driver.Draw.shader_compile_and_link":6.969,"Shader.DrawStage":3.961,"Driver.Draw.draw_enqueued":3.126,"Driver.Present":3.019,"Driver.Draw.prepare":2.232},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":9.555,"events_lost":138618,"totals_full":false}},"trace":"aps5-trace-7cee08fdaf5c-20504.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 11540: 88.7 ms at 10983 ms: batch (gpu) 17.3, Driver.Present (presenter) 3.8, Driver.Present.acquire_image (presenter) 2.9, Vulkan.Acquire (presenter) 2.9 - present 11462: 53.9 ms at 7626 ms: Driver.Packet (queue worker 0x0) 42.0, batch (gpu) 20.6, Driver.Packet.draw (queue worker 0x0) 12.9, Driver.Draw (queue worker 0x0) 12.6 - present 11329: 51.7 ms at 1714 ms: Driver.Packet (queue worker 0x0) 39.6, batch (gpu) 15.8, Driver.Packet.draw (queue worker 0x0) 14.5, Driver.Draw (queue worker 0x0) 14.2 - present 11321: 49.7 ms at 1322 ms: Driver.Packet (queue worker 0x0) 37.4, batch (gpu) 14.9, Driver.Packet.draw (queue worker 0x0) 12.6, Driver.Draw (queue worker 0x0) 12.3 - present 11294: 49.5 ms at 87 ms: Driver.Packet (queue worker 0x0) 37.6, Driver.Packet.draw (queue worker 0x0) 15.0, Driver.Draw (queue worker 0x0) 14.7, batch (gpu) 10.4 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 20.1 (46 %) | 2.2 (5 %) | 21.6 | 20.1 | Driver.Packet 20.1, Driver.EndSubmission 0.0 | | presenter | 0.3 (1 %) | 2.7 (6 %) | 40.9 | 0.0 | Driver.Present 3.0 | | gpu | 13.5 (31 %) | 0.0 (0 %) | 30.5 | 0.0 | batch 13.5 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 20.1, batch 13.5, Driver.Packet.draw 6.8, Driver.Draw 6.6, Driver.Present 3.0, Driver.Draw.shader_compile_and_link 2.8, Driver.WorkerWait 2.2, Driver.WorkerWait.idle_and_completion_poll 2.2, Driver.Present.acquire_image 1.8, Vulkan.Acquire 1.8 **Longest waits** - Driver.WorkerWait (queue worker 0x0) 4.7 ms at 2390 ms, present 11342 - Driver.WorkerWait (queue worker 0x0) 4.6 ms at 9156 ms, present 11497 - Driver.WorkerWait (queue worker 0x0) 4.4 ms at 1226 ms, present 11318 - Driver.WorkerWait (queue worker 0x0) 4.3 ms at 2529 ms, present 11345 - Driver.WorkerWait (queue worker 0x0) 4.3 ms at 1912 ms, present 11332 - Driver.WorkerWait (queue worker 0x0) 4.2 ms at 2248 ms, present 11339 - Driver.WorkerWait (queue worker 0x0) 4.2 ms at 5621 ms, present 11415 - Driver.WorkerWait (queue worker 0x0) 4.2 ms at 9463 ms, present 11504 - Driver.WorkerWait (queue worker 0x0) 4.2 ms at 1863 ms, present 11331 - Driver.WorkerWait (queue worker 0x0) 4.2 ms at 9199 ms, present 11498 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 6280: 8.7 ms at 7667 ms, present 11462: GPU no ranges; recorded by no CPU slices - batch 11165: 5.8 ms at 13689 ms, present 11602: GPU no ranges; recorded by no CPU slices - batch 6986: 5.5 ms at 8503 ms, present 11482: GPU no ranges; recorded by no CPU slices - batch 4066: 5.4 ms at 4954 ms, present 11400: GPU no ranges; recorded by no CPU slices - batch 8333: 5.4 ms at 10163 ms, present 11520: GPU no ranges; recorded by no CPU slices </details> One of five Trivial Pursuit runs with the change stopped about 218 s in on a libc heap error: a freed `ALLOC_GFX` chunk overwritten with `0xff`, reported through the unimplemented `sceKernelPrintBacktraceWithModuleInfo`. One of five runs without the change ended without a message at a similar point. Whether this pull request makes the heap error more likely is not known yet; it is being looked at separately. ### 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] Fixes: none - [x] Unblocks: none (CUSA03312 #7198 on #6977's branch ran faster with earlier versions; this head is not measured there) - [x] GPUs tested: AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-21 20:04:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T20:04:46Z.


This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6325373962 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6325373962). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T20:04:46Z. --- <!-- pr-labels-perf --> This pull request is labeled `perf`, so it needs the summary line of a capture on `main` and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both `aps5-summary.jsonl` lines, attach the two traces and add the output of `tools/trace_digest.py`.
savvaniss commented 2026-10-21 20:45:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T20:45:00Z.


I checked the shared files of the pull requests the overlap check could not compare. None of them changes what this one changes:

  • #6501 adds enqueueSampleDumpPacket to the same enqueueLabelPacket(...) || enqueueDmaPacket(...) line in PacketExecution.cpp. The two merge side by side.
  • #6549 adds COPY_DATA to and from the GDS. A COPY_DATA drains the draw pipeline before it runs, so a GDS fill this pull request queues is committed before a COPY_DATA reads the GDS.
  • #6946, #6947 and #7642 only set APS5_PIPELINE_DMA in their own tests. Their pipelined DMA_DATA paths are unchanged here, apart from the immediate GDS fill, which is now queued without the switch.
  • The rest touch other entries of docs/dev/ARCHITECTURE.md, docs/dev/ENVIRONMENT.md or tests/Pm4.cpp.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6326155450 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6326155450). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-21T20:45:00Z. --- I checked the shared files of the pull requests the overlap check could not compare. None of them changes what this one changes: - #6501 adds `enqueueSampleDumpPacket` to the same `enqueueLabelPacket(...) || enqueueDmaPacket(...)` line in `PacketExecution.cpp`. The two merge side by side. - #6549 adds `COPY_DATA` to and from the GDS. A `COPY_DATA` drains the draw pipeline before it runs, so a GDS fill this pull request queues is committed before a `COPY_DATA` reads the GDS. - #6946, #6947 and #7642 only set `APS5_PIPELINE_DMA` in their own tests. Their pipelined `DMA_DATA` paths are unchanged here, apart from the immediate GDS fill, which is now queued without the switch. - The rest touch other entries of `docs/dev/ARCHITECTURE.md`, `docs/dev/ENVIRONMENT.md` or `tests/Pm4.cpp`.
MarcZX10 commented 2026-10-22 06:28:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T06:28:17Z.

Review: CHANGES_REQUESTED


I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5610089073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9385#pullrequestreview-5610089073). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T06:28:17Z. **Review:** CHANGES_REQUESTED --- ## Changes requested The `perf` label's required evidence is not yet satisfied as written. The repository's [game testing guidance](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/GAME_TESTING.md#performance-testing) and the automated comment on this PR request captures from upstream `main` and the changed build, using the same title, scene and machine. The title A/B sections here use #6977's PS4 integration branch (for example, base `adcc2b2b59da`, change `7cee08fdaf5c`); the summary calls the base `main`, but this is not upstream `main`. Please provide the required upstream-main comparison, or ask the maintainer whether this integration-branch-only title evidence qualifies for an exception because the title does not run on current main. Keep the branch and environment explicit in any report. This PR gives a concrete CUSA03312 packet and strong evidence on #6977's branch, but that branch is not current main. Please also refresh the 472-commit-stale branch against current `main` (`d6eafa54d0464258574fd2f71889754d05a5bc93`) before merge, then rerun convention, overlap and relevant test checks. The merge-tree of this PR alone with current main is clean. ## Overlap coordination I checked the active related PR heads. #6549's `COPY_DATA` changes are distinct from this `DMA_DATA` change; their `Pm4.cpp` and `tests/Pm4.cpp` changes merge automatically, while the `libSceAgcDriver.md` debt file conflicts and needs both entries preserved. #6501's `PacketMemory.cpp` change merges automatically with this head, although the pair has conflicts in adjacent pipeline/test files. #6960's `PacketMemory.cpp` change also merges automatically; its texture-file conflicts are elsewhere. Please refresh the overlap report after rebasing and coordinate any file conflicts with those authors; no `Depends on` is implied by these independent topics. ## Checks observed - Local `python3 tools/check_conventions.py --base upstream/main`: passed. - Local `git diff --check upstream/main...refs/review/9385`: passed. - Local Linux `agc_driver_pm4_tests` and `agc_driver_gds_dma_fill_tests` targets: compiled and linked successfully. - Local CTest for `agc_driver_pm4` and `agc_driver_gds_dma_fill`: both abort before test assertions because the host CPU lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA. No local GPU runtime result is claimed. - The PR reports focused RX 9070 XT Vulkan validation-layer tests and title A/B runs; those were not reproduced locally. Hosted eligibility, conventions, intake, labels and report checks passed; product build jobs were skipped. I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
savvaniss commented 2026-10-22 10:55:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-22T10:55:07Z.


@MarcZX10 thanks for the review.

Refresh. I merged current main (4777caca34) into the branch (41f483c8e2). It merged without conflicts and the diff is unchanged. check_conventions.py --base origin/main passes. Focused tests on the RX 9070 XT with ANYPS5_GPU=AMD, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver, agc_driver_pm4 with its 13 agc_driver_pm4_* mode tests (the replay pair was not built), agc_driver_gds_append_consume and agc_driver_pipelined_dma pass on main (17 of 17). This branch passes the same tests plus agc_driver_gds_dma_fill (18 of 18). Neither log has a VUID- line or the missing-layer message.

Overlap. The refreshed pr_overlap.py --branch report matches the bot's: only #9400's ARCHITECTURE.md lines conflict. On your notes, each head gives the same conflicts merged into this branch as merged into main alone, so none of them comes from this pull request:

  • #6549 conflicts in docs/dev/debt/libSceAgcDriver.md. This pull request adds no debt entry. The conflict is #6549's new "COPY_DATA to or from GDS" entry against main's rewritten INDEX_ATTRIBUTES_INDIRECT entry next to it, and the resolution keeps both entries. Pm4.cpp and tests/Pm4.cpp merge automatically.
  • #6501 conflicts with main in CMakeLists.txt, SynchronizationStatistics.hpp/.cpp and PacketExecution.cpp. PacketMemory.cpp merges automatically.
  • #6960 conflicts with main in Texture.hpp and Texture.cpp. PacketMemory.cpp merges automatically.

Performance evidence. You're right that neither build is upstream main. Both are #6977's PS4 integration branch: the base adcc2b2b59 is #6977 at 93eeee0141 plus 62 PS4 commits from Get-fix/AnyPS5, and the change 7cee08fdaf is the same plus this pull request's commit. The description now says so. CUSA03312 does not run on current main, since PS4 titles need #6977's branch, so a main capture of this title is not possible.

I also looked for a PS5 path on main that would let this stand alone. sceAgcDcbDmaData and sceAgcAcbDmaData accept a GDS destination, and agc_driver_gds_append_consume sets its counters that way. But I found no issue, pull request or trace that names a PS5 title emitting these fills, and I have none to measure. So I have no main measurement to offer. agc_driver_gds_dma_fill covers the behaviour, not the speed.

@oneandonlydean: the title cannot run on current main. Does this integration-branch A/B (same RX 9070 XT, same scenes, builds alternated, branch and commits as above) qualify for an exception to the perf evidence rule and to the #5239 intake hold? This pull request stays on hold until you confirm.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339024045 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9385#issuecomment-6339024045). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-22T10:55:07Z. --- @MarcZX10 thanks for the review. **Refresh.** I merged current `main` (`4777caca34`) into the branch (`41f483c8e2`). It merged without conflicts and the diff is unchanged. `check_conventions.py --base origin/main` passes. Focused tests on the RX 9070 XT with `ANYPS5_GPU=AMD`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: `agc_driver`, `agc_driver_pm4` with its 13 `agc_driver_pm4_*` mode tests (the replay pair was not built), `agc_driver_gds_append_consume` and `agc_driver_pipelined_dma` pass on `main` (17 of 17). This branch passes the same tests plus `agc_driver_gds_dma_fill` (18 of 18). Neither log has a `VUID-` line or the missing-layer message. **Overlap.** The refreshed `pr_overlap.py --branch` report matches the bot's: only #9400's `ARCHITECTURE.md` lines conflict. On your notes, each head gives the same conflicts merged into this branch as merged into `main` alone, so none of them comes from this pull request: - #6549 conflicts in `docs/dev/debt/libSceAgcDriver.md`. This pull request adds no debt entry. The conflict is #6549's new "COPY_DATA to or from GDS" entry against `main`'s rewritten INDEX_ATTRIBUTES_INDIRECT entry next to it, and the resolution keeps both entries. `Pm4.cpp` and `tests/Pm4.cpp` merge automatically. - #6501 conflicts with `main` in `CMakeLists.txt`, `SynchronizationStatistics.hpp`/`.cpp` and `PacketExecution.cpp`. `PacketMemory.cpp` merges automatically. - #6960 conflicts with `main` in `Texture.hpp` and `Texture.cpp`. `PacketMemory.cpp` merges automatically. **Performance evidence.** You're right that neither build is upstream `main`. Both are #6977's PS4 integration branch: the base `adcc2b2b59` is #6977 at `93eeee0141` plus 62 PS4 commits from Get-fix/AnyPS5, and the change `7cee08fdaf` is the same plus this pull request's commit. The description now says so. CUSA03312 does not run on current `main`, since PS4 titles need #6977's branch, so a `main` capture of this title is not possible. I also looked for a PS5 path on `main` that would let this stand alone. `sceAgcDcbDmaData` and `sceAgcAcbDmaData` accept a GDS destination, and `agc_driver_gds_append_consume` sets its counters that way. But I found no issue, pull request or trace that names a PS5 title emitting these fills, and I have none to measure. So I have no `main` measurement to offer. `agc_driver_gds_dma_fill` covers the behaviour, not the speed. @oneandonlydean: the title cannot run on current `main`. Does this integration-branch A/B (same RX 9070 XT, same scenes, builds alternated, branch and commits as above) qualify for an exception to the `perf` evidence rule and to the #5239 intake hold? This pull request stays on hold until you confirm.
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!9385
No description provided.