perf(agc): write the draw profile reports through the asynchronous profile output #9373

Merged
thuanquang merged 1 commit from upstream-pr/9373 into main 2026-10-24 16:49:00 +00:00
thuanquang commented 2026-10-21 19:35:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T19:35:21Z.


What

With APS5_PROFILE_DRAW=1, three 10 s reports were still written with std::fprintf(stderr) on the threads that run draws:

  • the 10 s [draws] report and its [rescache] draws: line in reportDraw (Graphics/src/Draw.cpp), on the draw committer, with DrawProfile's mutex held;
  • the 10 s [draw] pipelined line in DrawPipeline::report, on the queue worker, with the pipeline mutex held;
  • the 10 s [finisher] draws line that #6946 added, in noteFinisherHandOff (Execution/src/Driver/Draw/Draw.cpp), on the queue worker in the draw path.

The draw committer also holds GuestMemory::GpuMutex around the draw (Execution/src/Driver/Draw/Draw.cpp:1048). So the report write held up every user of the GPU lock, not only the callers of DrawProfile's mutex.

The CRT's stderr is unbuffered. When it is not a console, a printf-family call writes it one byte per WriteFile, so a 1 KB [draws] line costs about 1000 writes. All three now go through ProfilePrint_nid_no_patch, as the other periodic reports have since #798. It formats on the caller and writes from its own thread with one fwrite. The text of the lines is unchanged.

Why

In a profiled game run with stderr redirected by Start-Process -RedirectStandardError (how our scripts start the game), every 10 s window had one frame of 134 to 177 ms. That frame comes from the profiler, not the game, so the p99 and max of profiled runs could not be trusted. #798 measured up to 107 ms for single synchronous writes; this report was not part of that change.

A micro-benchmark shows the cost of one call. Stderr was redirected to a file on D: the same way run.ps1 starts the game, with the project's compile flags and its force-included HostStandardStreams.hpp, 50 calls each:

one call, 1035-char line (the mean [draws] length) median max WriteFiles
std::fprintf(stderr, "%s\n", line) 117 ms 397 ms 1036
the [draws] + [rescache] pair 134 ms 342 ms 1213
one std::fwrite of the line 0.11 ms 0.23 ms 1
ProfilePrint_nid_no_patch, caller side 3.5 us 50 us 0

How much one write costs depends on how stderr is opened:

  • Our runs. Windows PowerShell 5.1's Start-Process -RedirectStandardError opens the file write-through (FileModeInformation 0x22). One WriteFile on it takes 0.11 to 0.39 ms, so the pair costs about 134 ms. That is the setup of the table above and of the game runs below.
  • A normally opened file on the same disk. One write takes 2 to 5 us, so the pair would cost a few ms. This is inferred from the per-write cost, not measured in the game.
  • Either way, about 1200 writes per report move off the draw committer and the queue worker.

Tested

Rebased again onto main 513ca7e558 (head 09b9bf9afa) after #6292 added Mutex.hpp to the same include list in Graphics/src/Draw.cpp: both includes kept, nothing else changed (git range-diff shows only that context line). On this head, built clean: the 23 tests below, 3 rounds, all pass; under the Khronos validation layer 23 of 23 pass with 0 VUID- lines, the layer inserted 51 times, no "was not found" line. The measurements further down are from 04a63e9d8d, whose code is the same apart from that include.

Rebased onto main 0db47b263d (head 04a63e9d8d), after #6946 merged into the same [draw] pipelined line, which now also reports the lock wait and the committer wakes. The rebase keeps main's line and only switches its write to ProfilePrint_nid_no_patch, as before; the [draws] and [rescache] changes applied unchanged. #6946 also added the [finisher] report, written the same way, so this head moves that line too (one call and its include). ProfilePrint_nid_no_patch has no switch of its own, so the line still appears with APS5_PIPELINE_STATS alone. On this head and on main 0db47b263d, both built clean, with the tests listed below plus agc_driver_prepared_shaders itself (23 in all):

  • 23 tests, 3 rounds, all pass on both sides.
  • Under the Khronos validation layer, 23 of 23 pass with 0 VUID- lines on both sides. VK_LOADER_DEBUG=layer shows the layer inserted 51 times on main and 51 times on this head, with no "was not found" line.

Before the rebase, on main 7e2ba73e4c and head 64e264f8dd:

Tests that turn on APS5_PROFILE_DRAW (none of them parses the report text): agc_driver_address_passes, agc_driver_address_passes_targets_split, agc_driver_dispatch_differing_value_sets, agc_driver_rect_list_indirect, and agc_driver_prepared_shaders_debug and _debug_failure, run together with the other 16 agc_driver_prepared_shaders_* modes.

  • 22 tests, 3 rounds, all pass.
  • Under the Khronos validation layer, on main 7e2ba73e4c and on this PR, 22 of 22 pass with 0 VUID- lines on both sides. VK_LOADER_DEBUG=layer shows the layer inserted 48 times on each side, with no "was not found" line.
  • No new test. A red test would need a GPU test that blocks stderr on a full pipe for over 10 s, because the report interval is fixed. As in #798, the writer itself is covered by agc_profile_output, which this PR does not change.
  • Ordering: the lines keep their order among the profile output. They can now land after a synchronous stderr line written later, such as an error. Nothing reads them that way: tools/trace_digest.py and tools/performance_compare.py read the JSON trace and summaries.

PPSA14363 on main 0db47b263d, rerun for this head (METAL GEAR SOLID Master Collection Vol. 1, own dump), RX 6700 XT:

  • Setup. Launcher title screen, 150 s, APS5_PROFILE_DRAW=1, APS5_TRACE_SUMMARY_EVERY=10 and a 20 s trace window at 100 s (APS5_TRACE_SECONDS=100:20), no frame dumps.
  • Both sides built clean (dirty: false): main 0db47b263d and this head 04a63e9d8d, with only libSceAgcDriver.prx swapped.
  • Isolation. Each run held this PC's exclusive GPU lock and its build lock, and nobody used the PC (no input for more than 5 minutes before and during every run).
  • Results. Per 10 s window, from 20 s on, without 110 to 120 s, whose last frame writes the trace:
Launcher title, per 10 s window main, 15:12 main, 15:22 this PR, 15:28 this PR, 15:32 main, 15:35
presents 588 to 593 580 to 591 600 600 590 to 592
frame p99 17.3 to 17.7 ms 17.3 to 18.0 ms 17.3 to 17.7 ms 17.2 to 17.4 ms 17.3 to 17.6 ms
frame max 125.8 to 247.7 ms 135.1 to 298.7 ms 17.5 to 21.8 ms 17.3 to 18.1 ms 123.0 to 159.8 ms
windows with a frame over 20 ms 11 of 11 11 of 11 1 of 10 0 of 11 11 of 11
  • Left out: a main run at 15:25, during which something outside the emulator slowed the PC (373 to 590 presents, frames of 1 to 4 s, the queue worker waiting in draw_enqueued); this head was not run then. Also two runs of this head's code at 15:15 and 15:19 from a build made before the commit was amended, so their summaries say dirty: true; they read the same (600 presents, max 17.4 to 18.8 ms).
