Skip to content

perf(agc): write the frame-dump log line through the asynchronous profile output - #9602

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/frame-dump-line-async
Oct 25, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/frame-dump-line-async

Conversation

@thuanquang

@thuanquang thuanquang commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

WriteFrameDump (Execution/src/VulkanDevice.cpp) logs each frame that APS5_DUMP_FRAMES dumps with std::fprintf(stderr, "[gpu] frame_NNN.bmp: ..."). It runs on the presenter, inside Driver::Present, before the guest sees the flip complete. The path is the trailing FinishPresent, then RetirePresents(0), then RetireSlot, then WriteFrameDump. VideoOutDriver::processFlip raises the FLIP event and stores the previous buffer's label only after Present returns, so the guest waits for this write. The BMP itself is already written by the dump writer thread; only the log line was synchronous.

The line now goes through ProfilePrint_nid_no_patch, like the periodic reports since #798. Its text and timestamp are unchanged: the time is still taken when the frame is read back.

Why

The CRT's stderr is unbuffered. When it is not a console, a printf-family call writes it one byte per WriteFile, so this 67-character line costs 67 writes on every dumped frame. When stderr is a file redirected with Windows PowerShell's Start-Process -RedirectStandardError (how our scripts start a title), that file is opened write-through, and one write costs 0.11 to 0.39 ms. The line then costs about 7 to 26 ms on the presenter per dumped frame. Every frame-time measurement made with frame dumps on showed it in p99 and max. #9373 does the same for APS5_PROFILE_DRAW's draw reports.

Tested

Rerun on main 048d0f9aa3 (head 1a9f8be3fc, the same one-line change), PPSA14363 (METAL GEAR SOLID Master Collection Vol. 1, own dump), RX 6700 XT: launcher title screen, 150 s, APS5_DUMP_FRAMES=400 with APS5_DUMP_FRAMES_EVERY=30, APS5_TRACE_SUMMARY_EVERY=10, APS5_TRACE_SECONDS=100:20; both sides built clean with only libSceAgcDriver.prx swapped; each run held the exclusive GPU lock and the build lock on an idle PC; two pairs, the second in the opposite order. Per 10 s window from 20 s on, without 110 to 120 s:

presents p99 max
main 048d0f9aa3, pair 1 600 17.5-17.8 ms 17.8-25.7 ms, 4 of 11 windows over 20 ms
main 048d0f9aa3, pair 2 600 17.5-17.8 ms 17.7-21.7 ms, 2 of 11 windows over 20 ms
this PR 1a9f8be3fc, pair 1 600 17.3-17.4 ms 17.5-19.3 ms, 0 of 11 windows over 20 ms
this PR 1a9f8be3fc, pair 2 600 17.2-17.4 ms 17.4-20.7 ms, 1 of 11 windows over 20 ms

Summary lines, tools/performance_compare.py and tools/trace_digest.py output for these runs: this comment.

Before the rebase, on main 3ca07d086d and head 67a69f7d8e:

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

  • Setup. Launcher title screen, 150 s, APS5_DUMP_FRAMES=400 with APS5_DUMP_FRAMES_EVERY=30, APS5_TRACE_SUMMARY_EVERY=10 and a 20 s trace window at 100 s (APS5_TRACE_SECONDS=100:20), no profiler.
  • Both sides are built clean, main 3ca07d086d and this PR's head 67a69f7d8e, each with fix(libSceNpTrophy2): return INVALID_TROPHY_ID for a trophy that is not in the title's data #9115's trophy fix (to get past stop 1), with only libSceAgcDriver.prx swapped.
  • Isolation. The runs held this PC's GPU and build locks; this PR ran first, then main.
  • 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 3ca07d086d 597-600 17.6-18.0 ms 18.0-75.1 ms, 7 of 11 windows over 20 ms
this PR 67a69f7d8e 600 17.2-17.5 ms 17.3-17.9 ms, 0 of 11 windows over 20 ms

Earlier A/Bs showed the same direction: on main 7e2ba73e4c, 17.6-17.8 ms against 17.2-17.5 ms at p99 and 3 against 1 windows over 20 ms; on main 6ef5a1c4c9, main read 17.8-24.0 ms at p99 and 18.2-208.0 ms at max, with 6 of 12 windows over 20 ms and Vulkan.Retire.dump at 0.6-1.1 ms per frame, while this PR read 17.2-17.4 ms and 17.5-23.0 ms. The cost of each write to the write-through log varies between runs.

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

