fix(agc): count REWIND tail flips as capture frame boundaries and retry a busy capture start #12565
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12565"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-10-28T20:44:26Z.
What
Frame capture never started on a title that presents through REWIND tails (#12235):
executeRewindTailattaches to a released REWIND tail never reachedFrameRecorder::FrameBoundary. The driver now counts tails that carry a flip (Driver::RewindTailFlips), and the recorder takes the count as frame boundaries, under its lock, at the title's nextSubmit,ReserveEopFliporSubmitFlip. The baseline is taken once the driver is idle, before the snapshot, so tail flips that drained before the capture started are not counted as captured frames.start()waited up to 10 s for idle at each boundary and gave up after five, so a queue parked on memory only the title stores blocked the title for 10 s per boundary and the capture never started.WaitIdleUnlessTitleWaitsForstops waiting as soon as a queue waits on memory only the title can store (awaitsTitle), and the start is retried at the next boundary, up to 600.The BUILD.md frame capture section and the debt entry describe the new start.
Overlap: #10760, #11447 and #12452 edit the same lines of
docs/dev/debt/libSceAgcDriver.md(L82-83 onmain). As agreed with @lgqdaxia (comment), #10760 merges first and this PR rebases onto it, keeping both edits. As agreed with @Tehshortbus, #12452 merges next and this PR keeps both edits when it rebases onto it. As agreed with @iamthehimansh (comment), #11447 merges after this PR and keeps both edits when it rebases; its Depends on line lists this PR. The BUILD.md tests are in a paragraph of their own, so this does not conflict with #11435 and #11436.Tested
Windows 11 Pro 26220, WinLibs GCC, Ninja Release, NVIDIA GeForce RTX 3080 (driver 621.01).
New tests in
agc_driver_frame_capture_eop_tests:agc_driver_frame_capture_rewindmakes the six EOP flips from REWIND tails and checks that they start the capture and that it holds three frames. Withmain'sExecution/sources it fails:flips made by rewind tails did not reach the frame recorder, so the capture did not start. With this PR it passes in 0.2 s.agc_driver_frame_capture_rewind_heldreleases each REWIND only after its thread's next call returns, then checks that no call waits at a busy boundary and that the capture starts at the first idle one. With the tail-flip count butmain'sstart(), it fails after 40 s:a driver call waited 10017 ms at a frame boundary for a REWIND its thread releases after the call. With this PR it passes in 0.3 s.Paired run on
mainand this branch merged into it, same machine and GPU, full builds with submodules at their pinned commits,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "frame_(capture|replay)|sample_multisample_target" -V:mainat1a217758a5: 12 tests, all passed, 0VUID-lines; this branch at1587cb79ea(main1a217758a5merged in, including theHostOnlySampleRangescapture reads inFrameRecorder.cpp) merged into it (ab7bfc7b1f, same tree): 14 tests, all passed, 0VUID-lines. Neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS.GTA V (PPSA04263, North Yankton prologue), with this PR and the other three of this series applied (host-only multisample snapshot, settled deltas, GPU stores in deltas): a capture triggered during gameplay starts at the first boundary after the trigger (3.3 GiB snapshot in 5.3 s) and records 3 frames. On
mainit does not start, as #12235 reports.Checklist
main; no other open PR implements the same functionsNotImplemented_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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T20:59:46Z.
Review: CHANGES_REQUESTED
Findings
Blocking: overlapping debt-entry edits have no agreed merge order or declared dependency
The PR body identifies overlapping edits to
docs/dev/debt/libSceAgcDriver.mdwith open PRs #10760, #11447 and #12452, but its checklist saysDepends on: none. I checked that all three are still open, and found no discussion agreeing which change should merge first. The repository contribution rules say to agree on the order with the overlapping PR authors and declare the dependency on the checklist.Please coordinate the order with the affected authors and update the checklist to name the PR(s) that must land first. If the intended order is that this PR lands before the others, record that agreement in the overlap discussion; otherwise rebase after the agreed predecessor(s). I am not requesting any change to the implementation based on this finding.
Checks
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T07:24:53Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The author has recorded the agreed #10760-first order, and #10760’s author confirmed it. The two other open overlaps, #11447 and #12452, still have not confirmed the proposed order. Current
mainhas also changed this PR’s CMake and debt files since its base.What I ran
mainand pairwise merge previews with #10760, #11447 and #12452.git diff --check.Results
git diff --checkUnedited local check output
Findings
Blocking
mainand rerun the focused checks; currentmainhas since changed the touched AGC CMake and debt files.Depends on: #10760, but the other two conflicting debt edits still need agreement before the combined stack is clear.Non-blocking
Sources
03ffe1f35b581d7981e8af21eb7924bf4749c7fcmainedf6804cf52c62eacafc592dd6142cb4efe5bd05Not verified
I did not independently reproduce the author’s GPU tests.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T01:09:29Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The author’s Windows comparison addresses the prior test report, but current
mainhas since changed frame-capture code and the proposed merge order with #11447 is still unconfirmed by that PR’s author.What I ran
4284e7715b6b08ca5e755347e0b2ab9cc8e39b6d; recorded PR base and author-testedmain:bb04a4f1ea0175e9e4f149f0359a764d62ff3296; currentmain:f6fddd60d826831f70f7c62e25423610ee742bcc.mainis clean, but main changedFrameRecorder.cppand its header since the tested base. The addedreadGuestpath samples host-only multisample ranges during capture, so the existing capture/replay results do not cover the combined current-main implementation.docs/dev/debt/libSceAgcDriver.md.Results
669beb6e7b7460f8514a2f2dbc8161cb2bc6e3d7git diff --checkFrameRecorder.cppand its header changed;readGuestnow routes snapshot/delta reads throughHostOnlySampleRangesand records host-only sample bytesmainbb04a4f1eaand 14/14 on this head merged with it; no VUID lines or missing-layer message reportedUnedited local command output
git diff --checkproduced no output and exited 0.Findings
Blocking
bb04a4f1ea, but currentmainchangesFrameRecorder.cpp, which this PR also changes. The intervening code routes capture snapshot/delta reads throughHostOnlySampleRanges; please integrate currentmainand rerun the focused capture/replay comparison on the combined tree. The merge preview is clean; this request is about coverage of the changed capture path.Non-blocking
The author’s reported Windows comparison is useful and has no reported test failures. I found no new source defect in the merge-only update.
Sources
FrameRecorder.cppcapture pathNot verified
I did not build or run capture/replay tests locally. The Windows test results are author-reported. Linux product and specialized CI jobs were skipped.
To get this to a good state
Update the branch and rerun the focused capture/replay comparison on current
main, then record an agreed order with #11447. I will rerun the same non-build checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T01:37:37Z.
Review: APPROVED
Re-checked — looks good
On exact head
1587cb79ea50dc5610daecd4dcb39496134e772f, the earlier validation and overlap blockers are resolved; the recorded order is #10760, #12452, #12565, then #11447.The author reports a clean full build and 14/14 focused Windows/Vulkan checks on the merged tree, with zero validation messages and both new regression tests failing in the stated negative controls. The code and tests were already reviewed, and this head adds the current-main integration; GitHub reports it mergeable. Hosted conventions pass, Windows is still pending, and Linux/specialized jobs are skipped. I did not run local tests or a build. Exact-head test report, #11447 order confirmation.