fix(agc): run an indirect buffer as it is when execution reaches it #11346
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11346"
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 milescoviello on 2026-10-26T06:03:36Z.
What
The driver copies a submission's indirect buffers into one command stream when the submission is queued (
copySegment), but the CP reads an indirect buffer only when it reaches it. A buffer that work earlier in the stream fills was executed as it was before that work ran.MXGP 26 (PPSA30839) builds part of its command list on the GPU every frame:
ds_ordered_count, keeping only the records whose three counts multiply to a nonzero value.COND_INDIRECT_BUFFERthen runs that buffer.On
mainthe copy only ever saw the buffer's NOP fill (0xffff1000), so none of those commands ran (#9510). In a 45 s window of the 3D profile scene, all 161 such buffers were copied about 0.3 s before the packing dispatch that fills them ran. Read again when execution reached them, every one had changed and held nestedINDIRECT_BUFFERs.How
copySegmentnotes everyINDIRECT_BUFFERandCOND_INDIRECT_BUFFERit inlined unchanged (not chained or predicated): where its copy starts, its guest address and its size (Submission::indirectSegments).executereaches one,refreshIndirectSegmentreads it again only while queued GPU work writes its range: the draw pipeline or the draw finisher holds such work, or the recorder lists a writer of the range in its open or unfinished batches (PendingWriterSerial). It drains that work and reads the buffer throughGuestMemory::Read, which syncs pending GPU writes. That is when the CP reads an indirect buffer.COND_INDIRECT_BUFFERoutside aCOND_EXECrange replaces the rest of the buffer it is in, like a chainedINDIRECT_BUFFER:copySegmentstops copying that buffer once it has inlined the target. Before, it was flattened like a call, and the packets after the branch ran again after the target. Inside aCOND_EXECrange the packets after it are still copied. That the branch does not return is unverified on hardware; it is in the technical debt file.WAIT_REG_MEMgate, which the CP would read, also runs as copied; that is in the technical debt file.reserveOutputstakes one for every (video output, buffer) pair a rendering wait has targeted before (Submission::preparedWaits). A ticket taken at execution would also wait for flips that later submissions reserved, which can't complete first.WRITE_DATA,RELEASE_MEM) join the submission'slabelWritesand the queue'sunfinishedWrites, so a wait submitted later sees a writer; completion readslabelWritesafterexecute, so they're released with the submission. A wait already marked held at submit on one of those dwords, later in this submission or in one pending on the same queue, loses the mark and waits at execution. Waits inside a rewritten buffer are never held.mainwould have run. The first eight are logged.Overlap (
tools/pr_overlap.py,git merge-tree): files only. #10487, #10507 and #11207 also changeDriver.hppand merge cleanly with this. #10193 conflicts withmainalready. Many open PRs add entries todocs/dev/debt/libSceAgcDriver.md, none next to this one.Tested
Linux (Ubuntu 26.04.1, GCC 15.2, Release, RTX 4070 Ti, NVIDIA 615.71.09) unless noted.
This head
772c16e9bemergesmain3e089775b9. The one conflict was inSubmission.cpp: it keepsmain's chained hand-off anddepthincopySegment/copyLink, notes the inlined segment after the copy, andrefreshIndirectSegmentpasses depth 0. The merge passes a full build.VK_LOADER_DEBUG=layer, RTX 4070 Ti):main3e089775b9passes 51 of 51 and the head 52 of 52. The loader inserted the layer once per Vulkan device created: 55 devices onmainand 57 on the head. No newVUID-lines.772c16e9beintegrated onmaind83049b37c(plus #11630). Validation-layer insertion and GPU selection were confirmed. The display, host-import and teardown groups pass 3 of 3 on both arms, and both new indirect-buffer fixtures pass 3 of 3 with the change. The same fixture binaries run against baseline libraries fail at the expected missing-marker check (marker 0 instead of theWRITE_DATAvalue). 0VUID-lines.Head
b11a1c2c63, on the same merge baseba5b5330b3, after the Hot Wheels report:agc_driver_gpu_written_indirect_buffer, for aCOND_INDIRECT_BUFFERand anINDIRECT_BUFFER: the submission waits on a CPU gate before the buffer. After it is submitted, the CPU writes aWRITE_DATAmarker into the buffer and opens the gate. The packet after the buffer must run and the marker must stay 0.e309c36252, this head's test file on the previous head's driver (15a4f95d4d): fails at the new check on Linux (1 of 1) and on the Windows VM (3 of 3):a COND_INDIRECT_BUFFER the CPU rewrote after its submission, with no GPU work before it writing the buffer, ran the rewritten commands instead of running as it was copied.video_out_flip_*tests skip in that environment.ba5b5330b3passes 31 of 31 and this head 32 of 32, no layer missing, 17 and 19 Vulkan devices created, noVUID-messages on either side.VK_LOADER_DEBUG=layer): head9a29e805bfagainst its merge base105c9e4d91on the PR's own tests (agc_driver_gpu_written_indirect_buffer,agc_driver_pipelined_dispatch,agc_submit_progress). 2 of 2 and 3 of 3 pass, the loader inserted the layer for each of the 4 and 6 Vulkan devices, noVUID-. The 1.4.363 runs in this description can't be confirmed to have loaded the layer: the layer directory they used is gone, and withoutVK_LOADER_DEBUGa missing layer leaves no trace in the log (#17896). Rely on this re-run instead.Head
82f3ada000: the same five commits rebased ontomainaaccd0ba39with no conflicts. The 32 area tests pass 3 of 3, the new case passes, and both negative controls fail on this exact head. Khronos validation: 22 of 22 onmainand 23 of 23 here, noVUID-messages. Windows 11 VM (GT 1030):main10 of 10 and this head 11 of 11, 3 of 3 each (details).Head
e593f32f86(oneandonlydean's and MarcZX10's reviews), test only:TicketWait::Waitrecords the ticket it waits for, andRewrittenWaitBeforeOwnFliprequires exactly{0, 1}(the seeded wait, then the rewritten wait on the first flip's ticket), so the rewritten wait must run. The 32 area tests pass 3 of 3. A mutant with the old placement (waits captured after the walk) fails with the 3 s timeout, and one that refuses every rewritten rendering wait fails withthey waited for {0}(details).Head
d93a040aa2(XairRrR's review): each indirect segment's rendering-wait tickets are now taken at its place in the submission. The new case (a rendering wait written into the buffer, then a flip of the same video buffer in the same submission, with a fake output whose waits give up after 3 s) passes. With the tickets taken after the walk again (7dc220b955) it fails on the 3 s timeout. The 32 tests of the area regex plus the flip tests pass 3 of 3. Validation layer (Khronos 1.4.363) over^agc_driver_gpu_written_indirect_buffer$|^agc_driver_pm4$|flip: the merge base46e54cf1f7passes 22 of 22 and this head 23 of 23. Neither log has a missing-layer line, the layer checked 4 and 6 devices, and neither side has aVUID-message. Windows 11 VM (GT 1030): the merge base passes 10 of 10 and this head 11 of 11, 3 of 3 each.Head
521bbc33c3, rebased ontomain46e54cf1f7. One conflict:mainmoved thereportSkipdeclaration inDriver.hppto the public section (03fcf738b6), next to the line where the second commit addsvalidate'sreportparameter. I keptmain's move and the parameter;git range-diffshows the first and third commits unchanged. The 11 tests pass 3 of 3. Windows 11 VM (GT 1030):main10 of 10 and this head 11 of 11, 3 of 3 each.Head
240c1c218b, rebased ontomain8c7cf8269f(clean), adds a third commit after review: the held-wait case waits for an observed execution event instead of 500 ms. After opening the gate it polls, for up to 10 s, untilAgcDriverAwaitedWaits_nid_postfixreports the queue worker blocked on the label with reference 1, or until the marker turns 1. It then reads the label, which must still be 0 from the rewrittenWRITE_DATA, and only then sets it back to 1. The marker must have stayed 0 until then and be 1 after.Controls, 3 runs each, with a local switch that is not part of this PR:
APS5_CONTROL_EXECUTE_DELAY_MSsleeps at the start of everyexecute, and at 1000 ms every submission starts executing after the old 500 ms sample.erase_iflines inrefreshIndirectSegmentWithout the invalidation the new test fails, with and without the delay, at
a wait on a label that a rewritten indirect buffer before it sets to 0 passed on the value 1 it held at submission. The previous test passes under the delay, so it could not catch a missing invalidation when the worker started late.The 11 tests pass 3 of 3. Khronos validation 1.4.363: 10 of 10 on
main8c7cf8269fand 11 of 11 on this head, noVUID-messages. Windows 11 VM (GT 1030):main10 of 10 and this head 11 of 11, 3 of 3 each.Head
199186dabdadded a second commit after review. In a MXGP 26 run with a local diagnostic on5dd3166c16, the title stopped at 48 s: a rewritten 44,019-dword list at 0x1078da8010, one of MXGP's GPU-built command lists, held a0x00000000header. The throw from the refresh'svalidatefailed the queue withunsupported PM4 packet type: header 0x00000000 at DWORD 39212 of 44019. Such contents now run as copied.agc_driver_gpu_written_indirect_buffer: after the submission, the CPU rewrites a gatedCOND_INDIRECT_BUFFER's target with a0x00000000header and aWRITE_DATA. The queue must keep running, the packet after the buffer must run, and theWRITE_DATAmust not. The test alone on5dd3166c16fails 2 of 2 with... failed the queue instead of running as it was copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64.main4b1a9a3b2fand 11 of 11 on this head, noVUID-messages. Windows 11 VM (GT 1030):mainb27cc8416f10 of 10 and this head 11 of 11, 3 of 3 each.199186dabdmerged ontomain9ff033b1a1, the 11 tests withctest --repeat until-fail:3. RTX 4070 SUPER and GTX 1650 SUPER: 11 of 11, 3 of 3. RDNA2 iGPU: 10 of 11, 3 of 3, withagc_driver_pipelined_dispatchfailing once on the #9680 fixture check. The new case logs itsruns as copiedline on every device and passes. Withmain's production files, the test fails on the 4070 with the original marker-0 message.Head
5dd3166c16:25000ed852rebased ontomainb27cc8416f, the same patch (git range-diffshows it unchanged). Since204c6747d0,mainchanged onlydocs/dev/debt/libSceAgcDriver.mdamong the touched files; both sides' entries are kept and conventions pass. The runs below are on25000ed852.Windows hardware (ycbuzi, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7):
25000ed852merged ontomainb27cc8416f, the same tree as this head, the 11 tests withctest --repeat until-fail:3:main's four driver files, the new test fails on the 4070 with the marker 0, and the other 10 pass.1002:164e, AMD 32.0.21030.2001): 10 of 11 pass 3 of 3,agc_submit_progressincluded.agc_driver_pipelined_dispatchfailed once there; in 20 runs each it fails 2 of 20 onmainand 2 of 20 onmain+ this head, always at the fixture'sthe two targets do not share their high address dwordcheck before any dispatch, which is #9680 (fixed by #9696).agc_submit_progresspasses 20 of 20 on both.Head
25000ed852, rebased ontomain204c6747d0(clean; both sides' entries kept indocs/dev/debt/libSceAgcDriver.md). The 11 tests pass 3 of 3 on Linux. Khronos validation: 10 of 10 onmain204c6747d0and 11 of 11 on this head, noVUID-messages. Windows 11 VM (GT 1030):main10 of 10 and this head 11 of 11, 3 of 3 each.agc_submit_progress(in the set) failed twice on PR builds in about 100 runs, with its 2 ssubmission lost its real GPU completion storedeadline: once in a 3-run pass onb5c1a82490, and once within 15 repeats. It passed 20 more on that build and 60 of 60 on25000ed852, and 40 of 40 onmain. A further 100 runs each, onectestper run: 100 of 100 on this head5dd3166c16and 100 of 100 onmain4e43321bd6, so 2 failures in about 280 PR-build runs against 0 in 140 onmain. It submits no indirect buffer, so the refresh path is never entered there. It has never failed on Linux. I read it as the 2 s deadline on a loaded VM, but I'm listing it.Previous head
b5c1a82490onmain14c99b52ac, after review: rebased, the held-wait bookkeeping added, andindirectSegmentskept sorted by start after the copy and after every splice.an indirect buffer called from a rewritten COND_INDIRECT_BUFFER ran as it was when the parent was read ... the marker is 0. The 11 tests pass 3 of 3 on this head.main14c99b52acand 11 of 11 on this head, noVUID-messages. The Windows VM run of this head is in a comment below.Previous head
867f93d9dc(same code as4f55aae4f8, which only shortened the debt entry):a wait on a label that a rewritten indirect buffer before it sets to 0 passed on the value 1 it held at submission. The 11 tests pass 3 of 3 on this head.main14c99b52acand 11 of 11 on this head, noVUID-messages. The Windows VM run of this head is in a comment below.Red/green: new
agc_driver_gpu_written_indirect_buffer. A dispatch writes aWRITE_DATApacket into a NOP-filled buffer, then aCOND_INDIRECT_BUFFER(and, in a second case, anINDIRECT_BUFFER) runs that buffer; the marker the packet stores must be set.WRITE_DATA label = 0into a NOP-filled buffer that aCOND_INDIRECT_BUFFERruns. The label starts at 1.label == 1and then writes a marker.COND_INDIRECT_BUFFERruns a NOP-filled parent.WRITE_DATA markerinto a second NOP-filled buffer, followed by anINDIRECT_BUFFERcall into it.main5b85225ef3fails in both runs:a COND_INDIRECT_BUFFER ran the command buffer as it was at submission, not as the dispatch before it wrote it: the marker is 0.Focused tests: the 11 tests matching
^agc_driver_gpu_written_indirect_buffer$|^agc_driver_pm4$|^agc_predication_tests$|^agc_submit_progress|^agc_driver_empty_indirect_skip$|^agc_driver_pipelined_dispatch$|^agc_driver_dispatch_differing_value_sets$|^agc_driver_graphics$|^agc_driver_gds_append_consume$|^agc_driver_depth_fast_clear_submit$pass 3 of 3.Khronos validation 1.4.363 over the same set, each arm run as
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -R "$R" -V: 10 of 10 on the merge base5b85225ef3, 11 of 11 on this head, no layer missing, noVUID-messages on either. Correction (10-27): two tests of this set never load the layer.agc_driver_graphicsandagc_driver_pm4run on a test fixture's own device, so the clean result doesn't cover them. The test this PR changes,agc_driver_gpu_written_indirect_buffer(built at240c1c218b), creates a real device, as do the others; I countedPhysical device selectedper test.Windows 11 VM (GT 1030, driver 582.78, WinLibs GCC 15.2.0 r7), the same set: 10 of 10 pass 3 of 3 on the merge base and 11 of 11 pass 3 of 3 on this head; the new test runs there (not skipped).
MXGP 26 (PPSA30839), warm, 12 GB cap, the same scripted route to the 3D profile scene, release libraries:
main(16ff208dc3with a trace-only diagnostic): at 465 s the rider, the bike and the grass are black against a lit sky, as in #9510.refreshIndirectSegment: it runs to the 480 s timeout. 883 rewritten buffers were read again and spliced in, with 1 to 4 rendering waits each, and none was kept as copied. At 478 s the rider is lit and textured (suit, helmet, goggles) on lit ground, and the trees behind the menus are lit too. Some foreground grass and the bike at the edge of the frame are still dark.GameThread timed out waiting for RenderThread after 120.00 secs.Jump fold-in (
ddb59eefaf), merge preview6c257dbfb6onmain4f41f4c375:^agc_driver_pm4|^agc_driver_gpu_written_indirect_buffer, 17 tests in 3 executables, 3 of 3 runs pass. @mrfelek's negative control: with only theSubmission.cppline reverted,agc_driver_pm4fails withthe packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call.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.mdfiles or images added to the repository (attach them to this PR)runtime resource snapshot did not stabilizewithout it)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:09:01Z.
Review: CHANGES_REQUESTED
This branch is 1 commit ahead and 168 commits behind current
upstream/main(14c99b52ace303eef1667764670d1d1540140b3d). The merge preview is clean, but the sync checker reports shared changes toDriver.hppanddocs/dev/debt/libSceAgcDriver.mdsince its merge base. Please refresh onto current main and rerun the focused GPU-written-indirect-buffer regression and related AGC execution tests on the resulting exact head. I have not completed the full source review yet, so this request is limited to the outstanding current-main validation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:26:17Z.
Review: CHANGES_REQUESTED
The rebase resolves the sync request, but I found an execution-order bookkeeping gap in the new dynamic rewrite path.
noteHeldAtSubmitruns only while the original flattened commands are scanned inreserveOutputs. For an indirect buffer copied as NOPs, a later-splicedWRITE_DATA/RELEASE_MEMis absent fromsubmission.labelWritesand fromQueueWorker::unfinishedWrites; the rewritten command path also does not updateheldAtSubmit. A concrete sequence is an earlier submission whose GPU-written indirect buffer later gains a label write to address X, followed by a same-queue wait on X whose condition is true when submitted. Because the writer is not registered,noteHeldAtSubmitcan mark the wait as held;waitMemorydeliberately returns onheldAtSubmiteven if the condition has since become false. This can let the later wait pass before the required value is restored.Please register the newly expanded label writes and waits with the same ordering metadata as ordinary submitted commands (including the corresponding unfinished-write lifetime), or otherwise ensure dynamic commands cannot use the held-at-submit shortcut based on incomplete writer tracking. Add a focused regression that starts with a NOP-filled indirect buffer, has preceding GPU work replace it with a label write, and verifies a following same-queue wait does not pass using a stale submit-time condition. The current regression proves the indirect command executes, but not this wait-ordering case.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:45:56Z.
Review: CHANGES_REQUESTED
The latest head includes the label-writer bookkeeping and regression for the stale held-wait case from my earlier review. I found a separate nested-indirect-buffer ordering issue in the refresh path.
copySegmentrecursively expands an indirect buffer and only callsnoteIndirectSegmentafter the recursion returns (for example, theCOND_INDIRECT_BUFFERpath atSubmission.cpp:214-218). Thus when a copied parent buffer contains a child indirect buffer, the child segment is appended before the parent segment even though the parent starts earlier insubmission.commands. The same order is retained when rewritten segments are spliced atSubmission.cpp:324-327.executeadvances a singlenextSegmentindex and assumes the next entry has the earliest start; if the child start is later than the parent start, the parent is skipped at its execution position and never refreshed.This is observable when a rewritten buffer contains an indirect call whose command range is itself GPU-written by work earlier in the stream: the child can execute the submit-time copy rather than the commands present when execution reaches the parent’s call. Please keep
indirectSegmentsordered bystartafter initial recursive expansion and after each splice, and add a regression with a GPU-written parent that contains a nested indirect buffer whose contents are also updated before its call. The current tests cover direct and conditional buffers plus the held-wait case, but not this nested refresh ordering.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:56:11Z.
Review: COMMENTED
Correction: I overlooked the guard in
noteIndirectSegment. A parent buffer whose nested call was expanded is not recorded as a segment, because the flattened commands no longer match the parent’s original words. The recorded leaf segments follow the flattened traversal order, and the splice replaces one segment with the nested entries before shifting later entries. That means my reported child-before-parent execution ordering is not substantiated; I withdraw that changes-requested finding.The nested GPU-written regression described in your comment will be useful confirmation of this reasoning. I have not run it independently, so I’m leaving this as a comment rather than approving before the promised exact-head tests are available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T08:50:27Z.
Review: APPROVED
Reviewed exact head
5dd3166c16d0c32c282a3c88865d76891f704f54against currentmainb27cc8416f820e40ce187f165d34138e24373dd7.The updated implementation now registers label writes from dynamically refreshed indirect commands in the submission and worker tracking, including the held-at-submit ordering path. Its regression coverage exercises direct and conditional indirect buffers, nested buffers, and the stale held-wait case. I previously withdrew my nested-segment ordering finding after checking the guard and traversal, and the author has since reported the nested refresh regression passing.
The author rebased onto current main and reports that the only change on a touched path since the tested base was the debt document.
git range-diff 204c6747d0a1cbaf932def3dea0778810cc3935e..25000ed852e52da6cfbf4bb9cb7e8ac91dbe8258 b27cc8416f820e40ce187f165d34138e24373dd7..5dd3166c16d0c32c282a3c88865d76891f704f54shows the single implementation commit unchanged by the rebase.The author reports the focused 11-test AGC set passing 3/3 on Linux and Windows, with baseline/change counts and Khronos validation showing no new VUIDs. I did not independently run those GPU tests. Current hosted eligibility, conventions and report checks pass; product jobs are skipped by path policy. I found no outstanding blocking issue on this head.
AI-assisted review.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T04:18:59Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The refresh works and is well covered by the new test, but a rendering wait spliced in from a rewritten buffer uses a ticket that also covers the flips its own submission reserves after it, so a buffer that waits on video buffer N, followed by a flip of N in the same submission, waits forever.
What I ran
521bbc33c3f80fbd53e7449ed93d832954812cd8main:b433c40f2f46aa2e59e19806010a839ac8572d64mainwith no conflicts, in a clean worktree. The build directory was configured as Release, GCC 16.2.1, Ninja,BUILD_TESTING=ON.Results
maingit diff --checktools/check_conventions.py --base origin/mainAll conventions checks passed.libsand the 12 test executables)mainagc_driver_gpu_written_indirect_bufferdoes not exist there)agc_driver_flip,_flip_stores_small_results,_present_mode,_worker_failure_log,_flip_compute): merged andmainVUID-linesmainwas not found but was requested by env var VK_INSTANCE_LAYERSagc_driver_gpu_written_indirect_bufferand 7 others.agc_driver_pm4,agc_driver_graphicsandagc_predication_testscreate no device, as the author's correction says.agc_driver_gpu_written_indirect_buffer0.75 smain: no stall. See Blocking.agc_driver_gpu_written_indirect_bufferon the merged treeNegative control
I restored
Driver.hpp,Submission.hpp,CommandValidation.cpp,PacketExecution.cppandSubmission.cppfromorigin/main, kept the new test, and rebuilt. The test fails at its first case:I then restored the merged files and rebuilt before the final runs. I did not repeat the author's held-wait, nested and invalid-rewrite mutants; the earlier comments describe those.
Findings
Blocking
1. A rendering wait spliced in from a rewritten buffer waits for the flips that its own submission reserves after it.
Submission.cppL455-L463 takes thepreparedWaitstickets after the loop over the whole submission. By then, the loop has already reserved every flip in that submission (L444-L450). An ordinary rendering wait is captured in stream order (L426-L432), so its ticket covers only flips before it.On the real output,
CaptureRenderingWaitreturnsbufferReuse[index].Capture(), which is the last ticket reserved for that buffer (VideoOutDriver.cppL151-L156,BufferReuseTracker.hppL21-L25).RenderingWait::Waithas no timeout (L137-L144).Take a submission of the form
[wait] [COND_INDIRECT_BUFFER → B] [flip of buffer N], where B is rewritten after submit to holdsceAgcDcbWaitUntilSafeForRendering(N)and N has been the target of a rendering wait before:refreshIndirectSegmentuses the prepared ticket (L296-L308).On
mainthat buffer runs as copied, so this is a hang thatmaindoes not have. "Wait until safe, render, flip" in one command buffer is the usual frame shape, so this is not tied to one title. The debt entry only mentions flips that later submissions reserve, not flips of the same submission.I reproduced the ordering with a scratch execution test (not pushed, not part of the PR). It registers a fake
IVideoOutputthat tracks per-buffer tickets the same way asBufferReuseTracker, completes a ticket onGpuReady, and gives up a wait after 3 s instead of blocking:rendering wait (7, 0)andflip (7, 0), so (7, 0) is inrenderingWaitTargets.COND_INDIRECT_BUFFERto 64 NOP dwords, andflip (7, 0).rendering wait (7, 0)into the buffer, then opens the gate.Ticket 1 is the flip of the first submission. Ticket 2 is the flip that follows the rewritten buffer in the second submission.
Scratch test, core of the case
Suggested fix: take each indirect segment's tickets at that segment's position in the
reserveOutputswalk. WhencursorreachesindirectSegments[k].start, capture the waits for that segment, which covers only the flips reserved before it, the same as a top-level rendering wait. Store them per segment, and let nested segments from a splice inherit the parent's set. A regression like the one above, with a ticket-tracking fake output, would cover it. Then update the debt sentence to match.Non-blocking
2.
reserveOutputssilently swallows everyCaptureRenderingWaitfailure (L459-L462).renderingWaitTargetsis never pruned when a buffer or output is unregistered. A stale pair then throwswait buffer is not registeredand is caught on every later submission that has an indirect segment. A rewritten buffer that waits on that pair runs as copied, and nothing is logged. Consider dropping the pair fromrenderingWaitTargetswhen its capture fails, and logging it the way the eight validation failures are logged.Not verified
BufferReuseTracker, not withlibSceVideoOut.To get this to a good state
renderingWaitTargetsand log failed captures (finding 2).Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T05:29:14Z.
Review: APPROVED
Re-checked — approved
d93a040aa2now takes each indirect segment's rendering-wait tickets at that segment's place in thereserveOutputswalk, which fixes the same-submission flip hang from my last review; the new regression case fails on the previous head and passes here.What changed since my last review
d93a040aa2("take a rewritten indirect buffer's rendering wait tickets at its place in the submission"), on top of521bbc33c3. It is not a rebase.Submission::preparedWaitsis removed. EachIndirectSegmentnow carries ashared_ptr<const PreparedWaits>.reserveOutputsfills it when its cursor reaches the segment'sstart, before the packet at that position is reserved.RewrittenWaitBeforeOwnFlipinagc_driver_gpu_written_indirect_buffer, using a ticket-tracking fakeIVideoOutputwhose waits give up after 3 s.What I ran
d93a040aa2cab45bc2285daf89d807019fd9dc18main:52c09d567d2fa453494dd720fcf53a98149468e4mainwith no conflicts, in a clean worktree (merge commit3a74c14c86).mainhas not changedSubmission.hpp,Submission.cppor the test since the merge base46e54cf1f7. Release, GCC 16.2.1, Ninja,BUILD_TESTING=ON, on Arch Linux 7.2.11-zen with an Intel Core i9-14900KF and an NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08).Results
maingit diff --checktools/check_conventions.py --base origin/mainAll conventions checks passed.libsand the 12 test executables)agc_submit_progress_no_timeline), merged tree, validation layerVUID-lineswas not found but was requested by env var VK_INSTANCE_LAYERSagc_driver_gpu_written_indirect_bufferagc_driver_gpu_written_indirect_bufferdurationSubmission.*plus the new testagc_driver_gpu_written_indirect_bufferon the merged treeNegative control output
Previous findings
Blocking: a spliced rendering wait waited for its own submission's later flips. Resolved.
preparenow runs when the walk reachesindirectSegments[k].start, before any packet at or after it is reserved (Submission.cppL425-L439).refreshIndirectSegmentreads only that segment's set (L302-L308). Spliced nested segments inherit the parent's set (L335), which is sound for two reasons:noteIndirectSegmentonly records buffers inlined unchanged, so segments never overlap.The new case reproduces my scratch scenario. It fails on the previous head's two files and passes here. The debt entry was updated to match.
Non-blocking:
CaptureRenderingWaitfailures are swallowed andrenderingWaitTargetsis never pruned. Still open, and the cost now scales with the number of segments. The emptycatchis now insideprepare(L432-L433), and nothing erases fromrenderingWaitTargets. A stale pair now throws and is caught once per indirect segment of every later submission, instead of once per submission. This is still not blocking.New findings
Blocking
None.
Non-blocking
1. The new case also passes when the rewritten rendering wait never runs.
RewrittenWaitBeforeOwnFlipchecks that no wait timed out and that two flips completed (test L336-L337). Both checks also hold if the refresh refuses the buffer and it runs as copied, which is 64 NOPs. With every rewritten rendering wait refused (the mutant above), the test passes in 0.62 s. So the case catches the hang, but not a regression that turns the splice into "run as copied", for examplesegment.waitsleft empty. One fix: countTicketWait::Waitcalls and require two, one from the first submission and one from the rewritten buffer. Another: put aWRITE_DATAmarker after the wait in the rewritten buffer and require it to be set.2.
preparecaptures every known target once per segment. Each call takescfg->mutexinVideoOutDriverand allocates a wait for every pair inrenderingWaitTargets, all while the driver mutex is held (L425-L437). The previous head captured them once per submission. Between two segments with no flip reserved in between, the two sets are identical. Reusing the last set until the walk reserves a flip or an EOP flip would keep the stream-order rule and bring the cost back to one capture per flip interval. I measured no cost; this only matters for titles with many indirect buffers per submission.Not verified
mainon this round. The merged tree logs noVUID-lines, so the change cannot add any. My last review found 0 onmainb433c40f2f.libSceVideoOutbehaviour for the new case. The test uses a fake output that tracks tickets the wayBufferReuseTrackerdoes.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:37:27Z.
Review: APPROVED
Re-checked — approved
The new segment-local rendering-wait tickets address the same-submission flip hang from the previous review. I inspected the ticket capture point, propagation to nested segments, and the added regression that fails when tickets are captured after the submission walk.
What I ran
d93a040aa2cab45bc2285daf89d807019fd9dc18against currentmain52c09d567d2fa453494dd720fcf53a98149468e4.git merge-tree --write-treeandgit diff --check.python3 tools/check_conventions.py --base refs/review/main-20261029c --head refs/review/pr-11346-latest.Results
git diff --checkVUID-messagesd93a040aa2is reportedThe targeted regression exercises the reported hang and has a negative control. I did not run the C++ tests locally or independently reproduce on a GPU.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:28:02Z.
Review: CHANGES_REQUESTED
Re-reviewed exact head
d93a040aa2cab45bc2285daf89d807019fd9dc18. The newRewrittenWaitBeforeOwnFlipcase does not currently prove the rewritten rendering wait runs: the indirect buffer is first filled withFillercommands, the assertions only require no timeout and two completed flips, andTicketWait::Waithas no execution counter. The test can therefore pass if the rewritten wait is refused and the copied fillers execute. Please make execution of both the seeded and rewritten waits observable and required, then show the corrected case passes on this head, fails with the old ticket placement, and fails when the rewritten wait is deliberately refused. Current-main merge preview is clean;git diff --checkandpython3 tools/check_conventions.py --base upstream/mainpass. I did not run the GPU test locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:13:57Z.
Review: CHANGES_REQUESTED
Re-check — changes requested\n\nThis test-only update resolves my observability finding. TicketWait::Wait now records the awaited ticket, the test requires exactly the seeded ticket 0 followed by rewritten wait ticket 1, and the contributor reports the old-placement mutant and the deliberately refused rewritten-wait mutant both fail while the fix passes 3/3. That is the needed negative-control evidence. I did not run the GPU tests locally.\n\nThe integration base is still stale: the branch is based on
470a562903, while current main isaaccd0ba39(420 commits ahead). Main changed Driver.hpp in this interval, although its ThreadDimensionGroups addition is separate from this PR's declarations. Please update onto current main and rerun agc_driver_gpu_written_indirect_buffer plus the related area tests on the exact refreshed head before merge. The previous review's test-coverage blocker is resolved; this request is for current-base integration only.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:31:28Z.
Review: CHANGES_REQUESTED
Re-check — changes requested
The latest head
82f3ada0001a99183ac99761d32657dfb6f9eed2is now based directly on currentmainaaccd0ba39b7d40fdbf19664575a7e567d8542f7, so the stale-base finding is resolved. The newest commit changes only the regression test to require the seeded wait and rewritten wait tickets in order.The reported 3/3 pass and both negative controls are for the preceding head
e593f32f863b04603da8c7634592142f85b0c42e, not this latest test commit. The hosted conventions, eligibility, and report checks for82f3adaare still pending. Please runagc_driver_gpu_written_indirect_bufferon this exact head, including the old-ticket-placement and refused-wait negative controls, and report the result. I have not run the GPU test locally. The earlier source-level blockers remain resolved; this request is only for exact-head validation of the test-only update.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:55:09Z.
Review: CHANGES_REQUESTED
Re-check — changes requested for current-main integration\n\nThe author’s exact-head report for
82f3ada0001a99183ac99761d32657dfb6f9eed2resolves my test-coverage request: the updated test requires tickets{0, 1}, and the old-placement and refused-wait controls fail as expected. The reported Linux and Windows repetitions and validation comparison are useful.\n\nOne repository-rule item remains. The tested branch is based onaaccd0ba39; current upstreammainis nowd2b15d8802. Since that base,core/libs/prx/libSceAgcDriver/CMakeLists.txtanddocs/dev/debt/libSceAgcDriver.mdboth changed. The current merge preview is clean, but the branch is no longer based on currentmain. Please update it ontod2b15d8802, verify the test registration and debt entry keep the intervening main changes, and rerun the focused indirect-buffer/area tests on the resulting head.\n\nI checked the current-main merge preview andgit diff --check; both pass. I did not run the GPU tests locally. Linux, relinker, ASan, register-context, and write-watch hosted product jobs are path-skipped for this PR.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T11:16:08Z.
Review: APPROVED
Re-checked — approved
Since my last review there is one new test-only commit,
15a4f95d4d, which records the ticket each rendering wait waits for and requires{0, 1}, plus a rebase ontomainba5b5330b3. The new assertion fails when every rewritten rendering wait is refused, which resolves my previous Non-blocking 1. The production code is unchanged.What changed since my last review
git range-diff 46e54cf1f7..d93a040aa2 ba5b5330b3..15a4f95d4dshows the four commits I reviewed unchanged (=). The only new commit is15a4f95d4d("test(agc): require the rewritten rendering wait to wait for the ticket at its place"), which changesGpuWrittenIndirectBuffer.cpponly:TicketWait::Waitappends its ticket toTickets::waitedbefore it waits (test L258-L263).RewrittenWaitBeforeOwnFlipnow requireswaited == {0, 1}(test L341-L345).mainba5b5330b3. The author's comment of 11:04 UTC reports the 32 area tests pass 3 of 3 at this head. It also asks whether a clean merge preview plus a focused rerun is enough from now on. MarcZX10 agreed, on condition of a paired validation-layer comparison betweenmainand the change. I ran that comparison; it is below.What I ran
15a4f95d4d54b9e4e33757a9087771c48b2eb307main:ba5b5330b37724bca4b99f30faab504653635a04. The head is based directly on it.81e5b88d33(no conflicts). Release, GCC 16.2.1, Ninja,BUILD_TESTING=ON, Arch Linux 7.2.11-zen, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). Everything ran in a clean worktree.Results
mainba5b5330b3git diff --checktools/check_conventions.py --base origin/mainAll conventions checks passed.libsand the 12 test executables), merged tree andmainmain, validation layerVUID-linesmain, 0 on the merged treewas not found but was requested by env var VK_INSTANCE_LAYERSmainand 17 on the merged tree, includingagc_driver_gpu_written_indirect_bufferagc_driver_gpu_written_indirect_bufferdurationthey waited for {0}agc_driver_gpu_written_indirect_bufferon the merged treeMutant outputs
Previous findings
they waited for {0}. Waits run in order on the queue worker, so requiring{0, 1}exactly is deterministic here. This confirms the author-reported control in their 09:11 reply, which oneandonlydean and MarcZX10 had also asked for.preparecaptures every known target once per segment. Still open. The production code is unchanged (Submission.cppL423-L436). It is still not blocking, and it is fine as a follow-up.CaptureRenderingWaitfailures are swallowed, andrenderingWaitTargetsis never pruned. Still open, unchanged (the emptycatchat L432-L433 of the same link). Not blocking.New findings
Blocking
None.
Non-blocking
None.
Not verified
82f3ada000, which has the same diff.libSceVideoOutbehaviour forRewrittenWaitBeforeOwnFlip. The test uses a fake output.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:22:58Z.
Review: APPROVED
Re-reviewed exact head
15a4f95d4d54b9e4e33757a9087771c48b2eb307, directly based on currentmainba5b5330b37724bca4b99f30faab504653635a04. The new report closes my outstanding request: withVK_LAYER_KHRONOS_validation, the paired base run is 22/22 and the PR run is 23/23, with no new VUIDs; the author also reports the 32 area tests passing three times on this head. The merge preview is the PR tree itself, without conflicts, and the conventions check passes. The Windows hosted job is still pending; Linux product and specialized jobs are skipped by policy. I did not independently run the GPU tests. The paired validation evidence addresses the last requested review item, so I approve this head.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T20:16:10Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The new commit
b11a1c2c63limits the re-read to buffers that queued GPU work still touches, addsCpuRewriteAfterSubmitand switches the older cases from CPU rewrites to dispatch-filled buffers. The code and tests hold up here. Changes are still requested because, as reported, this head turns the PPSA22408 garage load into a hang wheremainloads, and the description itself says "not for merge until that loop is understood".What changed since my last review
git range-diff(delta.patch): the five commits I reviewed are unchanged (=). One commit is new:b11a1c2c63"fix(agc): read an indirect buffer again only while queued GPU work writes it".refreshIndirectSegmentnow returns early unless at least one of these holds: the draw pipeline overlaps the range, the draw finisher has pending work over it, orRecorder::PendingWriterSerial(address, bytes)is non-zero (Submission.cpp L275-L284).CpuRewriteAfterSubmit(conditional and direct): a CPU rewrite after submit, behind a gate, must run as copied.NestedRewrite,InvalidRewriteandRewrittenWaitBeforeOwnFlipnow have a dispatch earlier in the same submission fill the buffer, instead of a CPU rewrite behind a gate.WAIT_REG_MEMruns as copied).15a4f95d4d, and the same hang onb11a1c2c63.0x54that runs only once the generated list runs. The author added the "not for merge yet" note to the description.VUID-vkCmdCopyBuffer-commonparentinagc_driver_depth_clear_hle(report). The author and mrfelek did not reproduce it.What I ran
Head
b11a1c2c63d65abb9b64cc1687e56132458a960a,main096c45570f516de76a43bbe1b97781381c84f55f, merged treed2102d3f88ca302db4c68c24d44f7c46038be6ae. Release, GCC 14.2.0, Ninja, Debian 13 VM, lavapipe (Mesa 26.1.6).git diff --checkAll conventions checks passed.main; 2main_sync_renames_*tests fixedagc_driver_gpu_written_indirect_buffer, merged treeruns as copiedline for the zero-header casea COND_INDIRECT_BUFFER the CPU rewrote after its submission, with no GPU work before it writing the buffer, ran the rewritten commands instead of running as it was copiedmain's production files)a COND_INDIRECT_BUFFER ran the command buffer as it was at submission, not as the dispatch before it wrote it: the marker is 0, ...VUID-; nowas not found but was requestedgit status --porcelainempty)The script's paired validation comparison was skipped (no
mainbaseline yet), and I did not run themainside. On lavapipe,agc_driver_depth_clear_hleshows noVUID-vkCmdCopyBuffer-commonparentwith this PR, which agrees with the author's and mrfelek's NVIDIA reruns.Previous findings
{0, 1}): Resolved in my last review. Still holds:RewrittenWaitBeforeOwnFlipkeeps the{0, 1}assertion and passes.preparecaptures every known target once per segment: Still open, unchanged (Submission.cpp L433-L446). Fine as a follow-up.CaptureRenderingWaitfailures are swallowed, andrenderingWaitTargetsis never pruned: Still open, unchanged (the emptycatchat L440-L441 of the same file). Not blocking.New findings
Blocking
As reported, the PR turns a loading title into a hang, and the description holds it back from merge. In mrfelek's runs (Linux, RTX 3080 Ti, with #11580), Hot Wheels Infinite Rush (PPSA22408) behaves differently on the two sides:
mainba5b5330b3the garage loads (with a black 3D scene).b11a1c2c63the garage load hangs until the title's 120 s render-thread watchdog fires.APS5_LOOP_GUARD=1048576it draws, with corrupted areas (guard run,maincomparison).The trace shows that the refresh behaves as designed: the buffer is GPU-filled. The hang comes from a second bug that running the generated list exposes: pass 2 of a two-pass compaction reads entries that are never written. Merged as it is, though, this changes a title from loading to hanging, and the author's own note says "Not for merge until that loop is understood." I could not reproduce this here (no title runs on this machine), so the evidence is author- and tester-reported.
Suggested fix: land the fix for the lost entry-table writes first and add it under
Depends on. Otherwise, show that PPSA22408 no longer hangs with this head.Non-blocking
PendingWriterSerialcounts a batch that only reads the range address-based as a writer (Recorder.cpp L3318-L3327). So a buffer rewritten only by the CPU is still re-read when such a reader is outstanding.Not verified
mainvs PR validation-layer comparison (the script skipped it); Windows; and non-lavapipe GPUs. The AMD CI on this head reports no new VUIDs.To get this to a good state
Depends on, or show the garage loading without the loop guard on this head.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T20:40:18Z.
Review: CHANGES_REQUESTED
Re-checked — changes still requested
The only new commit,
55ad5b541c, is a debt-entry sentence. It resolves my non-blocking point about address-based readers. The blocking PPSA22408 hang is still open, and the author agrees this head is not for merge.What changed since my last review
git range-diff(delta.patch): the six commits I reviewed are unchanged (=). One commit is new:55ad5b541c"docs(agc): note that an address-based reader also triggers the indirect buffer re-read". It changes one line indocs/dev/debt/libSceAgcDriver.mdand no code or tests.Depends onstill saysnone.What I ran
Head
55ad5b541c088e6fde9ec25ba55d99facf66bbf3,main9090972b7e91fd266819cbd77a8b058e177b5682, merged treedf6f6a11f4b4babd32880ae56605b132e3d757c0. Release, GCC 14.2.0, Ninja, Debian 13 VM, lavapipe (Mesa 26.1.6).git diff --check[debt-length] Technical debt entry over 1000 characters ... 1124 characters(see below)b11a1c2c63docs/dev/debt/libSceAgcDriver.mdonly, 1 line changedmain.VUID-agc_driver_gpu_written_indirect_buffer, merged treeNegative control: none rerun. No test or production code changed since my last review, where both controls (only the new eligibility check reverted, and
main's production files) failed as expected.Previous findings
main. Still open. The new commit changes no code. The author agrees and says it stays not for merge, but neither condition is met: no dependency is listed, and there is no run of the garage without the loop guard.preparecaptures every known target once per segment. Still open, unchanged. Fine as a follow-up.CaptureRenderingWaitfailures are swallowed, andrenderingWaitTargetsis never pruned. Still open, unchanged. Not blocking.New findings
Blocking
None.
Non-blocking
tools/check_conventions.pywarns that the entry is 1124 characters, above its 1000. It is a warning, not an error, but CONTRIBUTING asks entries to "state the gap first ... and describe the implemented behaviour only as far as the gap needs it". Suggested fix: shorten the entry. For example, merge the two "runs as copied" sentences into one list, or move the rendering-wait ticket detail to a shorter clause, so the entry stays under 1000 characters.Not verified
To get this to a good state
Depends on, or show the garage loading on this head withoutAPS5_LOOP_GUARD.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T11:26:05Z.
Review: CHANGES_REQUESTED
Re-checked — changes still requested
The code is the same as in my last review. What's new is in the discussion: mrfelek traced the PPSA22408 loop to how
COND_INDIRECT_BUFFERis flattened, and the author agreed to have that fixed in a separate PR built on top of this one. That order still means merging this head alone would turn the black garage into a hang, so the blocking finding stays open.What changed since my last review
55ad5b541c, and all seven commits are unchanged (=in the range-diff). Onlymainmoved, to4f41f4c375.copySegmentflattens aCOND_INDIRECT_BUFFERlike a call: after the target, it goes on copying the packets that follow the branch.COND_INDIRECT_BUFFERthat chains into the rest of the frame. So the rest of the frame is copied twice, and the second copy re-runs pass 1. That second run is the loop at pc0x54.main.Depends on: none.What I ran
55ad5b541c088e6fde9ec25ba55d99facf66bbf3,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree32e9a885142ef4fbaf827f28087dc4a55bf045c7.git diff --checkdebt-lengthwarning as before (1124 characters)main.VUID-:agc_driver_native_depth_uniform_planes, which was not in the older baseline.VUID-, checked directlyVUID-vkCmdDispatch-groupCountX-00386×4 on the merged tree, and the same ×4 withmain's production files. It comes frommain, not this PR.agc_driver_gpu_written_indirect_buffer, merged treeVUID-messages)git status --porcelainis empty)Negative control: I did not run it again. No test or production code changed since my last review, and both controls failed as expected there.
Previous findings
main. Still open.copySegmentruns aCOND_INDIRECT_BUFFERas a call, which re-runs the frame's continuation. That behaviour is already onmain, but it only becomes harmful once this PR runs the GPU-built list instead of its NOPs.maingoes from "garage loads, 3D black" to "garage hangs" until that PR lands.preparecaptures every known target once per segment. Still open, unchanged.CaptureRenderingWaitfailures are swallowed, andrenderingWaitTargetsis never pruned. Still open, unchanged.New findings
Blocking
None. The open blocker is finding 1 above.
Non-blocking
COND_INDIRECT_BUFFERthat the new diagnosis questions.COND_INDIRECT_BUFFERto run:InvalidRewrite, GpuWrittenIndirectBuffer.cpp L204;CpuRewriteAfterSubmit(block, true), L233.maindoes.INDIRECT_BUFFER, as mrfelek did locally. Or wait for the semantics change and adapt then.Not verified
COND_INDIRECT_BUFFER(call or jump, and whether a chain bit exists in its control dword). The author asked this too, and nobody has measured it on hardware.To get this to a good state
Fix the order of the two changes so that
mainnever runs the GPU-built list with the duplicated continuation. Either:COND_INDIRECT_BUFFERjump fix first, onmain(it changes code that is already there), and list it underDepends on; orThen show a PPSA22408 garage run on the resulting tree without
APS5_LOOP_GUARDthat is no worse thanmain(it loads, even if the scene is still black).Optionally, decouple the two conditional-branch test checks above from the call behaviour, and trim the debt entry below 1000 characters.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T17:14:37Z.
Review: APPROVED
Re-checked — approved
The new commit
ddb59eefafadds mrfelek's change: a takenCOND_INDIRECT_BUFFERnow replaces the rest of its buffer. Its tests now reach the branch through anINDIRECT_BUFFERcall. With this, merging the PR alone no longer brings in the PPSA22408 loop, and the remaining dependency (#15465) is now on the checklist.What changed since my last review
ddb59eefaf(co-authored by mrfelek). Commits 1–7 are unchanged (=in the range-diff).copySegment, aCOND_INDIRECT_BUFFERoutside aCOND_EXECrange now doesreturn falseonce it has inlined its target. The packets after it in the same buffer are no longer copied (Submission.cpp L214-L226).testBranchSubmissionnow requires that the packet after a taken branch does not run. It also adds a case where a branch inside a called buffer returns to its caller.InvalidRewrite,CpuRewriteAfterSubmit(…, true)andRewrittenWaitBeforeOwnFlipnow reach their branch throughCalledBranch, a small buffer run by anINDIRECT_BUFFER.COND_INDIRECT_BUFFERdebt entry now says the branch does not return, and that this is unverified on hardware.Depends on: #15465is listed, and the PPSA22408 story is updated.55ad5b541cplus the same jump diff (the folded commit differs only in comments that were removed), withoutAPS5_LOOP_GUARD:main;runtime resource snapshot did not stabilize.What I ran
Head
ddb59eefaf7728b983274cac47f7d25e3aa640fc,main1e658521a0a599872612bb91949311e2956b5283, merged tree5740244de3bfc34a4c20bf44e0a7d2a1e99626c4. Release build with GCC 14.2.0 and Ninja, on a Debian 13 VM with lavapipe (Mesa 26.1.6).git diff --checkdebt-lengthwarning as before (indirect-buffer entry, 1124 characters)main.VUID-.^agc_driver_pm4…andagc_driver_gpu_written_indirect_buffer, merged treeVUID-lines, and nowas not found but was requestedlineNegative control
agc_driver_pm4agc_driver_gpu_written_indirect_bufferreturn falseremovedthe packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a callmaina COND_INDIRECT_BUFFER ran the command buffer as it was at submission … the marker is 0Previous findings
mainnever runs the GPU-built list with a duplicated continuation.main, provided #15465 is applied. That dependency is declared under Depends on.preparecaptures every known target once per segment (Submission.cpp L434-L445). Still open, unchanged.CaptureRenderingWaitfailures are swallowed inprepare, andrenderingWaitTargetsis never pruned. Still open, unchanged.COND_INDIRECT_BUFFER. Resolved.InvalidRewriteandCpuRewriteAfterSubmit(…, true)now call the branch throughCalledBranch, and the remaining top-level branches don't check the packet after them.New findings
Blocking
None.
Non-blocking
if (targetWords != 0), so a taken branch to a buffer of 0 dwords still falls through to the next packet. Pm4.cpp L1386-L1389 requires that fall-through.COND_INDIRECT_BUFFERentry saying that an empty taken branch falls through, also unverified. Or make the two cases consistent.COND_INDIRECT_BUFFERnow runs its stale copy, and the caller's packets after the branch don't run at all. Before this commit, those packets ran once. Refusal cases are a flip, an EOP flip, a REWIND, a new rendering-wait target, a validation failure, or no queued writer seen.sceAgcCbBranch, not only GPU-built lists: packets after a taken branch, flips included, are no longer copied or reserved.COND_INDIRECT_BUFFER, since the change now affects every title that uses branches.Not verified
55ad5b541cplus a diff that matches the folded commit apart from comments, not on the pushed head.COND_INDIRECT_BUFFER.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:43:43Z.
Review: APPROVED
Re-checked — approved
The only new commit,
4143f1b4a0, mergesmaininto the branch and resolves a conflict indocs/dev/debt/libSceAgcDriver.md. The PR's own code and tests have not changed sinceddb59eefaf, which I approved last time.What changed since my last review
=in the range-diff). The new commit is a merge ofmain6cd2899cc6.main086c0686c8is still the same 8 files. In the debt file it still changes theCOND_INDIRECT_BUFFERentry and adds the indirect-buffer entry.main's two label entries are kept next to them, as the author says.VUID-). I accept both as author-reported.What I ran
Head
4143f1b4a03f8e41d608c577214e260a005dc015,main086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree536d6128f5af8d324bb5c8bcbdb91b7ca47f13bf. Build: Release, GCC 14.2.0, Ninja, on Debian 13 (VM) with lavapipe (Mesa 26.1.6).git diff --checkdebt-lengthwarning as before (indirect-buffer entry, 1124 characters)main.VUID-s:agc_driver_image_gather_volume("test not run on main")agc_driver_image_gather_volumewith the layer, merged tree vs.main's production filesVUID-VkSamplerCreateInfo-addressMode{U,V,W}-*lines on both, and the test passes on both. So they come frommain's newer gather test, not from this PR.^agc_driver_pm4…andagc_driver_gpu_written_indirect_buffer, merged treeNegative control
With
main's five production files and the PR's tests:agc_driver_gpu_written_indirect_bufferfails:a COND_INDIRECT_BUFFER ran the command buffer as it was at submission … the marker is 0.agc_driver_pm4fails:the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call.With the merged files restored, both pass.
Previous findings
preparecaptures every known target once per segment (core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp:435): still open, non-blocking, unchanged.CaptureRenderingWaitfailures are swallowed andrenderingWaitTargetsis never pruned: still open, non-blocking, unchanged.docs/dev/debt/libSceAgcDriver.md:220): still open, non-blocking. The warning shows again.COND_INDIRECT_BUFFER: stays resolved.Submission.cpp:215-223): still open, non-blocking, unchanged.sceAgcCbBranch: still open as a follow-up (a hardware oracle check), non-blocking.New findings
Blocking
None.
Non-blocking
None.
Not verified
COND_INDIRECT_BUFFER.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T02:12:15Z.
Review: APPROVED
Re-checked — new head, approved
I reviewed exact head
772c16e9becf7075095b47f8a7f45e08e5a754b1; the queued-writer regression is registered, its author-reported baseline control fails as expected, and no blocking issue remains.What I ran
The PR metadata reports target-base SHA
3e089775b9a12e3d2e70ede255363c522dbf3135. The no-build precheck resolved currentmainto077a573cd1dab3d2fa2dbe6e508fa46118bce4ccand produced a clean merge preview. Environment: Linux 6.1, Python 3.11.2, GCC 12.2.0. I did not build or run CTest locally. I also read the exact-head Windows status and the author's exact-head Linux qualification report.Results
main.772c16e9becf.Commands and recorded output
Precheck command:
Precheck output:
Hosted-check command:
Hosted-check output:
Required-check query output:
The precheck's incomplete conclusion reflects its intentionally unrun build-dependent checks; it is not a reported failure. The exact-head Linux tests below were supplied by the author, not run locally.
Negative control
I did not run a negative control locally. The author reports that, on the exact head, both new fixtures passed three times with the change; the same frozen fixtures against baseline AGC/libc failed at the expected missing-marker assertions, with no skips or Vulkan validation messages (exact-head report).
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not compile or run CTest locally, and I did not run a console test. The Linux and GPU results are author-reported. Workflow jobs marked skipped provide no evidence for their platforms.
To get this to a good state
No changes are requested for this head. If the head changes, I will review the new diff and rerun the relevant checks.