fix(agc): run an indirect buffer as it is when execution reaches it #11346

Merged
milescoviello merged 16 commits from upstream-pr/11346 into main 2026-11-14 03:39:20 +00:00
milescoviello commented 2026-10-26 06:03:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-26T06:03:36Z.


Hot Wheels Infinite Rush (PPSA22408): @mrfelek's runs show its garage needs this refresh. The re-read buffer is an Unreal shader bundle's command list, written on the GPU earlier in the same submission (trace). main runs the copy taken at submit, 375 NOPs: the garage loads, but its 3D scene stays black. The previous head ran the generated list, and then a compute loop never exited (pc 0x54). @mrfelek traced that loop to copySegment flattening a COND_INDIRECT_BUFFER like a call: Hot Wheels leaves its list through another COND_INDIRECT_BUFFER that chains into the rest of the frame, so the rest of the frame ran twice. This head (ddb59eefaf, with @mrfelek's change folded in) makes a taken COND_INDIRECT_BUFFER replace the rest of its buffer. In @mrfelek's runs the loop guard then trips 0 times; without #15465 the load can abort with runtime resource snapshot did not stabilize, so this depends on #15465.

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:

  • A compute pass packs records into a buffer with ds_ordered_count, keeping only the records whose three counts multiply to a nonzero value.
  • A COND_INDIRECT_BUFFER then runs that buffer.

On main the 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 nested INDIRECT_BUFFERs.

How

  • copySegment notes every INDIRECT_BUFFER and COND_INDIRECT_BUFFER it inlined unchanged (not chained or predicated): where its copy starts, its guest address and its size (Submission::indirectSegments).
  • When execute reaches one, refreshIndirectSegment reads 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 through GuestMemory::Read, which syncs pending GPU writes. That is when the CP reads an indirect buffer.
  • A taken COND_INDIRECT_BUFFER outside a COND_EXEC range replaces the rest of the buffer it is in, like a chained INDIRECT_BUFFER: copySegment stops 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 a COND_EXEC range the packets after it are still copied. That the branch does not return is unverified on hardware; it is in the technical debt file.
  • A buffer no queued work writes runs as copied. A title that rewrites one on the CPU after submitting it would normally find the console's CP done with it, while here execution can trail the submission by a long way. A CPU rewrite behind a WAIT_REG_MEM gate, which the CP would read, also runs as copied; that is in the technical debt file.
  • If the buffer is unchanged, nothing else happens. If it changed:
    • The new contents are expanded like a submission (nested buffers included), validated, and their register lists read.
    • Their rendering waits use tickets the submission took at submit: reserveOutputs takes 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.
    • They replace the old copy.
    • The positions of the flips, rendering waits, register lists, conditional ranges, held waits and later indirect buffers move by the size difference.
    • Dispatches resolved ahead are dropped, and queued work is drained before the stream changes.
    • The label writes of the new contents (WRITE_DATA, RELEASE_MEM) join the submission's labelWrites and the queue's unfinishedWrites, so a wait submitted later sees a writer; completion reads labelWrites after execute, 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.
  • A rewritten buffer holding a flip, an EOP flip release, a REWIND, or a rendering wait on a buffer no ticket was taken for runs as it was copied, since those were not reserved at submit. The pair of such a wait gets a ticket from the next submission on. A chained or predicated buffer also runs as copied. Both are in the technical debt file.
  • New contents that fail to expand, validate or have their register lists read (an unsupported packet, for instance) also leave the buffer as it was copied, which validated at submit, so a refresh can never fail a queue that main would have run. The first eight are logged.

Overlap (tools/pr_overlap.py, git merge-tree): files only. #10487, #10507 and #11207 also change Driver.hpp and merge cleanly with this. #10193 conflicts with main already. Many open PRs add entries to docs/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 772c16e9be merges main 3e089775b9. The one conflict was in Submission.cpp: it keeps main's chained hand-off and depth in copySegment/copyLink, notes the inlined segment after the copy, and refreshIndirectSegment passes depth 0. The merge passes a full build.

    • Khronos validation (layer 1.4.341 with VK_LOADER_DEBUG=layer, RTX 4070 Ti): main 3e089775b9 passes 51 of 51 and the head 52 of 52. The loader inserted the layer once per Vulkan device created: 55 devices on main and 57 on the head. No new VUID- lines.
    • AMD by @JJenkx (comment): RX 6650 XT with RADV, Linux 7.2.14, Release, with 772c16e9be integrated on main d83049b37c (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 the WRITE_DATA value). 0 VUID- lines.
  • Head b11a1c2c63, on the same merge base ba5b5330b3, after the Hot Wheels report:

    • New case in agc_driver_gpu_written_indirect_buffer, for a COND_INDIRECT_BUFFER and an INDIRECT_BUFFER: the submission waits on a CPU gate before the buffer. After it is submitted, the CPU writes a WRITE_DATA marker into the buffer and opens the gate. The packet after the buffer must run and the marker must stay 0.
    • Red control 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.
    • The nested, invalid-contents and rendering-wait cases used to rewrite their buffers on the CPU behind a gate. Now a dispatch earlier in the same submission writes them, the case this PR is for. Their checks are unchanged.
    • Linux: the 32 tests of the area regex plus the flip tests, 3 runs: the 16 AGC tests pass 3 of 3, this one included; the 16 video_out_flip_* tests skip in that environment.
    • Khronos validation 1.4.363 over the same set: the merge base ba5b5330b3 passes 31 of 31 and this head 32 of 32, no layer missing, 17 and 19 Vulkan devices created, no VUID- messages on either side.
    • Validation re-run 11-09 (Khronos 1.4.341 with VK_LOADER_DEBUG=layer): head 9a29e805bf against its merge base 105c9e4d91 on 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, no VUID-. 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 without VK_LOADER_DEBUG a missing layer leaves no trace in the log (#17896). Rely on this re-run instead.
    • Windows 11 VM (GT 1030, WinLibs GCC 15.2.0 r7): the test passes 3 of 3 on this head (the merge base has no such test).
  • Head 82f3ada000: the same five commits rebased onto main aaccd0ba39 with 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 on main and 23 of 23 here, no VUID- messages. Windows 11 VM (GT 1030): main 10 of 10 and this head 11 of 11, 3 of 3 each (details).

  • Head e593f32f86 (oneandonlydean's and MarcZX10's reviews), test only: TicketWait::Wait records the ticket it waits for, and RewrittenWaitBeforeOwnFlip requires 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 with they 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 base 46e54cf1f7 passes 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 a VUID- 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 onto main 46e54cf1f7. One conflict: main moved the reportSkip declaration in Driver.hpp to the public section (03fcf738b6), next to the line where the second commit adds validate's report parameter. I kept main's move and the parameter; git range-diff shows the first and third commits unchanged. The 11 tests pass 3 of 3. Windows 11 VM (GT 1030): main 10 of 10 and this head 11 of 11, 3 of 3 each.

  • Head 240c1c218b, rebased onto main 8c7cf8269f (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, until AgcDriverAwaitedWaits_nid_postfix reports 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 rewritten WRITE_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_MS sleeps at the start of every execute, and at 1000 ms every submission starts executing after the old 500 ms sample.

      Build No delay 1 s delay
      This head plus the switch 3 of 3 pass 3 of 3 pass
      The same without the two held-wait erase_if lines in refreshIndirectSegment 3 of 3 fail 3 of 3 fail
      The same, with the previous test 3 of 3 fail 3 of 3 pass

      Without 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 main 8c7cf8269f and 11 of 11 on this head, no VUID- messages. Windows 11 VM (GT 1030): main 10 of 10 and this head 11 of 11, 3 of 3 each.

  • Head 199186dabd added a second commit after review. In a MXGP 26 run with a local diagnostic on 5dd3166c16, the title stopped at 48 s: a rewritten 44,019-dword list at 0x1078da8010, one of MXGP's GPU-built command lists, held a 0x00000000 header. The throw from the refresh's validate failed the queue with unsupported PM4 packet type: header 0x00000000 at DWORD 39212 of 44019. Such contents now run as copied.

    • New case in agc_driver_gpu_written_indirect_buffer: after the submission, the CPU rewrites a gated COND_INDIRECT_BUFFER's target with a 0x00000000 header and a WRITE_DATA. The queue must keep running, the packet after the buffer must run, and the WRITE_DATA must not. The test alone on 5dd3166c16 fails 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.
    • On this head the 11 tests pass 3 of 3. Khronos validation: 10 of 10 on main 4b1a9a3b2f and 11 of 11 on this head, no VUID- messages. Windows 11 VM (GT 1030): main b27cc8416f 10 of 10 and this head 11 of 11, 3 of 3 each.
    • MXGP 26 on this head with the same diagnostic: it runs to the 480 s timeout, and no rewritten list failed validation in that run.
    • Windows hardware (ycbuzi): 199186dabd merged onto main 9ff033b1a1, the 11 tests with ctest --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, with agc_driver_pipelined_dispatch failing once on the #9680 fixture check. The new case logs its runs as copied line on every device and passes. With main's production files, the test fails on the 4070 with the original marker-0 message.
  • Head 5dd3166c16: 25000ed852 rebased onto main b27cc8416f, the same patch (git range-diff shows it unchanged). Since 204c6747d0, main changed only docs/dev/debt/libSceAgcDriver.md among the touched files; both sides' entries are kept and conventions pass. The runs below are on 25000ed852.

  • Windows hardware (ycbuzi, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7): 25000ed852 merged onto main b27cc8416f, the same tree as this head, the 11 tests with ctest --repeat until-fail:3:

    • GeForce RTX 4070 SUPER and GTX 1650 SUPER (NVIDIA 616.92): 11 of 11, 3 of 3. With main's four driver files, the new test fails on the 4070 with the marker 0, and the other 10 pass.
    • AMD Radeon RDNA2 iGPU (1002:164e, AMD 32.0.21030.2001): 10 of 11 pass 3 of 3, agc_submit_progress included. agc_driver_pipelined_dispatch failed once there; in 20 runs each it fails 2 of 20 on main and 2 of 20 on main + this head, always at the fixture's the two targets do not share their high address dword check before any dispatch, which is #9680 (fixed by #9696). agc_submit_progress passes 20 of 20 on both.
  • Head 25000ed852, rebased onto main 204c6747d0 (clean; both sides' entries kept in docs/dev/debt/libSceAgcDriver.md). The 11 tests pass 3 of 3 on Linux. Khronos validation: 10 of 10 on main 204c6747d0 and 11 of 11 on this head, no VUID- messages. Windows 11 VM (GT 1030): main 10 of 10 and this head 11 of 11, 3 of 3 each.

    • On the VM, agc_submit_progress (in the set) failed twice on PR builds in about 100 runs, with its 2 s submission lost its real GPU completion store deadline: once in a 3-run pass on b5c1a82490, and once within 15 repeats. It passed 20 more on that build and 60 of 60 on 25000ed852, and 40 of 40 on main. A further 100 runs each, one ctest per run: 100 of 100 on this head 5dd3166c16 and 100 of 100 on main 4e43321bd6, so 2 failures in about 280 PR-build runs against 0 in 140 on main. 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 b5c1a82490 on main 14c99b52ac, after review: rebased, the held-wait bookkeeping added, and indirectSegments kept sorted by start after the copy and after every splice.

    • Nested case: a mutant whose splice drops the nested entries fails it with 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.
    • Khronos validation over the 11: 10 of 10 on main 14c99b52ac and 11 of 11 on this head, no VUID- messages. The Windows VM run of this head is in a comment below.
  • Previous head 867f93d9dc (same code as 4f55aae4f8, which only shortened the debt entry):

    • The held-wait case below fails in both runs on the head before it, 9f3361de12: 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.
    • Khronos validation over the same 11: 10 of 10 on main 14c99b52ac and 11 of 11 on this head, no VUID- 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 a WRITE_DATA packet into a NOP-filled buffer, then a COND_INDIRECT_BUFFER (and, in a second case, an INDIRECT_BUFFER) runs that buffer; the marker the packet stores must be set.

    • Held-wait case:
      1. A first submission waits on a CPU gate, then a dispatch writes WRITE_DATA label = 0 into a NOP-filled buffer that a COND_INDIRECT_BUFFER runs. The label starts at 1.
      2. A second submission, queued while the first is held, waits for label == 1 and then writes a marker.
      3. After the gate opens, the test waits up to 10 s until the worker is blocked on the label wait or the marker turns 1. The label must be 0 and the marker 0 at that point; then the CPU sets the label back to 1 and the marker must be 1.
    • Nested case:
      1. A submission waits on a CPU gate, then a COND_INDIRECT_BUFFER runs a NOP-filled parent.
      2. While the gate holds, the CPU rewrites the parent into a dispatch that writes a WRITE_DATA marker into a second NOP-filled buffer, followed by an INDIRECT_BUFFER call into it.
      3. When the parent is read again the child is still NOPs, so it has to be refreshed again at its call, and the marker must be set.
    • The test alone on main 5b85225ef3 fails 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.
    • With this change it passes 3 of 3.
  • 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 base 5b85225ef3, 11 of 11 on this head, no layer missing, no VUID- messages on either. Correction (10-27): two tests of this set never load the layer. agc_driver_graphics and agc_driver_pm4 run 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 at 240c1c218b), creates a real device, as do the others; I counted Physical device selected per 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 (16ff208dc3 with a trace-only diagnostic): at 465 s the rider, the bike and the grass are black against a lit sky, as in #9510.
    • This head plus one log line in 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.
    • Before rendering waits took their tickets at submit, a run hung at 252 s: a rendering wait in a rewritten boot buffer, captured at execution, also waited for flips that later submissions had reserved, and UE stopped on GameThread timed out waiting for RenderThread after 120.00 secs.
    • The frame rate is lower (0.8 against about 4.5 FPS in the menus), since the GPU now draws the passes it skipped. The run also overlapped a backup of the host's disk, so I make no frame-rate claim.
  • Jump fold-in (ddb59eefaf), merge preview 6c257dbfb6 on main 4f41f4c375: ^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 the Submission.cpp line reverted, agc_driver_pm4 fails with the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call.

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
  • 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: #15465 (PPSA22408 loads abort on runtime resource snapshot did not stabilize without it)
  • Fixes: none (part of #9510)
  • Unblocks: PPSA30839 #9725 (MXGP 26's GPU-built command lists)
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 615.71.09, Ubuntu 26.04.1; NVIDIA GeForce GT 1030, driver 582.78, Windows 11 VM; NVIDIA GeForce RTX 4070 SUPER and GTX 1650 SUPER, driver 616.92, and AMD Radeon RDNA2 iGPU, driver 32.0.21030.2001, Windows 11 (ycbuzi)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5012844381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-26T06:03:36Z. --- > **Hot Wheels Infinite Rush (PPSA22408):** @mrfelek's runs show its garage needs this refresh. The re-read buffer is an Unreal shader bundle's command list, written on the GPU earlier in the same submission ([trace](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6562511735)). `main` runs the copy taken at submit, 375 NOPs: the garage loads, but its 3D scene stays black. The previous head ran the generated list, and then a compute loop never exited (pc `0x54`). @mrfelek traced that loop to `copySegment` flattening a `COND_INDIRECT_BUFFER` like a call: Hot Wheels leaves its list through another `COND_INDIRECT_BUFFER` that chains into the rest of the frame, so the rest of the frame ran twice. This head (`ddb59eefaf`, with @mrfelek's change folded in) makes a taken `COND_INDIRECT_BUFFER` replace the rest of its buffer. In @mrfelek's runs the loop guard then trips 0 times; without #15465 the load can abort with `runtime resource snapshot did not stabilize`, so this depends on #15465. ### 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: - A compute pass packs records into a buffer with `ds_ordered_count`, keeping only the records whose three counts multiply to a nonzero value. - A `COND_INDIRECT_BUFFER` then runs that buffer. On `main` the 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 nested `INDIRECT_BUFFER`s. ### How - `copySegment` notes every `INDIRECT_BUFFER` and `COND_INDIRECT_BUFFER` it inlined unchanged (not chained or predicated): where its copy starts, its guest address and its size (`Submission::indirectSegments`). - When `execute` reaches one, `refreshIndirectSegment` reads 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 through `GuestMemory::Read`, which syncs pending GPU writes. That is when the CP reads an indirect buffer. - A taken `COND_INDIRECT_BUFFER` outside a `COND_EXEC` range replaces the rest of the buffer it is in, like a chained `INDIRECT_BUFFER`: `copySegment` stops 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 a `COND_EXEC` range the packets after it are still copied. That the branch does not return is unverified on hardware; it is in the technical debt file. - A buffer no queued work writes runs as copied. A title that rewrites one on the CPU after submitting it would normally find the console's CP done with it, while here execution can trail the submission by a long way. A CPU rewrite behind a `WAIT_REG_MEM` gate, which the CP would read, also runs as copied; that is in the technical debt file. - If the buffer is unchanged, nothing else happens. If it changed: - The new contents are expanded like a submission (nested buffers included), validated, and their register lists read. - Their rendering waits use tickets the submission took at submit: `reserveOutputs` takes 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. - They replace the old copy. - The positions of the flips, rendering waits, register lists, conditional ranges, held waits and later indirect buffers move by the size difference. - Dispatches resolved ahead are dropped, and queued work is drained before the stream changes. - The label writes of the new contents (`WRITE_DATA`, `RELEASE_MEM`) join the submission's `labelWrites` and the queue's `unfinishedWrites`, so a wait submitted later sees a writer; completion reads `labelWrites` after `execute`, 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. - A rewritten buffer holding a flip, an EOP flip release, a REWIND, or a rendering wait on a buffer no ticket was taken for runs as it was copied, since those were not reserved at submit. The pair of such a wait gets a ticket from the next submission on. A chained or predicated buffer also runs as copied. Both are in the technical debt file. - New contents that fail to expand, validate or have their register lists read (an unsupported packet, for instance) also leave the buffer as it was copied, which validated at submit, so a refresh can never fail a queue that `main` would have run. The first eight are logged. **Overlap** (`tools/pr_overlap.py`, `git merge-tree`): files only. #10487, #10507 and #11207 also change `Driver.hpp` and merge cleanly with this. #10193 conflicts with `main` already. Many open PRs add entries to `docs/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** `772c16e9be` merges `main` `3e089775b9`. The one conflict was in `Submission.cpp`: it keeps `main`'s chained hand-off and `depth` in `copySegment`/`copyLink`, notes the inlined segment after the copy, and `refreshIndirectSegment` passes depth 0. The merge passes a full build. - Khronos validation (layer 1.4.341 with `VK_LOADER_DEBUG=layer`, RTX 4070 Ti): `main` `3e089775b9` passes 51 of 51 and the head 52 of 52. The loader inserted the layer once per Vulkan device created: 55 devices on `main` and 57 on the head. No new `VUID-` lines. - AMD by @JJenkx ([comment](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6760977151)): RX 6650 XT with RADV, Linux 7.2.14, Release, with `772c16e9be` integrated on `main` `d83049b37c` (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 the `WRITE_DATA` value). 0 `VUID-` lines. - **Head** `b11a1c2c63`, on the same merge base `ba5b5330b3`, after the Hot Wheels report: - New case in `agc_driver_gpu_written_indirect_buffer`, for a `COND_INDIRECT_BUFFER` and an `INDIRECT_BUFFER`: the submission waits on a CPU gate before the buffer. After it is submitted, the CPU writes a `WRITE_DATA` marker into the buffer and opens the gate. The packet after the buffer must run and the marker must stay 0. - Red control `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`. - The nested, invalid-contents and rendering-wait cases used to rewrite their buffers on the CPU behind a gate. Now a dispatch earlier in the same submission writes them, the case this PR is for. Their checks are unchanged. - Linux: the 32 tests of the area regex plus the flip tests, 3 runs: the 16 AGC tests pass 3 of 3, this one included; the 16 `video_out_flip_*` tests skip in that environment. - Khronos validation 1.4.363 over the same set: the merge base `ba5b5330b3` passes 31 of 31 and this head 32 of 32, no layer missing, 17 and 19 Vulkan devices created, no `VUID-` messages on either side. - **Validation re-run 11-09** (Khronos 1.4.341 with `VK_LOADER_DEBUG=layer`): head `9a29e805bf` against its merge base `105c9e4d91` on 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, no `VUID-`. 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 without `VK_LOADER_DEBUG` a missing layer leaves no trace in the log (#17896). Rely on this re-run instead. - Windows 11 VM (GT 1030, WinLibs GCC 15.2.0 r7): the test passes 3 of 3 on this head (the merge base has no such test). - **Head** `82f3ada000`: the same five commits rebased onto `main` `aaccd0ba39` with 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 on `main` and 23 of 23 here, no `VUID-` messages. Windows 11 VM (GT 1030): `main` 10 of 10 and this head 11 of 11, 3 of 3 each ([details](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6493887148)). - **Head** `e593f32f86` (oneandonlydean's and MarcZX10's reviews), test only: `TicketWait::Wait` records the ticket it waits for, and `RewrittenWaitBeforeOwnFlip` requires 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 with `they waited for {0}` ([details](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6492647762)). - **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 base `46e54cf1f7` passes 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 a `VUID-` 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 onto `main` `46e54cf1f7`. One conflict: `main` moved the `reportSkip` declaration in `Driver.hpp` to the public section (03fcf738b6), next to the line where the second commit adds `validate`'s `report` parameter. I kept `main`'s move and the parameter; `git range-diff` shows the first and third commits unchanged. The 11 tests pass 3 of 3. Windows 11 VM (GT 1030): `main` 10 of 10 and this head 11 of 11, 3 of 3 each. - **Head** `240c1c218b`, rebased onto `main` 8c7cf8269f (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, until `AgcDriverAwaitedWaits_nid_postfix` reports 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 rewritten `WRITE_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_MS` sleeps at the start of every `execute`, and at 1000 ms every submission starts executing after the old 500 ms sample. | Build | No delay | 1 s delay | |---|---|---| | This head plus the switch | 3 of 3 pass | 3 of 3 pass | | The same without the two held-wait `erase_if` lines in `refreshIndirectSegment` | 3 of 3 fail | 3 of 3 fail | | The same, with the previous test | 3 of 3 fail | 3 of 3 pass | Without 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 `main` 8c7cf8269f and 11 of 11 on this head, no `VUID-` messages. Windows 11 VM (GT 1030): `main` 10 of 10 and this head 11 of 11, 3 of 3 each. - **Head** `199186dabd` added a second commit after review. In a MXGP 26 run with a local diagnostic on `5dd3166c16`, the title stopped at 48 s: a rewritten 44,019-dword list at 0x1078da8010, one of MXGP's GPU-built command lists, held a `0x00000000` header. The throw from the refresh's `validate` failed the queue with `unsupported PM4 packet type: header 0x00000000 at DWORD 39212 of 44019`. Such contents now run as copied. - New case in `agc_driver_gpu_written_indirect_buffer`: after the submission, the CPU rewrites a gated `COND_INDIRECT_BUFFER`'s target with a `0x00000000` header and a `WRITE_DATA`. The queue must keep running, the packet after the buffer must run, and the `WRITE_DATA` must not. The test alone on `5dd3166c16` fails 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`. - On this head the 11 tests pass 3 of 3. Khronos validation: 10 of 10 on `main` 4b1a9a3b2f and 11 of 11 on this head, no `VUID-` messages. Windows 11 VM (GT 1030): `main` b27cc8416f 10 of 10 and this head 11 of 11, 3 of 3 each. - MXGP 26 on this head with the same diagnostic: it runs to the 480 s timeout, and no rewritten list failed validation in that run. - Windows hardware (ycbuzi): `199186dabd` merged onto `main` 9ff033b1a1, the 11 tests with `ctest --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, with `agc_driver_pipelined_dispatch` failing once on the #9680 fixture check. The new case logs its `runs as copied` line on every device and passes. With `main`'s production files, the test fails on the 4070 with the original marker-0 message. - **Head** `5dd3166c16`: `25000ed852` rebased onto `main` b27cc8416f, the same patch (`git range-diff` shows it unchanged). Since 204c6747d0, `main` changed only `docs/dev/debt/libSceAgcDriver.md` among the touched files; both sides' entries are kept and conventions pass. The runs below are on `25000ed852`. - **Windows hardware** (ycbuzi, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7): `25000ed852` merged onto `main` b27cc8416f, the same tree as this head, the 11 tests with `ctest --repeat until-fail:3`: - GeForce RTX 4070 SUPER and GTX 1650 SUPER (NVIDIA 616.92): 11 of 11, 3 of 3. With `main`'s four driver files, the new test fails on the 4070 with the marker 0, and the other 10 pass. - AMD Radeon RDNA2 iGPU (`1002:164e`, AMD 32.0.21030.2001): 10 of 11 pass 3 of 3, `agc_submit_progress` included. `agc_driver_pipelined_dispatch` failed once there; in 20 runs each it fails 2 of 20 on `main` and 2 of 20 on `main` + this head, always at the fixture's `the two targets do not share their high address dword` check before any dispatch, which is #9680 (fixed by #9696). `agc_submit_progress` passes 20 of 20 on both. - **Head** `25000ed852`, rebased onto `main` 204c6747d0 (clean; both sides' entries kept in `docs/dev/debt/libSceAgcDriver.md`). The 11 tests pass 3 of 3 on Linux. Khronos validation: 10 of 10 on `main` 204c6747d0 and 11 of 11 on this head, no `VUID-` messages. Windows 11 VM (GT 1030): `main` 10 of 10 and this head 11 of 11, 3 of 3 each. - On the VM, `agc_submit_progress` (in the set) failed twice on PR builds in about 100 runs, with its 2 s `submission lost its real GPU completion store` deadline: once in a 3-run pass on `b5c1a82490`, and once within 15 repeats. It passed 20 more on that build and 60 of 60 on `25000ed852`, and 40 of 40 on `main`. A further 100 runs each, one `ctest` per run: 100 of 100 on this head `5dd3166c16` and 100 of 100 on `main` 4e43321bd6, so 2 failures in about 280 PR-build runs against 0 in 140 on `main`. 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** `b5c1a82490` on `main` 14c99b52ac, after review: rebased, the held-wait bookkeeping added, and `indirectSegments` kept sorted by start after the copy and after every splice. - Nested case: a mutant whose splice drops the nested entries fails it with `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. - Khronos validation over the 11: 10 of 10 on `main` 14c99b52ac and 11 of 11 on this head, no `VUID-` messages. The Windows VM run of this head is in a comment below. - **Previous head** `867f93d9dc` (same code as `4f55aae4f8`, which only shortened the debt entry): - The held-wait case below fails in both runs on the head before it, 9f3361de12: `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. - Khronos validation over the same 11: 10 of 10 on `main` 14c99b52ac and 11 of 11 on this head, no `VUID-` 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 a `WRITE_DATA` packet into a NOP-filled buffer, then a `COND_INDIRECT_BUFFER` (and, in a second case, an `INDIRECT_BUFFER`) runs that buffer; the marker the packet stores must be set. - Held-wait case: 1. A first submission waits on a CPU gate, then a dispatch writes `WRITE_DATA label = 0` into a NOP-filled buffer that a `COND_INDIRECT_BUFFER` runs. The label starts at 1. 2. A second submission, queued while the first is held, waits for `label == 1` and then writes a marker. 3. After the gate opens, the test waits up to 10 s until the worker is blocked on the label wait or the marker turns 1. The label must be 0 and the marker 0 at that point; then the CPU sets the label back to 1 and the marker must be 1. - Nested case: 1. A submission waits on a CPU gate, then a `COND_INDIRECT_BUFFER` runs a NOP-filled parent. 2. While the gate holds, the CPU rewrites the parent into a dispatch that writes a `WRITE_DATA marker` into a second NOP-filled buffer, followed by an `INDIRECT_BUFFER` call into it. 3. When the parent is read again the child is still NOPs, so it has to be refreshed again at its call, and the marker must be set. - The test alone on `main` 5b85225ef3 fails 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`. - With this change it passes 3 of 3. - **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 base `5b85225ef3`, 11 of 11 on this head, no layer missing, no `VUID-` messages on either. Correction (10-27): two tests of this set never load the layer. `agc_driver_graphics` and `agc_driver_pm4` run 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 at `240c1c218b`), creates a real device, as do the others; I counted `Physical device selected` per 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` (16ff208dc3 with a trace-only diagnostic): at 465 s the rider, the bike and the grass are black against a lit sky, as in #9510. - This head plus one log line in `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. - Before rendering waits took their tickets at submit, a run hung at 252 s: a rendering wait in a rewritten boot buffer, captured at execution, also waited for flips that later submissions had reserved, and UE stopped on `GameThread timed out waiting for RenderThread after 120.00 secs`. - The frame rate is lower (0.8 against about 4.5 FPS in the menus), since the GPU now draws the passes it skipped. The run also overlapped a backup of the host's disk, so I make no frame-rate claim. - **Jump fold-in** (`ddb59eefaf`), merge preview `6c257dbfb6` on `main` `4f41f4c375`: `^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 the `Submission.cpp` line reverted, `agc_driver_pm4` fails with `the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call`. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #15465 (PPSA22408 loads abort on `runtime resource snapshot did not stabilize` without it) - [x] Fixes: none (part of #9510) - [x] Unblocks: PPSA30839 #9725 (MXGP 26's GPU-built command lists) - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 615.71.09, Ubuntu 26.04.1; NVIDIA GeForce GT 1030, driver 582.78, Windows 11 VM; NVIDIA GeForce RTX 4070 SUPER and GTX 1650 SUPER, driver 616.92, and AMD Radeon RDNA2 iGPU, driver 32.0.21030.2001, Windows 11 (ycbuzi) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 06:09:01 +00:00 (Migrated from github.com)

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 to Driver.hpp and docs/dev/debt/libSceAgcDriver.md since 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5648015671 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5648015671). Originally posted by [MarcZX10](https://github.com/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 to `Driver.hpp` and `docs/dev/debt/libSceAgcDriver.md` since 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.
MarcZX10 commented 2026-10-26 06:26:17 +00:00 (Migrated from github.com)

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.

noteHeldAtSubmit runs only while the original flattened commands are scanned in reserveOutputs. For an indirect buffer copied as NOPs, a later-spliced WRITE_DATA/RELEASE_MEM is absent from submission.labelWrites and from QueueWorker::unfinishedWrites; the rewritten command path also does not update heldAtSubmit. 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, noteHeldAtSubmit can mark the wait as held; waitMemory deliberately returns on heldAtSubmit even 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5648127918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5648127918). Originally posted by [MarcZX10](https://github.com/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. `noteHeldAtSubmit` runs only while the original flattened commands are scanned in `reserveOutputs`. For an indirect buffer copied as NOPs, a later-spliced `WRITE_DATA`/`RELEASE_MEM` is absent from `submission.labelWrites` and from `QueueWorker::unfinishedWrites`; the rewritten command path also does not update `heldAtSubmit`. 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, `noteHeldAtSubmit` can mark the wait as held; `waitMemory` deliberately returns on `heldAtSubmit` even 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.
MarcZX10 commented 2026-10-26 06:45:56 +00:00 (Migrated from github.com)

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.

copySegment recursively expands an indirect buffer and only calls noteIndirectSegment after the recursion returns (for example, the COND_INDIRECT_BUFFER path at Submission.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 in submission.commands. The same order is retained when rewritten segments are spliced at Submission.cpp:324-327. execute advances a single nextSegment index 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 indirectSegments ordered by start after 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5648302552 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5648302552). Originally posted by [MarcZX10](https://github.com/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. `copySegment` recursively expands an indirect buffer and only calls `noteIndirectSegment` after the recursion returns (for example, the `COND_INDIRECT_BUFFER` path at `Submission.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 in `submission.commands`. The same order is retained when rewritten segments are spliced at `Submission.cpp:324-327`. `execute` advances a single `nextSegment` index 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 `indirectSegments` ordered by `start` after 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.
MarcZX10 commented 2026-10-26 06:56:11 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5648409332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5648409332). Originally posted by [MarcZX10](https://github.com/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.
MarcZX10 commented 2026-10-26 08:50:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T08:50:27Z.

Review: APPROVED


Reviewed exact head 5dd3166c16d0c32c282a3c88865d76891f704f54 against current main b27cc8416f820e40ce187f165d34138e24373dd7.

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..5dd3166c16d0c32c282a3c88865d76891f704f54 shows 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5649459317 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5649459317). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T08:50:27Z. **Review:** APPROVED --- Reviewed exact head `5dd3166c16d0c32c282a3c88865d76891f704f54` against current `main` `b27cc8416f820e40ce187f165d34138e24373dd7`. 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..5dd3166c16d0c32c282a3c88865d76891f704f54` shows 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.
XairRrR commented 2026-10-29 04:18:59 +00:00 (Migrated from github.com)

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

  • Head: 521bbc33c3f80fbd53e7449ed93d832954812cd8
  • main: b433c40f2f46aa2e59e19806010a839ac8572d64
  • The head merged onto main with no conflicts, in a clean worktree. The build directory was configured as Release, GCC 16.2.1, Ninja, BUILD_TESTING=ON.
  • Machine: Arch Linux 7.2.11-zen, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Khronos validation layer from the system packages.
git fetch origin main pull/11346/head:refs/review/11346
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/11346
git diff --check origin/main...refs/review/11346
python3 tools/check_conventions.py --base origin/main

cmake --build build -j10 --target libs agc_driver_gpu_written_indirect_buffer_tests agc_predication_tests \
  agc_driver_submit_progress_tests agc_driver_pm4_tests agc_driver_graphics_tests \
  agc_driver_depth_fast_clear_submit_tests agc_driver_dispatch_differing_value_sets_tests \
  agc_driver_empty_indirect_skip_tests agc_driver_gds_append_consume_tests \
  agc_driver_pipelined_dispatch_tests agc_driver_flip_tests agc_driver_flip_stores_small_results_tests

R='^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$'
R2='^agc_driver_flip$|^agc_driver_flip_stores_small_results$|^agc_driver_present_mode$|^agc_driver_worker_failure_log$|^agc_driver_flip_compute$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R" -j4 -V --output-on-failure
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R2" -j4 -V --output-on-failure

# the same build and both ctest sets on origin/main, in the same worktree
# negative control: main's five production files, then the new test alone
# a scratch execution test, not part of the PR, run on the merged tree and on main's production files (see Findings)

Results

Check Result
Merge onto main Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build (libs and the 12 test executables) OK. The PR's files add no warnings.
The author's 11 focused tests, merged tree, validation layer 11 of 11 pass
The same set, main 10 of 10 pass (agc_driver_gpu_written_indirect_buffer does not exist there)
Flip and present tests (agc_driver_flip, _flip_stores_small_results, _present_mode, _worker_failure_log, _flip_compute): merged and main 5 of 5 on both
VUID- lines 0 on the merged tree, 0 on main
was not found but was requested by env var VK_INSTANCE_LAYERS Absent from both logs
Validation layer loaded Yes, in agc_driver_gpu_written_indirect_buffer and 7 others. agc_driver_pm4, agc_driver_graphics and agc_predication_tests create no device, as the author's correction says.
Test duration agc_driver_gpu_written_indirect_buffer 0.75 s
Scratch test: a rewritten buffer's rendering wait followed by a flip of the same buffer Merged tree: the wait blocks on its own submission's flip. main: no stall. See Blocking.
agc_driver_gpu_written_indirect_buffer on the merged tree
1141: [gpu] indirect buffer <addr> (64 dwords) changed since its submission but runs as copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64
1141: GPU-written indirect buffer: indirect buffers run what the dispatch before them wrote
10/11 Test #1141: agc_driver_gpu_written_indirect_buffer .....   Passed    0.75 sec
100% tests passed out of 11

Negative control

I restored Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp and Submission.cpp from origin/main, kept the new test, and rebuilt. The test fails at its first case:

1/1 Test #1141: agc_driver_gpu_written_indirect_buffer ...***Failed    0.72 sec
AGC graphics: 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, the WRITE_DATA the dispatch wrote stores 1592590337

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.cpp L455-L463 takes the preparedWaits tickets 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, CaptureRenderingWait returns bufferReuse[index].Capture(), which is the last ticket reserved for that buffer (VideoOutDriver.cpp L151-L156, BufferReuseTracker.hpp L21-L25). RenderingWait::Wait has 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 hold sceAgcDcbWaitUntilSafeForRendering(N) and N has been the target of a rendering wait before:

  • refreshIndirectSegment uses the prepared ticket (L296-L308).
  • That ticket includes the flip after it.
  • The flip can only complete once the worker has passed the wait, so the queue worker blocks until shutdown.

On main that buffer runs as copied, so this is a hang that main does 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 IVideoOutput that tracks per-buffer tickets the same way as BufferReuseTracker, completes a ticket on GpuReady, and gives up a wait after 3 s instead of blocking:

  1. A first submission holds rendering wait (7, 0) and flip (7, 0), so (7, 0) is in renderingWaitTargets.
  2. A second submission holds a gate wait, a COND_INDIRECT_BUFFER to 64 NOP dwords, and flip (7, 0).
  3. The CPU writes rendering wait (7, 0) into the buffer, then opens the gate.
merged tree:
[scratch] rendering wait on buffer 0 timed out: captured ticket 2, completed 1
[scratch] second submission took 3000 ms, rendering waits timed out 1, flips ready 2
main's production files:
[scratch] second submission took 0 ms, rendering waits timed out 0, flips ready 2

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
class TicketWait final : public AgcDriver::IRenderingWait {
    // Wait(): block until completed[index] >= ticket, give up after 3 s and count a timeout
};
class Output final : public AgcDriver::IVideoOutput {
    std::shared_ptr<AgcDriver::IRenderingWait> CaptureRenderingWait(std::uint32_t index) override {
        return std::make_shared<TicketWait>(state, index, state->issued[index]);
    }
    std::shared_ptr<AgcDriver::IFlipRequest> Reserve(const AgcDriver::FlipInfo& info) override {
        return std::make_shared<Request>(state, info.index, ++state->issued[info.index]);   // GpuReady completes the ticket
    }
};

std::vector<std::uint32_t> first{0xc0021018u, 7, 0, 0, 0xc004105cu, 7, 0, 1, 0, 0};
// submit first, AgcDriverWaitIdle_nid_postfix()
std::vector<std::uint32_t> second{
    0xc0053c00u, 0x13, gateLo, gateHi, 1, 0xffffffffu, 0x19,
    0xc00c3f00u, 1, 0, 0, 0, 0, 0, 0, ibLo, ibHi & 0xffffu, 64, 0, 0, 0,
    0xc004105cu, 7, 0, 1, 0, 0};
// submit second; then ib[0..3] = {0xc0021018, 7, 0, 0}; gate = 1; AgcDriverWaitIdle_nid_postfix()

Suggested fix: take each indirect segment's tickets at that segment's position in the reserveOutputs walk. When cursor reaches indirectSegments[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. reserveOutputs silently swallows every CaptureRenderingWait failure (L459-L462). renderingWaitTargets is never pruned when a buffer or output is unregistered. A stale pair then throws wait buffer is not registered and 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 from renderingWaitTargets when its capture fails, and logging it the way the eight validation failures are logged.

Not verified

  • MXGP 26 (PPSA30839) or any other title. I launched no title.
  • Windows and non-NVIDIA GPUs.
  • The cost of reading every inlined indirect buffer a second time at execution, on titles that submit many indirect buffers. The description makes no speed claim and I measured none.
  • Whether a real title puts a rendering wait and a flip of the same buffer around a rewritten buffer in one submission. The finding is shown with the driver and a fake output that follows BufferReuseTracker, not with libSceVideoOut.

To get this to a good state

  1. Capture the prepared rendering-wait tickets per indirect segment, in stream order, so they never cover a flip that comes later in the same submission. Add a regression with a fake output that tracks tickets.
  2. Update the debt entry for the new ticket rule.
  3. Optionally, handle stale renderingWaitTargets and log failed captures (finding 2).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692805567 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5692805567). Originally posted by [XairRrR](https://github.com/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 - Head: `521bbc33c3f80fbd53e7449ed93d832954812cd8` - `main`: `b433c40f2f46aa2e59e19806010a839ac8572d64` - The head merged onto `main` with no conflicts, in a clean worktree. The build directory was configured as Release, GCC 16.2.1, Ninja, `BUILD_TESTING=ON`. - Machine: Arch Linux 7.2.11-zen, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Khronos validation layer from the system packages. ```sh git fetch origin main pull/11346/head:refs/review/11346 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/11346 git diff --check origin/main...refs/review/11346 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target libs agc_driver_gpu_written_indirect_buffer_tests agc_predication_tests \ agc_driver_submit_progress_tests agc_driver_pm4_tests agc_driver_graphics_tests \ agc_driver_depth_fast_clear_submit_tests agc_driver_dispatch_differing_value_sets_tests \ agc_driver_empty_indirect_skip_tests agc_driver_gds_append_consume_tests \ agc_driver_pipelined_dispatch_tests agc_driver_flip_tests agc_driver_flip_stores_small_results_tests R='^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$' R2='^agc_driver_flip$|^agc_driver_flip_stores_small_results$|^agc_driver_present_mode$|^agc_driver_worker_failure_log$|^agc_driver_flip_compute$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R" -j4 -V --output-on-failure VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R2" -j4 -V --output-on-failure # the same build and both ctest sets on origin/main, in the same worktree # negative control: main's five production files, then the new test alone # a scratch execution test, not part of the PR, run on the merged tree and on main's production files (see Findings) ``` ## Results | Check | Result | |---|---| | Merge onto `main` | Clean | | `git diff --check` | Clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build (`libs` and the 12 test executables) | OK. The PR's files add no warnings. | | The author's 11 focused tests, merged tree, validation layer | 11 of 11 pass | | The same set, `main` | 10 of 10 pass (`agc_driver_gpu_written_indirect_buffer` does not exist there) | | Flip and present tests (`agc_driver_flip`, `_flip_stores_small_results`, `_present_mode`, `_worker_failure_log`, `_flip_compute`): merged and `main` | 5 of 5 on both | | `VUID-` lines | 0 on the merged tree, 0 on `main` | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | Absent from both logs | | Validation layer loaded | Yes, in `agc_driver_gpu_written_indirect_buffer` and 7 others. `agc_driver_pm4`, `agc_driver_graphics` and `agc_predication_tests` create no device, as the author's correction says. | | Test duration | `agc_driver_gpu_written_indirect_buffer` 0.75 s | | Scratch test: a rewritten buffer's rendering wait followed by a flip of the same buffer | Merged tree: the wait blocks on its own submission's flip. `main`: no stall. See Blocking. | <details><summary><code>agc_driver_gpu_written_indirect_buffer</code> on the merged tree</summary> ``` 1141: [gpu] indirect buffer <addr> (64 dwords) changed since its submission but runs as copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64 1141: GPU-written indirect buffer: indirect buffers run what the dispatch before them wrote 10/11 Test #1141: agc_driver_gpu_written_indirect_buffer ..... Passed 0.75 sec 100% tests passed out of 11 ``` </details> ## Negative control I restored `Driver.hpp`, `Submission.hpp`, `CommandValidation.cpp`, `PacketExecution.cpp` and `Submission.cpp` from `origin/main`, kept the new test, and rebuilt. The test fails at its first case: ``` 1/1 Test #1141: agc_driver_gpu_written_indirect_buffer ...***Failed 0.72 sec AGC graphics: 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, the WRITE_DATA the dispatch wrote stores 1592590337 ``` 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.cpp` L455-L463](https://github.com/boykopovar/AnyPS5/blob/521bbc33c3f80fbd53e7449ed93d832954812cd8/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L455-L463) takes the `preparedWaits` tickets after the loop over the whole submission. By then, the loop has already reserved every flip in that submission ([L444-L450](https://github.com/boykopovar/AnyPS5/blob/521bbc33c3f80fbd53e7449ed93d832954812cd8/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L444-L450)). An ordinary rendering wait is captured in stream order ([L426-L432](https://github.com/boykopovar/AnyPS5/blob/521bbc33c3f80fbd53e7449ed93d832954812cd8/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L426-L432)), so its ticket covers only flips before it. On the real output, `CaptureRenderingWait` returns `bufferReuse[index].Capture()`, which is the last ticket reserved for that buffer ([`VideoOutDriver.cpp` L151-L156](https://github.com/boykopovar/AnyPS5/blob/b433c40f2f46aa2e59e19806010a839ac8572d64/core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp#L151-L156), [`BufferReuseTracker.hpp` L21-L25](https://github.com/boykopovar/AnyPS5/blob/b433c40f2f46aa2e59e19806010a839ac8572d64/core/libs/prx/libSceVideoOut/include/BufferReuseTracker.hpp#L21-L25)). `RenderingWait::Wait` has no timeout ([L137-L144](https://github.com/boykopovar/AnyPS5/blob/b433c40f2f46aa2e59e19806010a839ac8572d64/core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp#L137-L144)). Take a submission of the form `[wait] [COND_INDIRECT_BUFFER → B] [flip of buffer N]`, where B is rewritten after submit to hold `sceAgcDcbWaitUntilSafeForRendering(N)` and N has been the target of a rendering wait before: - `refreshIndirectSegment` uses the prepared ticket ([L296-L308](https://github.com/boykopovar/AnyPS5/blob/521bbc33c3f80fbd53e7449ed93d832954812cd8/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L296-L308)). - That ticket includes the flip after it. - The flip can only complete once the worker has passed the wait, so the queue worker blocks until shutdown. On `main` that buffer runs as copied, so this is a hang that `main` does 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 `IVideoOutput` that tracks per-buffer tickets the same way as `BufferReuseTracker`, completes a ticket on `GpuReady`, and gives up a wait after 3 s instead of blocking: 1. A first submission holds `rendering wait (7, 0)` and `flip (7, 0)`, so (7, 0) is in `renderingWaitTargets`. 2. A second submission holds a gate wait, a `COND_INDIRECT_BUFFER` to 64 NOP dwords, and `flip (7, 0)`. 3. The CPU writes `rendering wait (7, 0)` into the buffer, then opens the gate. ``` merged tree: [scratch] rendering wait on buffer 0 timed out: captured ticket 2, completed 1 [scratch] second submission took 3000 ms, rendering waits timed out 1, flips ready 2 main's production files: [scratch] second submission took 0 ms, rendering waits timed out 0, flips ready 2 ``` Ticket 1 is the flip of the first submission. Ticket 2 is the flip that follows the rewritten buffer in the second submission. <details><summary>Scratch test, core of the case</summary> ```cpp class TicketWait final : public AgcDriver::IRenderingWait { // Wait(): block until completed[index] >= ticket, give up after 3 s and count a timeout }; class Output final : public AgcDriver::IVideoOutput { std::shared_ptr<AgcDriver::IRenderingWait> CaptureRenderingWait(std::uint32_t index) override { return std::make_shared<TicketWait>(state, index, state->issued[index]); } std::shared_ptr<AgcDriver::IFlipRequest> Reserve(const AgcDriver::FlipInfo& info) override { return std::make_shared<Request>(state, info.index, ++state->issued[info.index]); // GpuReady completes the ticket } }; std::vector<std::uint32_t> first{0xc0021018u, 7, 0, 0, 0xc004105cu, 7, 0, 1, 0, 0}; // submit first, AgcDriverWaitIdle_nid_postfix() std::vector<std::uint32_t> second{ 0xc0053c00u, 0x13, gateLo, gateHi, 1, 0xffffffffu, 0x19, 0xc00c3f00u, 1, 0, 0, 0, 0, 0, 0, ibLo, ibHi & 0xffffu, 64, 0, 0, 0, 0xc004105cu, 7, 0, 1, 0, 0}; // submit second; then ib[0..3] = {0xc0021018, 7, 0, 0}; gate = 1; AgcDriverWaitIdle_nid_postfix() ``` </details> Suggested fix: take each indirect segment's tickets at that segment's position in the `reserveOutputs` walk. When `cursor` reaches `indirectSegments[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. `reserveOutputs` silently swallows every `CaptureRenderingWait` failure** ([L459-L462](https://github.com/boykopovar/AnyPS5/blob/521bbc33c3f80fbd53e7449ed93d832954812cd8/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L459-L462)). `renderingWaitTargets` is never pruned when a buffer or output is unregistered. A stale pair then throws `wait buffer is not registered` and 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 from `renderingWaitTargets` when its capture fails, and logging it the way the eight validation failures are logged. ## Not verified - MXGP 26 (PPSA30839) or any other title. I launched no title. - Windows and non-NVIDIA GPUs. - The cost of reading every inlined indirect buffer a second time at execution, on titles that submit many indirect buffers. The description makes no speed claim and I measured none. - Whether a real title puts a rendering wait and a flip of the same buffer around a rewritten buffer in one submission. The finding is shown with the driver and a fake output that follows `BufferReuseTracker`, not with `libSceVideoOut`. ## To get this to a good state 1. Capture the prepared rendering-wait tickets per indirect segment, in stream order, so they never cover a flip that comes later in the same submission. Add a regression with a fake output that tracks tickets. 2. Update the debt entry for the new ticket rule. 3. Optionally, handle stale `renderingWaitTargets` and log failed captures (finding 2).
XairRrR commented 2026-10-29 05:29:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T05:29:14Z.

Review: APPROVED


Re-checked — approved

d93a040aa2 now takes each indirect segment's rendering-wait tickets at that segment's place in the reserveOutputs walk, 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

  • One new commit, d93a040aa2 ("take a rewritten indirect buffer's rendering wait tickets at its place in the submission"), on top of 521bbc33c3. It is not a rebase.
    • Submission::preparedWaits is removed. Each IndirectSegment now carries a shared_ptr<const PreparedWaits>. reserveOutputs fills it when its cursor reaches the segment's start, before the packet at that position is reserved.
    • Segments spliced in from a rewritten buffer inherit the parent's set. Later segments keep their own.
    • New case RewrittenWaitBeforeOwnFlip in agc_driver_gpu_written_indirect_buffer, using a ticket-tracking fake IVideoOutput whose waits give up after 3 s.
    • The debt sentence now says the tickets are taken "at the buffer's place".
  • The author's reply of 2026-10-29 05:18 UTC describes the fix and says the validation-layer comparison was still running. The description's Tested section now has a line for this head.

What I ran

  • Head: d93a040aa2cab45bc2285daf89d807019fd9dc18
  • main: 52c09d567d2fa453494dd720fcf53a98149468e4
  • The head merged onto main with no conflicts, in a clean worktree (merge commit 3a74c14c86). main has not changed Submission.hpp, Submission.cpp or the test since the merge base 46e54cf1f7. 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).
git fetch origin main pull/11346/head:refs/review/11346
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/11346
git diff --check origin/main...refs/review/11346
python3 tools/check_conventions.py --base origin/main

cmake --build build -j10 --target libs agc_driver_gpu_written_indirect_buffer_tests agc_predication_tests \
  agc_driver_submit_progress_tests agc_driver_pm4_tests agc_driver_graphics_tests \
  agc_driver_depth_fast_clear_submit_tests agc_driver_dispatch_differing_value_sets_tests \
  agc_driver_empty_indirect_skip_tests agc_driver_gds_append_consume_tests \
  agc_driver_pipelined_dispatch_tests agc_driver_flip_tests agc_driver_flip_stores_small_results_tests

R='^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$|^agc_driver_flip$|^agc_driver_flip_stores_small_results$|^agc_driver_present_mode$|^agc_driver_worker_failure_log$|^agc_driver_flip_compute$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R" -j4 -V --output-on-failure

# negative control: Submission.hpp and Submission.cpp from 521bbc33c3, then the test alone
git checkout 521bbc33c3f80fbd53e7449ed93d832954812cd8 -- \
  core/libs/prx/libSceAgcDriver/Execution/include/Driver/Queues/Submission.hpp \
  core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp
cmake --build build -j10 --target agc_driver_gpu_written_indirect_buffer_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure

# mutant: the merged files, with every rewritten rendering wait refused (append `|| true` to the
# `segment.waits == nullptr || prepared == segment.waits->end()` condition), then the test alone

Results

Check Result
Merge onto main Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build (libs and the 12 test executables) OK
16 focused tests (the author's 11, the flip and present tests, and agc_submit_progress_no_timeline), merged tree, validation layer 16 of 16 pass
VUID- lines 0
was not found but was requested by env var VK_INSTANCE_LAYERS Absent
Validation layer loaded in agc_driver_gpu_written_indirect_buffer Yes
agc_driver_gpu_written_indirect_buffer duration 0.89 s
Previous head's Submission.* plus the new test Fails on the 3 s timeout (see Negative control)
Mutant that runs every rewritten rendering wait as copied The new case passes (see Non-blocking 1)
agc_driver_gpu_written_indirect_buffer on the merged tree
1141: [gpu] indirect buffer <addr> (64 dwords) changed since its submission but runs as copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64
1141: GPU-written indirect buffer: indirect buffers run what the dispatch before them wrote
15/16 Test #1141: agc_driver_gpu_written_indirect_buffer .....   Passed    0.89 sec
100% tests passed out of 16
Negative control output
AGC graphics: a rendering wait written into an indirect buffer after its submission waited for the flip after that buffer in the same submission (3000 ms, timed out after 3 s)
0% tests passed, 1 tests failed out of 1

Previous findings

  1. Blocking: a spliced rendering wait waited for its own submission's later flips. Resolved. prepare now runs when the walk reaches indirectSegments[k].start, before any packet at or after it is reserved (Submission.cpp L425-L439). refreshIndirectSegment reads only that segment's set (L302-L308). Spliced nested segments inherit the parent's set (L335), which is sound for two reasons:

    • A splice is refused when the expanded buffer holds a flip or an EOP flip release (L299-L300), so no flip lies between a parent's start and a nested start.
    • noteIndirectSegment only 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.

  2. Non-blocking: CaptureRenderingWait failures are swallowed and renderingWaitTargets is never pruned. Still open, and the cost now scales with the number of segments. The empty catch is now inside prepare (L432-L433), and nothing erases from renderingWaitTargets. 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. RewrittenWaitBeforeOwnFlip checks 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 example segment.waits left empty. One fix: count TicketWait::Wait calls and require two, one from the first submission and one from the rewritten buffer. Another: put a WRITE_DATA marker after the wait in the rewritten buffer and require it to be set.

2. prepare captures every known target once per segment. Each call takes cfg->mutex in VideoOutDriver and allocates a wait for every pair in renderingWaitTargets, 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

  • I did not rebuild or rerun main on this round. The merged tree logs no VUID- lines, so the change cannot add any. My last review found 0 on main b433c40f2f.
  • MXGP 26 (PPSA30839) or any other title. I launched no title.
  • Windows and non-NVIDIA GPUs. The author reports 3 of 3 for the area tests and flip tests at this head on Linux; the validation run against the merge base was still pending in their comment.
  • Real libSceVideoOut behaviour for the new case. The test uses a fake output that tracks tickets the way BufferReuseTracker does.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693270733 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5693270733). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T05:29:14Z. **Review:** APPROVED --- # Re-checked — approved `d93a040aa2` now takes each indirect segment's rendering-wait tickets at that segment's place in the `reserveOutputs` walk, 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 - One new commit, `d93a040aa2` ("take a rewritten indirect buffer's rendering wait tickets at its place in the submission"), on top of `521bbc33c3`. It is not a rebase. - `Submission::preparedWaits` is removed. Each `IndirectSegment` now carries a `shared_ptr<const PreparedWaits>`. `reserveOutputs` fills it when its cursor reaches the segment's `start`, before the packet at that position is reserved. - Segments spliced in from a rewritten buffer inherit the parent's set. Later segments keep their own. - New case `RewrittenWaitBeforeOwnFlip` in `agc_driver_gpu_written_indirect_buffer`, using a ticket-tracking fake `IVideoOutput` whose waits give up after 3 s. - The debt sentence now says the tickets are taken "at the buffer's place". - The author's reply of 2026-10-29 05:18 UTC describes the fix and says the validation-layer comparison was still running. The description's Tested section now has a line for this head. ## What I ran - Head: `d93a040aa2cab45bc2285daf89d807019fd9dc18` - `main`: `52c09d567d2fa453494dd720fcf53a98149468e4` - The head merged onto `main` with no conflicts, in a clean worktree (merge commit `3a74c14c86`). `main` has not changed `Submission.hpp`, `Submission.cpp` or the test since the merge base `46e54cf1f7`. 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). ```sh git fetch origin main pull/11346/head:refs/review/11346 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/11346 git diff --check origin/main...refs/review/11346 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target libs agc_driver_gpu_written_indirect_buffer_tests agc_predication_tests \ agc_driver_submit_progress_tests agc_driver_pm4_tests agc_driver_graphics_tests \ agc_driver_depth_fast_clear_submit_tests agc_driver_dispatch_differing_value_sets_tests \ agc_driver_empty_indirect_skip_tests agc_driver_gds_append_consume_tests \ agc_driver_pipelined_dispatch_tests agc_driver_flip_tests agc_driver_flip_stores_small_results_tests R='^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$|^agc_driver_flip$|^agc_driver_flip_stores_small_results$|^agc_driver_present_mode$|^agc_driver_worker_failure_log$|^agc_driver_flip_compute$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R" -j4 -V --output-on-failure # negative control: Submission.hpp and Submission.cpp from 521bbc33c3, then the test alone git checkout 521bbc33c3f80fbd53e7449ed93d832954812cd8 -- \ core/libs/prx/libSceAgcDriver/Execution/include/Driver/Queues/Submission.hpp \ core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp cmake --build build -j10 --target agc_driver_gpu_written_indirect_buffer_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure # mutant: the merged files, with every rewritten rendering wait refused (append `|| true` to the # `segment.waits == nullptr || prepared == segment.waits->end()` condition), then the test alone ``` ## Results | Check | Result | |---|---| | Merge onto `main` | Clean | | `git diff --check` | Clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build (`libs` and the 12 test executables) | OK | | 16 focused tests (the author's 11, the flip and present tests, and `agc_submit_progress_no_timeline`), merged tree, validation layer | 16 of 16 pass | | `VUID-` lines | 0 | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | Absent | | Validation layer loaded in `agc_driver_gpu_written_indirect_buffer` | Yes | | `agc_driver_gpu_written_indirect_buffer` duration | 0.89 s | | Previous head's `Submission.*` plus the new test | Fails on the 3 s timeout (see Negative control) | | Mutant that runs every rewritten rendering wait as copied | The new case passes (see Non-blocking 1) | <details><summary><code>agc_driver_gpu_written_indirect_buffer</code> on the merged tree</summary> ``` 1141: [gpu] indirect buffer <addr> (64 dwords) changed since its submission but runs as copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64 1141: GPU-written indirect buffer: indirect buffers run what the dispatch before them wrote 15/16 Test #1141: agc_driver_gpu_written_indirect_buffer ..... Passed 0.89 sec 100% tests passed out of 16 ``` </details> <details><summary>Negative control output</summary> ``` AGC graphics: a rendering wait written into an indirect buffer after its submission waited for the flip after that buffer in the same submission (3000 ms, timed out after 3 s) 0% tests passed, 1 tests failed out of 1 ``` </details> ## Previous findings 1. **Blocking: a spliced rendering wait waited for its own submission's later flips.** Resolved. `prepare` now runs when the walk reaches `indirectSegments[k].start`, before any packet at or after it is reserved ([`Submission.cpp` L425-L439](https://github.com/boykopovar/AnyPS5/blob/d93a040aa2cab45bc2285daf89d807019fd9dc18/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L425-L439)). `refreshIndirectSegment` reads only that segment's set ([L302-L308](https://github.com/boykopovar/AnyPS5/blob/d93a040aa2cab45bc2285daf89d807019fd9dc18/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L302-L308)). Spliced nested segments inherit the parent's set ([L335](https://github.com/boykopovar/AnyPS5/blob/d93a040aa2cab45bc2285daf89d807019fd9dc18/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L335)), which is sound for two reasons: - A splice is refused when the expanded buffer holds a flip or an EOP flip release (L299-L300), so no flip lies between a parent's start and a nested start. - `noteIndirectSegment` only 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. 2. **Non-blocking: `CaptureRenderingWait` failures are swallowed and `renderingWaitTargets` is never pruned.** Still open, and the cost now scales with the number of segments. The empty `catch` is now inside `prepare` ([L432-L433](https://github.com/boykopovar/AnyPS5/blob/d93a040aa2cab45bc2285daf89d807019fd9dc18/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L432-L433)), and nothing erases from `renderingWaitTargets`. 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.** `RewrittenWaitBeforeOwnFlip` checks that no wait timed out and that two flips completed ([test L336-L337](https://github.com/boykopovar/AnyPS5/blob/d93a040aa2cab45bc2285daf89d807019fd9dc18/core/libs/prx/libSceAgcDriver/tests/execution/GpuWrittenIndirectBuffer.cpp#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 example `segment.waits` left empty. One fix: count `TicketWait::Wait` calls and require two, one from the first submission and one from the rewritten buffer. Another: put a `WRITE_DATA` marker after the wait in the rewritten buffer and require it to be set. **2. `prepare` captures every known target once per segment.** Each call takes `cfg->mutex` in `VideoOutDriver` and allocates a wait for every pair in `renderingWaitTargets`, all while the driver mutex is held ([L425-L437](https://github.com/boykopovar/AnyPS5/blob/d93a040aa2cab45bc2285daf89d807019fd9dc18/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#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 - I did not rebuild or rerun `main` on this round. The merged tree logs no `VUID-` lines, so the change cannot add any. My last review found 0 on `main` `b433c40f2f`. - MXGP 26 (PPSA30839) or any other title. I launched no title. - Windows and non-NVIDIA GPUs. The author reports 3 of 3 for the area tests and flip tests at this head on Linux; the validation run against the merge base was still pending in their comment. - Real `libSceVideoOut` behaviour for the new case. The test uses a fake output that tracks tickets the way `BufferReuseTracker` does.
MarcZX10 commented 2026-10-29 05:37:27 +00:00 (Migrated from github.com)

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

  • Reviewed exact head d93a040aa2cab45bc2285daf89d807019fd9dc18 against current main 52c09d567d2fa453494dd720fcf53a98149468e4.
  • Ran git merge-tree --write-tree and git diff --check.
  • Ran python3 tools/check_conventions.py --base refs/review/main-20261029c --head refs/review/pr-11346-latest.
  • Checked the exact-head test and validation reports and current hosted checks.

Results

Check Result
Current-main merge preview Clean
git diff --check Passed
Conventions Passed
Focused area and flip tests Author reports 32 tests pass 3 of 3
Validation-layer comparison Author reports 22/22 base and 23/23 head; no missing-layer or VUID- messages
Windows focused run Existing report covers the prior rebased head; no Windows rerun for d93a040aa2 is reported
Hosted checks Windows, eligibility, conventions, labels, and report pass; platform/product jobs are skipped

The 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693327056 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5693327056). Originally posted by [MarcZX10](https://github.com/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 - Reviewed exact head `d93a040aa2cab45bc2285daf89d807019fd9dc18` against current `main` `52c09d567d2fa453494dd720fcf53a98149468e4`. - Ran `git merge-tree --write-tree` and `git diff --check`. - Ran `python3 tools/check_conventions.py --base refs/review/main-20261029c --head refs/review/pr-11346-latest`. - Checked the exact-head test and validation reports and current hosted checks. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | `git diff --check` | Passed | | Conventions | Passed | | Focused area and flip tests | Author reports 32 tests pass 3 of 3 | | Validation-layer comparison | Author reports 22/22 base and 23/23 head; no missing-layer or `VUID-` messages | | Windows focused run | Existing report covers the prior rebased head; no Windows rerun for `d93a040aa2` is reported | | Hosted checks | Windows, eligibility, conventions, labels, and report pass; platform/product jobs are skipped | The 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.
MarcZX10 commented 2026-10-29 08:28:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:28:02Z.

Review: CHANGES_REQUESTED


Re-reviewed exact head d93a040aa2cab45bc2285daf89d807019fd9dc18. The new RewrittenWaitBeforeOwnFlip case does not currently prove the rewritten rendering wait runs: the indirect buffer is first filled with Filler commands, the assertions only require no timeout and two completed flips, and TicketWait::Wait has 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 --check and python3 tools/check_conventions.py --base upstream/main pass. I did not run the GPU test locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694775545 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5694775545). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:28:02Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `d93a040aa2cab45bc2285daf89d807019fd9dc18`. The new `RewrittenWaitBeforeOwnFlip` case does not currently prove the rewritten rendering wait runs: the indirect buffer is first filled with `Filler` commands, the assertions only require no timeout and two completed flips, and `TicketWait::Wait` has 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 --check` and `python3 tools/check_conventions.py --base upstream/main` pass. I did not run the GPU test locally.
MarcZX10 commented 2026-10-29 09:13:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:13:57Z.

Review: CHANGES_REQUESTED


<!-- greyfinch-sync:boykopovar/AnyPS5:review:5695312412 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5695312412). Originally posted by [MarcZX10](https://github.com/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 is aaccd0ba39 (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.
MarcZX10 commented 2026-10-29 09:31:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:31:28Z.

Review: CHANGES_REQUESTED


Re-check — changes requested

The latest head 82f3ada0001a99183ac99761d32657dfb6f9eed2 is now based directly on current main aaccd0ba39b7d40fdbf19664575a7e567d8542f7, 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 for 82f3ada are still pending. Please run agc_driver_gpu_written_indirect_buffer on 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5695524580 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5695524580). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T09:31:28Z. **Review:** CHANGES_REQUESTED --- ## Re-check — changes requested The latest head `82f3ada0001a99183ac99761d32657dfb6f9eed2` is now based directly on current `main` `aaccd0ba39b7d40fdbf19664575a7e567d8542f7`, 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 for `82f3ada` are still pending. Please run `agc_driver_gpu_written_indirect_buffer` on 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.
MarcZX10 commented 2026-10-29 10:55:09 +00:00 (Migrated from github.com)

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 82f3ada0001a99183ac99761d32657dfb6f9eed2 resolves 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 on aaccd0ba39; current upstream main is now d2b15d8802. Since that base, core/libs/prx/libSceAgcDriver/CMakeLists.txt and docs/dev/debt/libSceAgcDriver.md both changed. The current merge preview is clean, but the branch is no longer based on current main. Please update it onto d2b15d8802, 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 and git 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696565518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5696565518). Originally posted by [MarcZX10](https://github.com/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 `82f3ada0001a99183ac99761d32657dfb6f9eed2` resolves 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 on `aaccd0ba39`; current upstream `main` is now `d2b15d8802`. Since that base, `core/libs/prx/libSceAgcDriver/CMakeLists.txt` and `docs/dev/debt/libSceAgcDriver.md` both changed. The current merge preview is clean, but the branch is no longer based on current `main`. Please update it onto `d2b15d8802`, 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 and `git 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.
XairRrR commented 2026-10-29 11:16:08 +00:00 (Migrated from github.com)

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 onto main ba5b5330b3. 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..15a4f95d4d shows the four commits I reviewed unchanged (=). The only new commit is 15a4f95d4d ("test(agc): require the rewritten rendering wait to wait for the ticket at its place"), which changes GpuWrittenIndirectBuffer.cpp only:
    • TicketWait::Wait appends its ticket to Tickets::waited before it waits (test L258-L263).
    • RewrittenWaitBeforeOwnFlip now requires waited == {0, 1} (test L341-L345).
  • The branch was rebased onto main ba5b5330b3. 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 between main and the change. I ran that comparison; it is below.

What I ran

  • Head: 15a4f95d4d54b9e4e33757a9087771c48b2eb307
  • main: ba5b5330b37724bca4b99f30faab504653635a04. The head is based directly on it.
  • Merged tree: 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.
git fetch origin main pull/11346/head:refs/review/11346
git range-diff 46e54cf1f7..d93a040aa2 origin/main..refs/review/11346
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/11346
git diff --check origin/main...refs/review/11346
python3 tools/check_conventions.py --base origin/main

cmake --build build -j10 --target libs agc_driver_gpu_written_indirect_buffer_tests agc_predication_tests \
  agc_driver_submit_progress_tests agc_driver_pm4_tests agc_driver_graphics_tests \
  agc_driver_depth_fast_clear_submit_tests agc_driver_dispatch_differing_value_sets_tests \
  agc_driver_empty_indirect_skip_tests agc_driver_gds_append_consume_tests \
  agc_driver_pipelined_dispatch_tests agc_driver_flip_tests agc_driver_flip_stores_small_results_tests

R='^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$|^agc_driver_flip$|^agc_driver_flip_stores_small_results$|^agc_driver_present_mode$|^agc_driver_worker_failure_log$|^agc_driver_flip_compute$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R" -j4 -V --output-on-failure

# mutant 1: the merged tree with every rewritten rendering wait refused
#   (Submission.cpp L304: append `|| true` to the `segment.waits == nullptr || prepared == segment.waits->end()` condition)
# mutant 2: Submission.hpp and Submission.cpp from 0c975f79c3 (the old placement: waits captured after the walk)
# each: build agc_driver_gpu_written_indirect_buffer_tests, then
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure

# paired arm: the same build targets (without the new test) and the same ctest command on origin/main
git checkout --detach origin/main

Results

Check Result
Merge onto main ba5b5330b3 Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build (libs and the 12 test executables), merged tree and main OK
Focused tests, merged tree, validation layer 16 of 16 pass
Focused tests, main, validation layer 15 of 15 pass (the new test does not exist there)
VUID- lines 0 on main, 0 on the merged tree
was not found but was requested by env var VK_INSTANCE_LAYERS Absent from both logs
Validation layer loaded 15 inserts on main and 17 on the merged tree, including agc_driver_gpu_written_indirect_buffer
agc_driver_gpu_written_indirect_buffer duration 0.92 s
Mutant 1 (rewritten waits refused) Fails: they waited for {0}
Mutant 2 (old ticket placement) Fails on the 3 s timeout
agc_driver_gpu_written_indirect_buffer on the merged tree
1147: [gpu] indirect buffer <addr> (64 dwords) changed since its submission but runs as copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64
1147: GPU-written indirect buffer: indirect buffers run what the dispatch before them wrote
15/16 Test #1147: agc_driver_gpu_written_indirect_buffer .....   Passed    0.92 sec
100% tests passed out of 16
Mutant outputs
# mutant 1: every rewritten rendering wait refused
1/1 Test #1147: agc_driver_gpu_written_indirect_buffer ...***Failed    0.69 sec
AGC graphics: the rendering waits did not wait for the first submission's ticket 0 and then the rewritten wait's ticket 1 of the first flip; they waited for {0}

# mutant 2: Submission.* from 0c975f79c3
1/1 Test #1147: agc_driver_gpu_written_indirect_buffer ...***Failed    3.75 sec
AGC graphics: a rendering wait written into an indirect buffer after its submission waited for the flip after that buffer in the same submission (3000 ms, timed out after 3 s)

Previous findings

  1. Non-blocking: the new case also passed when the rewritten rendering wait never ran. Resolved. In my last review this mutant passed in 0.62 s. With the new assertion, the same mutant fails with 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.
  2. Non-blocking: prepare captures every known target once per segment. Still open. The production code is unchanged (Submission.cpp L423-L436). It is still not blocking, and it is fine as a follow-up.
  3. Non-blocking (from the review before that): CaptureRenderingWait failures are swallowed, and renderingWaitTargets is never pruned. Still open, unchanged (the empty catch at L432-L433 of the same link). Not blocking.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • MXGP 26 (PPSA30839) or any other title. I launched no title.
  • Windows and non-NVIDIA GPUs. The author reports 3 of 3 for the area tests at this head on Linux. Their latest Windows VM run is for 82f3ada000, which has the same diff.
  • Real libSceVideoOut behaviour for RewrittenWaitBeforeOwnFlip. The test uses a fake output.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696798762 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5696798762). Originally posted by [XairRrR](https://github.com/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 onto `main` `ba5b5330b3`. 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..15a4f95d4d` shows the four commits I reviewed unchanged (`=`). The only new commit is `15a4f95d4d` ("test(agc): require the rewritten rendering wait to wait for the ticket at its place"), which changes `GpuWrittenIndirectBuffer.cpp` only: - `TicketWait::Wait` appends its ticket to `Tickets::waited` before it waits ([test L258-L263](https://github.com/boykopovar/AnyPS5/blob/15a4f95d4d54b9e4e33757a9087771c48b2eb307/core/libs/prx/libSceAgcDriver/tests/execution/GpuWrittenIndirectBuffer.cpp#L258-L263)). - `RewrittenWaitBeforeOwnFlip` now requires `waited == {0, 1}` ([test L341-L345](https://github.com/boykopovar/AnyPS5/blob/15a4f95d4d54b9e4e33757a9087771c48b2eb307/core/libs/prx/libSceAgcDriver/tests/execution/GpuWrittenIndirectBuffer.cpp#L341-L345)). - The branch was rebased onto `main` `ba5b5330b3`. The author's [comment of 11:04 UTC](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6494955593) 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 between `main` and the change. I ran that comparison; it is below. ## What I ran - Head: `15a4f95d4d54b9e4e33757a9087771c48b2eb307` - `main`: `ba5b5330b37724bca4b99f30faab504653635a04`. The head is based directly on it. - Merged tree: `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. ```sh git fetch origin main pull/11346/head:refs/review/11346 git range-diff 46e54cf1f7..d93a040aa2 origin/main..refs/review/11346 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/11346 git diff --check origin/main...refs/review/11346 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target libs agc_driver_gpu_written_indirect_buffer_tests agc_predication_tests \ agc_driver_submit_progress_tests agc_driver_pm4_tests agc_driver_graphics_tests \ agc_driver_depth_fast_clear_submit_tests agc_driver_dispatch_differing_value_sets_tests \ agc_driver_empty_indirect_skip_tests agc_driver_gds_append_consume_tests \ agc_driver_pipelined_dispatch_tests agc_driver_flip_tests agc_driver_flip_stores_small_results_tests R='^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$|^agc_driver_flip$|^agc_driver_flip_stores_small_results$|^agc_driver_present_mode$|^agc_driver_worker_failure_log$|^agc_driver_flip_compute$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -R "$R" -j4 -V --output-on-failure # mutant 1: the merged tree with every rewritten rendering wait refused # (Submission.cpp L304: append `|| true` to the `segment.waits == nullptr || prepared == segment.waits->end()` condition) # mutant 2: Submission.hpp and Submission.cpp from 0c975f79c3 (the old placement: waits captured after the walk) # each: build agc_driver_gpu_written_indirect_buffer_tests, then ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure # paired arm: the same build targets (without the new test) and the same ctest command on origin/main git checkout --detach origin/main ``` ## Results | Check | Result | |---|---| | Merge onto `main` `ba5b5330b3` | Clean | | `git diff --check` | Clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build (`libs` and the 12 test executables), merged tree and `main` | OK | | Focused tests, merged tree, validation layer | 16 of 16 pass | | Focused tests, `main`, validation layer | 15 of 15 pass (the new test does not exist there) | | `VUID-` lines | 0 on `main`, 0 on the merged tree | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | Absent from both logs | | Validation layer loaded | 15 inserts on `main` and 17 on the merged tree, including `agc_driver_gpu_written_indirect_buffer` | | `agc_driver_gpu_written_indirect_buffer` duration | 0.92 s | | Mutant 1 (rewritten waits refused) | Fails: `they waited for {0}` | | Mutant 2 (old ticket placement) | Fails on the 3 s timeout | <details><summary><code>agc_driver_gpu_written_indirect_buffer</code> on the merged tree</summary> ``` 1147: [gpu] indirect buffer <addr> (64 dwords) changed since its submission but runs as copied: AGC driver: unsupported PM4 packet type: header 0x00000000 at DWORD 0 of 64 1147: GPU-written indirect buffer: indirect buffers run what the dispatch before them wrote 15/16 Test #1147: agc_driver_gpu_written_indirect_buffer ..... Passed 0.92 sec 100% tests passed out of 16 ``` </details> <details><summary>Mutant outputs</summary> ``` # mutant 1: every rewritten rendering wait refused 1/1 Test #1147: agc_driver_gpu_written_indirect_buffer ...***Failed 0.69 sec AGC graphics: the rendering waits did not wait for the first submission's ticket 0 and then the rewritten wait's ticket 1 of the first flip; they waited for {0} # mutant 2: Submission.* from 0c975f79c3 1/1 Test #1147: agc_driver_gpu_written_indirect_buffer ...***Failed 3.75 sec AGC graphics: a rendering wait written into an indirect buffer after its submission waited for the flip after that buffer in the same submission (3000 ms, timed out after 3 s) ``` </details> ## Previous findings 1. **Non-blocking: the new case also passed when the rewritten rendering wait never ran.** Resolved. In my last review this mutant passed in 0.62 s. With the new assertion, the same mutant fails with `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](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6492647762), which oneandonlydean and MarcZX10 had also asked for. 2. **Non-blocking: `prepare` captures every known target once per segment.** Still open. The production code is unchanged ([`Submission.cpp` L423-L436](https://github.com/boykopovar/AnyPS5/blob/15a4f95d4d54b9e4e33757a9087771c48b2eb307/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L423-L436)). It is still not blocking, and it is fine as a follow-up. 3. **Non-blocking (from the review before that): `CaptureRenderingWait` failures are swallowed, and `renderingWaitTargets` is never pruned.** Still open, unchanged (the empty `catch` at L432-L433 of the same link). Not blocking. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - MXGP 26 (PPSA30839) or any other title. I launched no title. - Windows and non-NVIDIA GPUs. The author reports 3 of 3 for the area tests at this head on Linux. Their latest Windows VM run is for `82f3ada000`, which has the same diff. - Real `libSceVideoOut` behaviour for `RewrittenWaitBeforeOwnFlip`. The test uses a fake output.
MarcZX10 commented 2026-10-29 11:22:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:22:58Z.

Review: APPROVED


Re-reviewed exact head 15a4f95d4d54b9e4e33757a9087771c48b2eb307, directly based on current main ba5b5330b37724bca4b99f30faab504653635a04. The new report closes my outstanding request: with VK_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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696874121 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5696874121). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T11:22:58Z. **Review:** APPROVED --- Re-reviewed exact head `15a4f95d4d54b9e4e33757a9087771c48b2eb307`, directly based on current `main` `ba5b5330b37724bca4b99f30faab504653635a04`. The new report closes my outstanding request: with `VK_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.
XairRrR commented 2026-11-02 20:16:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T20:16:10Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The new commit b11a1c2c63 limits the re-read to buffers that queued GPU work still touches, adds CpuRewriteAfterSubmit and 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 where main loads, 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".
    • refreshIndirectSegment now returns early unless at least one of these holds: the draw pipeline overlaps the range, the draw finisher has pending work over it, or Recorder::PendingWriterSerial(address, bytes) is non-zero (Submission.cpp L275-L284).
    • New test case CpuRewriteAfterSubmit (conditional and direct): a CPU rewrite after submit, behind a gate, must run as copied. NestedRewrite, InvalidRewrite and RewrittenWaitBeforeOwnFlip now have a dispatch earlier in the same submission fill the buffer, instead of a CPU rewrite behind a gate.
    • The debt entry is reworded to match ("only while queued GPU work writes its range"; a CPU rewrite behind a WAIT_REG_MEM runs as copied).
  • Discussion since then:
    • mrfelek's runs (2026-10-30 to 2026-11-02) show the Hot Wheels hang on 15a4f95d4d, and the same hang on b11a1c2c63.
    • mrfelek's 19:06 packet trace shows that the re-read buffer is GPU-filled (an Unreal shader-bundle list). Both mrfelek and oneandonlydean then withdrew the reads-vs-writes explanation.
    • The hang was traced to a compute loop at pc 0x54 that runs only once the generated list runs. The author added the "not for merge yet" note to the description.
    • The NVIDIA CI reported a new VUID-vkCmdCopyBuffer-commonparent in agc_driver_depth_clear_hle (report). The author and mrfelek did not reproduce it.

What I ran

Head b11a1c2c63d65abb9b64cc1687e56132458a960a, main 096c45570f516de76a43bbe1b97781381c84f55f, merged tree d2102d3f88ca302db4c68c24d44f7c46038be6ae. Release, GCC 14.2.0, Ninja, Debian 13 VM, lavapipe (Mesa 26.1.6).

git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...b11a1c2c63d65abb9b64cc1687e56132458a960a
python3 tools/check_conventions.py --base 096c45570f516de76a43bbe1b97781381c84f55f
ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' -V
ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --repeat until-fail:3

# negative control A: merged tree, Submission.cpp with only b11a1c2c63's eligibility check reverted
ninja -C build -j32 -l32 agc_driver_gpu_written_indirect_buffer_tests
ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure
# negative control B: Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp from main
ninja -C build -j32 -l32 agc_driver_gpu_written_indirect_buffer_tests
ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure

# temporary probes in the test file (not kept), merged production files, 3 runs each:
#  1. dispatch fills the buffer, then WRITE_DATA label + WAIT_REG_MEM on it, then the COND_INDIRECT_BUFFER
#  2. gated submission 1: dispatch fills the buffer + WRITE_DATA label;
#     submission 2 (queued behind it): WAIT_REG_MEM label, COND_INDIRECT_BUFFER

ninja -C build -j32 -l32 agc_driver_depth_clear_hle_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R '^agc_driver_gpu_written_indirect_buffer$|^agc_driver_depth_clear_hle$'
git status --porcelain
Check Result
git diff --check Clean
Conventions All conventions checks passed.
Script build and tests (build.json) Build OK; 2094 run, no new failures, no timeouts; 7 known failures from main; 2 main_sync_renames_* tests fixed
agc_driver_gpu_written_indirect_buffer, merged tree Passes, 4 of 4 (0.22–0.44 s); logs the runs as copied line for the zero-header case
Negative control A (new check reverted) Fails: 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
Negative control B (main's production files) Fails: 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, ...
Probe 1 and probe 2 (GPU writer completed or in an earlier submission before the buffer is reached) Pass 3 of 3 each: the buffer is still re-read
Validation layer, PR side only Both tests pass; layer loaded (8 insert lines); 0 VUID-; no was not found but was requested
Worktree after the controls Back to the merged tree (git status --porcelain empty)

The script's paired validation comparison was skipped (no main baseline yet), and I did not run the main side. On lavapipe, agc_driver_depth_clear_hle shows no VUID-vkCmdCopyBuffer-commonparent with this PR, which agrees with the author's and mrfelek's NVIDIA reruns.

Previous findings

  1. Rewritten-wait observability ({0, 1}): Resolved in my last review. Still holds: RewrittenWaitBeforeOwnFlip keeps the {0, 1} assertion and passes.
  2. Non-blocking: prepare captures every known target once per segment: Still open, unchanged (Submission.cpp L433-L446). Fine as a follow-up.
  3. Non-blocking: CaptureRenderingWait failures are swallowed, and renderingWaitTargets is never pruned: Still open, unchanged (the empty catch at L440-L441 of the same file). Not blocking.

New findings

Blocking

  1. 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:

    • On main ba5b5330b3 the garage loads (with a black 3D scene).
    • On b11a1c2c63 the garage load hangs until the title's 120 s render-thread watchdog fires.
    • With APS5_LOOP_GUARD=1048576 it draws, with corrupted areas (guard run, main comparison).

    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

  1. The eligibility check also fires on address-based reads, which the debt entry does not say.
    • PendingWriterSerial counts 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.
    • Keeping it is reasonable: as discussed on 2026-11-01, address-based stores are recorded only as address-based reads, and dropping them would reopen the case this PR fixes.
    • The debt entry, though, says the buffer is read again "only while queued GPU work writes its range" (debt L168), and no test pins either side of this.
    • Suggested fix: add one sentence to the entry saying that an outstanding address-based reader of the range also triggers the re-read, since address-based stores are noted only as reads.

Not verified

  • PPSA22408 and MXGP 26 (PPSA30839): I launched no title. The Hot Wheels hang and the MXGP benefit are as reported by mrfelek and the author. The author says MXGP 26 has not been brought back to the GPU-built path on this head.
  • A writer batch that is reaped (its writes synced and its range no longer listed) before execution reaches the buffer: in that case the new check would leave the buffer as copied. My two probes, with the writer earlier in the same submission or in a gated earlier submission, still triggered the re-read, so I could not construct this case.
  • The paired main vs 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

  • Resolve the PPSA22408 hang that this head exposes: either land the fix it depends on first and list it under Depends on, or show the garage loading without the loop guard on this head.
  • Optionally, add the address-based-reader sentence to the debt entry.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742735134 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5742735134). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T20:16:10Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The new commit `b11a1c2c63` limits the re-read to buffers that queued GPU work still touches, adds `CpuRewriteAfterSubmit` and 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 where `main` loads, 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". - `refreshIndirectSegment` now returns early unless at least one of these holds: the draw pipeline overlaps the range, the draw finisher has pending work over it, or `Recorder::PendingWriterSerial(address, bytes)` is non-zero ([Submission.cpp L275-L284](https://github.com/boykopovar/AnyPS5/blob/b11a1c2c63d65abb9b64cc1687e56132458a960a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L275-L284)). - New test case `CpuRewriteAfterSubmit` (conditional and direct): a CPU rewrite after submit, behind a gate, must run as copied. `NestedRewrite`, `InvalidRewrite` and `RewrittenWaitBeforeOwnFlip` now have a dispatch earlier in the same submission fill the buffer, instead of a CPU rewrite behind a gate. - The debt entry is reworded to match ("only while queued GPU work writes its range"; a CPU rewrite behind a `WAIT_REG_MEM` runs as copied). - Discussion since then: - mrfelek's runs (2026-10-30 to 2026-11-02) show the Hot Wheels hang on `15a4f95d4d`, and the same hang on `b11a1c2c63`. - mrfelek's 19:06 packet trace shows that the re-read buffer is GPU-filled (an Unreal shader-bundle list). Both mrfelek and oneandonlydean then withdrew the reads-vs-writes explanation. - The hang was traced to a compute loop at pc `0x54` that runs only once the generated list runs. The author added the "not for merge yet" note to the description. - The NVIDIA CI reported a new `VUID-vkCmdCopyBuffer-commonparent` in `agc_driver_depth_clear_hle` ([report](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6561349662)). The author and mrfelek did not reproduce it. ## What I ran Head `b11a1c2c63d65abb9b64cc1687e56132458a960a`, `main` `096c45570f516de76a43bbe1b97781381c84f55f`, merged tree `d2102d3f88ca302db4c68c24d44f7c46038be6ae`. Release, GCC 14.2.0, Ninja, Debian 13 VM, lavapipe (Mesa 26.1.6). ```sh git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...b11a1c2c63d65abb9b64cc1687e56132458a960a python3 tools/check_conventions.py --base 096c45570f516de76a43bbe1b97781381c84f55f ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' -V ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --repeat until-fail:3 # negative control A: merged tree, Submission.cpp with only b11a1c2c63's eligibility check reverted ninja -C build -j32 -l32 agc_driver_gpu_written_indirect_buffer_tests ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure # negative control B: Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp from main ninja -C build -j32 -l32 agc_driver_gpu_written_indirect_buffer_tests ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure # temporary probes in the test file (not kept), merged production files, 3 runs each: # 1. dispatch fills the buffer, then WRITE_DATA label + WAIT_REG_MEM on it, then the COND_INDIRECT_BUFFER # 2. gated submission 1: dispatch fills the buffer + WRITE_DATA label; # submission 2 (queued behind it): WAIT_REG_MEM label, COND_INDIRECT_BUFFER ninja -C build -j32 -l32 agc_driver_depth_clear_hle_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R '^agc_driver_gpu_written_indirect_buffer$|^agc_driver_depth_clear_hle$' git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | Conventions | `All conventions checks passed.` | | Script build and tests (build.json) | Build OK; 2094 run, no new failures, no timeouts; 7 known failures from `main`; 2 `main_sync_renames_*` tests fixed | | `agc_driver_gpu_written_indirect_buffer`, merged tree | Passes, 4 of 4 (0.22–0.44 s); logs the `runs as copied` line for the zero-header case | | Negative control A (new check reverted) | Fails: `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` | | Negative control B (`main`'s production files) | Fails: `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, ...` | | Probe 1 and probe 2 (GPU writer completed or in an earlier submission before the buffer is reached) | Pass 3 of 3 each: the buffer is still re-read | | Validation layer, PR side only | Both tests pass; layer loaded (8 insert lines); 0 `VUID-`; no `was not found but was requested` | | Worktree after the controls | Back to the merged tree (`git status --porcelain` empty) | The script's paired validation comparison was skipped (no `main` baseline yet), and I did not run the `main` side. On lavapipe, `agc_driver_depth_clear_hle` shows no `VUID-vkCmdCopyBuffer-commonparent` with this PR, which agrees with the author's and mrfelek's NVIDIA reruns. ## Previous findings 1. **Rewritten-wait observability (`{0, 1}`):** Resolved in my last review. Still holds: `RewrittenWaitBeforeOwnFlip` keeps the `{0, 1}` assertion and passes. 2. **Non-blocking: `prepare` captures every known target once per segment:** Still open, unchanged ([Submission.cpp L433-L446](https://github.com/boykopovar/AnyPS5/blob/b11a1c2c63d65abb9b64cc1687e56132458a960a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L433-L446)). Fine as a follow-up. 3. **Non-blocking: `CaptureRenderingWait` failures are swallowed, and `renderingWaitTargets` is never pruned:** Still open, unchanged (the empty `catch` at L440-L441 of the same file). Not blocking. ## New findings ### Blocking 1. **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: - On `main` `ba5b5330b3` the garage loads (with a black 3D scene). - On `b11a1c2c63` the garage load hangs until the title's 120 s render-thread watchdog fires. - With `APS5_LOOP_GUARD=1048576` it draws, with corrupted areas ([guard run](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6563633169), [`main` comparison](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6565460931)). 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 1. **The eligibility check also fires on address-based reads, which the debt entry does not say.** - `PendingWriterSerial` counts a batch that only reads the range address-based as a writer ([Recorder.cpp L3318-L3327](https://github.com/boykopovar/AnyPS5/blob/096c45570f516de76a43bbe1b97781381c84f55f/core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp#L3318-L3327)). So a buffer rewritten only by the CPU is still re-read when such a reader is outstanding. - Keeping it is reasonable: as discussed on 2026-11-01, address-based stores are recorded only as address-based reads, and dropping them would reopen the case this PR fixes. - The debt entry, though, says the buffer is read again "only while queued GPU work writes its range" ([debt L168](https://github.com/boykopovar/AnyPS5/blob/b11a1c2c63d65abb9b64cc1687e56132458a960a/docs/dev/debt/libSceAgcDriver.md#L168)), and no test pins either side of this. - Suggested fix: add one sentence to the entry saying that an outstanding address-based reader of the range also triggers the re-read, since address-based stores are noted only as reads. ## Not verified - PPSA22408 and MXGP 26 (PPSA30839): I launched no title. The Hot Wheels hang and the MXGP benefit are as reported by mrfelek and the author. The author says MXGP 26 has not been brought back to the GPU-built path on this head. - A writer batch that is reaped (its writes synced and its range no longer listed) before execution reaches the buffer: in that case the new check would leave the buffer as copied. My two probes, with the writer earlier in the same submission or in a gated earlier submission, still triggered the re-read, so I could not construct this case. - The paired `main` vs 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 - Resolve the PPSA22408 hang that this head exposes: either land the fix it depends on first and list it under `Depends on`, or show the garage loading without the loop guard on this head. - Optionally, add the address-based-reader sentence to the debt entry. <!-- anyps5-bots job=1905 head=b11a1c2c63d65abb9b64cc1687e56132458a960a -->
XairRrR commented 2026-11-02 20:40:18 +00:00 (Migrated from github.com)

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 in docs/dev/debt/libSceAgcDriver.md and no code or tests.
  • The author replied on 2026-11-02 20:18. They agree with the blocking point: the head stays not for merge until either the fix for pass 2's lost entry-table writes lands first and is listed under Depends on, or the garage loads on this head without the loop guard.
  • The description still has the "not for merge yet" note. Depends on still says none.

What I ran

Head 55ad5b541c088e6fde9ec25ba55d99facf66bbf3, main 9090972b7e91fd266819cbd77a8b058e177b5682, merged tree df6f6a11f4b4babd32880ae56605b132e3d757c0. Release, GCC 14.2.0, Ninja, Debian 13 VM, lavapipe (Mesa 26.1.6).

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...55ad5b541c088e6fde9ec25ba55d99facf66bbf3
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
git diff b11a1c2c63d65abb9b64cc1687e56132458a960a 55ad5b541c088e6fde9ec25ba55d99facf66bbf3 --stat
ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure
git status --porcelain
Check Result
git diff --check Clean
Conventions Passes (0 errors). One warning: [debt-length] Technical debt entry over 1000 characters ... 1124 characters (see below)
Delta since b11a1c2c63 docs/dev/debt/libSceAgcDriver.md only, 1 line changed
Script build and tests (build.json) Build OK. 2040 tests run: no new failures, no timeouts. The 7 known failures also fail on main.
Script validation comparison (build.json) 758 tests run, layer loaded in 757 and missing in none, 0 tests with a new VUID-
agc_driver_gpu_written_indirect_buffer, merged tree Passes (0.38 s)

Negative 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

  1. Blocking: as reported, PPSA22408 (Hot Wheels Infinite Rush) hangs at the garage load on this head, while it loads on 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.
  2. Non-blocking: the debt entry did not say that address-based readers also trigger the re-read. Resolved. The entry at debt L168 now says "Queued work that reads the range address-based also counts, because address-based stores are noted only as reads."
  3. Non-blocking: prepare captures every known target once per segment. Still open, unchanged. Fine as a follow-up.
  4. Non-blocking: CaptureRenderingWait failures are swallowed, and renderingWaitTargets is never pruned. Still open, unchanged. Not blocking.

New findings

Blocking

None.

Non-blocking

  1. The indirect-buffer debt entry is now over the checker's length limit. With the added sentence, tools/check_conventions.py warns 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

  • PPSA22408 and MXGP 26 (PPSA30839): I did not launch any title. The hang and the benefit are as reported by mrfelek and the author.
  • Windows and non-lavapipe GPUs.

To get this to a good state

  • Resolve the PPSA22408 hang, as the author's own plan says: either land the fix for the lost entry-table writes first and list it under Depends on, or show the garage loading on this head without APS5_LOOP_GUARD.
  • Optionally, trim the debt entry below the checker's 1000-character limit.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743014241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5743014241). Originally posted by [XairRrR](https://github.com/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 in `docs/dev/debt/libSceAgcDriver.md` and no code or tests. - The author replied on 2026-11-02 20:18. They agree with the blocking point: the head stays not for merge until either the fix for pass 2's lost entry-table writes lands first and is listed under Depends on, or the garage loads on this head without the loop guard. - The description still has the "not for merge yet" note. `Depends on` still says `none`. ## What I ran Head `55ad5b541c088e6fde9ec25ba55d99facf66bbf3`, `main` `9090972b7e91fd266819cbd77a8b058e177b5682`, merged tree `df6f6a11f4b4babd32880ae56605b132e3d757c0`. Release, GCC 14.2.0, Ninja, Debian 13 VM, lavapipe (Mesa 26.1.6). ```sh git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...55ad5b541c088e6fde9ec25ba55d99facf66bbf3 python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 git diff b11a1c2c63d65abb9b64cc1687e56132458a960a 55ad5b541c088e6fde9ec25ba55d99facf66bbf3 --stat ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | Conventions | Passes (0 errors). One warning: `[debt-length] Technical debt entry over 1000 characters ... 1124 characters` (see below) | | Delta since `b11a1c2c63` | `docs/dev/debt/libSceAgcDriver.md` only, 1 line changed | | Script build and tests (build.json) | Build OK. 2040 tests run: no new failures, no timeouts. The 7 known failures also fail on `main`. | | Script validation comparison (build.json) | 758 tests run, layer loaded in 757 and missing in none, 0 tests with a new `VUID-` | | `agc_driver_gpu_written_indirect_buffer`, merged tree | Passes (0.38 s) | **Negative 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 1. **Blocking: as reported, PPSA22408 (Hot Wheels Infinite Rush) hangs at the garage load on this head, while it loads on `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. 2. **Non-blocking: the debt entry did not say that address-based readers also trigger the re-read.** Resolved. The entry at [debt L168](https://github.com/boykopovar/AnyPS5/blob/55ad5b541c088e6fde9ec25ba55d99facf66bbf3/docs/dev/debt/libSceAgcDriver.md#L168) now says "Queued work that reads the range address-based also counts, because address-based stores are noted only as reads." 3. **Non-blocking: `prepare` captures every known target once per segment.** Still open, unchanged. Fine as a follow-up. 4. **Non-blocking: `CaptureRenderingWait` failures are swallowed, and `renderingWaitTargets` is never pruned.** Still open, unchanged. Not blocking. ## New findings ### Blocking None. ### Non-blocking 1. **The indirect-buffer debt entry is now over the checker's length limit.** With the added sentence, `tools/check_conventions.py` warns 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 - PPSA22408 and MXGP 26 (PPSA30839): I did not launch any title. The hang and the benefit are as reported by mrfelek and the author. - Windows and non-lavapipe GPUs. ## To get this to a good state - Resolve the PPSA22408 hang, as the author's own plan says: either land the fix for the lost entry-table writes first and list it under `Depends on`, or show the garage loading on this head without `APS5_LOOP_GUARD`. - Optionally, trim the debt entry below the checker's 1000-character limit. <!-- anyps5-bots job=2413 head=55ad5b541c088e6fde9ec25ba55d99facf66bbf3 -->
XairRrR commented 2026-11-03 11:26:05 +00:00 (Migrated from github.com)

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_BUFFER is 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

  • Commits: none. The head is still 55ad5b541c, and all seven commits are unchanged (= in the range-diff). Only main moved, to 4f41f4c375.
  • mrfelek's diagnosis (2026-11-03 11:13). There is no lost entry-table write. copySegment flattens a COND_INDIRECT_BUFFER like a call: after the target, it goes on copying the packets that follow the branch.
    • Hot Wheels leaves its GPU-built list through another COND_INDIRECT_BUFFER that 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 pc 0x54.
    • With the branch treated as a jump, the loop guard trips 0 times on both GPUs, and the 3D scene is black, as on main.
    • A separate storage-image write-back fix then makes the garage render.
  • Author's reply (11:14). The author agrees that the jump change goes in mrfelek's own PR, "with this one as its base", and that it may change this PR's tests.
  • The description still has "Not for merge until that loop is understood", and Depends on: none.

What I ran

  • Head 55ad5b541c088e6fde9ec25ba55d99facf66bbf3, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 32e9a885142ef4fbaf827f28087dc4a55bf045c7.
  • Release build with GCC 14.2.0 and Ninja, on a Debian 13 VM with lavapipe (Mesa 26.1.6).
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...55ad5b541c088e6fde9ec25ba55d99facf66bbf3
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$|^agc_driver_gpu_written_indirect_buffer$'
# main's versions of Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:<path> > <path>
ninja -C build agc_driver_native_multisample_depth_tests
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$'
# merged files restored, rebuilt
git show 32e9a885142ef4fbaf827f28087dc4a55bf045c7:<path> > <path>
ninja -C build agc_driver_native_multisample_depth_tests agc_driver_gpu_written_indirect_buffer_tests
ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure
git status --porcelain
Check Result
git diff --check Clean
Conventions 0 errors. The same debt-length warning as before (1124 characters)
Script build and tests (build.json) Build OK. 2171 tests run: no new failures, no timeouts. The 7 known failures also fail on main.
Script validation comparison Layer loaded in 770 of 771 tests, missing in none. One test with a "new" VUID-: agc_driver_native_depth_uniform_planes, which was not in the older baseline.
That VUID-, checked directly VUID-vkCmdDispatch-groupCountX-00386 ×4 on the merged tree, and the same ×4 with main's production files. It comes from main, not this PR.
agc_driver_gpu_written_indirect_buffer, merged tree Passes (0.40 s with the validation layer on, no VUID- messages)
Worktree after restoring Clean (git status --porcelain is 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

  1. Blocking: PPSA22408 hangs at the garage load on this head (as reported), while it loads on main. Still open.
    • mrfelek's new runs explain the hang. copySegment runs a COND_INDIRECT_BUFFER as a call, which re-runs the frame's continuation. That behaviour is already on main, but it only becomes harmful once this PR runs the GPU-built list instead of its NOPs.
    • The agreed fix goes in a PR based on this one. If this PR merges first, main goes from "garage loads, 3D black" to "garage hangs" until that PR lands.
    • Neither condition from the last round is met: no dependency is listed, and there is no garage run without the loop guard on this head.
  2. Non-blocking: the debt entry did not say that address-based readers also trigger the re-read. Resolved in my last review, and it stays resolved.
  3. Non-blocking: prepare captures every known target once per segment. Still open, unchanged.
  4. Non-blocking: CaptureRenderingWait failures are swallowed, and renderingWaitTargets is never pruned. Still open, unchanged.
  5. Non-blocking: the debt entry is over the checker's 1000-character limit (1124). Still open: the conventions check warns again on this merge.

New findings

Blocking

None. The open blocker is finding 1 above.

Non-blocking

  1. This PR's tests assume the call behaviour of COND_INDIRECT_BUFFER that the new diagnosis questions.
    • Two checks require the packet after a COND_INDIRECT_BUFFER to run:
    • Both pin the call behaviour of Submission.cpp L214-L224 more firmly than main does.
    • Why it matters: the jump change mrfelek plans will have to rewrite these checks. Merging them now adds weight to a behaviour that is now in doubt.
    • Suggested fix: have these cases check what they are about, the rewritten contents running or not, without depending on the packet after the branch. For example, call the branch from a small buffer run by an INDIRECT_BUFFER, as mrfelek did locally. Or wait for the semantics change and adapt then.

Not verified

  • PPSA22408 and MXGP 26 (PPSA30839): I launched no title. The diagnosis and the "branch as jump" results are as mrfelek reported them.
  • What the CP actually does after a 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.
  • Windows and GPUs other than lavapipe.

To get this to a good state

  • Fix the order of the two changes so that main never runs the GPU-built list with the duplicated continuation. Either:

    • land the COND_INDIRECT_BUFFER jump fix first, on main (it changes code that is already there), and list it under Depends on; or
    • bring that fix into this PR.

    Then show a PPSA22408 garage run on the resulting tree without APS5_LOOP_GUARD that is no worse than main (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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5751316793 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5751316793). Originally posted by [XairRrR](https://github.com/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_BUFFER` is 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 - **Commits:** none. The head is still `55ad5b541c`, and all seven commits are unchanged (`=` in the range-diff). Only `main` moved, to `4f41f4c375`. - **mrfelek's diagnosis (2026-11-03 11:13).** There is no lost entry-table write. `copySegment` flattens a `COND_INDIRECT_BUFFER` like a call: after the target, it goes on copying the packets that follow the branch. - Hot Wheels leaves its GPU-built list through another `COND_INDIRECT_BUFFER` that 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 pc `0x54`. - With the branch treated as a jump, the loop guard trips 0 times on both GPUs, and the 3D scene is black, as on `main`. - A separate storage-image write-back fix then makes the garage render. - **Author's reply (11:14).** The author agrees that the jump change goes in mrfelek's own PR, "with this one as its base", and that it may change this PR's tests. - The description still has "Not for merge until that loop is understood", and `Depends on: none`. ## What I ran - Head `55ad5b541c088e6fde9ec25ba55d99facf66bbf3`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `32e9a885142ef4fbaf827f28087dc4a55bf045c7`. - Release build with GCC 14.2.0 and Ninja, on a Debian 13 VM with lavapipe (Mesa 26.1.6). ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...55ad5b541c088e6fde9ec25ba55d99facf66bbf3 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$|^agc_driver_gpu_written_indirect_buffer$' # main's versions of Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp git show 4f41f4c375f5abb487dbd184fbc150f31994d762:<path> > <path> ninja -C build agc_driver_native_multisample_depth_tests env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$' # merged files restored, rebuilt git show 32e9a885142ef4fbaf827f28087dc4a55bf045c7:<path> > <path> ninja -C build agc_driver_native_multisample_depth_tests agc_driver_gpu_written_indirect_buffer_tests ctest --test-dir build -R '^agc_driver_gpu_written_indirect_buffer$' --output-on-failure git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | Conventions | 0 errors. The same `debt-length` warning as before (1124 characters) | | Script build and tests (build.json) | Build OK. 2171 tests run: no new failures, no timeouts. The 7 known failures also fail on `main`. | | Script validation comparison | Layer loaded in 770 of 771 tests, missing in none. One test with a "new" `VUID-`: `agc_driver_native_depth_uniform_planes`, which was not in the older baseline. | | That `VUID-`, checked directly | `VUID-vkCmdDispatch-groupCountX-00386` ×4 on the merged tree, and the same ×4 with `main`'s production files. It comes from `main`, not this PR. | | `agc_driver_gpu_written_indirect_buffer`, merged tree | Passes (0.40 s with the validation layer on, no `VUID-` messages) | | Worktree after restoring | Clean (`git status --porcelain` is 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 1. **Blocking: PPSA22408 hangs at the garage load on this head (as reported), while it loads on `main`.** Still open. - mrfelek's new runs explain the hang. `copySegment` runs a `COND_INDIRECT_BUFFER` as a call, which re-runs the frame's continuation. That behaviour is already on `main`, but it only becomes harmful once this PR runs the GPU-built list instead of its NOPs. - The agreed fix goes in a PR based on this one. If this PR merges first, `main` goes from "garage loads, 3D black" to "garage hangs" until that PR lands. - Neither condition from the last round is met: no dependency is listed, and there is no garage run without the loop guard on this head. 2. **Non-blocking: the debt entry did not say that address-based readers also trigger the re-read.** Resolved in my last review, and it stays resolved. 3. **Non-blocking: `prepare` captures every known target once per segment.** Still open, unchanged. 4. **Non-blocking: `CaptureRenderingWait` failures are swallowed, and `renderingWaitTargets` is never pruned.** Still open, unchanged. 5. **Non-blocking: the debt entry is over the checker's 1000-character limit (1124).** Still open: the conventions check warns again on this merge. ## New findings ### Blocking None. The open blocker is finding 1 above. ### Non-blocking 1. **This PR's tests assume the call behaviour of `COND_INDIRECT_BUFFER` that the new diagnosis questions.** - Two checks require the packet after a `COND_INDIRECT_BUFFER` to run: - `InvalidRewrite`, [GpuWrittenIndirectBuffer.cpp L204](https://github.com/boykopovar/AnyPS5/blob/55ad5b541c088e6fde9ec25ba55d99facf66bbf3/core/libs/prx/libSceAgcDriver/tests/execution/GpuWrittenIndirectBuffer.cpp#L204-L204); - `CpuRewriteAfterSubmit(block, true)`, [L233](https://github.com/boykopovar/AnyPS5/blob/55ad5b541c088e6fde9ec25ba55d99facf66bbf3/core/libs/prx/libSceAgcDriver/tests/execution/GpuWrittenIndirectBuffer.cpp#L233-L233). - Both pin the call behaviour of [Submission.cpp L214-L224](https://github.com/boykopovar/AnyPS5/blob/55ad5b541c088e6fde9ec25ba55d99facf66bbf3/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L214-L224) more firmly than `main` does. - **Why it matters:** the jump change mrfelek plans will have to rewrite these checks. Merging them now adds weight to a behaviour that is now in doubt. - **Suggested fix:** have these cases check what they are about, the rewritten contents running or not, without depending on the packet after the branch. For example, call the branch from a small buffer run by an `INDIRECT_BUFFER`, as mrfelek did locally. Or wait for the semantics change and adapt then. ## Not verified - PPSA22408 and MXGP 26 (PPSA30839): I launched no title. The diagnosis and the "branch as jump" results are as mrfelek reported them. - What the CP actually does after a `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. - Windows and GPUs other than lavapipe. ## To get this to a good state - Fix the order of the two changes so that `main` never runs the GPU-built list with the duplicated continuation. Either: - land the `COND_INDIRECT_BUFFER` jump fix first, on `main` (it changes code that is already there), and list it under `Depends on`; or - bring that fix into this PR. Then show a PPSA22408 garage run on the resulting tree without `APS5_LOOP_GUARD` that is no worse than `main` (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. <!-- anyps5-bots job=3307 head=55ad5b541c088e6fde9ec25ba55d99facf66bbf3 -->
XairRrR commented 2026-11-03 17:14:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T17:14:37Z.

Review: APPROVED


Re-checked — approved

The new commit ddb59eefaf adds mrfelek's change: a taken COND_INDIRECT_BUFFER now replaces the rest of its buffer. Its tests now reach the branch through an INDIRECT_BUFFER call. 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

  • One new commit, ddb59eefaf (co-authored by mrfelek). Commits 1–7 are unchanged (= in the range-diff).
    • In copySegment, a COND_INDIRECT_BUFFER outside a COND_EXEC range now does return false once it has inlined its target. The packets after it in the same buffer are no longer copied (Submission.cpp L214-L226).
    • testBranchSubmission now 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) and RewrittenWaitBeforeOwnFlip now reach their branch through CalledBranch, a small buffer run by an INDIRECT_BUFFER.
    • The COND_INDIRECT_BUFFER debt entry now says the branch does not return, and that this is unverified on hardware.
  • Description: "Not for merge" is gone, Depends on: #15465 is listed, and the PPSA22408 story is updated.
  • Discussion: mrfelek reports a garage run on 55ad5b541c plus the same jump diff (the folded commit differs only in comments that were removed), without APS5_LOOP_GUARD:
    • with #15465: the garage loads and the 3D scene is black, as on main;
    • without #15465: 2 of 2 runs abort on runtime resource snapshot did not stabilize.

What I ran

Head ddb59eefaf7728b983274cac47f7d25e3aa640fc, main 1e658521a0a599872612bb91949311e2956b5283, merged tree 5740244de3bfc34a4c20bf44e0a7d2a1e99626c4. Release build with GCC 14.2.0 and Ninja, on a Debian 13 VM with lavapipe (Mesa 26.1.6).

git diff --check 1e658521a0a599872612bb91949311e2956b5283...ddb59eefaf7728b983274cac47f7d25e3aa640fc
python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283
ctest --test-dir build --output-on-failure -j8 --test-load 32 -R "^agc_driver_pm4|^agc_driver_gpu_written_indirect_buffer$"
# control 1: delete only `if (guarded.empty()) return false;` in Submission.cpp
ninja -C build tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$"
# control 2: main's Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp
git show 1e658521a0a599872612bb91949311e2956b5283:<path> > <path>
ninja -C build tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$"
# restore the merged files
git show 5740244de3bfc34a4c20bf44e0a7d2a1e99626c4:<path> > <path>
ninja -C build tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$"
git status --porcelain
Check Result
git diff --check Clean
Conventions 0 errors. The same debt-length warning as before (indirect-buffer entry, 1124 characters)
Script build and tests (build.json) Build OK. 2162 tests run: no new failures, no timeouts. The 7 known failures also fail on main.
Script validation comparison Layer loaded in 772 of 773 tests, missing in none. No tests with a new VUID-.
^agc_driver_pm4… and agc_driver_gpu_written_indirect_buffer, merged tree 17 of 17 pass
The two changed tests, run with the validation layer 2 of 2 pass. 0 VUID- lines, and no was not found but was requested line
Worktree after restoring Clean

Negative control

Tree agc_driver_pm4 agc_driver_gpu_written_indirect_buffer
Merged passes passes
Only the new return false removed fails: the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call passes (its cases no longer depend on the packet after a branch, as mrfelek said)
All five production files from main fails (same message) fails: a COND_INDIRECT_BUFFER ran the command buffer as it was at submission … the marker is 0

Previous findings

  1. Blocking: merging this PR would turn the PPSA22408 black garage into a hang. Resolved.
    • The jump fix is now in this PR, so main never runs the GPU-built list with a duplicated continuation.
    • The garage run without the loop guard comes from mrfelek, on code that matches this head. It loads, no worse than main, provided #15465 is applied. That dependency is declared under Depends on.
    • Both are author-reported. A run on the exact pushed head is still announced.
  2. Non-blocking: the debt entry did not say that address-based readers also trigger the re-read. Stays resolved.
  3. Non-blocking: prepare captures every known target once per segment (Submission.cpp L434-L445). Still open, unchanged.
  4. Non-blocking: CaptureRenderingWait failures are swallowed in prepare, and renderingWaitTargets is never pruned. Still open, unchanged.
  5. Non-blocking: the indirect-buffer debt entry is over the checker's 1000-character limit. Still open: 1124 characters, and the warning shows again on this merge.
  6. Non-blocking: two test checks pinned the call behaviour of COND_INDIRECT_BUFFER. Resolved. InvalidRewrite and CpuRewriteAfterSubmit(…, true) now call the branch through CalledBranch, and the remaining top-level branches don't check the packet after them.

New findings

Blocking

None.

Non-blocking

  1. An empty taken branch still returns.
    • Where: Submission.cpp L214-L226. The early return sits inside 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.
    • Why it matters: the debt entry now says "the branch does not return", so the model has an exception that the entry doesn't record.
    • Suggested fix: add one clause to the COND_INDIRECT_BUFFER entry saying that an empty taken branch falls through, also unverified. Or make the two cases consistent.
  2. The jump also changes what "runs as copied" means.
    • When the refresh is refused or not triggered, a GPU-built list entered by a COND_INDIRECT_BUFFER now 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.
    • The same applies to every title that uses sceAgcCbBranch, not only GPU-built lists: packets after a taken branch, flips included, are no longer copied or reserved.
    • This follows from the unverified jump model that the debt entry records, and it is what PPSA22408 needs, so I'm not blocking on it.
    • Suggested follow-up: a hardware oracle check of what the CP does after a taken COND_INDIRECT_BUFFER, since the change now affects every title that uses branches.

Not verified

  • PPSA22408 and MXGP 26: I launched no title. The garage results come from mrfelek, on 55ad5b541c plus a diff that matches the folded commit apart from comments, not on the pushed head.
  • #15465 itself: I did not review it or check whether it is merged. Without it, the garage load is reported to abort 2 of 2 times.
  • The CP's real behaviour after a taken COND_INDIRECT_BUFFER.
  • Windows and GPUs other than lavapipe.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5756534211 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5756534211). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T17:14:37Z. **Review:** APPROVED --- # Re-checked — approved The new commit `ddb59eefaf` adds mrfelek's change: a taken `COND_INDIRECT_BUFFER` now replaces the rest of its buffer. Its tests now reach the branch through an `INDIRECT_BUFFER` call. 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 - **One new commit**, `ddb59eefaf` (co-authored by mrfelek). Commits 1–7 are unchanged (`=` in the range-diff). - In `copySegment`, a `COND_INDIRECT_BUFFER` outside a `COND_EXEC` range now does `return false` once it has inlined its target. The packets after it in the same buffer are no longer copied ([Submission.cpp L214-L226](https://github.com/boykopovar/AnyPS5/blob/ddb59eefaf7728b983274cac47f7d25e3aa640fc/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L214-L226)). - `testBranchSubmission` now 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)` and `RewrittenWaitBeforeOwnFlip` now reach their branch through `CalledBranch`, a small buffer run by an `INDIRECT_BUFFER`. - The `COND_INDIRECT_BUFFER` debt entry now says the branch does not return, and that this is unverified on hardware. - **Description:** "Not for merge" is gone, `Depends on: #15465` is listed, and the PPSA22408 story is updated. - **Discussion:** mrfelek reports a garage run on `55ad5b541c` plus the same jump diff (the folded commit differs only in comments that were removed), without `APS5_LOOP_GUARD`: - with #15465: the garage loads and the 3D scene is black, as on `main`; - without #15465: 2 of 2 runs abort on `runtime resource snapshot did not stabilize`. ## What I ran Head `ddb59eefaf7728b983274cac47f7d25e3aa640fc`, `main` `1e658521a0a599872612bb91949311e2956b5283`, merged tree `5740244de3bfc34a4c20bf44e0a7d2a1e99626c4`. Release build with GCC 14.2.0 and Ninja, on a Debian 13 VM with lavapipe (Mesa 26.1.6). ```sh git diff --check 1e658521a0a599872612bb91949311e2956b5283...ddb59eefaf7728b983274cac47f7d25e3aa640fc python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283 ctest --test-dir build --output-on-failure -j8 --test-load 32 -R "^agc_driver_pm4|^agc_driver_gpu_written_indirect_buffer$" # control 1: delete only `if (guarded.empty()) return false;` in Submission.cpp ninja -C build tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests ctest --test-dir build --output-on-failure -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$" # control 2: main's Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp git show 1e658521a0a599872612bb91949311e2956b5283:<path> > <path> ninja -C build tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests ctest --test-dir build --output-on-failure -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$" # restore the merged files git show 5740244de3bfc34a4c20bf44e0a7d2a1e99626c4:<path> > <path> ninja -C build tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | Conventions | 0 errors. The same `debt-length` warning as before (indirect-buffer entry, 1124 characters) | | Script build and tests (build.json) | Build OK. 2162 tests run: no new failures, no timeouts. The 7 known failures also fail on `main`. | | Script validation comparison | Layer loaded in 772 of 773 tests, missing in none. No tests with a new `VUID-`. | | `^agc_driver_pm4…` and `agc_driver_gpu_written_indirect_buffer`, merged tree | 17 of 17 pass | | The two changed tests, run with the validation layer | 2 of 2 pass. 0 `VUID-` lines, and no `was not found but was requested` line | | Worktree after restoring | Clean | ## Negative control | Tree | `agc_driver_pm4` | `agc_driver_gpu_written_indirect_buffer` | |---|---|---| | Merged | passes | passes | | Only the new `return false` removed | **fails**: `the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call` | passes (its cases no longer depend on the packet after a branch, as mrfelek said) | | All five production files from `main` | **fails** (same message) | **fails**: `a COND_INDIRECT_BUFFER ran the command buffer as it was at submission … the marker is 0` | ## Previous findings 1. **Blocking: merging this PR would turn the PPSA22408 black garage into a hang.** Resolved. - The jump fix is now in this PR, so `main` never runs the GPU-built list with a duplicated continuation. - The garage run without the loop guard comes from mrfelek, on code that matches this head. It loads, no worse than `main`, provided #15465 is applied. That dependency is declared under Depends on. - Both are author-reported. A run on the exact pushed head is still announced. 2. **Non-blocking: the debt entry did not say that address-based readers also trigger the re-read.** Stays resolved. 3. **Non-blocking: `prepare` captures every known target once per segment** ([Submission.cpp L434-L445](https://github.com/boykopovar/AnyPS5/blob/ddb59eefaf7728b983274cac47f7d25e3aa640fc/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L434-L445)). Still open, unchanged. 4. **Non-blocking: `CaptureRenderingWait` failures are swallowed in `prepare`, and `renderingWaitTargets` is never pruned.** Still open, unchanged. 5. **Non-blocking: the indirect-buffer debt entry is over the checker's 1000-character limit.** Still open: 1124 characters, and the warning shows again on this merge. 6. **Non-blocking: two test checks pinned the call behaviour of `COND_INDIRECT_BUFFER`.** Resolved. `InvalidRewrite` and `CpuRewriteAfterSubmit(…, true)` now call the branch through `CalledBranch`, and the remaining top-level branches don't check the packet after them. ## New findings ### Blocking None. ### Non-blocking 1. **An empty taken branch still returns.** - Where: [Submission.cpp L214-L226](https://github.com/boykopovar/AnyPS5/blob/ddb59eefaf7728b983274cac47f7d25e3aa640fc/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp#L214-L226). The early return sits inside `if (targetWords != 0)`, so a taken branch to a buffer of 0 dwords still falls through to the next packet. [Pm4.cpp L1386-L1389](https://github.com/boykopovar/AnyPS5/blob/ddb59eefaf7728b983274cac47f7d25e3aa640fc/core/libs/prx/libSceAgcDriver/tests/Pm4.cpp#L1386-L1389) requires that fall-through. - Why it matters: the debt entry now says "the branch does not return", so the model has an exception that the entry doesn't record. - Suggested fix: add one clause to the `COND_INDIRECT_BUFFER` entry saying that an empty taken branch falls through, also unverified. Or make the two cases consistent. 2. **The jump also changes what "runs as copied" means.** - When the refresh is refused or not triggered, a GPU-built list entered by a `COND_INDIRECT_BUFFER` now 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. - The same applies to every title that uses `sceAgcCbBranch`, not only GPU-built lists: packets after a taken branch, flips included, are no longer copied or reserved. - This follows from the unverified jump model that the debt entry records, and it is what PPSA22408 needs, so I'm not blocking on it. - Suggested follow-up: a hardware oracle check of what the CP does after a taken `COND_INDIRECT_BUFFER`, since the change now affects every title that uses branches. ## Not verified - PPSA22408 and MXGP 26: I launched no title. The garage results come from mrfelek, on `55ad5b541c` plus a diff that matches the folded commit apart from comments, not on the pushed head. - #15465 itself: I did not review it or check whether it is merged. Without it, the garage load is reported to abort 2 of 2 times. - The CP's real behaviour after a taken `COND_INDIRECT_BUFFER`. - Windows and GPUs other than lavapipe. <!-- anyps5-bots job=3466 head=ddb59eefaf7728b983274cac47f7d25e3aa640fc -->
XairRrR commented 2026-11-03 19:43:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:43:43Z.

Review: APPROVED


Re-checked — approved

The only new commit, 4143f1b4a0, merges main into the branch and resolves a conflict in docs/dev/debt/libSceAgcDriver.md. The PR's own code and tests have not changed since ddb59eefaf, which I approved last time.

What changed since my last review

  • Commits 1–8 are unchanged (all = in the range-diff). The new commit is a merge of main 6cd2899cc6.
  • The PR's diff against main 086c0686c8 is still the same 8 files. In the debt file it still changes the COND_INDIRECT_BUFFER entry and adds the indirect-buffer entry. main's two label entries are kept next to them, as the author says.
  • In the discussion, the author reports the 17 focused tests passing 3 of 3 on this head, plus a paired Khronos run (10/10 base, 11/11 head, no VUID-). I accept both as author-reported.

What I ran

Head 4143f1b4a03f8e41d608c577214e260a005dc015, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree 536d6128f5af8d324bb5c8bcbdb91b7ca47f13bf. Build: Release, GCC 14.2.0, Ninja, on Debian 13 (VM) with lavapipe (Mesa 26.1.6).

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...4143f1b4a03f8e41d608c577214e260a005dc015
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "^agc_driver_image_gather_volume$"
# control: main's Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp
git show 086c0686c8adff3ee648fdbe34e0b0b647e1d511:<path> > <path>
ninja -C build -j32 -l32 tests/agc_driver_image_gather_volume_tests tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "^agc_driver_image_gather_volume$"
ctest --test-dir build --output-on-failure -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$"
# restore the merged files
git show 536d6128f5af8d324bb5c8bcbdb91b7ca47f13bf:<path> > <path>
ninja -C build -j32 -l32 tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests tests/agc_driver_image_gather_volume_tests
ctest --test-dir build --output-on-failure -j8 --test-load 32 -R "^agc_driver_pm4|^agc_driver_gpu_written_indirect_buffer$"
git status --porcelain
Check Result
git diff --check Clean
Conventions 0 errors. The same debt-length warning as before (indirect-buffer entry, 1124 characters)
Script build and tests (build.json) Build OK. 2180 tests run: no new failures, no timeouts. The 7 known failures also fail on main.
Script validation comparison Layer loaded in 783 of 784 tests and missing in none. One test has new VUID-s: agc_driver_image_gather_volume ("test not run on main")
agc_driver_image_gather_volume with the layer, merged tree vs. main's production files The same 8 VUID-VkSamplerCreateInfo-addressMode{U,V,W}-* lines on both, and the test passes on both. So they come from main's newer gather test, not from this PR.
^agc_driver_pm4… and agc_driver_gpu_written_indirect_buffer, merged tree 17 of 17 pass
Worktree after restoring Clean

Negative control

With main's five production files and the PR's tests:

  • agc_driver_gpu_written_indirect_buffer fails: a COND_INDIRECT_BUFFER ran the command buffer as it was at submission … the marker is 0.
  • agc_driver_pm4 fails: the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call.

With the merged files restored, both pass.

Previous findings

  • PPSA22408 hang if merged alone: stays resolved. The jump commit is unchanged and #15465 is still under Depends on.
  • Debt entry left out address-based readers: stays resolved.
  • prepare captures every known target once per segment (core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp:435): still open, non-blocking, unchanged.
  • CaptureRenderingWait failures are swallowed and renderingWaitTargets is never pruned: still open, non-blocking, unchanged.
  • Indirect-buffer debt entry is over 1000 characters (docs/dev/debt/libSceAgcDriver.md:220): still open, non-blocking. The warning shows again.
  • Tests pinned the call behaviour of COND_INDIRECT_BUFFER: stays resolved.
  • An empty taken branch still falls through, which the "does not return" debt sentence doesn't record (Submission.cpp:215-223): still open, non-blocking, unchanged.
  • The jump changes what "runs as copied" means for every title that uses sceAgcCbBranch: still open as a follow-up (a hardware oracle check), non-blocking.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • PPSA22408 and MXGP 26: I launched no title. The garage results are mrfelek's, not on this exact head.
  • #15465 itself: I did not review it or check whether it is merged.
  • What the CP really does after a taken COND_INDIRECT_BUFFER.
  • Windows, and GPUs other than lavapipe.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5758482533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5758482533). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T19:43:43Z. **Review:** APPROVED --- # Re-checked — approved The only new commit, `4143f1b4a0`, merges `main` into the branch and resolves a conflict in `docs/dev/debt/libSceAgcDriver.md`. The PR's own code and tests have not changed since `ddb59eefaf`, which I approved last time. ## What changed since my last review - Commits 1–8 are unchanged (all `=` in the range-diff). The new commit is a merge of `main` `6cd2899cc6`. - The PR's diff against `main` `086c0686c8` is still the same 8 files. In the debt file it still changes the `COND_INDIRECT_BUFFER` entry and adds the indirect-buffer entry. `main`'s two label entries are kept next to them, as the author says. - In the discussion, the author reports the 17 focused tests passing 3 of 3 on this head, plus a paired Khronos run (10/10 base, 11/11 head, no `VUID-`). I accept both as author-reported. ## What I ran Head `4143f1b4a03f8e41d608c577214e260a005dc015`, `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, merged tree `536d6128f5af8d324bb5c8bcbdb91b7ca47f13bf`. Build: Release, GCC 14.2.0, Ninja, on Debian 13 (VM) with lavapipe (Mesa 26.1.6). ```sh git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...4143f1b4a03f8e41d608c577214e260a005dc015 python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "^agc_driver_image_gather_volume$" # control: main's Driver.hpp, Submission.hpp, CommandValidation.cpp, PacketExecution.cpp, Submission.cpp git show 086c0686c8adff3ee648fdbe34e0b0b647e1d511:<path> > <path> ninja -C build -j32 -l32 tests/agc_driver_image_gather_volume_tests tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "^agc_driver_image_gather_volume$" ctest --test-dir build --output-on-failure -R "^agc_driver_pm4$|^agc_driver_gpu_written_indirect_buffer$" # restore the merged files git show 536d6128f5af8d324bb5c8bcbdb91b7ca47f13bf:<path> > <path> ninja -C build -j32 -l32 tests/agc_driver_pm4_tests tests/agc_driver_gpu_written_indirect_buffer_tests tests/agc_driver_image_gather_volume_tests ctest --test-dir build --output-on-failure -j8 --test-load 32 -R "^agc_driver_pm4|^agc_driver_gpu_written_indirect_buffer$" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | Conventions | 0 errors. The same `debt-length` warning as before (indirect-buffer entry, 1124 characters) | | Script build and tests (build.json) | Build OK. 2180 tests run: no new failures, no timeouts. The 7 known failures also fail on `main`. | | Script validation comparison | Layer loaded in 783 of 784 tests and missing in none. One test has new `VUID-`s: `agc_driver_image_gather_volume` ("test not run on main") | | `agc_driver_image_gather_volume` with the layer, merged tree vs. `main`'s production files | The same 8 `VUID-VkSamplerCreateInfo-addressMode{U,V,W}-*` lines on both, and the test passes on both. So they come from `main`'s newer gather test, not from this PR. | | `^agc_driver_pm4…` and `agc_driver_gpu_written_indirect_buffer`, merged tree | 17 of 17 pass | | Worktree after restoring | Clean | ## Negative control With `main`'s five production files and the PR's tests: - `agc_driver_gpu_written_indirect_buffer` fails: `a COND_INDIRECT_BUFFER ran the command buffer as it was at submission … the marker is 0`. - `agc_driver_pm4` fails: `the packet after a taken COND_INDIRECT_BUFFER ran: the branch returned like a call`. With the merged files restored, both pass. ## Previous findings - PPSA22408 hang if merged alone: stays resolved. The jump commit is unchanged and #15465 is still under Depends on. - Debt entry left out address-based readers: stays resolved. - `prepare` captures every known target once per segment (`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp:435`): still open, non-blocking, unchanged. - `CaptureRenderingWait` failures are swallowed and `renderingWaitTargets` is never pruned: still open, non-blocking, unchanged. - Indirect-buffer debt entry is over 1000 characters (`docs/dev/debt/libSceAgcDriver.md:220`): still open, non-blocking. The warning shows again. - Tests pinned the call behaviour of `COND_INDIRECT_BUFFER`: stays resolved. - An empty taken branch still falls through, which the "does not return" debt sentence doesn't record (`Submission.cpp:215-223`): still open, non-blocking, unchanged. - The jump changes what "runs as copied" means for every title that uses `sceAgcCbBranch`: still open as a follow-up (a hardware oracle check), non-blocking. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - PPSA22408 and MXGP 26: I launched no title. The garage results are mrfelek's, not on this exact head. - #15465 itself: I did not review it or check whether it is merged. - What the CP really does after a taken `COND_INDIRECT_BUFFER`. - Windows, and GPUs other than lavapipe. <!-- anyps5-bots job=3555 head=4143f1b4a03f8e41d608c577214e260a005dc015 -->
MarcZX10 commented 2026-11-12 02:12:15 +00:00 (Migrated from github.com)

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 current main to 077a573cd1dab3d2fa2dbe6e508fa46118bce4cc and 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.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11346 --output-dir /tmp/pr-11346-precheck-current
gh pr checks 11346 --repo boykopovar/AnyPS5
gh pr checks 11346 --repo boykopovar/AnyPS5 --required

Results

Check Result Note
Diff, conventions and merge preview passed Exact head; clean preview against current main.
Test discovery passed The execution-test CMake glob discovers the new fixture.
Windows hosted checks passed Exact head 772c16e9becf.
Linux GPU validation and focused tests passed Author-reported on exact head; paired baseline controls included.
Other hosted build jobs not run They were skipped by workflow filters.
Local build and CTest not run No local build was needed for this re-check.
Commands and recorded output

Precheck command:

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11346 --output-dir /tmp/pr-11346-precheck-current

Precheck output:

/tmp/pr-11346-precheck-current/report.md
/tmp/pr-11346-precheck-current/report.json
Conclusion: checks incomplete

Hosted-check command:

gh pr checks 11346 --repo boykopovar/AnyPS5

Hosted-check output:

edge-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558797469
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798747
pipe-write	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558797884
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798417
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558797620
labels	pass	11s	https://github.com/boykopovar/AnyPS5/actions/runs/42772998629/job/129684910184
windows	pass	19m13s	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558795775
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798528
conventions	pass	25s	https://github.com/boykopovar/AnyPS5/actions/runs/42772998690/job/129684906664
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798450
eligibility	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558751593
library-portability	pass	1m46s	https://github.com/boykopovar/AnyPS5/actions/runs/42734020384/job/129558745339
report	pass	1m1s	https://github.com/boykopovar/AnyPS5/actions/runs/42734020245/job/129558744221

Required-check query output:

no required checks reported on the 'fix/gpu-written-indirect-buffer' branch

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5867945887 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11346#pullrequestreview-5867945887). Originally posted by [MarcZX10](https://github.com/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 current `main` to `077a573cd1dab3d2fa2dbe6e508fa46118bce4cc` and 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. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11346 --output-dir /tmp/pr-11346-precheck-current gh pr checks 11346 --repo boykopovar/AnyPS5 gh pr checks 11346 --repo boykopovar/AnyPS5 --required ``` ## Results | Check | Result | Note | |---|---|---| | Diff, conventions and merge preview | passed | Exact head; clean preview against current `main`. | | Test discovery | passed | The execution-test CMake glob discovers the new fixture. | | Windows hosted checks | passed | Exact head `772c16e9becf`. | | Linux GPU validation and focused tests | passed | Author-reported on exact head; paired baseline controls included. | | Other hosted build jobs | not run | They were skipped by workflow filters. | | Local build and CTest | not run | No local build was needed for this re-check. | <details> <summary>Commands and recorded output</summary> Precheck command: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11346 --output-dir /tmp/pr-11346-precheck-current ``` Precheck output: ```text /tmp/pr-11346-precheck-current/report.md /tmp/pr-11346-precheck-current/report.json Conclusion: checks incomplete ``` Hosted-check command: ```sh gh pr checks 11346 --repo boykopovar/AnyPS5 ``` Hosted-check output: ```text edge-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558797469 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798747 pipe-write skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558797884 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798417 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558797620 labels pass 11s https://github.com/boykopovar/AnyPS5/actions/runs/42772998629/job/129684910184 windows pass 19m13s https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558795775 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798528 conventions pass 25s https://github.com/boykopovar/AnyPS5/actions/runs/42772998690/job/129684906664 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558798450 eligibility pass 4s https://github.com/boykopovar/AnyPS5/actions/runs/42734020536/job/129558751593 library-portability pass 1m46s https://github.com/boykopovar/AnyPS5/actions/runs/42734020384/job/129558745339 report pass 1m1s https://github.com/boykopovar/AnyPS5/actions/runs/42734020245/job/129558744221 ``` Required-check query output: ```text no required checks reported on the 'fix/gpu-written-indirect-buffer' branch ``` 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. </details> ## 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](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6760977151)). ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [Queued-writer regression at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/772c16e9becf7075095b47f8a7f45e08e5a754b1/core/libs/prx/libSceAgcDriver/tests/execution/GpuWrittenIndirectBufferQueuedWriter.cpp) - [Execution-test discovery at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/772c16e9becf7075095b47f8a7f45e08e5a754b1/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L690-L703) - [Exact-head Linux validation and negative controls](https://github.com/boykopovar/AnyPS5/pull/11346#issuecomment-6760977151) ## 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11346
No description provided.