fix(agc): present EOP flips when draws are pipelined #6616
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6616"
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 hashaam1217 on 2026-10-15T23:07:36Z.
What
EOP flips (
sceVideoOutSubmitEopFlip, #5539) never present on currentmain. #1202 turned the queue-0 draw pipeline on by default. With the pipeline on,Driver::executehands every label-writing packet to the pipeline (enqueueLabelPacket) andcontinues. Flip packets and rendering waits are excluded, but aRELEASE_MEMthat completes a reserved EOP flip is not. So its label lands while thesubmission.flips.contains(cursor)branch never runs: the reservation is consumed (flipPendingNum0), the label reads 1, andcountstays 0 withcurrentBuffer-1.This PR keeps packets that carry a reserved flip out of the pipeline. They take the normal path, which drains the pipeline first, because
RELEASE_MEMis not a pipeline-keeping opcode, and then present the flip, as flip packets already do. It is one condition inPacketExecution.cpp.CI does not catch this. All 23 VideoOut flip tests skip on both Linux and Windows CI, because SDL2's
offscreendriver has no Vulkan. I ran them against a local Xvfb with-DANYPS5_VIDEO_OUT_TEST_DRIVER=x11.Tested
Ubuntu 24.04, GCC 13, Release, full build. VideoOut tests use Xvfb (
DISPLAY=:99) and-DANYPS5_VIDEO_OUT_TEST_DRIVER=x11on lavapipe (Mesa 25.2.8).Bisecting with
git bisect --first-parentonvideo_out_flip_eopfrom #5539's merge (937cd6cab, passes) tomaingives8856f180c(#1202) as the first failing merge; its parente49ec591dpasses.video_out_flip_eop_eop_main_eop_aftergpumain,APS5_PIPELINED_DRAWS=0main, pipeline on (default)APS5_PIPELINED_DRAWS=0With this PR, all 21 VideoOut tests pass on Xvfb/lavapipe.
ctest -R '^agc_'passes 606/606 on the Intel HD 530. On lavapipe it passes 605/606: the one failure is the existingagc_frame_dump_iopipe-capacity flake that #6573 fixes.python3 tools/check_conventions.py --base origin/mainpasses.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)agc_tests only (Xvfb has no DRI3 for presentation)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:09:24Z.
I checked the one-line guard against #6462. That issue reports an EOP delivery on flips that crashes Death Stranding 2, while this PR restores the reserved EOP
RELEASE_MEMpath when draw pipelining is enabled. I do not have evidence that this change alters the event count, but it would be useful to confirm the #6462 reproduction still behaves as expected (or document the interaction) before merging, since the title reports different expectations for flip-generated events.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T23:30:13Z.
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.
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppImported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-16T02:28:14Z.
I ran the Death Stranding 2 reproduction from #6462 with this change. The base is main
0029e62f9, which already has the pipelined default, plus the three local fixes DS2 needs to reach that point. Without this PR the title dies at 56.6 s on a null call in its event thread (app.elf+0x1bd01b1). With this PR cherry-picked onto the same stack it dies at 56.5 s at the same address, in 2 of 2 runs. So the guard leaves that reproduction as it was. This fits what the issue shows: DS2's first flip is a flip packet alone, with no RELEASE_MEM after it, and the existingFlipPacketHeadercheck already keeps that packet out of the pipeline.Imported from boykopovar/AnyPS5. Originally posted by hashaam1217 on 2026-10-16T17:08:49Z.
On the overlap with #6501: both PRs change the same
ifat L176, and they compose. #6501 addsenqueueSampleDumpPacketto the enqueue list, and this PR adds!submission.flips.contains(cursor)before the list, so a packet carrying a reserved flip skips all three enqueues. Whichever merges second needs only a one-line rebase. No ordering is needed (Depends on: nonestands).Thanks @fma-rc for running the #6462 Death Stranding 2 reproduction. Its first flip is a flip packet alone, which
FlipPacketHeaderalready kept out of the pipeline, so this guard does not change that path.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:32:35Z.
One additional related data point from #6350: the reporter measured two
AgcDriverDeliverEopInterruptdeliveries for one guestint_sel=1release and a separate flip on GT7. Suppressing the synthetic flip EOP at both inline and deferred delivery sites removed the null dereference in an 80-second RADV run, though there is no console trace and the regression/lifetime rule is still being worked out. I checked this PR diff: excluding reserved flip packets from pipelining does not itself change either delivery site or the delivery count, so I see no direct conflict; sharing this as relevant EOP-flip interaction evidence alongside the #6462 check.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T21:24:12Z.
I opened #6963 stacked on this PR, with
Depends on: #6616. It builds on the reserved flip EOP path here and adds delivery-time queue-0 guest-EOP tracking so one subsequent synthetic flip event is suppressed, while later bare flips still deliver. The focused packet-order regression passes locally; details and host limitations are in #6963.Imported from boykopovar/AnyPS5. Originally posted by cadenasynyster on 2026-10-17T00:51:08Z.
Confirmation on Windows with a real presenting GPU (the PR's tests were Xvfb/lavapipe):
Windows 11 10.0.26200.9711, RTX 5070 Ti (NVIDIA 617.42), Ryzen 7 9800X3D, WinLibs GCC 15.2.0 posix UCRT r7, Release, main
f3263dfbf, video_out_flip_tests run directly in a real window (ctest skips them on Windows under the offscreen driver).I did not run the full ctest with the change.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by marco-scheffler on 2026-10-17T09:38:39Z.
Linux data point on NVIDIA.
Ubuntu 24.04.4 (kernel 6.8.0-147), NVIDIA RTX 4000 SFF Ada Generation, driver 595.99.02 (open kernel module), GCC 13.3.0, Release, bundled dependencies, SPIRV-Tools ON. Base
mainbc3c0fc13, this PR at75f5beffaapplied as its diff. Xvfb with-DANYPS5_VIDEO_OUT_TEST_DRIVER=x11;ANYPS5_GPU=RTXandANYPS5_GPU=llvmpipeon the same machine.A first-parent binary search over
979ad7b6a..bc3c0fc13onvideo_out_flip_eop(RTX) also gives8856f180c(#1202) as the first failing merge, withe49ec591dpassing.video_out_flip_eop/_main/_aftergpuAPS5_PIPELINED_DRAWS=0high_frame_rate, no 120 Hz on Xvfb) on RTX and lavapipectest -R '^agc_'with this PR on RTX: 626/628.agc_driver_store_over_untrackedis the NVIDIA failure #6385 fixes;agc_driver_store_idle_resultsfailed once under--parallel 24and passes 20/20 serial on RTX and lavapipe both on main and with this PR.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T03:01:36Z.
Linux integration validation on latest main
c8e3fcb703(RX 6650 XT, RADV Mesa 26.2.4, GCC Release):video_out_flip_eopandvideo_out_flip_eop_mainfail; the newervideo_out_flip_eop_aftergputimes out.75f5beffa0: all 14 currently registeredvideo_out_flip_*cases pass, includingeop_aftergpuand both CPU-flip ordering modes. The three sparse-import cases run alongside them also pass: 17/17 total, zero skips.EOP packet did not finish its label and reserved flip.These are local integration results: the base also carries the existing Crimson Spires rendering/import fixes, so this is not a clean-main-only test. Integration pins before/after:
4aee85f5402cc8675f158541e96756e4ea286b9f/3939d3e59f2c9d7f661bf743a6ce737c393f7382. No performance claim; Windows not tested.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-19T03:20:56Z.
Independent Windows/NVIDIA cross-test, current
mainca13a56a5plus this PR's75f5beffa, no other patches:https://github.com/Scramblrrrr/AnyPS5/tree/codex/videoout-eop-windows-cross-test
Exact derived head 5a5e5aa35f5e68e5d30a4ab6f80c452891ed250c; your authorship preserved. Windows11 26200, Ryzen7800X3D, RTX5070Ti, NVIDIA617.42, 32GiB, WinLibs GCC15.2.0 r7 UCRT/POSIX/SEH, Ninja Release. Configured ANYPS5_VIDEO_OUT_TEST_DRIVER=windows, actual Vulkan windows (not offscreen).
video_out_flip_eopand_eop_mainboth fail at the existing completion assertion, 0/2 in11.82s. No fixture changes.^video_out_flip_CTests pass, 13.02s, zero skips. This includes_eop,_eop_main,_eop_aftergpuand both CPU-flip modes. Conventions pass.Also confirms #6899 on Windows: our initial offscreen run skipped the display cases, and switching the test driver exposed this regression. No replacement PR opened. AI-assisted: Codex; only public synthetic fixtures used for these tests.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T07:40:14Z.
Checked the one-line guard against the packet loop:
submission.flips.contains(cursor)is the same test the flip branch uses later (presentation andGpuReady), so aRELEASE_MEMcarrying a reserved flip now takes the normal path, which drains the pipeline first. The regression bisect to #1202 and the bad-main/good-PR results are confirmed independently on Linux RADV, NVIDIA and Windows by the reports above. Merging through the queue.