Summary lines of the five trace windows (100 to 120 s), in the table's order
{"commit":"0db47b263d10","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5846,"ms":20004.022},"presents":1181,"frame_ms":{"p50":16.684,"p90":16.931,"p99":17.407,"max":148.418},"gpu_busy_ms_per_present":1.212,"worker_busy_pct":{"queue worker 0x0":4.402},"top_phases_ms_per_frame":{"VideoOut.Flip":8.810,"VideoOut.Flip.vblank_wait":7.475,"VideoOut.Flip.present":1.175,"Driver.Present":1.172,"Driver.Present.acquire_image":0.782,"Vulkan.Acquire":0.781,"Driver.Packet":0.742,"Vulkan.Acquire.acquire_fence_wait":0.710},"trace_dropped":false,"trace":"aps5-trace-0db47b263d10-17748.json.gz"}
{"commit":"0db47b263d10","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5821,"ms":20003.256},"presents":1175,"frame_ms":{"p50":16.684,"p90":16.944,"p99":17.448,"max":191.424},"gpu_busy_ms_per_present":1.198,"worker_busy_pct":{"queue worker 0x0":5.228},"top_phases_ms_per_frame":{"VideoOut.Flip":8.937,"VideoOut.Flip.vblank_wait":7.596,"VideoOut.Flip.present":1.190,"Driver.Present":1.186,"Driver.Packet":0.886,"Driver.Present.acquire_image":0.783,"Vulkan.Acquire":0.782,"Vulkan.Acquire.acquire_fence_wait":0.701},"trace_dropped":false,"trace":"aps5-trace-0db47b263d10-2012.json.gz"}
{"commit":"04a63e9d8d50","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5945,"ms":20003.215},"presents":1199,"frame_ms":{"p50":16.692,"p90":17.047,"p99":17.539,"max":17.750},"gpu_busy_ms_per_present":1.221,"worker_busy_pct":{"queue worker 0x0":3.448},"top_phases_ms_per_frame":{"VideoOut.Flip":1.975,"VideoOut.Flip.present":1.770,"Driver.Present":1.766,"Driver.Present.acquire_image":1.318,"Vulkan.Acquire":1.316,"Vulkan.Acquire.acquire_fence_wait":1.203,"Driver.Packet":0.569,"Graphics.Draw":0.315},"trace_dropped":false,"trace":"aps5-trace-04a63e9d8d50-24480.json.gz"}
{"commit":"04a63e9d8d50","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5914,"ms":20002.879},"presents":1199,"frame_ms":{"p50":16.685,"p90":16.944,"p99":17.233,"max":17.590},"gpu_busy_ms_per_present":1.220,"worker_busy_pct":{"queue worker 0x0":2.292},"top_phases_ms_per_frame":{"VideoOut.Flip":1.833,"VideoOut.Flip.present":1.722,"Driver.Present":1.720,"Driver.Present.acquire_image":1.308,"Vulkan.Acquire":1.307,"Vulkan.Acquire.acquire_fence_wait":1.240,"Driver.Packet":0.379,"Driver.Present.render_fence_wait":0.242},"trace_dropped":false,"trace":"aps5-trace-04a63e9d8d50-4944.json.gz"}
{"commit":"0db47b263d10","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5843,"ms":20003.308},"presents":1182,"frame_ms":{"p50":16.683,"p90":16.913,"p99":17.326,"max":123.812},"gpu_busy_ms_per_present":1.201,"worker_busy_pct":{"queue worker 0x0":4.241},"top_phases_ms_per_frame":{"VideoOut.Flip":14.559,"VideoOut.Flip.vblank_wait":13.737,"Driver.Packet":0.715,"VideoOut.Flip.present":0.703,"Driver.Present":0.700,"Driver.Packet.draw":0.468,"Driver.Draw":0.461,"Driver.Draw.draw_enqueued":0.346},"trace_dropped":false,"trace":"aps5-trace-0db47b263d10-27900.json.gz"}

PPSA14363 (METAL GEAR SOLID Master Collection Vol. 1, own dump), RX 6700 XT, measured before the rebase:

  • Setup. Launcher title screen, 150 s, APS5_PROFILE_DRAW=1, APS5_TRACE_SUMMARY_EVERY=10 and a 20 s trace window at 100 s (APS5_TRACE_SECONDS=100:20), no frame dumps.
  • Both sides are built clean, main 7e2ba73e4c and this PR's head 64e264f8dd, each with #9115's trophy fix (which gets past stop 1), with only libSceAgcDriver.prx swapped.
  • Isolation. The runs held this PC's GPU and build locks, so no other job ran next to them.
  • Results. Per 10 s window, from 20 s on, without 110 to 120 s, whose last frame writes the trace on both sides:
presents p99 max
main 7e2ba73e4c 590-592 17.3-17.9 ms 127.0-161.9 ms
this PR 64e264f8dd 600 17.2-17.5 ms 17.4-19.3 ms

An earlier A/B on main 1896871ba7 read the same, and showed that without the DrawPipeline.cpp line the max stays at 45 to 75 ms (one 103 ms).

Summary lines of the trace window, 100 to 120 s. First main, then this PR:

{"commit":"7e2ba73e4c8c","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5865,"ms":20004.400},"presents":1183,"frame_ms":{"p50":16.683,"p90":16.903,"p99":17.349,"max":161.892},"gpu_busy_ms_per_present":1.144,"worker_busy_pct":{"queue worker 0x0":4.237},"top_phases_ms_per_frame":{"VideoOut.Flip":15.688,"VideoOut.Flip.vblank_wait":14.896,"Driver.Packet":0.714,"VideoOut.Flip.present":0.625,"Driver.Present":0.621,"Graphics.Draw":0.473,"Driver.Packet.draw":0.439,"Driver.Draw":0.433},"trace_dropped":false,"trace":"aps5-trace-7e2ba73e4c8c-19744.json.gz"}
{"commit":"64e264f8ddfc","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5944,"ms":20003.317},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.929,"p99":17.308,"max":17.716},"gpu_busy_ms_per_present":1.145,"worker_busy_pct":{"queue worker 0x0":2.426},"top_phases_ms_per_frame":{"VideoOut.Flip":15.844,"VideoOut.Flip.vblank_wait":15.112,"VideoOut.Flip.present":0.597,"Driver.Present":0.594,"Driver.Packet":0.403,"Driver.Present.acquire_image":0.258,"Vulkan.Acquire":0.257,"Graphics.Draw":0.241},"trace_dropped":false,"trace":"aps5-trace-64e264f8ddfc-19808.json.gz"}

tools/performance_compare.py on these two lines and the tools/trace_digest.py tables of both runs are in this comment. Traces are not attached, because these runs come from a commercial title.

tools/check_conventions.py passes.

Not tested: other GPUs, Linux. The same synchronous write remains in a few rarer reports ([indirect], [fill], [fill-cover]/[fill-clear], [dispatch-item], none of which this title prints; and #6946's [finisher-held] and [epoch-proofs] lines, which print at power-of-two counts) and in the [gpu] frame_NNN.bmp line of APS5_DUMP_FRAMES, which #8807 works near. So is the per-draw [draw] line of APS5_TRACE_DRAWS, which stays synchronous so it keeps its order with the same draw's other trace lines. They are left for a follow-up.

Overlap:

  • #6946 merged into the same [draw] pipelined line, and this PR now carries its extended version. #7642 and #1896 (drafts) and #9508 edit that line too; all three conflict with main now. #6947 was closed.
  • #7622 changes how ProfileOutput starts its thread. It does not conflict with this PR.

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
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, Windows 11 26200
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4957270493 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9373). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T19:35:21Z. --- ### What With `APS5_PROFILE_DRAW=1`, three 10 s reports were still written with `std::fprintf(stderr)` on the threads that run draws: - the 10 s `[draws]` report and its `[rescache] draws:` line in `reportDraw` (`Graphics/src/Draw.cpp`), on the draw committer, with `DrawProfile`'s mutex held; - the 10 s `[draw] pipelined` line in `DrawPipeline::report`, on the queue worker, with the pipeline mutex held; - the 10 s `[finisher] draws` line that #6946 added, in `noteFinisherHandOff` (`Execution/src/Driver/Draw/Draw.cpp`), on the queue worker in the draw path. The draw committer also holds `GuestMemory::GpuMutex` around the draw (`Execution/src/Driver/Draw/Draw.cpp:1048`). So the report write held up every user of the GPU lock, not only the callers of `DrawProfile`'s mutex. The CRT's stderr is unbuffered. When it is not a console, a printf-family call writes it one byte per `WriteFile`, so a 1 KB `[draws]` line costs about 1000 writes. All three now go through `ProfilePrint_nid_no_patch`, as the other periodic reports have since #798. It formats on the caller and writes from its own thread with one `fwrite`. The text of the lines is unchanged. ### Why In a profiled game run with stderr redirected by `Start-Process -RedirectStandardError` (how our scripts start the game), every 10 s window had one frame of 134 to 177 ms. That frame comes from the profiler, not the game, so the p99 and max of profiled runs could not be trusted. #798 measured up to 107 ms for single synchronous writes; this report was not part of that change. A micro-benchmark shows the cost of one call. Stderr was redirected to a file on D: the same way `run.ps1` starts the game, with the project's compile flags and its force-included `HostStandardStreams.hpp`, 50 calls each: | one call, 1035-char line (the mean `[draws]` length) | median | max | `WriteFile`s | |---|---|---|---| | `std::fprintf(stderr, "%s\n", line)` | 117 ms | 397 ms | 1036 | | the `[draws]` + `[rescache]` pair | 134 ms | 342 ms | 1213 | | one `std::fwrite` of the line | 0.11 ms | 0.23 ms | 1 | | `ProfilePrint_nid_no_patch`, caller side | 3.5 us | 50 us | 0 | How much one write costs depends on how stderr is opened: - **Our runs.** Windows PowerShell 5.1's `Start-Process -RedirectStandardError` opens the file write-through (`FileModeInformation` 0x22). One `WriteFile` on it takes 0.11 to 0.39 ms, so the pair costs about 134 ms. That is the setup of the table above and of the game runs below. - **A normally opened file on the same disk.** One write takes 2 to 5 us, so the pair would cost a few ms. This is inferred from the per-write cost, not measured in the game. - **Either way,** about 1200 writes per report move off the draw committer and the queue worker. ### Tested **Rebased again onto `main` `513ca7e558`** (head `09b9bf9afa`) after #6292 added `Mutex.hpp` to the same include list in `Graphics/src/Draw.cpp`: both includes kept, nothing else changed (`git range-diff` shows only that context line). On this head, built clean: the 23 tests below, 3 rounds, all pass; under the Khronos validation layer 23 of 23 pass with 0 `VUID-` lines, the layer inserted 51 times, no "was not found" line. The measurements further down are from `04a63e9d8d`, whose code is the same apart from that include. **Rebased onto `main` `0db47b263d`** (head `04a63e9d8d`), after #6946 merged into the same `[draw] pipelined` line, which now also reports the lock wait and the committer wakes. The rebase keeps `main`'s line and only switches its write to `ProfilePrint_nid_no_patch`, as before; the `[draws]` and `[rescache]` changes applied unchanged. #6946 also added the `[finisher]` report, written the same way, so this head moves that line too (one call and its include). `ProfilePrint_nid_no_patch` has no switch of its own, so the line still appears with `APS5_PIPELINE_STATS` alone. On this head and on `main` `0db47b263d`, both built clean, with the tests listed below plus `agc_driver_prepared_shaders` itself (23 in all): - 23 tests, 3 rounds, all pass on both sides. - Under the Khronos validation layer, 23 of 23 pass with 0 `VUID-` lines on both sides. `VK_LOADER_DEBUG=layer` shows the layer inserted 51 times on `main` and 51 times on this head, with no "was not found" line. Before the rebase, on `main` `7e2ba73e4c` and head `64e264f8dd`: **Tests that turn on `APS5_PROFILE_DRAW`** (none of them parses the report text): `agc_driver_address_passes`, `agc_driver_address_passes_targets_split`, `agc_driver_dispatch_differing_value_sets`, `agc_driver_rect_list_indirect`, and `agc_driver_prepared_shaders_debug` and `_debug_failure`, run together with the other 16 `agc_driver_prepared_shaders_*` modes. - 22 tests, 3 rounds, all pass. - Under the Khronos validation layer, on `main` `7e2ba73e4c` and on this PR, 22 of 22 pass with 0 `VUID-` lines on both sides. `VK_LOADER_DEBUG=layer` shows the layer inserted 48 times on each side, with no "was not found" line. - No new test. A red test would need a GPU test that blocks stderr on a full pipe for over 10 s, because the report interval is fixed. As in #798, the writer itself is covered by `agc_profile_output`, which this PR does not change. - **Ordering:** the lines keep their order among the profile output. They can now land after a synchronous stderr line written later, such as an error. Nothing reads them that way: `tools/trace_digest.py` and `tools/performance_compare.py` read the JSON trace and summaries. **PPSA14363 on `main` `0db47b263d`, rerun for this head** (METAL GEAR SOLID Master Collection Vol. 1, own dump), RX 6700 XT: - **Setup.** Launcher title screen, 150 s, `APS5_PROFILE_DRAW=1`, `APS5_TRACE_SUMMARY_EVERY=10` and a 20 s trace window at 100 s (`APS5_TRACE_SECONDS=100:20`), no frame dumps. - **Both sides** built clean (`dirty: false`): `main` `0db47b263d` and this head `04a63e9d8d`, with only `libSceAgcDriver.prx` swapped. - **Isolation.** Each run held this PC's exclusive GPU lock and its build lock, and nobody used the PC (no input for more than 5 minutes before and during every run). - **Results.** Per 10 s window, from 20 s on, without 110 to 120 s, whose last frame writes the trace: | Launcher title, per 10 s window | `main`, 15:12 | `main`, 15:22 | this PR, 15:28 | this PR, 15:32 | `main`, 15:35 | |---|---|---|---|---|---| | presents | 588 to 593 | 580 to 591 | 600 | 600 | 590 to 592 | | frame p99 | 17.3 to 17.7 ms | 17.3 to 18.0 ms | 17.3 to 17.7 ms | 17.2 to 17.4 ms | 17.3 to 17.6 ms | | frame max | 125.8 to 247.7 ms | 135.1 to 298.7 ms | 17.5 to 21.8 ms | 17.3 to 18.1 ms | 123.0 to 159.8 ms | | windows with a frame over 20 ms | 11 of 11 | 11 of 11 | 1 of 10 | 0 of 11 | 11 of 11 | - **Left out:** a `main` run at 15:25, during which something outside the emulator slowed the PC (373 to 590 presents, frames of 1 to 4 s, the queue worker waiting in `draw_enqueued`); this head was not run then. Also two runs of this head's code at 15:15 and 15:19 from a build made before the commit was amended, so their summaries say `dirty: true`; they read the same (600 presents, max 17.4 to 18.8 ms). <details><summary>Summary lines of the five trace windows (100 to 120 s), in the table's order</summary> ```json {"commit":"0db47b263d10","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5846,"ms":20004.022},"presents":1181,"frame_ms":{"p50":16.684,"p90":16.931,"p99":17.407,"max":148.418},"gpu_busy_ms_per_present":1.212,"worker_busy_pct":{"queue worker 0x0":4.402},"top_phases_ms_per_frame":{"VideoOut.Flip":8.810,"VideoOut.Flip.vblank_wait":7.475,"VideoOut.Flip.present":1.175,"Driver.Present":1.172,"Driver.Present.acquire_image":0.782,"Vulkan.Acquire":0.781,"Driver.Packet":0.742,"Vulkan.Acquire.acquire_fence_wait":0.710},"trace_dropped":false,"trace":"aps5-trace-0db47b263d10-17748.json.gz"} ``` ```json {"commit":"0db47b263d10","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5821,"ms":20003.256},"presents":1175,"frame_ms":{"p50":16.684,"p90":16.944,"p99":17.448,"max":191.424},"gpu_busy_ms_per_present":1.198,"worker_busy_pct":{"queue worker 0x0":5.228},"top_phases_ms_per_frame":{"VideoOut.Flip":8.937,"VideoOut.Flip.vblank_wait":7.596,"VideoOut.Flip.present":1.190,"Driver.Present":1.186,"Driver.Packet":0.886,"Driver.Present.acquire_image":0.783,"Vulkan.Acquire":0.782,"Vulkan.Acquire.acquire_fence_wait":0.701},"trace_dropped":false,"trace":"aps5-trace-0db47b263d10-2012.json.gz"} ``` ```json {"commit":"04a63e9d8d50","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5945,"ms":20003.215},"presents":1199,"frame_ms":{"p50":16.692,"p90":17.047,"p99":17.539,"max":17.750},"gpu_busy_ms_per_present":1.221,"worker_busy_pct":{"queue worker 0x0":3.448},"top_phases_ms_per_frame":{"VideoOut.Flip":1.975,"VideoOut.Flip.present":1.770,"Driver.Present":1.766,"Driver.Present.acquire_image":1.318,"Vulkan.Acquire":1.316,"Vulkan.Acquire.acquire_fence_wait":1.203,"Driver.Packet":0.569,"Graphics.Draw":0.315},"trace_dropped":false,"trace":"aps5-trace-04a63e9d8d50-24480.json.gz"} ``` ```json {"commit":"04a63e9d8d50","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5914,"ms":20002.879},"presents":1199,"frame_ms":{"p50":16.685,"p90":16.944,"p99":17.233,"max":17.590},"gpu_busy_ms_per_present":1.220,"worker_busy_pct":{"queue worker 0x0":2.292},"top_phases_ms_per_frame":{"VideoOut.Flip":1.833,"VideoOut.Flip.present":1.722,"Driver.Present":1.720,"Driver.Present.acquire_image":1.308,"Vulkan.Acquire":1.307,"Vulkan.Acquire.acquire_fence_wait":1.240,"Driver.Packet":0.379,"Driver.Present.render_fence_wait":0.242},"trace_dropped":false,"trace":"aps5-trace-04a63e9d8d50-4944.json.gz"} ``` ```json {"commit":"0db47b263d10","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5843,"ms":20003.308},"presents":1182,"frame_ms":{"p50":16.683,"p90":16.913,"p99":17.326,"max":123.812},"gpu_busy_ms_per_present":1.201,"worker_busy_pct":{"queue worker 0x0":4.241},"top_phases_ms_per_frame":{"VideoOut.Flip":14.559,"VideoOut.Flip.vblank_wait":13.737,"Driver.Packet":0.715,"VideoOut.Flip.present":0.703,"Driver.Present":0.700,"Driver.Packet.draw":0.468,"Driver.Draw":0.461,"Driver.Draw.draw_enqueued":0.346},"trace_dropped":false,"trace":"aps5-trace-0db47b263d10-27900.json.gz"} ``` </details> **PPSA14363** (METAL GEAR SOLID Master Collection Vol. 1, own dump), RX 6700 XT, measured before the rebase: - **Setup.** Launcher title screen, 150 s, `APS5_PROFILE_DRAW=1`, `APS5_TRACE_SUMMARY_EVERY=10` and a 20 s trace window at 100 s (`APS5_TRACE_SECONDS=100:20`), no frame dumps. - **Both sides** are built clean, `main` `7e2ba73e4c` and this PR's head `64e264f8dd`, each with #9115's trophy fix (which gets past stop 1), with only `libSceAgcDriver.prx` swapped. - **Isolation.** The runs held this PC's GPU and build locks, so no other job ran next to them. - **Results.** Per 10 s window, from 20 s on, without 110 to 120 s, whose last frame writes the trace on both sides: | | presents | p99 | max | |---|---|---|---| | `main` `7e2ba73e4c` | 590-592 | 17.3-17.9 ms | 127.0-161.9 ms | | this PR `64e264f8dd` | 600 | 17.2-17.5 ms | 17.4-19.3 ms | An earlier A/B on `main` `1896871ba7` read the same, and showed that without the `DrawPipeline.cpp` line the max stays at 45 to 75 ms (one 103 ms). Summary lines of the trace window, 100 to 120 s. First `main`, then this PR: ```json {"commit":"7e2ba73e4c8c","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5865,"ms":20004.400},"presents":1183,"frame_ms":{"p50":16.683,"p90":16.903,"p99":17.349,"max":161.892},"gpu_busy_ms_per_present":1.144,"worker_busy_pct":{"queue worker 0x0":4.237},"top_phases_ms_per_frame":{"VideoOut.Flip":15.688,"VideoOut.Flip.vblank_wait":14.896,"Driver.Packet":0.714,"VideoOut.Flip.present":0.625,"Driver.Present":0.621,"Graphics.Draw":0.473,"Driver.Packet.draw":0.439,"Driver.Draw":0.433},"trace_dropped":false,"trace":"aps5-trace-7e2ba73e4c8c-19744.json.gz"} ``` ```json {"commit":"64e264f8ddfc","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5944,"ms":20003.317},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.929,"p99":17.308,"max":17.716},"gpu_busy_ms_per_present":1.145,"worker_busy_pct":{"queue worker 0x0":2.426},"top_phases_ms_per_frame":{"VideoOut.Flip":15.844,"VideoOut.Flip.vblank_wait":15.112,"VideoOut.Flip.present":0.597,"Driver.Present":0.594,"Driver.Packet":0.403,"Driver.Present.acquire_image":0.258,"Vulkan.Acquire":0.257,"Graphics.Draw":0.241},"trace_dropped":false,"trace":"aps5-trace-64e264f8ddfc-19808.json.gz"} ``` `tools/performance_compare.py` on these two lines and the `tools/trace_digest.py` tables of both runs are in [this comment](https://github.com/boykopovar/AnyPS5/pull/9373#issuecomment-6337623346). Traces are not attached, because these runs come from a commercial title. `tools/check_conventions.py` passes. **Not tested:** other GPUs, Linux. The same synchronous write remains in a few rarer reports (`[indirect]`, `[fill]`, `[fill-cover]`/`[fill-clear]`, `[dispatch-item]`, none of which this title prints; and #6946's `[finisher-held]` and `[epoch-proofs]` lines, which print at power-of-two counts) and in the `[gpu] frame_NNN.bmp` line of `APS5_DUMP_FRAMES`, which #8807 works near. So is the per-draw `[draw]` line of `APS5_TRACE_DRAWS`, which stays synchronous so it keeps its order with the same draw's other trace lines. They are left for a follow-up. **Overlap:** - #6946 merged into the same `[draw] pipelined` line, and this PR now carries its extended version. #7642 and #1896 (drafts) and #9508 edit that line too; all three conflict with `main` now. #6947 was closed. - #7622 changes how `ProfileOutput` starts its thread. It does not conflict with this PR. ### 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 - [x] GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, Windows 11 26200 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-21 19:35:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T19:35:36Z.


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:6324813193 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9373#issuecomment-6324813193). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T19:35:36Z. --- <!-- 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`.
thuanquang commented 2026-10-21 19:37:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T19:37:19Z.


Summary lines for the bot's request, one 10 s window per side (70-80 s), same title, scene and machine as the table in the body. main 1896871ba7 plus #9115's trophy fix:

{"commit":"1896871ba75b","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"summary_every 10","first_present":4091,"ms":10010.898},"interval_start_s":70.289,"interval_end_s":80.300,"presents":592,"frame_ms":{"p50":16.682,"p90":16.908,"p99":17.413,"max":142.190},"gpu_busy_ms_per_present":1.210,"worker_busy_pct":{"queue worker 0x0":4.421},"top_phases_ms_per_frame":{"VideoOut.Flip":15.367,"VideoOut.Flip.vblank_wait":14.565,"Driver.Packet":0.745,"VideoOut.Flip.present":0.676,"Driver.Present":0.673,"Graphics.Draw":0.477,"Driver.Packet.draw":0.449,"Driver.Draw":0.443},"trace_dropped":false,"trace":""}

This PR, same setup. It was built while the DrawPipeline.cpp change was still uncommitted on top of a40fd382d3, so the line says a40fd382d362 and dirty; the source equals this PR's head 5b04afb32e:

{"commit":"a40fd382d362","dirty":true,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"summary_every 10","first_present":4152,"ms":10009.959},"interval_start_s":70.069,"interval_end_s":80.079,"presents":600,"frame_ms":{"p50":16.684,"p90":16.910,"p99":17.230,"max":17.737},"gpu_busy_ms_per_present":1.209,"worker_busy_pct":{"queue worker 0x0":2.794},"top_phases_ms_per_frame":{"VideoOut.Flip":15.694,"VideoOut.Flip.vblank_wait":14.898,"VideoOut.Flip.present":0.664,"Driver.Present":0.659,"Driver.Packet":0.463,"Graphics.Draw":0.273,"Driver.Present.acquire_image":0.271,"Vulkan.Acquire":0.270},"trace_dropped":false,"trace":""}

tools/trace_digest.py over each run's aps5-summary.jsonl, main first:

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 549 16.7 16.9 44.6 618.4 1.2 4 % VideoOut.Flip 15.1
2 10-20 589 16.7 16.9 18.8 238.8 1.5 5 % VideoOut.Flip 9.4
3 20-30 591 16.7 16.9 17.2 145.3 1.2 5 % VideoOut.Flip 15.5
4 30-40 590 16.7 17.0 17.6 152.0 1.2 5 % VideoOut.Flip 1.9
5 40-50 591 16.7 16.9 17.3 150.0 1.2 5 % VideoOut.Flip 15.4
6 50-60 591 16.7 16.9 17.4 134.1 1.2 4 % VideoOut.Flip 15.7
7 60-70 590 16.7 16.9 17.4 171.8 1.2 5 % VideoOut.Flip 15.5
8 70-80 592 16.7 16.9 17.4 142.2 1.2 4 % VideoOut.Flip 15.4
9 80-90 589 16.7 17.0 17.5 168.2 1.2 5 % VideoOut.Flip 1.9
10 90-100 592 16.7 16.9 17.3 139.2 1.2 4 % VideoOut.Flip 15.5
11 100-110 590 16.7 16.9 17.4 176.8 1.2 5 % VideoOut.Flip 15.4
12 110-120 591 16.7 17.0 17.4 139.5 1.2 4 % VideoOut.Flip 1.9
13 120-130 591 16.7 16.9 17.4 160.4 1.2 4 % VideoOut.Flip 15.5
14 130-140 591 16.7 16.9 17.5 152.5 1.2 4 % VideoOut.Flip 15.5

This PR:

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 553 16.7 16.9 26.8 599.4 1.2 3 % VideoOut.Flip 15.6
2 10-20 599 16.7 16.9 17.3 47.6 1.5 3 % VideoOut.Flip 15.9
3 20-30 600 16.7 16.9 17.3 17.5 1.2 3 % VideoOut.Flip 15.7
4 30-40 600 16.7 16.9 17.4 17.7 1.2 3 % VideoOut.Flip 15.7
5 40-50 600 16.7 16.9 17.3 17.6 1.2 3 % VideoOut.Flip 15.7
6 50-60 600 16.7 16.9 17.3 17.8 1.2 3 % VideoOut.Flip 15.7
7 60-70 600 16.7 16.9 17.3 17.7 1.2 3 % VideoOut.Flip 15.7
8 70-80 600 16.7 16.9 17.2 17.7 1.2 3 % VideoOut.Flip 15.7
9 80-90 600 16.7 16.9 17.3 17.7 1.2 3 % VideoOut.Flip 15.7
10 90-100 600 16.7 16.9 17.4 17.6 1.2 3 % VideoOut.Flip 15.8
11 100-110 600 16.7 16.9 17.2 17.5 1.2 3 % VideoOut.Flip 15.5
12 110-120 600 16.7 16.9 17.2 17.6 1.2 3 % VideoOut.Flip 15.7
13 120-130 600 16.7 16.9 17.3 17.5 1.2 3 % VideoOut.Flip 15.7

I am not attaching traces, because these runs come from a commercial title. Both sides are summary-only runs (APS5_TRACE_SUMMARY_EVERY=10) without a trace window.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324846591 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9373#issuecomment-6324846591). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T19:37:19Z. --- Summary lines for the bot's request, one 10 s window per side (70-80 s), same title, scene and machine as the table in the body. `main` `1896871ba7` plus #9115's trophy fix: ```json {"commit":"1896871ba75b","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"summary_every 10","first_present":4091,"ms":10010.898},"interval_start_s":70.289,"interval_end_s":80.300,"presents":592,"frame_ms":{"p50":16.682,"p90":16.908,"p99":17.413,"max":142.190},"gpu_busy_ms_per_present":1.210,"worker_busy_pct":{"queue worker 0x0":4.421},"top_phases_ms_per_frame":{"VideoOut.Flip":15.367,"VideoOut.Flip.vblank_wait":14.565,"Driver.Packet":0.745,"VideoOut.Flip.present":0.676,"Driver.Present":0.673,"Graphics.Draw":0.477,"Driver.Packet.draw":0.449,"Driver.Draw":0.443},"trace_dropped":false,"trace":""} ``` This PR, same setup. It was built while the `DrawPipeline.cpp` change was still uncommitted on top of `a40fd382d3`, so the line says `a40fd382d362` and `dirty`; the source equals this PR's head `5b04afb32e`: ```json {"commit":"a40fd382d362","dirty":true,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"summary_every 10","first_present":4152,"ms":10009.959},"interval_start_s":70.069,"interval_end_s":80.079,"presents":600,"frame_ms":{"p50":16.684,"p90":16.910,"p99":17.230,"max":17.737},"gpu_busy_ms_per_present":1.209,"worker_busy_pct":{"queue worker 0x0":2.794},"top_phases_ms_per_frame":{"VideoOut.Flip":15.694,"VideoOut.Flip.vblank_wait":14.898,"VideoOut.Flip.present":0.664,"Driver.Present":0.659,"Driver.Packet":0.463,"Graphics.Draw":0.273,"Driver.Present.acquire_image":0.271,"Vulkan.Acquire":0.270},"trace_dropped":false,"trace":""} ``` `tools/trace_digest.py` over each run's `aps5-summary.jsonl`, `main` first: | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 0-10 | 549 | 16.7 | 16.9 | 44.6 | 618.4 | 1.2 | 4 % | VideoOut.Flip 15.1 | | 2 | 10-20 | 589 | 16.7 | 16.9 | 18.8 | 238.8 | 1.5 | 5 % | VideoOut.Flip 9.4 | | 3 | 20-30 | 591 | 16.7 | 16.9 | 17.2 | 145.3 | 1.2 | 5 % | VideoOut.Flip 15.5 | | 4 | 30-40 | 590 | 16.7 | 17.0 | 17.6 | 152.0 | 1.2 | 5 % | VideoOut.Flip 1.9 | | 5 | 40-50 | 591 | 16.7 | 16.9 | 17.3 | 150.0 | 1.2 | 5 % | VideoOut.Flip 15.4 | | 6 | 50-60 | 591 | 16.7 | 16.9 | 17.4 | 134.1 | 1.2 | 4 % | VideoOut.Flip 15.7 | | 7 | 60-70 | 590 | 16.7 | 16.9 | 17.4 | 171.8 | 1.2 | 5 % | VideoOut.Flip 15.5 | | 8 | 70-80 | 592 | 16.7 | 16.9 | 17.4 | 142.2 | 1.2 | 4 % | VideoOut.Flip 15.4 | | 9 | 80-90 | 589 | 16.7 | 17.0 | 17.5 | 168.2 | 1.2 | 5 % | VideoOut.Flip 1.9 | | 10 | 90-100 | 592 | 16.7 | 16.9 | 17.3 | 139.2 | 1.2 | 4 % | VideoOut.Flip 15.5 | | 11 | 100-110 | 590 | 16.7 | 16.9 | 17.4 | 176.8 | 1.2 | 5 % | VideoOut.Flip 15.4 | | 12 | 110-120 | 591 | 16.7 | 17.0 | 17.4 | 139.5 | 1.2 | 4 % | VideoOut.Flip 1.9 | | 13 | 120-130 | 591 | 16.7 | 16.9 | 17.4 | 160.4 | 1.2 | 4 % | VideoOut.Flip 15.5 | | 14 | 130-140 | 591 | 16.7 | 16.9 | 17.5 | 152.5 | 1.2 | 4 % | VideoOut.Flip 15.5 | This PR: | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 0-10 | 553 | 16.7 | 16.9 | 26.8 | 599.4 | 1.2 | 3 % | VideoOut.Flip 15.6 | | 2 | 10-20 | 599 | 16.7 | 16.9 | 17.3 | 47.6 | 1.5 | 3 % | VideoOut.Flip 15.9 | | 3 | 20-30 | 600 | 16.7 | 16.9 | 17.3 | 17.5 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 4 | 30-40 | 600 | 16.7 | 16.9 | 17.4 | 17.7 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 5 | 40-50 | 600 | 16.7 | 16.9 | 17.3 | 17.6 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 6 | 50-60 | 600 | 16.7 | 16.9 | 17.3 | 17.8 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 7 | 60-70 | 600 | 16.7 | 16.9 | 17.3 | 17.7 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 8 | 70-80 | 600 | 16.7 | 16.9 | 17.2 | 17.7 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 9 | 80-90 | 600 | 16.7 | 16.9 | 17.3 | 17.7 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 10 | 90-100 | 600 | 16.7 | 16.9 | 17.4 | 17.6 | 1.2 | 3 % | VideoOut.Flip 15.8 | | 11 | 100-110 | 600 | 16.7 | 16.9 | 17.2 | 17.5 | 1.2 | 3 % | VideoOut.Flip 15.5 | | 12 | 110-120 | 600 | 16.7 | 16.9 | 17.2 | 17.6 | 1.2 | 3 % | VideoOut.Flip 15.7 | | 13 | 120-130 | 600 | 16.7 | 16.9 | 17.3 | 17.5 | 1.2 | 3 % | VideoOut.Flip 15.7 | I am not attaching traces, because these runs come from a commercial title. Both sides are summary-only runs (`APS5_TRACE_SUMMARY_EVERY=10`) without a trace window.
MarcZX10 commented 2026-10-22 06:48:08 +00:00 (Migrated from github.com)

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

Review: DISMISSED


The change is narrowly focused on moving the two periodic diagnostic reports off the draw/queue workers. The reported 3.5 us caller-side enqueue cost and the PPSA14363 A/B data make the intended benefit plausible; I did not find a correctness defect in the two call-site substitutions.

There are several required validation/readiness items before merge:

  1. Refresh the title A/B on current main. The report compares commit 1896871ba7 plus #9115 against a dirty build based on a40fd382d3. This PR head is 514 commits behind current main (d6eafa54d046), so please rebase and repeat the same title/scene/machine comparison on current main and the rebased PR. The existing summary windows and digest table are useful, but do not describe current main.
  2. Resolve the trace requirement. The PR explains that the traces are not attached because the title is commercial. The perf check and CONTRIBUTING.md request both captures and tools/trace_digest.py output; the summaries/digest table are present, but trace files are not. Please attach them if they can be shared, or ask a maintainer to confirm that summary-only evidence is acceptable for this title.
  3. Run the required AGC comparison. CONTRIBUTING.md asks for the same focused tests on main and the change with Vulkan validation, and a comparison of new VUID- lines. The PR reports the validation run on this PR only. Please run the focused set on both refreshed commits and report the comparison.
  4. Coordinate the active DrawPipeline.cpp overlaps. My pairwise merge-tree check finds content conflicts with #6946 and #9508 on the [draw] pipelined report, and with #1896; #7642 also has broad pipeline conflicts. #9508 is a newer overlap than the original overlap report. Agree with the affected authors which change goes first, preserve the added report fields, and update Depends on if the agreed order requires it.

Local checks: conventions and git diff --check pass; merge-tree with current main is clean. Hosted conventions, eligibility, labels and report pass, while product jobs skip by path filters. I could not run the GPU tests here: this host has no available GPU, full configuration is blocked by the missing SDL2 submodule/XRandR support, and my GitHub permission is read-only so I cannot dispatch the manual build workflow. The author reports 22 focused tests passing in three rounds on an RX 6700 XT, including a validation-layer run on the PR; I have not independently reproduced those results.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5610250818 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9373#pullrequestreview-5610250818). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T06:48:08Z. **Review:** DISMISSED --- The change is narrowly focused on moving the two periodic diagnostic reports off the draw/queue workers. The reported 3.5 us caller-side enqueue cost and the PPSA14363 A/B data make the intended benefit plausible; I did not find a correctness defect in the two call-site substitutions. There are several required validation/readiness items before merge: 1. **Refresh the title A/B on current `main`.** The report compares commit `1896871ba7` plus #9115 against a dirty build based on `a40fd382d3`. This PR head is 514 commits behind current `main` (`d6eafa54d046`), so please rebase and repeat the same title/scene/machine comparison on current `main` and the rebased PR. The existing summary windows and digest table are useful, but do not describe current `main`. 2. **Resolve the trace requirement.** The PR explains that the traces are not attached because the title is commercial. The `perf` check and `CONTRIBUTING.md` request both captures and `tools/trace_digest.py` output; the summaries/digest table are present, but trace files are not. Please attach them if they can be shared, or ask a maintainer to confirm that summary-only evidence is acceptable for this title. 3. **Run the required AGC comparison.** `CONTRIBUTING.md` asks for the same focused tests on `main` and the change with Vulkan validation, and a comparison of new `VUID-` lines. The PR reports the validation run on this PR only. Please run the focused set on both refreshed commits and report the comparison. 4. **Coordinate the active `DrawPipeline.cpp` overlaps.** My pairwise merge-tree check finds content conflicts with #6946 and #9508 on the `[draw] pipelined` report, and with #1896; #7642 also has broad pipeline conflicts. #9508 is a newer overlap than the original overlap report. Agree with the affected authors which change goes first, preserve the added report fields, and update `Depends on` if the agreed order requires it. Local checks: conventions and `git diff --check` pass; merge-tree with current `main` is clean. Hosted conventions, eligibility, labels and report pass, while product jobs skip by path filters. I could not run the GPU tests here: this host has no available GPU, full configuration is blocked by the missing SDL2 submodule/XRandR support, and my GitHub permission is read-only so I cannot dispatch the manual build workflow. The author reports 22 focused tests passing in three rounds on an RX 6700 XT, including a validation-layer run on the PR; I have not independently reproduced those results.
thuanquang commented 2026-10-22 09:38:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-22T09:38:13Z.


Thanks. Point by point:

  1. Rebased and refreshed. The branch is rebased on main 7e2ba73e4c (head 64e264f8dd), and the A/B is rerun on that main and on the rebased head, same machine and scene, both built clean (dirty: false). Both sides have #9115's trophy fix, which gets the title past stop 1, and only libSceAgcDriver.prx is swapped between them. Launcher title, 150 s, APS5_PROFILE_DRAW=1, APS5_TRACE_SUMMARY_EVERY=10 and a 20 s trace window at 100 s (APS5_TRACE_SECONDS=100:20), with the GPU and build locks held so no other job ran. Per 10 s window from 20 s on, leaving out 110 to 120 s on both sides, because its last frame writes the trace (239.7 ms on main, 115.4 ms with this PR):
Launcher title, 11 windows main 7e2ba73e4c this PR 64e264f8dd
presents per 10 s 590 to 592 600
frame p99 17.3 to 17.9 ms 17.2 to 17.5 ms
frame max 127.0 to 161.9 ms 17.4 to 19.3 ms

The summary lines of the trace window (100 to 120 s), main first:

{"commit":"7e2ba73e4c8c","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5865,"ms":20004.400},"presents":1183,"frame_ms":{"p50":16.683,"p90":16.903,"p99":17.349,"max":161.892},"gpu_busy_ms_per_present":1.144,"worker_busy_pct":{"queue worker 0x0":4.237},"top_phases_ms_per_frame":{"VideoOut.Flip":15.688,"VideoOut.Flip.vblank_wait":14.896,"Driver.Packet":0.714,"VideoOut.Flip.present":0.625,"Driver.Present":0.621,"Graphics.Draw":0.473,"Driver.Packet.draw":0.439,"Driver.Draw":0.433},"trace_dropped":false,"trace":"aps5-trace-7e2ba73e4c8c-19744.json.gz"}
{"commit":"64e264f8ddfc","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5944,"ms":20003.317},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.929,"p99":17.308,"max":17.716},"gpu_busy_ms_per_present":1.145,"worker_busy_pct":{"queue worker 0x0":2.426},"top_phases_ms_per_frame":{"VideoOut.Flip":15.844,"VideoOut.Flip.vblank_wait":15.112,"VideoOut.Flip.present":0.597,"Driver.Present":0.594,"Driver.Packet":0.403,"Driver.Present.acquire_image":0.258,"Vulkan.Acquire":0.257,"Graphics.Draw":0.241},"trace_dropped":false,"trace":"aps5-trace-64e264f8ddfc-19808.json.gz"}

tools/performance_compare.py on these two lines. The only configuration difference it reports is window.first_present (5865 and 5944), the present at which the 100 s window opened:

Metric (ms) main this PR Change
frame_ms.p50 16.683 16.683 +0.000
frame_ms.p90 16.903 16.929 +0.026
frame_ms.p99 17.349 17.308 -0.041
frame_ms.max 161.892 17.716 -144.176
mean_frame_ms 16.910 16.683 -0.227
gpu_busy_ms_per_present 1.144 1.145 +0.001

In its top phases, Driver.Packet goes from 0.714 to 0.403 ms per frame and Graphics.Draw from 0.473 to 0.241.

tools/trace_digest.py on both runs' summary files

main 7e2ba73e4c:

14 intervals, 0.0 to 140.3 s, 8232 presents
AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1 (AMD proprietary shader compiler), Windows 10.0.26200, 1920x1080, commit 7e2ba73e4c

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 552 16.7 16.9 40.7 601.2 1.2 4 % VideoOut.Flip 15.7
2 10-20 590 16.7 16.9 17.7 151.2 1.4 4 % VideoOut.Flip 15.7
3 20-30 591 16.7 16.9 17.5 151.3 1.1 4 % VideoOut.Flip 15.6
4 30-40 592 16.7 16.9 17.3 148.1 1.1 4 % VideoOut.Flip 15.6
5 40-50 591 16.7 17.0 17.9 142.3 1.1 4 % VideoOut.Flip 1.8
6 50-60 591 16.7 17.0 17.4 144.6 1.1 4 % VideoOut.Flip 1.8
7 60-70 590 16.7 16.9 17.4 160.2 1.1 4 % VideoOut.Flip 15.7
8 70-80 590 16.7 17.0 17.6 135.8 1.1 5 % VideoOut.Flip 2.0
9 80-90 592 16.7 16.9 17.4 129.9 1.1 4 % VideoOut.Flip 15.7
10 90-100 592 16.7 17.0 17.3 127.0 1.1 4 % VideoOut.Flip 2.0
11 100-110 592 16.7 16.9 17.4 161.9 1.1 4 % VideoOut.Flip 15.6
12 110-120 586 16.7 16.9 17.3 239.7 1.1 4 % VideoOut.Flip 15.9
13 120-130 591 16.7 17.0 17.6 157.1 1.1 4 % VideoOut.Flip 1.8
14 130-140 592 16.7 17.0 17.6 128.4 1.1 4 % VideoOut.Flip 2.0
p99 ms  @=============  0-40.7
gpu ms  #@############  0-1.4

This PR 64e264f8dd:

14 intervals, 0.0 to 140.2 s, 8344 presents
AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1 (AMD proprietary shader compiler), Windows 10.0.26200, 1920x1080, commit 64e264f8ddfc

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 550 16.7 17.0 33.0 590.9 1.2 3 % VideoOut.Flip 12.7
2 10-20 599 16.7 16.9 17.3 47.1 1.4 3 % VideoOut.Flip 15.9
3 20-30 600 16.7 16.9 17.3 17.7 1.1 3 % VideoOut.Flip 15.7
4 30-40 600 16.7 16.9 17.4 17.7 1.1 2 % VideoOut.Flip 15.8
5 40-50 600 16.7 16.9 17.5 17.7 1.1 3 % VideoOut.Flip 15.8
6 50-60 600 16.7 16.9 17.3 17.6 1.1 3 % VideoOut.Flip 15.8
7 60-70 600 16.7 16.9 17.3 17.6 1.1 2 % VideoOut.Flip 15.8
8 70-80 600 16.7 16.9 17.2 17.8 1.1 2 % VideoOut.Flip 15.8
9 80-90 600 16.7 16.9 17.2 17.7 1.1 2 % VideoOut.Flip 15.9
10 90-100 600 16.7 16.9 17.3 17.4 1.1 3 % VideoOut.Flip 15.8
11 100-110 600 16.7 16.9 17.3 17.7 1.1 2 % VideoOut.Flip 15.8
12 110-120 595 16.7 16.9 17.3 115.4 1.1 2 % VideoOut.Flip 16.0
13 120-130 600 16.7 17.0 17.4 19.3 1.1 2 % VideoOut.Flip 1.8
14 130-140 600 16.7 17.1 17.5 18.2 1.1 4 % VideoOut.Flip 1.9
p99 ms  @+++++++++++++  0-33.0
gpu ms  #@############  0-1.4
  1. Traces. These runs come from a commercial title, so the trace files stay local, and the description and this comment carry the summary lines and the tools' output instead. @adriadam10 @oneandonlydean, is summary-only evidence acceptable for a title whose trace files we can't share?

  2. Validation-layer A/B. The 22 focused tests ran on main 7e2ba73e4c and on the rebased head, each 3 rounds without the layer and once with it (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, implicit layers disabled):

plain, 3 rounds with the layer VUID- lines layer inserted
main 7e2ba73e4c 22 of 22 pass, 3 of 3 22 of 22 0 48 times, no "was not found"
this PR 64e264f8dd 22 of 22 pass, 3 of 3 22 of 22 0 48 times, no "was not found"

The tests are agc_driver_address_passes and _targets_split, agc_driver_dispatch_differing_value_sets, agc_driver_rect_list_indirect and the 18 agc_driver_prepared_shaders_* modes, among them the two that turn on APS5_PROFILE_DRAW.

  1. Overlaps on the [draw] pipelined line. #6946 and #9508 (@Raghav314) change its text and fields, and #1896 (@fisherjoey, draft) adds a field. #7642 (@EagleBearerYS, draft) conflicts more broadly in DrawPipeline.cpp. This PR only replaces the std::fprintf(stderr, ...) call with AgcDriver::ProfilePrint_nid_no_patch(...) and keeps the format string and arguments, so whichever lands second keeps the other's fields with the ProfilePrint call, a one-line resolution. I'm fine with this one going after any of them and will rebase it then; tell me if you prefer the other order.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337623346 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9373#issuecomment-6337623346). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-22T09:38:13Z. --- Thanks. Point by point: 1. **Rebased and refreshed.** The branch is rebased on `main` `7e2ba73e4c` (head `64e264f8dd`), and the A/B is rerun on that `main` and on the rebased head, same machine and scene, both built clean (`dirty: false`). Both sides have #9115's trophy fix, which gets the title past stop 1, and only `libSceAgcDriver.prx` is swapped between them. Launcher title, 150 s, `APS5_PROFILE_DRAW=1`, `APS5_TRACE_SUMMARY_EVERY=10` and a 20 s trace window at 100 s (`APS5_TRACE_SECONDS=100:20`), with the GPU and build locks held so no other job ran. Per 10 s window from 20 s on, leaving out 110 to 120 s on both sides, because its last frame writes the trace (239.7 ms on `main`, 115.4 ms with this PR): | Launcher title, 11 windows | `main` `7e2ba73e4c` | this PR `64e264f8dd` | |---|---|---| | presents per 10 s | 590 to 592 | 600 | | frame p99 | 17.3 to 17.9 ms | 17.2 to 17.5 ms | | frame max | 127.0 to 161.9 ms | 17.4 to 19.3 ms | The summary lines of the trace window (100 to 120 s), `main` first: ```json {"commit":"7e2ba73e4c8c","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5865,"ms":20004.400},"presents":1183,"frame_ms":{"p50":16.683,"p90":16.903,"p99":17.349,"max":161.892},"gpu_busy_ms_per_present":1.144,"worker_busy_pct":{"queue worker 0x0":4.237},"top_phases_ms_per_frame":{"VideoOut.Flip":15.688,"VideoOut.Flip.vblank_wait":14.896,"Driver.Packet":0.714,"VideoOut.Flip.present":0.625,"Driver.Present":0.621,"Graphics.Draw":0.473,"Driver.Packet.draw":0.439,"Driver.Draw":0.433},"trace_dropped":false,"trace":"aps5-trace-7e2ba73e4c8c-19744.json.gz"} ``` ```json {"commit":"64e264f8ddfc","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_TRACE_SECONDS":"100:20","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 100:20","first_present":5944,"ms":20003.317},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.929,"p99":17.308,"max":17.716},"gpu_busy_ms_per_present":1.145,"worker_busy_pct":{"queue worker 0x0":2.426},"top_phases_ms_per_frame":{"VideoOut.Flip":15.844,"VideoOut.Flip.vblank_wait":15.112,"VideoOut.Flip.present":0.597,"Driver.Present":0.594,"Driver.Packet":0.403,"Driver.Present.acquire_image":0.258,"Vulkan.Acquire":0.257,"Graphics.Draw":0.241},"trace_dropped":false,"trace":"aps5-trace-64e264f8ddfc-19808.json.gz"} ``` `tools/performance_compare.py` on these two lines. The only configuration difference it reports is `window.first_present` (5865 and 5944), the present at which the 100 s window opened: | Metric (ms) | `main` | this PR | Change | |---|---:|---:|---:| | `frame_ms.p50` | 16.683 | 16.683 | +0.000 | | `frame_ms.p90` | 16.903 | 16.929 | +0.026 | | `frame_ms.p99` | 17.349 | 17.308 | -0.041 | | `frame_ms.max` | 161.892 | 17.716 | -144.176 | | `mean_frame_ms` | 16.910 | 16.683 | -0.227 | | `gpu_busy_ms_per_present` | 1.144 | 1.145 | +0.001 | In its top phases, `Driver.Packet` goes from 0.714 to 0.403 ms per frame and `Graphics.Draw` from 0.473 to 0.241. <details><summary><code>tools/trace_digest.py</code> on both runs' summary files</summary> `main` `7e2ba73e4c`: **14 intervals**, 0.0 to 140.3 s, 8232 presents AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1 (AMD proprietary shader compiler), Windows 10.0.26200, 1920x1080, commit 7e2ba73e4c8c | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 0-10 | 552 | 16.7 | 16.9 | 40.7 | 601.2 | 1.2 | 4 % | VideoOut.Flip 15.7 | | 2 | 10-20 | 590 | 16.7 | 16.9 | 17.7 | 151.2 | 1.4 | 4 % | VideoOut.Flip 15.7 | | 3 | 20-30 | 591 | 16.7 | 16.9 | 17.5 | 151.3 | 1.1 | 4 % | VideoOut.Flip 15.6 | | 4 | 30-40 | 592 | 16.7 | 16.9 | 17.3 | 148.1 | 1.1 | 4 % | VideoOut.Flip 15.6 | | 5 | 40-50 | 591 | 16.7 | 17.0 | 17.9 | 142.3 | 1.1 | 4 % | VideoOut.Flip 1.8 | | 6 | 50-60 | 591 | 16.7 | 17.0 | 17.4 | 144.6 | 1.1 | 4 % | VideoOut.Flip 1.8 | | 7 | 60-70 | 590 | 16.7 | 16.9 | 17.4 | 160.2 | 1.1 | 4 % | VideoOut.Flip 15.7 | | 8 | 70-80 | 590 | 16.7 | 17.0 | 17.6 | 135.8 | 1.1 | 5 % | VideoOut.Flip 2.0 | | 9 | 80-90 | 592 | 16.7 | 16.9 | 17.4 | 129.9 | 1.1 | 4 % | VideoOut.Flip 15.7 | | 10 | 90-100 | 592 | 16.7 | 17.0 | 17.3 | 127.0 | 1.1 | 4 % | VideoOut.Flip 2.0 | | 11 | 100-110 | 592 | 16.7 | 16.9 | 17.4 | 161.9 | 1.1 | 4 % | VideoOut.Flip 15.6 | | 12 | 110-120 | 586 | 16.7 | 16.9 | 17.3 | 239.7 | 1.1 | 4 % | VideoOut.Flip 15.9 | | 13 | 120-130 | 591 | 16.7 | 17.0 | 17.6 | 157.1 | 1.1 | 4 % | VideoOut.Flip 1.8 | | 14 | 130-140 | 592 | 16.7 | 17.0 | 17.6 | 128.4 | 1.1 | 4 % | VideoOut.Flip 2.0 | ``` p99 ms @============= 0-40.7 gpu ms #@############ 0-1.4 ``` This PR `64e264f8dd`: **14 intervals**, 0.0 to 140.2 s, 8344 presents AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1 (AMD proprietary shader compiler), Windows 10.0.26200, 1920x1080, commit 64e264f8ddfc | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 0-10 | 550 | 16.7 | 17.0 | 33.0 | 590.9 | 1.2 | 3 % | VideoOut.Flip 12.7 | | 2 | 10-20 | 599 | 16.7 | 16.9 | 17.3 | 47.1 | 1.4 | 3 % | VideoOut.Flip 15.9 | | 3 | 20-30 | 600 | 16.7 | 16.9 | 17.3 | 17.7 | 1.1 | 3 % | VideoOut.Flip 15.7 | | 4 | 30-40 | 600 | 16.7 | 16.9 | 17.4 | 17.7 | 1.1 | 2 % | VideoOut.Flip 15.8 | | 5 | 40-50 | 600 | 16.7 | 16.9 | 17.5 | 17.7 | 1.1 | 3 % | VideoOut.Flip 15.8 | | 6 | 50-60 | 600 | 16.7 | 16.9 | 17.3 | 17.6 | 1.1 | 3 % | VideoOut.Flip 15.8 | | 7 | 60-70 | 600 | 16.7 | 16.9 | 17.3 | 17.6 | 1.1 | 2 % | VideoOut.Flip 15.8 | | 8 | 70-80 | 600 | 16.7 | 16.9 | 17.2 | 17.8 | 1.1 | 2 % | VideoOut.Flip 15.8 | | 9 | 80-90 | 600 | 16.7 | 16.9 | 17.2 | 17.7 | 1.1 | 2 % | VideoOut.Flip 15.9 | | 10 | 90-100 | 600 | 16.7 | 16.9 | 17.3 | 17.4 | 1.1 | 3 % | VideoOut.Flip 15.8 | | 11 | 100-110 | 600 | 16.7 | 16.9 | 17.3 | 17.7 | 1.1 | 2 % | VideoOut.Flip 15.8 | | 12 | 110-120 | 595 | 16.7 | 16.9 | 17.3 | 115.4 | 1.1 | 2 % | VideoOut.Flip 16.0 | | 13 | 120-130 | 600 | 16.7 | 17.0 | 17.4 | 19.3 | 1.1 | 2 % | VideoOut.Flip 1.8 | | 14 | 130-140 | 600 | 16.7 | 17.1 | 17.5 | 18.2 | 1.1 | 4 % | VideoOut.Flip 1.9 | ``` p99 ms @+++++++++++++ 0-33.0 gpu ms #@############ 0-1.4 ``` </details> 2. **Traces.** These runs come from a commercial title, so the trace files stay local, and the description and this comment carry the summary lines and the tools' output instead. @adriadam10 @oneandonlydean, is summary-only evidence acceptable for a title whose trace files we can't share? 3. **Validation-layer A/B.** The 22 focused tests ran on `main` `7e2ba73e4c` and on the rebased head, each 3 rounds without the layer and once with it (`ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, implicit layers disabled): | | plain, 3 rounds | with the layer | `VUID-` lines | layer inserted | |---|---|---|---|---| | `main` `7e2ba73e4c` | 22 of 22 pass, 3 of 3 | 22 of 22 | 0 | 48 times, no "was not found" | | this PR `64e264f8dd` | 22 of 22 pass, 3 of 3 | 22 of 22 | 0 | 48 times, no "was not found" | The tests are `agc_driver_address_passes` and `_targets_split`, `agc_driver_dispatch_differing_value_sets`, `agc_driver_rect_list_indirect` and the 18 `agc_driver_prepared_shaders_*` modes, among them the two that turn on `APS5_PROFILE_DRAW`. 4. **Overlaps on the `[draw] pipelined` line.** #6946 and #9508 (@Raghav314) change its text and fields, and #1896 (@fisherjoey, draft) adds a field. #7642 (@EagleBearerYS, draft) conflicts more broadly in `DrawPipeline.cpp`. This PR only replaces the `std::fprintf(stderr, ...)` call with `AgcDriver::ProfilePrint_nid_no_patch(...)` and keeps the format string and arguments, so whichever lands second keeps the other's fields with the `ProfilePrint` call, a one-line resolution. I'm fine with this one going after any of them and will rebase it then; tell me if you prefer the other order.
fisherjoey commented 2026-10-22 09:42:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-22T09:42:08Z.


Either order is fine for #1896. It's a draft, and I'm restacking it onto main anyway, so if this lands first I'll keep the ProfilePrint call and add our field when I rebase.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337695725 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9373#issuecomment-6337695725). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-22T09:42:08Z. --- Either order is fine for #1896. It's a draft, and I'm restacking it onto main anyway, so if this lands first I'll keep the `ProfilePrint` call and add our field when I rebase. AI-assisted: yes
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!9373
No description provided.