Skip to content

feat(libc): add frame-time percentiles, compile time and a run recipe to the run report - #17432

Merged
oneandonlydean merged 43 commits into
boykopovar:mainfrom
MarcZX10:feat/run-report-frame-stats-and-recipe
Nov 12, 2026
Merged

oneandonlydean merged 43 commits into
boykopovar:mainfrom
MarcZX10:feat/run-report-frame-stats-and-recipe

Conversation

@MarcZX10

@MarcZX10 MarcZX10 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What

Adds three things to the run report written at the end of a run (anyps5-report.json, schema version 2, additive fields only, so version 1 readers keep working):

  • frameMs: p50, p90 and p99 of the intervals between presented frames, over the most recent 2,048 intervals. Null with fewer than two presented frames.
  • shaders.compileMs and shaders.slowCompiles: total wall time spent compiling shaders, failed compiles included, and the number of compiles slower than 100 ms. Left out when shader coverage is off.
  • anyps5-recipe.json next to the report: how the run was started (argv, ANYPS5 variables as received, config names, build commit). Values pass through the same text filter as the report, and a variable whose name contains TOKEN, KEY, PASSWORD or SECRET is never written.

Commits: fixed-size ring for run report values; nearest-rank percentile function; frame interval ring at the present path; compile timing through the diagnostic sink; recipe serializer, redaction and capture; schema version 2 and version 1 kept for additive fields; docs per commit.

Tested

Linux, Debian kernel 6.1.0-54-amd64, Intel Xeon E5-1620 v2. No GPU hardware: Vulkan through the lavapipe software ICD under Xvfb.

Command:

flock <build lock> env VERIFY_DIR=<worktree> VERIFY_TAG=runreport5 ANYPS5_REQUIRE_DISPLAY=1 VK_ICD_FILENAMES=<lavapipe ICD json> xvfb-run -a bash <runner with the x11 driver step> '^(run_report|run_report_revision|run_report_schema|video_out_frame_dump_queue)$' run_report_tests video_out_frame_dump_queue_tests

Output:

BUILD-EXIT 0
1/4 Test  #817: run_report .......................   Passed    1.36 sec
2/4 Test  #818: run_report_schema ................   Passed    0.39 sec
3/4 Test  #819: run_report_revision ..............   Passed    0.52 sec
4/4 Test #3858: video_out_frame_dump_queue .......   Passed    1.74 sec
100% tests passed, 0 tests failed out of 4

Driver note: with the default driver (SDL_VIDEODRIVER=offscreen), video_out_frame_dump_queue skips because the offscreen driver has no Vulkan window, and ANYPS5_REQUIRE_DISPLAY=1 turns that skip into a failure. The run therefore wrote ANYPS5_VIDEO_OUT_TEST_DRIVER:STRING=x11 into build/CMakeCache.txt right after the configure step, the same step as the keep-awake PR. The code does not depend on this option.

Not verified:

  • Frame-time percentiles and compile times were checked on the code paths and unit tests only. No real title run was measured.
  • Windows and macOS capture of the recipe environment (GetEnvironmentStringsW, _NSGetEnviron) is not verified. It is listed in the debt file.
  • Any GPU hardware, and any console.

Overlap: no other open PR implements frame percentiles, shader compile time or the run recipe. Two open PRs change the same run report writer and its tests and will likely conflict in RunReport.hpp, RunReport.cpp and core/libs/tests/RunReport.cpp: #15973 (recovers the report of a run that ended without writing one) and #16757 (writes the report when a run ends in std::terminate). The functions are different. The other matches only share the libc debt file (append-only sections), or AGC and shader files where the changed functions are unrelated; #13809 and #12828 touch PerformanceTrace.hpp for other counters.

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: none; lavapipe software Vulkan under Xvfb, no GPU hardware
  • AI-assisted: yes

The recipe passed the commit through the value redactor, which hides any
long hexadecimal string, so a valid 40-character build commit was written
as [redacted]. The commit is a build identity checked against the same
40-character pattern as the report, so it is written as it is when it
matches and omitted otherwise.
The run block of the report has carried a frameMs field, null when a run
has too few frames, since the frame percentiles were added. The
serialization test still listed the block without it.
Finishing a run writes the recipe next to the report, so one file in the
folder was the wrong expectation. The check now fails on any leftover
temporary file and expects exactly the report and the recipe.
@JJenkx