{"commit":"3ca07d086d5f","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5828,"ms":20003.375},"presents":1198,"frame_ms":{"p50":16.686,"p90":17.007,"p99":17.689,"max":26.245},"gpu_busy_ms_per_present":1.299,"worker_busy_pct":{"queue worker 0x0":2.497},"top_phases_ms_per_frame":{"VideoOut.Flip":2.339,"VideoOut.Flip.present":2.093,"Driver.Present":2.090,"Driver.Present.acquire_image":1.324,"Vulkan.Acquire":1.323,"Vulkan.Acquire.acquire_fence_wait":1.252,"Driver.Present.render_fence_wait":0.585,"Vulkan.Retire":0.584},"trace_dropped":false,"trace":"aps5-trace-3ca07d086d5f-28544.json.gz"}
{"commit":"67a69f7d8e23","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5943,"ms":20003.384},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.917,"p99":17.277,"max":17.673},"gpu_busy_ms_per_present":1.228,"worker_busy_pct":{"queue worker 0x0":2.624},"top_phases_ms_per_frame":{"VideoOut.Flip":15.836,"VideoOut.Flip.vblank_wait":14.989,"VideoOut.Flip.present":0.681,"Driver.Present":0.677,"Driver.Packet":0.435,"Driver.Present.acquire_image":0.256,"Graphics.Draw":0.255,"Vulkan.Acquire":0.255},"trace_dropped":false,"trace":"aps5-trace-67a69f7d8e23-5548.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.

Tests:

  • video_out_hdr_present dumps frames, reads the BMPs back and prints the [gpu] frame_NNN.bmp line. It passes 3 of 3 together with video_out_hdr_probe, on main 048d0f9aa3 and on this head (and before the rebase on main 3ca07d086d and 67a69f7d8e).
  • Under the Khronos validation layer, on main 048d0f9aa3 and on this head (and before on 3ca07d086d), both pass with 0 VUID- lines on both sides. VK_LOADER_DEBUG=layer shows the layer inserted in the one Vulkan test process, with no "was not found" line.
  • video_out_frame_dump_queue is registered only off Windows, so it was not run here.

tools/check_conventions.py passes.

Ordering and overload: like every line sent through ProfilePrint_nid_no_patch, the frame-dump line now keeps its order only among the profile output: it can land after a later synchronous stderr line, and if the writer falls behind it can be dropped and counted on a [profile-output] dropped ... line instead of being printed.

Not tested: other GPUs, Linux.

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

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 22, 2026
@github-actions

Copy link
Copy Markdown

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.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is a one-line replacement on the presenter path; the reported improvement is plausible, and the PR reports focused frame-dump tests with the validation layer. Hosted conventions, eligibility, intake, labels and report checks pass; product/relinker jobs are skipped. I did not run tests locally.

The required perf evidence is not complete yet. Both summary lines identify commit 6ef5a1c4c922; the changed run is marked dirty, and the traces are neither attached nor digested. The repository requires distinct main and change captures from the same title, scene and machine, the traces, and tools/trace_digest.py output. Please rerun against current main and the clean PR head and add those artifacts.

The AGC validation rule also requires the focused tests on both main and the change on the same machine/GPU with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the Khronos layer, confirming the layer was loaded and comparing VUIDs. The current report documents the PR side only. Finally, this branch is based on 6ef5a1c4, while current upstream main is dce41a89; update the branch and rerun the report and focused validation on the resulting head.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to my preceding review: the PR branch is based on d9c99c9, not 6ef5a1c4; the report’s paired baseline is 6ef5a1c4, and current upstream main is now dce41a89. Please update the branch and rerun the required captures/tests against current main and the PR head.

The performance evidence remains incomplete: both summary lines identify commit 6ef5a1c4c922, the changed run is marked dirty, and the traces are neither attached nor digested. The repository requires distinct clean main/change captures from the same title, scene and machine, with both traces and tools/trace_digest.py output.

For this AGC change, the repository also requires the focused tests on main and the change on the same machine/GPU with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the Khronos layer, confirmation the layer loaded, and a VUID comparison. The current report documents PR-side checks, not the required paired baseline comparison. Hosted conventions, eligibility, intake, labels and report checks pass; product/relinker jobs are skipped. I did not run tests locally.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6960 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7369 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8014 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9400 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9431 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9432 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9489 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9672 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9673 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9674 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9675 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9676 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9842 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9892 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9893 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9898 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10046 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10487 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

@MarcZX10

Copy link
Copy Markdown
Contributor

I rechecked exact head 52d1385bddf4: it remains a one-line switch from synchronous fprintf to ProfilePrint_nid_no_patch; git diff --check and current-main conventions pass. Hosted eligibility, conventions, labels, and report pass, while product/relinker jobs are skipped. The prior change request still applies: provide clean main/change performance captures, both traces plus trace_digest.py output, and the paired validation-layer/no-shader-cache focused tests on the updated main and PR head before asking for re-review.

@thuanquang

Copy link
Copy Markdown
Contributor Author

Thanks. Rebased on main 7e2ba73e4c (head 52d1385bdd), with the evidence refreshed:

Clean captures, same title, scene and machine. main 7e2ba73e4c against this head, 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_DUMP_FRAMES=400 with APS5_DUMP_FRAMES_EVERY=30, 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. Per 10 s window from 20 s on, leaving out 110 to 120 s on both sides, because its last frame writes the trace (120.0 ms on main, 109.1 ms with this PR):

Launcher title, 11 windows main 7e2ba73e4c this PR 52d1385bdd
presents per 10 s 600 599 to 600
frame p99 17.6 to 17.8 ms 17.2 to 17.5 ms
frame max 17.8 to 25.0 ms, 3 windows over 20 ms 17.5 to 24.2 ms, 1 window over 20 ms

The gap is smaller than in the description's first A/B on main 6ef5a1c4c9, where main had 6 of 12 windows over 20 ms and one 208 ms frame. The cost of each write to the write-through log varies between runs (0.11 to 0.39 ms per WriteFile in the measurement under Why).

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

{"commit":"7e2ba73e4c8c","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5894,"ms":20003.816},"presents":1199,"frame_ms":{"p50":16.684,"p90":17.033,"p99":17.741,"max":18.160},"gpu_busy_ms_per_present":1.145,"worker_busy_pct":{"queue worker 0x0":2.600},"top_phases_ms_per_frame":{"VideoOut.Flip":2.226,"VideoOut.Flip.present":1.892,"Driver.Present":1.890,"Driver.Present.acquire_image":1.297,"Vulkan.Acquire":1.295,"Vulkan.Acquire.acquire_fence_wait":1.220,"Driver.Packet":0.431,"Driver.Present.render_fence_wait":0.415},"trace_dropped":false,"trace":"aps5-trace-7e2ba73e4c8c-18208.json.gz"}
{"commit":"52d1385bddf4","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5947,"ms":20003.301},"presents":1199,"frame_ms":{"p50":16.682,"p90":16.962,"p99":17.377,"max":17.941},"gpu_busy_ms_per_present":1.145,"worker_busy_pct":{"queue worker 0x0":2.313},"top_phases_ms_per_frame":{"VideoOut.Flip":1.744,"VideoOut.Flip.present":1.665,"Driver.Present":1.663,"Driver.Present.acquire_image":1.331,"Vulkan.Acquire":1.330,"Vulkan.Acquire.acquire_fence_wait":1.262,"Driver.Packet":0.383,"Graphics.Draw":0.224},"trace_dropped":false,"trace":"aps5-trace-52d1385bddf4-20000.json.gz"}

tools/performance_compare.py on these two lines. The only configuration difference it reports is window.first_present (5894 and 5947):

Metric (ms) main this PR Change
frame_ms.p50 16.684 16.682 -0.002
frame_ms.p90 17.033 16.962 -0.071
frame_ms.p99 17.741 17.377 -0.364
frame_ms.max 18.160 17.941 -0.219
mean_frame_ms 16.684 16.683 -0.000
gpu_busy_ms_per_present 1.145 1.145 +0.000

In its top phases, VideoOut.Flip goes from 2.226 to 1.744 ms per frame and Driver.Present from 1.890 to 1.663, where WriteFrameDump runs.

tools/trace_digest.py on both runs' summary files

main 7e2ba73e4c:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 502 16.7 17.0 34.2 831.8 1.3 3 % VideoOut.Flip 15.8
2 10-20 597 16.7 17.0 17.9 62.2 1.4 2 % VideoOut.Flip 8.2
3 20-30 600 16.7 17.0 17.8 17.9 1.1 3 % VideoOut.Flip 2.2
4 30-40 600 16.7 17.0 17.6 23.3 1.1 2 % VideoOut.Flip 2.2
5 40-50 600 16.7 17.0 17.7 25.0 1.1 2 % VideoOut.Flip 2.2
6 50-60 600 16.7 17.1 17.7 18.3 1.1 2 % VideoOut.Flip 2.2
7 60-70 600 16.7 17.0 17.6 21.2 1.1 2 % VideoOut.Flip 2.2
8 70-80 600 16.7 17.0 17.7 18.1 1.1 2 % VideoOut.Flip 2.2
9 80-90 600 16.7 17.0 17.6 18.2 1.1 2 % VideoOut.Flip 2.2
10 90-100 600 16.7 17.0 17.7 17.8 1.1 2 % VideoOut.Flip 2.2
11 100-110 600 16.7 17.0 17.7 18.0 1.1 2 % VideoOut.Flip 2.2
12 110-120 595 16.7 17.1 17.8 120.0 1.1 3 % VideoOut.Flip 2.4
13 120-130 600 16.7 17.0 17.8 18.2 1.1 3 % VideoOut.Flip 6.0
14 130-140 600 16.7 17.0 17.7 18.2 1.1 3 % VideoOut.Flip 2.2
p99 ms  @+++++++++++++  0-34.2
gpu ms  %@############  0-1.4

This PR 52d1385bdd:

14 intervals, 0.0 to 140.1 s, 8346 presents
AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1 (AMD proprietary shader compiler), Windows 10.0.26200, 1920x1080, commit 52d1385

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 553 16.7 17.0 26.5 599.7 1.2 2 % VideoOut.Flip 15.8
2 10-20 599 16.7 16.9 17.6 46.1 1.4 2 % VideoOut.Flip 11.8
3 20-30 600 16.7 16.9 17.3 17.6 1.1 2 % VideoOut.Flip 1.7
4 30-40 600 16.7 16.9 17.5 17.5 1.1 2 % VideoOut.Flip 1.7
5 40-50 600 16.7 16.9 17.4 18.1 1.1 2 % VideoOut.Flip 1.7
6 50-60 600 16.7 16.9 17.2 17.7 1.1 2 % VideoOut.Flip 1.7
7 60-70 600 16.7 16.9 17.3 17.5 1.1 2 % VideoOut.Flip 1.7
8 70-80 600 16.7 17.0 17.4 17.8 1.1 2 % VideoOut.Flip 1.7
9 80-90 600 16.7 17.0 17.3 17.5 1.1 2 % VideoOut.Flip 1.7
10 90-100 600 16.7 17.0 17.5 18.1 1.1 2 % VideoOut.Flip 1.7
11 100-110 600 16.7 17.0 17.4 17.9 1.1 2 % VideoOut.Flip 1.7
12 110-120 595 16.7 17.0 17.4 109.1 1.1 2 % VideoOut.Flip 1.9
13 120-130 599 16.7 17.0 17.3 24.2 1.1 2 % VideoOut.Flip 1.8
14 130-140 600 16.7 16.9 17.3 17.5 1.1 2 % VideoOut.Flip 1.7
p99 ms  @*************  0-26.5
gpu ms  #@############  0-1.4

Traces. These runs come from a commercial title, so the trace files stay local. I asked the maintainers on #9373 whether summary lines plus the tools' output are enough for such a title.

Validation-layer A/B. video_out_hdr_present and video_out_hdr_probe ran on main and on this 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 2 of 2 pass, 3 of 3 2 of 2 0 once, no "was not found"
this PR 52d1385bdd 2 of 2 pass, 3 of 3 2 of 2 0 once, no "was not found"

video_out_hdr_present is the one Vulkan process: it writes six frame dumps through WriteFrameDump, prints their [gpu] frame_NNN.bmp lines and reads the BMPs back, with a largest difference of 0 on both sides. HDR10 presentation is not exercised on this display. video_out_hdr_probe runs without a Vulkan instance. video_out_frame_dump_queue is registered only off Windows.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 22, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated comment adds a useful paired Vulkan validation run: the focused tests ran on the reported baseline and this PR, the layer loaded, and both sides show zero VUID- lines. The frame-dump test also passed three times on both sides and read back the BMPs. Exact-head whitespace and conventions pass against current main 3ca07d086d5f44fbe3c00370e7f03953ab46ca1b; the current-main merge tree is clean. The author’s Windows RX 6700 XT results are reported; I did not run GPU tests locally, and hosted product jobs are skipped.

The report still uses main 7e2ba73e4c (with only #9115) and PR head 52d1385bdd, while this branch is based on 7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d and current main is now 3ca07d086d5f44fbe3c00370e7f03953ab46ca1b. Please update the branch, then rerun the same title/scene/machine performance A/B and paired validation-layer checks against current main and the resulting clean PR head.

The summaries and trace_digest.py output are now present, but the trace files remain local because the test uses a commercial title. I found no maintainer answer in #9373 approving summary-only evidence. Please get that exception confirmed there rather than posting commercial traces without approval; otherwise attach the required traces and digest as the repository performance form requests. Preserve the agreed overlap handling for #6946/#9508/#1896/#7642 when updating. This request is for current-main and performance/validation evidence only; no intake hold is being applied.

@thuanquang
thuanquang force-pushed the fix/frame-dump-line-async branch from 52d1385 to 67a69f7 Compare October 22, 2026 19:19
@thuanquang

Copy link
Copy Markdown
Contributor Author

Rebased on main 3ca07d086d (head 67a69f7d8e, the same one-line change), and reran both checks against that base.

Performance A/B, same title, scene and machine. main 3ca07d086d against this head, both built clean (dirty: false), both with #9115's trophy fix (to get past stop 1), with only libSceAgcDriver.prx swapped. Launcher title screen, 150 s, APS5_DUMP_FRAMES=400 with APS5_DUMP_FRAMES_EVERY=30, APS5_TRACE_SUMMARY_EVERY=10 and a 20 s trace window at 100 s (APS5_TRACE_SECONDS=100:20), with this PC's GPU and build locks held (both taken by 20 s into each run, during boot). This PR ran first, then main. Per 10 s window from 20 s on, without 110 to 120 s, whose last frame writes the trace (119.4 ms with this PR, 112.4 ms on main):

Launcher title, 11 windows this PR 67a69f7d8e (ran first) main 3ca07d086d
presents per 10 s 600 597 to 600
frame p99 17.2 to 17.5 ms 17.6 to 18.0 ms
frame max 17.3 to 17.9 ms, 0 of 11 windows over 20 ms 18.0 to 75.1 ms, 7 of 11 windows over 20 ms
GPU busy per present 1.21 to 1.28 ms 1.23 to 1.32 ms

Two more runs of this session, one per side, are left out: another session's build held this PC's build lock while they ran (it came free 36 s into one of them and only after the other had ended), and both show single frames of 0.5 to 1.6 s that the pair above does not have.

tools/performance_compare.py on the two trace-window lines, main as the baseline (the only configuration difference it reports is window.first_present): frame p99 17.689 -> 17.277 ms, max 26.245 -> 17.673 ms, p90 17.007 -> 16.917 ms, mean 16.697 -> 16.683 ms, GPU busy per present 1.299 -> 1.228 ms. In the top phases Driver.Present, where WriteFrameDump runs, goes from 2.090 to 0.677 ms per frame and VideoOut.Flip.present from 2.093 to 0.681. VideoOut.Flip itself grows (2.339 -> 15.836) because its vblank_wait now shows (14.989 ms per frame): processFlip waits there only when a flip arrives before its target vblank, and on main that wait is not among the top phases.

Summary lines of the two trace windows (100 to 120 s), this PR first
{"commit":"67a69f7d8e23","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5943,"ms":20003.384},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.917,"p99":17.277,"max":17.673},"gpu_busy_ms_per_present":1.228,"worker_busy_pct":{"queue worker 0x0":2.624},"top_phases_ms_per_frame":{"VideoOut.Flip":15.836,"VideoOut.Flip.vblank_wait":14.989,"VideoOut.Flip.present":0.681,"Driver.Present":0.677,"Driver.Packet":0.435,"Driver.Present.acquire_image":0.256,"Graphics.Draw":0.255,"Vulkan.Acquire":0.255},"trace_dropped":false,"trace":"aps5-trace-67a69f7d8e23-5548.json.gz"}
{"commit":"3ca07d086d5f","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5828,"ms":20003.375},"presents":1198,"frame_ms":{"p50":16.686,"p90":17.007,"p99":17.689,"max":26.245},"gpu_busy_ms_per_present":1.299,"worker_busy_pct":{"queue worker 0x0":2.497},"top_phases_ms_per_frame":{"VideoOut.Flip":2.339,"VideoOut.Flip.present":2.093,"Driver.Present":2.090,"Driver.Present.acquire_image":1.324,"Vulkan.Acquire":1.323,"Vulkan.Acquire.acquire_fence_wait":1.252,"Driver.Present.render_fence_wait":0.585,"Vulkan.Retire":0.584},"trace_dropped":false,"trace":"aps5-trace-3ca07d086d5f-28544.json.gz"}
tools/performance_compare.py, main against this PR

Performance comparison

Capture Commit Trace Presents Window (ms)
baseline 3ca07d0 aps5-trace-3ca07d086d5f-28544.json.gz 1198 20003.375
candidate 67a69f7 aps5-trace-67a69f7d8e23-5548.json.gz 1199 20003.384
  • Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene.
  • Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval.
  • A missing top phase is unreported, not zero; its change is unavailable.
  • Recorded configuration differs; these measurements do not isolate the code change.

Configuration differences

Setting Baseline Candidate
window.first_present 5828 5943

Frame and GPU times (ms)

Metric Baseline Candidate Change Change (%)
frame_ms.p50 16.686 16.683 -0.003 -0.018
frame_ms.p90 17.007 16.917 -0.090 -0.529
frame_ms.p99 17.689 17.277 -0.412 -2.329
frame_ms.max 26.245 17.673 -8.572 -32.661
mean_frame_ms 16.697 16.683 -0.014 -0.083
gpu_busy_ms_per_present 1.299 1.228 -0.071 -5.466

Top phases (ms per frame)

Metric Baseline Candidate Change Change (%)
Driver.Packet n/a 0.435 n/a n/a
Driver.Present 2.090 0.677 -1.413 -67.608
Driver.Present.acquire_image 1.324 0.256 -1.068 -80.665
Driver.Present.render_fence_wait 0.585 n/a n/a n/a
Graphics.Draw n/a 0.255 n/a n/a
VideoOut.Flip 2.339 15.836 +13.497 +577.041
VideoOut.Flip.present 2.093 0.681 -1.412 -67.463
VideoOut.Flip.vblank_wait n/a 14.989 n/a n/a
Vulkan.Acquire 1.323 0.255 -1.068 -80.726
Vulkan.Acquire.acquire_fence_wait 1.252 n/a n/a n/a
Vulkan.Retire 0.584 n/a n/a n/a
tools/trace_digest.py on both runs' summary files

This PR 67a69f7d8e:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 549 16.7 17.0 34.4 589.1 1.2 4 % VideoOut.Flip 15.6
2 10-20 599 16.7 16.9 17.4 47.9 1.6 3 % VideoOut.Flip 15.9
3 20-30 600 16.7 16.9 17.2 17.6 1.2 2 % VideoOut.Flip 15.9
4 30-40 600 16.7 16.9 17.2 17.4 1.3 2 % VideoOut.Flip 15.9
5 40-50 600 16.7 16.9 17.2 17.7 1.2 2 % VideoOut.Flip 15.9
6 50-60 600 16.7 16.9 17.4 17.9 1.2 3 % VideoOut.Flip 15.8
7 60-70 600 16.7 16.9 17.5 17.8 1.3 3 % VideoOut.Flip 15.9
8 70-80 600 16.7 16.9 17.2 17.3 1.2 3 % VideoOut.Flip 15.8
9 80-90 600 16.7 16.9 17.2 17.7 1.3 3 % VideoOut.Flip 15.8
10 90-100 600 16.7 16.9 17.2 17.8 1.3 2 % VideoOut.Flip 15.9
11 100-110 600 16.7 16.9 17.2 17.7 1.2 3 % VideoOut.Flip 15.9
12 110-120 595 16.7 16.9 17.4 119.4 1.3 3 % VideoOut.Flip 16.0
13 120-130 600 16.7 17.0 17.4 17.9 1.3 3 % VideoOut.Flip 2.0
14 130-140 600 16.7 17.0 17.3 17.9 1.3 3 % VideoOut.Flip 2.0
p99 ms  @+++=+++===+++  0-34.4
gpu ms  #@############  0-1.6

main 3ca07d086d:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 441 16.7 17.2 63.7 1499.4 1.4 2 % VideoOut.Flip 11.0
2 10-20 598 16.7 17.0 17.5 63.7 1.6 3 % VideoOut.Flip 3.4
3 20-30 597 16.7 17.0 17.9 75.1 1.3 2 % VideoOut.Flip 2.4
4 30-40 600 16.7 17.1 17.8 18.0 1.3 3 % VideoOut.Flip 2.3
5 40-50 599 16.7 17.0 18.0 28.5 1.3 3 % VideoOut.Flip 2.3
6 50-60 600 16.7 17.0 17.7 18.1 1.3 3 % VideoOut.Flip 2.3
7 60-70 599 16.7 17.1 17.9 30.6 1.3 3 % VideoOut.Flip 2.4
8 70-80 599 16.7 17.0 17.8 28.1 1.2 3 % VideoOut.Flip 2.3
9 80-90 600 16.7 17.0 17.6 18.1 1.3 2 % VideoOut.Flip 4.4
10 90-100 600 16.7 17.0 17.8 24.5 1.3 3 % VideoOut.Flip 2.3
11 100-110 599 16.7 17.0 17.8 26.2 1.3 3 % VideoOut.Flip 2.4
12 110-120 595 16.7 17.0 17.6 112.4 1.3 2 % VideoOut.Flip 2.5
13 120-130 600 16.7 17.0 17.9 21.3 1.2 3 % VideoOut.Flip 2.3
14 130-140 600 16.7 17.0 17.8 18.0 1.3 2 % VideoOut.Flip 2.3
p99 ms  @:------:--:--  0-63.7
gpu ms  %@############  0-1.6

Validation-layer A/B. video_out_hdr_present and video_out_hdr_probe on main 3ca07d086d and on this head, 3 rounds without the layer and once with it (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, implicit layers disabled, VK_LOADER_DEBUG=layer):

plain, 3 rounds with the layer VUID- lines layer inserted
main 3ca07d086d 2 of 2 pass, 3 of 3 2 of 2 0 once, no "was not found"
this PR 67a69f7d8e 2 of 2 pass, 3 of 3 2 of 2 0 once, no "was not found"

video_out_hdr_present writes the frame dumps through WriteFrameDump, prints their [gpu] frame_NNN.bmp lines and reads the BMPs back, with a largest difference of 0 on both sides.

Traces. These runs come from a commercial title, so the trace files stay local. The question whether summary lines plus the tools' output are enough for such a title is still open on #9373 (no maintainer answer yet); I will attach the traces if a maintainer asks for them there.

The overlap handling is unchanged: the #6946/#9508/#1896/#7642 overlaps are on #9373's [draw] pipelined line, and this PR still only switches the frame-dump line from std::fprintf to ProfilePrint_nid_no_patch.

@fogydes

fogydes commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The performance-evidence form is now satisfied by the 2026-10-22T19:20Z comment: the paired captures are distinct, clean (dirty:false on both sides), identify main 3ca07d086d5f vs this head 67a69f7d8e23 from the same GPU/driver/CPU/OS/title/content-version/scene/window spec (RX 6700 XT, MGS Master Collection launcher, 20 s window at 100 s), with the full 14-interval trace_digest.py tables for both sides and the performance_compare.py table (Driver.Present 2.090 → 0.677 ms/frame, frame max 26.245 → 17.673 ms). The earlier "both summary lines identify 6ef5a1c4" complaint refers to the superseded comment — the current one replaced it. What remains from that form is exactly the trace files: withheld pending the open commercial-title exception question in #9373, which is a maintainer decision, not something more author work can resolve.

Current-main drift still requires a rerun, though: current main is 0a0ed72167 and this branch is 615 commits behind base 3ca07d086d, with main's VulkanDevice.cpp moving in that window (36559da793 one-sample color targets, the #8847 MSAA sRGB twin merge 8b3e39832a, 329efe1bfd, 6990044dfb). A git merge-tree against current main is textually clean, but the paired A/B and validation-layer runs should be re-taken against the rebased head, since both -32% on frame max and the VUID-comparison is anchored to the old main tip. [verified envelope + merge-tree]

Independent structural checks on the one-line change itself, [verified]:

  1. fprintf(stderr, …) → AgcDriver::ProfilePrint_nid_no_patch(...) — the latter is the async profile output used by the in-family diagnostic lines ([gpu] dispatches, [groupcap], [dispatch-cache]), so this presenter-path change reads in-family rather than novel.
  2. ProfileOutput's default writer still goes to stderr with flush — same destination as before — just serialized through the batching worker (4 MiB capacity, drop counter, failure rethrow). No test or doc pins the old synchronous stderr timing (the only references to display read back on the GPU are the source site itself), so the reroute breaks nothing by contract; the new author-reported video_out_hdr_present run reading back the BMPs with the [gpu] frame_NNN.bmp lines exercised on both sides covers the changed line end to end.
  3. Two semantic notes worth recording, neither blocking: interleaving of this line with other synchronous stderr output changes order (async batching), and under diagnostic overload the line can now be dropped with the [profile-output] dropped … accounting instead of being printed unconditionally — that is the designed behavior of the shared pipeline, but it is a real difference for anyone parsing the frame-dump trail after a heavy session. The fresh-line-at-crash timing similarly shifts to the worker.

Disclosure: source-level verification on Windows; I did not build, run, or GPU-test anything here, and every measurement above is author-reported plus form-checked by me. The validation A/B table (layer inserted, zero VUID- lines both sides, no "was not found" loader noise) and the three frame-dump BMP readbacks are implemented exactly as the AGC evidence rule asks — the only open items stay the trace-file exception in #9373 and the promised post-rebase rerun against whichever main tip is current when they push.

…file output

Co-Authored-By: Claude <noreply@anthropic.com>
@thuanquang

Copy link
Copy Markdown
Contributor Author

Rebased onto main 048d0f9aa3 (head 1a9f8be3fc; git range-diff shows the same one-line change on the new base) and reran both checks against that base, as asked.

Performance A/B, same title, scene and machine. main 048d0f9aa3 against this head, both built clean (dirty: false), with only libSceAgcDriver.prx swapped; main now has #9115, so no local change is needed to get past stop 1. Launcher title screen, 150 s, APS5_DUMP_FRAMES=400 with APS5_DUMP_FRAMES_EVERY=30, APS5_TRACE_SUMMARY_EVERY=10 and a 20 s trace window at 100 s (APS5_TRACE_SECONDS=100:20). Each run held this PC's exclusive GPU lock and its build lock, and nobody used the PC during the runs. Two pairs, the second in the opposite order. Per 10 s window from 20 s on, without 110 to 120 s, whose last frame writes the trace (117.5 ms, 114.4 ms, 116.8 ms, 111.9 ms in the table's order):

Launcher title, 11 windows per run main (pair 1) this PR (pair 1) this PR (pair 2) main (pair 2)
presents per 10 s 600 600 600 600
frame p99 17.5 to 17.8 ms 17.3 to 17.4 ms 17.2 to 17.4 ms 17.5 to 17.8 ms
windows with a frame over 20 ms 4 of 11 (max 25.7 ms) 0 of 11 (max 19.3 ms) 1 of 11 (max 20.7 ms) 2 of 11 (max 21.7 ms)
GPU busy per present 1.21 to 1.23 ms 1.21 to 1.23 ms 1.21 to 1.23 ms 1.21 to 1.22 ms

The gap is smaller on this base than on 3ca07d086d (there main reached 75.1 ms and 7 of 11 windows over 20 ms; as the body notes, the cost of each write to the write-through log varies between runs). The direction is the same in both pairs: p99 0.2 to 0.4 ms lower, and 0 or 1 windows over 20 ms against 2 or 4. The only configuration difference tools/performance_compare.py reports is window.first_present, where the 100 s window began.

tools/performance_compare.py, main against this PR, pair 1

Performance comparison

Capture Commit Trace Presents Window (ms)
baseline 048d0f9 aps5-trace-048d0f9aa35e-8604.json.gz 1199 20003.430
candidate 1a9f8be aps5-trace-1a9f8be3fc59-16180.json.gz 1199 20003.309
  • Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene.
  • Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval.
  • A missing top phase is unreported, not zero; its change is unavailable.
  • Recorded configuration differs; these measurements do not isolate the code change.

Configuration differences

Setting Baseline Candidate
window.first_present 5894 5948

Frame and GPU times (ms)

Metric Baseline Candidate Change Change (%)
frame_ms.p50 16.679 16.682 +0.003 +0.018
frame_ms.p90 17.000 16.957 -0.043 -0.253
frame_ms.p99 17.631 17.401 -0.230 -1.305
frame_ms.max 18.012 17.630 -0.382 -2.121
mean_frame_ms 16.683 16.683 -0.000 -0.001
gpu_busy_ms_per_present 1.214 1.214 +0.000 +0.000

Top phases (ms per frame)

Metric Baseline Candidate Change Change (%)
Driver.Packet n/a 0.376 n/a n/a
Driver.Present 1.937 1.727 -0.210 -10.842
Driver.Present.acquire_image 1.278 1.317 +0.039 +3.052
Driver.Present.render_fence_wait 0.488 0.241 -0.247 -50.615
VideoOut.Flip 2.280 1.860 -0.420 -18.421
VideoOut.Flip.present 1.940 1.729 -0.211 -10.876
Vulkan.Acquire 1.277 1.316 +0.039 +3.054
Vulkan.Acquire.acquire_fence_wait 1.209 1.249 +0.040 +3.309
Vulkan.Retire 0.488 n/a n/a n/a
tools/performance_compare.py, main against this PR, pair 2

Performance comparison

Capture Commit Trace Presents Window (ms)
baseline 048d0f9 aps5-trace-048d0f9aa35e-10148.json.gz 1199 20003.436
candidate 1a9f8be aps5-trace-1a9f8be3fc59-25528.json.gz 1199 20003.308
  • Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene.
  • Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval.
  • A missing top phase is unreported, not zero; its change is unavailable.
  • Recorded configuration differs; these measurements do not isolate the code change.

Configuration differences

Setting Baseline Candidate
window.first_present 5877 5946

Frame and GPU times (ms)

Metric Baseline Candidate Change Change (%)
frame_ms.p50 16.684 16.686 +0.002 +0.012
frame_ms.p90 16.977 16.926 -0.051 -0.300
frame_ms.p99 17.622 17.192 -0.430 -2.440
frame_ms.max 18.273 17.755 -0.518 -2.835
mean_frame_ms 16.683 16.683 -0.000 -0.001
gpu_busy_ms_per_present 1.222 1.222 +0.000 +0.000

Top phases (ms per frame)

Metric Baseline Candidate Change Change (%)
Driver.Packet n/a 0.374 n/a n/a
Driver.Present 1.938 1.724 -0.214 -11.042
Driver.Present.acquire_image 1.292 1.306 +0.014 +1.084
Driver.Present.render_fence_wait 0.480 0.250 -0.230 -47.917
VideoOut.Flip 2.210 1.850 -0.360 -16.290
VideoOut.Flip.present 1.940 1.727 -0.213 -10.979
Vulkan.Acquire 1.291 1.305 +0.014 +1.084
Vulkan.Acquire.acquire_fence_wait 1.226 1.238 +0.012 +0.979
Vulkan.Retire 0.479 n/a n/a n/a
tools/trace_digest.py on the four runs' summary files

9602-A1:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 502 16.7 17.1 39.5 874.4 1.3 2 % VideoOut.Flip 13.5
2 10-20 597 16.7 17.0 17.5 61.0 1.5 2 % VideoOut.Flip 8.1
3 20-30 600 16.7 17.0 17.7 25.7 1.2 2 % VideoOut.Flip 4.6
4 30-40 600 16.7 17.0 17.7 18.0 1.2 2 % VideoOut.Flip 2.3
5 40-50 600 16.7 17.0 17.7 18.2 1.2 2 % VideoOut.Flip 2.3
6 50-60 600 16.7 17.0 17.6 20.5 1.2 2 % VideoOut.Flip 2.3
7 60-70 600 16.7 17.0 17.7 17.8 1.2 2 % VideoOut.Flip 2.3
8 70-80 600 16.7 17.0 17.7 17.8 1.2 2 % VideoOut.Flip 2.3
9 80-90 600 16.7 17.0 17.8 21.5 1.2 2 % VideoOut.Flip 2.3
10 90-100 600 16.7 17.0 17.7 21.9 1.2 2 % VideoOut.Flip 2.3
11 100-110 600 16.7 17.0 17.5 18.0 1.2 2 % VideoOut.Flip 2.3
12 110-120 595 16.7 17.0 17.7 117.5 1.2 2 % VideoOut.Flip 2.5
13 120-130 600 16.7 17.0 17.6 17.9 1.2 2 % VideoOut.Flip 2.3
14 130-140 600 16.7 17.0 17.6 18.2 1.2 2 % VideoOut.Flip 2.3
p99 ms  @=============  0-39.5
gpu ms  %@############  0-1.5

9602-B1:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 554 16.7 16.9 32.6 584.0 1.2 2 % VideoOut.Flip 13.2
2 10-20 599 16.7 16.9 17.6 47.2 1.5 2 % VideoOut.Flip 11.9
3 20-30 600 16.7 17.0 17.3 17.5 1.2 2 % VideoOut.Flip 1.9
4 30-40 600 16.7 16.9 17.3 17.7 1.2 2 % VideoOut.Flip 1.9
5 40-50 600 16.7 16.9 17.3 17.5 1.2 2 % VideoOut.Flip 1.9
6 50-60 600 16.7 17.0 17.4 17.7 1.2 2 % VideoOut.Flip 1.9
7 60-70 600 16.7 16.9 17.3 17.5 1.2 2 % VideoOut.Flip 1.8
8 70-80 600 16.7 17.0 17.4 17.6 1.2 2 % VideoOut.Flip 1.9
9 80-90 600 16.7 17.0 17.4 18.2 1.2 2 % VideoOut.Flip 1.9
10 90-100 600 16.7 16.9 17.3 17.6 1.2 2 % VideoOut.Flip 1.8
11 100-110 600 16.7 17.0 17.4 17.6 1.2 2 % VideoOut.Flip 1.9
12 110-120 595 16.7 16.9 17.4 114.4 1.2 2 % VideoOut.Flip 2.1
13 120-130 600 16.7 16.9 17.3 19.3 1.2 2 % VideoOut.Flip 1.9
14 130-140 600 16.7 17.0 17.4 17.7 1.2 2 % VideoOut.Flip 1.9
p99 ms  @+++++++++++++  0-32.6
gpu ms  #@############  0-1.5

9602-B2:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 552 16.7 16.9 32.6 590.3 1.2 2 % VideoOut.Flip 15.4
2 10-20 599 16.7 16.9 17.4 46.3 1.5 2 % VideoOut.Flip 12.7
3 20-30 600 16.7 16.9 17.2 17.7 1.2 2 % VideoOut.Flip 1.9
4 30-40 600 16.7 17.0 17.4 17.6 1.2 2 % VideoOut.Flip 1.8
5 40-50 600 16.7 16.9 17.3 17.7 1.2 2 % VideoOut.Flip 1.8
6 50-60 600 16.7 17.0 17.2 17.7 1.2 2 % VideoOut.Flip 1.9
7 60-70 600 16.7 17.0 17.4 17.5 1.2 2 % VideoOut.Flip 1.9
8 70-80 600 16.7 16.9 17.3 18.0 1.2 2 % VideoOut.Flip 1.9
9 80-90 600 16.7 16.9 17.2 17.4 1.2 2 % VideoOut.Flip 1.8
10 90-100 600 16.7 17.0 17.3 17.8 1.2 2 % VideoOut.Flip 1.8
11 100-110 600 16.7 16.9 17.2 17.4 1.2 2 % VideoOut.Flip 1.8
12 110-120 595 16.7 16.9 17.2 116.8 1.2 2 % VideoOut.Flip 2.0
13 120-130 600 16.7 16.9 17.3 17.8 1.2 2 % VideoOut.Flip 1.9
14 130-140 600 16.7 17.0 17.4 20.7 1.2 2 % VideoOut.Flip 1.9
p99 ms  @+++++++++++++  0-32.6
gpu ms  #@############  0-1.5

9602-A2:

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

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 484 16.7 17.1 50.6 843.8 1.3 2 % VideoOut.Flip 14.5
2 10-20 598 16.7 17.0 17.5 61.2 1.5 2 % VideoOut.Flip 4.7
3 20-30 600 16.7 17.0 17.7 18.5 1.2 2 % VideoOut.Flip 2.2
4 30-40 600 16.7 17.0 17.7 17.8 1.2 2 % VideoOut.Flip 2.2
5 40-50 600 16.7 17.0 17.7 17.9 1.2 2 % VideoOut.Flip 2.2
6 50-60 600 16.7 17.0 17.7 18.4 1.2 2 % VideoOut.Flip 2.2
7 60-70 600 16.7 17.0 17.8 19.8 1.2 2 % VideoOut.Flip 3.6
8 70-80 600 16.7 17.0 17.7 20.2 1.2 2 % VideoOut.Flip 2.2
9 80-90 600 16.7 17.0 17.5 17.7 1.2 2 % VideoOut.Flip 2.2
10 90-100 600 16.7 17.0 17.6 17.8 1.2 2 % VideoOut.Flip 2.2
11 100-110 600 16.7 17.0 17.6 18.3 1.2 2 % VideoOut.Flip 2.2
12 110-120 595 16.7 17.0 17.6 111.9 1.2 2 % VideoOut.Flip 2.4
13 120-130 600 16.7 17.0 17.7 21.7 1.2 2 % VideoOut.Flip 2.2
14 130-140 600 16.7 17.0 17.5 17.7 1.2 2 % VideoOut.Flip 6.9
p99 ms  @-------------  0-50.6
gpu ms  %@############  0-1.5
Summary lines of the four trace windows (100 to 120 s), in the table's order
{"commit":"048d0f9aa35e","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5894,"ms":20003.430},"presents":1199,"frame_ms":{"p50":16.679,"p90":17.000,"p99":17.631,"max":18.012},"gpu_busy_ms_per_present":1.214,"worker_busy_pct":{"queue worker 0x0":2.308},"top_phases_ms_per_frame":{"VideoOut.Flip":2.280,"VideoOut.Flip.present":1.940,"Driver.Present":1.937,"Driver.Present.acquire_image":1.278,"Vulkan.Acquire":1.277,"Vulkan.Acquire.acquire_fence_wait":1.209,"Driver.Present.render_fence_wait":0.488,"Vulkan.Retire":0.488},"trace_dropped":false,"trace":"aps5-trace-048d0f9aa35e-8604.json.gz"}
{"commit":"1a9f8be3fc59","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5948,"ms":20003.309},"presents":1199,"frame_ms":{"p50":16.682,"p90":16.957,"p99":17.401,"max":17.630},"gpu_busy_ms_per_present":1.214,"worker_busy_pct":{"queue worker 0x0":2.272},"top_phases_ms_per_frame":{"VideoOut.Flip":1.860,"VideoOut.Flip.present":1.729,"Driver.Present":1.727,"Driver.Present.acquire_image":1.317,"Vulkan.Acquire":1.316,"Vulkan.Acquire.acquire_fence_wait":1.249,"Driver.Packet":0.376,"Driver.Present.render_fence_wait":0.241},"trace_dropped":false,"trace":"aps5-trace-1a9f8be3fc59-16180.json.gz"}
{"commit":"1a9f8be3fc59","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5946,"ms":20003.308},"presents":1199,"frame_ms":{"p50":16.686,"p90":16.926,"p99":17.192,"max":17.755},"gpu_busy_ms_per_present":1.222,"worker_busy_pct":{"queue worker 0x0":2.263},"top_phases_ms_per_frame":{"VideoOut.Flip":1.850,"VideoOut.Flip.present":1.727,"Driver.Present":1.724,"Driver.Present.acquire_image":1.306,"Vulkan.Acquire":1.305,"Vulkan.Acquire.acquire_fence_wait":1.238,"Driver.Packet":0.374,"Driver.Present.render_fence_wait":0.250},"trace_dropped":false,"trace":"aps5-trace-1a9f8be3fc59-25528.json.gz"}
{"commit":"048d0f9aa35e","dirty":false,"env":{"APS5_DUMP_FRAMES":"400","APS5_DUMP_FRAMES_EVERY":"30","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":5877,"ms":20003.436},"presents":1199,"frame_ms":{"p50":16.684,"p90":16.977,"p99":17.622,"max":18.273},"gpu_busy_ms_per_present":1.222,"worker_busy_pct":{"queue worker 0x0":2.175},"top_phases_ms_per_frame":{"VideoOut.Flip":2.210,"VideoOut.Flip.present":1.940,"Driver.Present":1.938,"Driver.Present.acquire_image":1.292,"Vulkan.Acquire":1.291,"Vulkan.Acquire.acquire_fence_wait":1.226,"Driver.Present.render_fence_wait":0.480,"Vulkan.Retire":0.479},"trace_dropped":false,"trace":"aps5-trace-048d0f9aa35e-10148.json.gz"}

Validation-layer A/B on the same two builds: video_out_hdr_present and video_out_hdr_probe, 3 rounds without the layer and once with it (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, implicit layers disabled, VK_LOADER_DEBUG=layer):

plain, 3 rounds with the layer VUID- lines layer inserted
main 048d0f9aa3 2 of 2 pass, 3 of 3 2 of 2 0 once, no "was not found"
this PR 1a9f8be3fc 2 of 2 pass, 3 of 3 2 of 2 0 once, no "was not found"

video_out_hdr_present writes the frame dumps through WriteFrameDump, prints their [gpu] frame_NNN.bmp lines and reads the BMPs back, with a largest difference of 0 on both sides.

Traces still stay local; the question for commercial titles is open on #9373.

On your two semantic notes: both are right and are what the shared output does for every line routed through it. The frame-dump line can now land after a later synchronous stderr line, and under diagnostic overload it can be dropped and counted on a [profile-output] dropped ... line instead of being printed. The PR body's Tested section now says so.

@thuanquang
thuanquang force-pushed the fix/frame-dump-line-async branch from 67a69f7 to 1a9f8be Compare October 23, 2026 08:56
@adriadam10 adriadam10 self-assigned this Oct 23, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 24, 2026 10:20

Dismissing a stale review: the requested changes were addressed after it (new head and/or updated description with the asked-for runs) and the merge queue blocks on it. Please request changes again if anything is still open.

@adriadam10
adriadam10 merged commit 6d88c2d into boykopovar:main Oct 25, 2026
11 of 12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Re-checked on current main: the diff is still the one-line switch to ProfilePrint_nid_no_patch (same text and arguments, same helper other lines in this file already use), and the new main changes in this file are elsewhere. The earlier change request is dismissed, and the paired A/B and validation-layer evidence cover the rest; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants