Repository navigation
fix(agc): finish the run report when the frame replay ends - #24021
Conversation
agc_frame_replay is a host program, so it never ends through the guest's exit or _exit, the only paths that write the run report on Windows (DLL exit handlers run inside the loader lock). On every system it also ends a failed run, and a listing, with std::_Exit, which skips the exit handler that writes the report on Linux and macOS. APS5_REPORT=1 therefore wrote no report for a Windows replay, for a failed replay or for a listing. The replay now finishes the report itself, with its exit code, after the driver has shut down and before it returns or exits. On Linux and macOS the exit handler finds the report already written and does nothing. agc_driver_frame_replay_run_report runs the tool with APS5_REPORT=1 on a listing and on a missing capture and requires a report with the exit code of each.
|
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.
|
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this change; the optional point below is for test cleanup.
What I ran
Reviewed head 0e2c3262c53dc392948bd82001e394abf9af29b0. I did not run commands or tests. The author reports three targeted tests passed on Linux and Windows and describes a negative control; these runs were not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All three changed files read |
| Tests in this review | not run | Author reports three passed |
Findings
Blocking
None.
Non-blocking
FrameReplayTool.cmake:135removes the temporary report state only after both runs succeed. If a check fails, the test leaves that directory behind and may affect a later run using the same temp path. Consider adding cleanup on failure or using a unique per-run directory.
Not verified
No tests or builds were run. Author-reported Windows 11/RTX 3080 replay and CI results were not independently checked. No changed files were excluded; the three changed files listed as reviewed in the manifest were read.
To get this to a good state
Nothing is required. The cleanup suggestion is optional.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the report finalization and added report checks are supported by the inspected code.
What I ran
Reviewed head a866a93e6c198d0b6d0b22c58a4229b0068c6a3a using repo_read.py access to the prepared review bundle and pinned repository source. No commands or tests were run by me; the description’s reported test runs are author supplied.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All three changed files read |
| Tests run by reviewer | not run | Author reports CI and local passes |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run by me. The author reports local real replay and test results, plus fork CI results; these were not independently verified. The only changed files are core/libs/prx/libSceAgcDriver/tests/FrameReplayTool.cmake, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_frame_replay_state_tests.cmake, and core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp; all three were read. files.json was not available through the reader.
To get this to a good state
Nothing is required.
What
agc_frame_replay(core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp) wrote no run report withAPS5_REPORT=1in three cases. On Windows the report is written only when the guest calls exit or_exit, because the DLL exit handlers run inside the loader lock; the replay is a host program whosemainreturns, so a successful replay never wrote one. On every OS, a failed replay and a--shadersor--submitslisting end withstd::_Exit, which skips the exit handler that writes the report on Linux and macOS.mainnow callsLibcRunReportFinishExit_nid_no_patch(code)after the driver has shut down and before it returns or exits. The call is idempotent, so on Linux and macOS the exit handler finds the report already written and does nothing. The Windows relaunch path (relaunch, which waits for the child and exits with its code) is unchanged: the child process writes the report of the replay that ran.tests/FrameReplayTool.cmakegets arun_reportmode, registered asagc_driver_frame_replay_run_report: it runs the tool withAPS5_REPORT=1on a listing (exit 0) and on a missing capture (exit 2) and requires exactly oneanyps5-report.jsonwith thatexitCodeafter each.+3 lines, -1 in
FrameReplay.cpp, +33 inFrameReplayTool.cmake(the test runs the tool with its report folder redirected to a temporary folder and accepts the report next to the executable or in that folder), +1 word inagc_driver_frame_replay_state_tests.cmake.Tested
agc_frame_replay frame-replay-once,APS5_REPORT=1, exit code 0): on mainc3a823624fnoanyps5-report.jsonis written; with this change one is written ("exit": "clean","exitCode": 0,"stage": "first-draw").ctest -R agc_driver_frame_replay_(run_report|submits|shader_output)with this change: 3 passed. Without theFrameReplay.cppchange:agc_driver_frame_replay_run_reportfails with "a finished listing wrote no run report".agc_driver_frame_replay_run_report,agc_driver_frame_replay_submits,agc_driver_frame_replay_shader_output: 3 passed on both: https://github.com/chitters2004/AnyPS5/actions/runs/44649125986FrameReplay.cpp, branchdraft/ci-370eaa5038c):agc_driver_frame_replay_run_reportfails on Linux and Windows: https://github.com/chitters2004/AnyPS5/actions/runs/44649309512Checklist
main(c3a8236); no other open PR implements the same functions (feat(run-report): recover the report of a run that ended without writing one #15973 adds a general run-report recovery in libc and does not touchFrameReplay.cpp; the open frame-replay PRs do not change the end ofmain)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code