JJenkx commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Windows check of head c9260e3630, merged onto main 095ff72367 (eeb20a6be3, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • run_report passes in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 15973 core/libs/prx/libc/include/RunReport.hpp L15
core/libs/prx/libc/src/RunReport.cpp L71, L1581, L1583-1598, L1671
docs/dev/debt/libc.md L373
docs/user/run-report.md L49-51
PR 16757 docs/dev/debt/libc.md L373

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 4448 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5609 core/shader/recompiler/Recompiler.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6412 core/shader/recompiler/Recompiler.cpp
PR 6488 core/shader/recompiler/Recompiler.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6858 core/shader/recompiler/Recompiler.cpp
PR 6924 core/shader/recompiler/Recompiler.cpp
PR 7447 docs/dev/debt/libc.md
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7464 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7544 docs/dev/debt/libc.md
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 7643 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7715 docs/dev/debt/libc.md
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 8150 docs/dev/debt/libc.md
PR 8417 docs/dev/debt/libc.md
PR 8965 docs/dev/debt/libc.md
PR 9087 docs/dev/debt/libc.md
PR 9289 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9340 docs/dev/debt/libc.md
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 9371 docs/dev/debt/libc.md
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 9447 docs/dev/debt/libc.md
PR 9466 docs/dev/debt/libc.md
PR 9526 docs/dev/debt/libc.md
PR 9748 core/shader/recompiler/Recompiler.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 10359 core/shader/recompiler/Recompiler.cpp
PR 10409 docs/dev/debt/libc.md
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 10678 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10757 core/shader/recompiler/Recompiler.cpp
PR 10780 docs/dev/debt/libc.md
PR 11109 docs/dev/debt/libc.md
PR 11172 docs/dev/debt/libc.md
PR 11266 docs/dev/debt/libc.md
PR 11332 docs/dev/debt/libc.md
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 11551 core/shader/recompiler/Recompiler.cpp
PR 11625 docs/dev/debt/libc.md
PR 11661 docs/dev/debt/libc.md
PR 11689 docs/dev/debt/libc.md
PR 11698 docs/dev/debt/libc.md
PR 11726 docs/dev/debt/libc.md
PR 12324 core/shader/recompiler/Recompiler.cpp
PR 12682 docs/dev/debt/libc.md
PR 12688 docs/dev/debt/libc.md
PR 12700 docs/dev/debt/libc.md
PR 12828 core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 12849 docs/dev/debt/libc.md
PR 12855 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12904 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12965 docs/dev/debt/libc.md
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13449 docs/dev/debt/libc.md
PR 13794 docs/dev/debt/libc.md
PR 13804 docs/dev/debt/libc.md
PR 13809 core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 14212 docs/dev/debt/libc.md
PR 14217 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 14218 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 14853 core/shader/recompiler/Recompiler.cpp
PR 14944 core/shader/recompiler/Recompiler.cpp
PR 15343 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 15719 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16888 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17026 docs/dev/debt/libc.md
PR 17056 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 17611 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/shader/recompiler/Recompiler.cpp
PR 17700 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18082 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18347 docs/dev/debt/libc.md
PR 18369 core/shader/recompiler/Recompiler.cpp
PR 18389 docs/dev/debt/libc.md
PR 18481 docs/dev/debt/libc.md
PR 18513 docs/dev/debt/libc.md
PR 18515 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18524 docs/dev/debt/libc.md
PR 18525 docs/dev/debt/libc.md
PR 18694 docs/dev/debt/libc.md
PR 18848 docs/dev/debt/libc.md
PR 19054 docs/dev/debt/libc.md

@github-actions github-actions Bot added libc shader core/shader docs agc libSceAgc* labels Nov 8, 2026
…cipe

The recipe filter only looked for TOKEN, KEY, PASSWORD and SECRET, so
ANYPS5_PSN_PASSCODE and ANYPS5_NP_AUTH were written as they are, and the
recipe is meant to be attached to bug reports.
@NathanFahey23

NathanFahey23 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Windows NVIDIA check of head 935c7e1625, merged onto main 07b318056e (clean merge).

Setup: Windows 11 Home 10.0.26300, i9-13900K, WinLibs GCC 15.2.0, Release, RTX 4080 (10de:2704, driver 32.0.16.2101), ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, Vulkan validation layer on. Runs were pinned to the E-cores (16-31) unless noted.

ctest -R '^(agc_|shader|video_out|guest_video)' --parallel 4:

passed validation errors
main 07b318056e 1692/1693 (guest_video_out_high_frame_rate) 0
with this PR 1691/1693 (agc_storage_dcc_mip_writeback, video_out_flip_backtoback) 0

Neither PR-side failure is caused by this PR. Each test repeated 20 times alone, pinned:

test main with this PR
agc_storage_dcc_mip_writeback 14/20 pass 10/20 pass
video_out_flip_backtoback 13/20 pass 16/20 pass

Both pass 20/20 with the PR when not pinned. video_out_flip_backtoback is #16956. The agc_storage_dcc_mip_writeback failure on main reads "the write-back stored 344064 of 344064 texels, expected only the accessed unit's"; 20 runs is too few to call the 14 vs 10 difference meaningful.

guest_video_out_high_frame_rate failed once on main and passed with the PR; not investigated.

The run-report tests (run_report, run_report_revision, agc_run_report_shader_failure) pass 3/3 on the PR build.

Not checked: a run report from a real title, the rest of the suite.

AI-assisted: yes

@oneandonlydean
oneandonlydean merged commit 449a777 into boykopovar:main Nov 12, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs libc shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants