perf(agc): cut the CPU work of PM4 register writes, submission copies and validation #18914

Merged
atinseau merged 13 commits from upstream-pr/18914 into main 2026-11-30 02:41:35 +00:00
atinseau commented 2026-11-12 13:23:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by atinseau on 2026-11-12T13:23:11Z.


What

The CPU path of a PM4 submission does more work than it needs at four points: writing register ranges, copying and scanning the command buffer, looking up the indirect register lists, and validating register writes. This PR removes that work while preserving packet validation, ordering and register values.

  • CbSet*RegistersDirect and the register range and list writers of libSceAgc copied their values into a std::vector before writing. They now write straight into the command buffer, split by the same runs. A single register write goes from 56 to 22 ns (1,239 to 595 instructions, one allocation to none); a 12-register list in 6 runs from 1,051 to 183 ns (17 allocations to none).
  • A submission's register lists are kept in a sorted array (RegisterLists) instead of a std::map; at() still throws std::out_of_range for a missing cursor (the diagnostic text depends on the standard library on main), and ReferencedPrograms and the dispatch-ahead scan read the new type. copyCommands sizes its buffer up front.
  • copySegment records the cursors of the flip, rendering-wait, end-of-pipe, label-write and wait packets and copies runs of ordinary packets with one insert; waitForFlipRoom, holdFlipBehindWorker and reserveOutputs visit only the recorded cursors, and fall back to the full scan when the copy met a non-type-3 or truncated tail. Copying 26 draws goes from 2.69 to 0.80 us (60.5k to 18.5k instructions); the three scans from 727, 731 and 1,175 ns to 3.1, 4.7 and 4.4 ns. A whole 26-draw submission (copy and scans) costs 9.7 us before and 5.1 us after (190k to 113k instructions, 9 allocations to 1); with three indirect register packets per draw, 29.4 and 16.3 us.
  • Pm4::Validate checks the four register write opcodes (80 % of a draw's packets) first, and an opcode table replaces the UnsupportedReason switch for opcodes that have no reason. A register write validates in 4.8 ns instead of 11.3 ns.

Behaviour locks: new tests pin the register writers across buffer growth and run splitting, the lookup of absent register list keys and the PM4 validation messages of the register write opcodes and of every unsupported opcode (all pass before and after the change). A differential of the new validation against the previous one over 4 million random and edge packets found no mismatch, and a digest over 8,000 random PM4 streams (valid ones and ones with truncated or non-type-3 tails, indirect packets, flips, rendering waits, end-of-pipe releases, label writes and conditional ends) covering copy, validate, lists, waitForFlipRoom, holdFlipBehindWorker and reserveOutputs is identical before and after. The figures are single-process fixture measurements (alternating runs of the parent and the change) from the older stack the commits were written on, not a title trace.

The register writer tests cover range lengths 64, 65 and 130, and register lists of 32, 33, 64, 65 and 130 entries. Register writes share the accepted flag mask with the general validator. The tests check rejection reasons for every opcode and flag byte, and exercise the four register-write opcodes at every flag byte.

Tested

Linux retest on the rebased head. Base 01c550960a9; change 144ab00b45f. The marker NOP fast path on the previous head rejected 0x68754000 in GCN mode. Marker NOPs now go through general validation. A focused reproducer on Linux fails on 6a8befbcf85 and passes on both main and the new head: GCN accepts the ordinary marker on both queues, legacy flip markers retain their specific error, and non-GCN rejects typed markers.

Ubuntu 25.10 x86-64, GCC 15.2 Release, BUILD_TESTING=ON. The same 11 CTests ran serially on main and the PR under QEMU user 10.0.13 (AVX2), using Mesa llvmpipe 25.2.8 (LLVM 20.1.8) and Khronos validation 1.4.335. Both runs: 11 passed, 0 failed, 0 skipped. Both logs show the loader inserting the validation layer, no missing-layer warning and no VUID-. agc_driver_pm4 ran and passed on the new head. The suite also covers register writer boundaries, context register RMW, REWIND copy/size/trace, prepared shaders (default, indirect, debug) and both GPU-written indirect-buffer cases.

export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer
ctest --test-dir build-review-linux -R '^(agc_register_command_tests|agc_driver_pm4(_context_reg_rmw|_rewind_copy|_rewind_size|_rewind_trace)?|agc_driver_prepared_shaders(_debug|_indirect)?|agc_driver_gpu_written_indirect_buffer(_queued_writer)?)$' -V

The REWIND test includes twelve deliberate waits and produces a one-present trace. First lines of tools/trace_digest.py for the same synthetic fixture (not used as performance evidence):

  • main: frames 0:1 from present 0: 1 presents, frame p50 70.5 / p90 70.5 / p99 70.5 / max 70.5 ms, GPU busy 0.0 ms per present
  • PR: frames 0:1 from present 0: 1 presents, frame p50 73.8 / p90 73.8 / p99 73.8 / max 73.8 ms, GPU busy 0.0 ms per present

I checked the indirect-buffer merge: replacement keeps the lists before the splice, takes the re-read lists within it, and shifts later cursors by the size difference. After a splice the submission falls back to the full scan. Output reservations capture waits before processing the next relevant packet, including trailing segments. The rebase preserved that code unchanged.

Paired CPU fixture on this head: one three-word SET_SH_REG (opcode 0x76, register offset 0x10, increasing payload) validated on the graphics queue. Linux x86-64 via OrbStack on an Apple M3 Max, GCC 15.2, -O2, no LTO. Both binaries linked the same harness and GCN decoder with their revision's production PM4 validator. Eight processes per arm in alternating order, 250,000 warmups and 10 million calls per process, no other compilation or tests running in the container. Median 13.18 ns/call on main (13.13–13.72) and 6.52 ns/call on this head (6.45–6.60). This measures CPU packet validation only. On an earlier revision the Cyberpunk intro comparison found no measurable frame-rate change. No paired title trace was captured on the new head.

Earlier macOS run:
macOS 27.0.1, Apple M3 Max (36 GB), MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, Release build with -DBUILD_TESTING=ON, x86_64 under Rosetta 2. main does not run its libraries on macOS, so both sides are main 3b7f31fa7 with the macOS port (the squash of #8658, which its author upstreams in parts) and local macOS build fixes for tests of main that Apple clang refuses; the change side adds this PR's commits.

  • Focused AGC, shader recompiler and VideoOut set, 811 tests, on both sides with VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1 (ctest --test-dir build-macos -R '<811 test names>' -V): on the change 702 pass, 71 skip, 37 fail and 1 times out, against 704, 71, 35 and 1 on main. The two tests that differ, agc_driver_graphics and agc_graphics_profile_draw, both stop on "two ranges under a budget for two were not imported" (the host refusing a memory import under load), which is intermittent on this Mac with or without the change: run alone ten times in the same conditions, agc_driver_graphics passes 8 times on main and 9 times with the change, and agc_graphics_profile_draw 9 times and 10 times. Every other test has the same status as on main; the failures are the ones main has on macOS (MoltenVK limits and macOS-only gaps of the tests). Both runs report the same 77 VUID- errors test by test, and was not found but was requested by env var VK_INSTANCE_LAYERS appears only in the 12 lines that print the failure regex of the agc_driver_image_table_packed* tests. The logs show the loader inserting the layer (Insert instance layer) in 490 tests.
  • python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists six open pull requests that change lines this PR changes: #17411 (copySegment loads each REWIND control once with acquire), #18072 (queues a flip submission before holding the title), #16054 (a 0xffffffff register offset names no register), #16878 (CONTEXT_REG_RMW), #11346 (runs an indirect buffer as it is) and #15136 (frame capture deltas). None implements the same optimization; whichever merges second rebases over the other. It could not compare eleven more that conflict with main (for example #6188, #10249, #11436).

No new Windows run on this head.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Linux software Vulkan: Mesa llvmpipe 25.2.8; earlier hardware run: Apple M3 Max, MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), macOS 27.0.1
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of register-write commands and command headers, including predication handling.
    • Improved command submission checks for indirect register lists and packet boundaries.
    • Corrected preview scanning behavior when packet data or register lists are invalid.
  • Performance
    • Reduced unnecessary scanning during command submission and avoided some temporary allocations when processing register writes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5278190448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18914). Originally posted by [atinseau](https://github.com/atinseau) on 2026-11-12T13:23:11Z. --- ### What The CPU path of a PM4 submission does more work than it needs at four points: writing register ranges, copying and scanning the command buffer, looking up the indirect register lists, and validating register writes. This PR removes that work while preserving packet validation, ordering and register values. - `CbSet*RegistersDirect` and the register range and list writers of `libSceAgc` copied their values into a `std::vector` before writing. They now write straight into the command buffer, split by the same runs. A single register write goes from 56 to 22 ns (1,239 to 595 instructions, one allocation to none); a 12-register list in 6 runs from 1,051 to 183 ns (17 allocations to none). - A submission's register lists are kept in a sorted array (`RegisterLists`) instead of a `std::map`; `at()` still throws `std::out_of_range` for a missing cursor (the diagnostic text depends on the standard library on main), and `ReferencedPrograms` and the dispatch-ahead scan read the new type. `copyCommands` sizes its buffer up front. - `copySegment` records the cursors of the flip, rendering-wait, end-of-pipe, label-write and wait packets and copies runs of ordinary packets with one insert; `waitForFlipRoom`, `holdFlipBehindWorker` and `reserveOutputs` visit only the recorded cursors, and fall back to the full scan when the copy met a non-type-3 or truncated tail. Copying 26 draws goes from 2.69 to 0.80 us (60.5k to 18.5k instructions); the three scans from 727, 731 and 1,175 ns to 3.1, 4.7 and 4.4 ns. A whole 26-draw submission (copy and scans) costs 9.7 us before and 5.1 us after (190k to 113k instructions, 9 allocations to 1); with three indirect register packets per draw, 29.4 and 16.3 us. - `Pm4::Validate` checks the four register write opcodes (80 % of a draw's packets) first, and an opcode table replaces the `UnsupportedReason` switch for opcodes that have no reason. A register write validates in 4.8 ns instead of 11.3 ns. Behaviour locks: new tests pin the register writers across buffer growth and run splitting, the lookup of absent register list keys and the PM4 validation messages of the register write opcodes and of every unsupported opcode (all pass before and after the change). A differential of the new validation against the previous one over 4 million random and edge packets found no mismatch, and a digest over 8,000 random PM4 streams (valid ones and ones with truncated or non-type-3 tails, indirect packets, flips, rendering waits, end-of-pipe releases, label writes and conditional ends) covering copy, validate, lists, `waitForFlipRoom`, `holdFlipBehindWorker` and `reserveOutputs` is identical before and after. The figures are single-process fixture measurements (alternating runs of the parent and the change) from the older stack the commits were written on, not a title trace. The register writer tests cover range lengths 64, 65 and 130, and register lists of 32, 33, 64, 65 and 130 entries. Register writes share the accepted flag mask with the general validator. The tests check rejection reasons for every opcode and flag byte, and exercise the four register-write opcodes at every flag byte. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> **Linux retest on the rebased head.** Base `01c550960a9`; change `144ab00b45f`. The marker NOP fast path on the [previous head](https://github.com/boykopovar/AnyPS5/pull/18914#issuecomment-6944243402) rejected `0x68754000` in GCN mode. Marker NOPs now go through general validation. A focused reproducer on Linux fails on `6a8befbcf85` and passes on both main and the new head: GCN accepts the ordinary marker on both queues, legacy flip markers retain their specific error, and non-GCN rejects typed markers. Ubuntu 25.10 x86-64, GCC 15.2 Release, BUILD_TESTING=ON. The same 11 CTests ran serially on main and the PR under QEMU user 10.0.13 (AVX2), using Mesa llvmpipe 25.2.8 (LLVM 20.1.8) and Khronos validation 1.4.335. Both runs: **11 passed, 0 failed, 0 skipped**. Both logs show the loader inserting the validation layer, no missing-layer warning and no `VUID-`. **`agc_driver_pm4` ran and passed on the new head**. The suite also covers register writer boundaries, context register RMW, REWIND copy/size/trace, prepared shaders (default, indirect, debug) and both GPU-written indirect-buffer cases. ```sh export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build-review-linux -R '^(agc_register_command_tests|agc_driver_pm4(_context_reg_rmw|_rewind_copy|_rewind_size|_rewind_trace)?|agc_driver_prepared_shaders(_debug|_indirect)?|agc_driver_gpu_written_indirect_buffer(_queued_writer)?)$' -V ``` The REWIND test includes twelve deliberate waits and produces a one-present trace. First lines of `tools/trace_digest.py` for the same synthetic fixture (not used as performance evidence): - main: **frames 0:1** from present 0: 1 presents, frame p50 70.5 / p90 70.5 / p99 70.5 / max 70.5 ms, GPU busy 0.0 ms per present - PR: **frames 0:1** from present 0: 1 presents, frame p50 73.8 / p90 73.8 / p99 73.8 / max 73.8 ms, GPU busy 0.0 ms per present I checked the [indirect-buffer merge](https://github.com/boykopovar/AnyPS5/pull/18914#issuecomment-6900604140): replacement keeps the lists before the splice, takes the re-read lists within it, and shifts later cursors by the size difference. After a splice the submission falls back to the full scan. Output reservations capture waits before processing the next relevant packet, including trailing segments. The rebase preserved that code unchanged. **Paired CPU fixture on this head:** one three-word SET_SH_REG (opcode `0x76`, register offset `0x10`, increasing payload) validated on the graphics queue. Linux x86-64 via OrbStack on an Apple M3 Max, GCC 15.2, `-O2`, no LTO. Both binaries linked the same harness and GCN decoder with their revision's production PM4 validator. Eight processes per arm in alternating order, 250,000 warmups and 10 million calls per process, no other compilation or tests running in the container. Median **13.18 ns/call on main** (13.13–13.72) and **6.52 ns/call on this head** (6.45–6.60). This measures CPU packet validation only. On an earlier revision the [Cyberpunk intro comparison](https://github.com/boykopovar/AnyPS5/pull/18914#issuecomment-6908424631) found no measurable frame-rate change. No paired title trace was captured on the new head. **Earlier macOS run:** macOS 27.0.1, Apple M3 Max (36 GB), MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, Release build with `-DBUILD_TESTING=ON`, x86_64 under Rosetta 2. `main` does not run its libraries on macOS, so both sides are `main` `3b7f31fa7` with the macOS port (the squash of #8658, which its author upstreams in parts) and local macOS build fixes for tests of `main` that Apple clang refuses; the change side adds this PR's commits. - Focused AGC, shader recompiler and VideoOut set, 811 tests, on both sides with `VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`, `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1` (`ctest --test-dir build-macos -R '<811 test names>' -V`): on the change 702 pass, 71 skip, 37 fail and 1 times out, against 704, 71, 35 and 1 on `main`. The two tests that differ, `agc_driver_graphics` and `agc_graphics_profile_draw`, both stop on "two ranges under a budget for two were not imported" (the host refusing a memory import under load), which is intermittent on this Mac with or without the change: run alone ten times in the same conditions, `agc_driver_graphics` passes 8 times on `main` and 9 times with the change, and `agc_graphics_profile_draw` 9 times and 10 times. Every other test has the same status as on `main`; the failures are the ones `main` has on macOS (MoltenVK limits and macOS-only gaps of the tests). Both runs report the same 77 `VUID-` errors test by test, and `was not found but was requested by env var VK_INSTANCE_LAYERS` appears only in the 12 lines that print the failure regex of the `agc_driver_image_table_packed*` tests. The logs show the loader inserting the layer (`Insert instance layer`) in 490 tests. - `python3 tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` lists six open pull requests that change lines this PR changes: #17411 (`copySegment` loads each REWIND control once with acquire), #18072 (queues a flip submission before holding the title), #16054 (a 0xffffffff register offset names no register), #16878 (`CONTEXT_REG_RMW`), #11346 (runs an indirect buffer as it is) and #15136 (frame capture deltas). None implements the same optimization; whichever merges second rebases over the other. It could not compare eleven more that conflict with `main` (for example #6188, #10249, #11436). No new Windows run on this head. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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) and the licence notice of code adapted from upstream (see AGENTS.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) file - [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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Linux software Vulkan: Mesa llvmpipe 25.2.8; earlier hardware run: Apple M3 Max, MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), macOS 27.0.1 - [x] AI-assisted: yes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved validation of register-write commands and command headers, including predication handling. * Improved command submission checks for indirect register lists and packet boundaries. * Corrected preview scanning behavior when packet data or register lists are invalid. * **Performance** * Reduced unnecessary scanning during command submission and avoided some temporary allocations when processing register writes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Ethan-Hainline commented 2026-11-12 22:19:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ethan-Hainline on 2026-11-12T22:19:11Z.

Review: COMMENTED


I traced the three paths that carry the "unchanged" claim on a95bfaad31.

Direct register writes. WriteRegisterRange still leaves the payload untouched when values == nullptr (Packet.cpp:154 passes the null through), but that is unchanged from main: the old snapshot.resize(count) was inside the same values != nullptr branch, and the batch path writes nothing in that case. The run splitting in WriteRegisters reproduces the old count != 0, count <= 0x3fff, offset <= 0xffff and count <= 0x10000 - offset checks.

Register lists. readRegisterLists clears submission.registerLists before it appends (Submission.cpp:353), and it walks commands in ascending order, so the sorted vector is never fed out of order. The reuse path in copyCommands is safe because the only caller clears first.

Scan cursors. Every scanned packet is recorded: the batch path records the first packet and each following one at first + (end - cursor); the default path records at the insertion point; the predicated-indirect path inserts the 4-word packet and the target goes through the same copyLink; the truncated tail is the only path that sets scanAll = true. I did not find an insertion that leaves scanAll == false with a missing cursor.

Two small test gaps, neither blocking:

  • testRegisterWritesDoNotAllocate uses 12 registers and 8 values, below the 32/64 inline limits of SmallSnapshot; it would still pass if the spill thresholds regressed. Add 64/65-entry cases (and a contiguous run longer than 64) and assert the contents.
  • Pm4::Validate's WithoutReason cache duplicates the flag check: it is equivalent today, but a later narrowing of allowedFlags would be accepted by the cache. A shared helper, or a test that both paths agree on every opcode/flag pair, would pin it.

The four independent hardware reports cover the functional side; I did not find a behavior change the PR misses.

AI-assisted review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5882890638 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18914#pullrequestreview-5882890638). Originally posted by [Ethan-Hainline](https://github.com/Ethan-Hainline) on 2026-11-12T22:19:11Z. **Review:** COMMENTED --- I traced the three paths that carry the "unchanged" claim on `a95bfaad31`. **Direct register writes.** `WriteRegisterRange` still leaves the payload untouched when `values == nullptr` (`Packet.cpp:154` passes the null through), but that is unchanged from `main`: the old `snapshot.resize(count)` was inside the same `values != nullptr` branch, and the batch path writes nothing in that case. The run splitting in `WriteRegisters` reproduces the old `count != 0`, `count <= 0x3fff`, `offset <= 0xffff` and `count <= 0x10000 - offset` checks. **Register lists.** `readRegisterLists` clears `submission.registerLists` before it appends (`Submission.cpp:353`), and it walks `commands` in ascending order, so the sorted vector is never fed out of order. The reuse path in `copyCommands` is safe because the only caller clears first. **Scan cursors.** Every scanned packet is recorded: the batch path records the first packet and each following one at `first + (end - cursor)`; the default path records at the insertion point; the predicated-indirect path inserts the 4-word packet and the target goes through the same `copyLink`; the truncated tail is the only path that sets `scanAll = true`. I did not find an insertion that leaves `scanAll == false` with a missing cursor. Two small test gaps, neither blocking: - `testRegisterWritesDoNotAllocate` uses 12 registers and 8 values, below the 32/64 inline limits of `SmallSnapshot`; it would still pass if the spill thresholds regressed. Add 64/65-entry cases (and a contiguous run longer than 64) and assert the contents. - `Pm4::Validate`'s `WithoutReason` cache duplicates the flag check: it is equivalent today, but a later narrowing of `allowedFlags` would be accepted by the cache. A shared helper, or a test that both paths agree on every opcode/flag pair, would pin it. The four independent hardware reports cover the functional side; I did not find a behavior change the PR misses. AI-assisted review.
MarcZX10 commented 2026-11-22 08:30:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T08:30:29Z.

Review: APPROVED


Reviewed — looks good

The reviewed changes appear sound on the inspected paths; author-reported tests passed, but I did not run checks in this review.

What I ran

Read the prepared diff and changed source at head 144ab00b45f172b9dd8ffd5be874ae9f585fd4ff using repo_read.py reader tools. No commands or tests were run.

Results

Check Result Note
Changed source review passed Inspected all nine changed files
Tests in this review not run Results in the description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not run tests, builds, or benchmarks. I read all files listed as reviewed in manifest.json; no files were excluded in that manifest. files.json was not available through the reader, so additional exclusions are not verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011239202 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18914#pullrequestreview-6011239202). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T08:30:29Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed changes appear sound on the inspected paths; author-reported tests passed, but I did not run checks in this review. ## What I ran Read the prepared diff and changed source at head `144ab00b45f172b9dd8ffd5be874ae9f585fd4ff` using `repo_read.py` reader tools. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Changed source review | passed | Inspected all nine changed files | | Tests in this review | not run | Results in the description are author-reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not run tests, builds, or benchmarks. I read all files listed as reviewed in `manifest.json`; no files were excluded in that manifest. `files.json` was not available through the reader, so additional exclusions are not verified. ## To get this to a good state Nothing is required.
coderabbitai[bot] commented 2026-11-29 22:54:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T22:54:16Z.

Review: COMMENTED


Architecture findings (1)

Advisory architecture findings (1)

  • Minor — The head derives wait and reservation positions from guest memory separately from the command bytes it later copies and validates. Concurrent modification can leave a valid command snapshot without its required preparation. The base scanned the owned snapshot for that preparation. In the head, a missing rendering-wait entry can fail execution and cause the shared driver failure handler to clear pending work across queues.
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3099cc99-3c4f-40fd-b47b-1ad89b1441d2
Commits

Reviewing files that changed from the base of the PR and between 1f27e2abfa and 4d5207a4c5.

Files selected for processing: 9

  • core/libs/prx/libSceAgc/Command/src/Packet.cpp
  • core/libs/prx/libSceAgc/tests/RegisterCommands.cpp
  • core/libs/prx/libSceAgcDriver/Execution/include/Driver/Queues/Submission.hpp
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/DispatchAhead.cpp
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/CommandValidation.cpp
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp
  • core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
  • core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6105231890 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18914#pullrequestreview-6105231890). Originally posted by [coderabbitai[bot]](https://github.com/apps/coderabbitai) on 2026-11-29T22:54:16Z. **Review:** COMMENTED --- <!-- coderabbit-ai-generated:v1 --> **Architecture findings (1)** <details> <summary>Advisory architecture findings (1)</summary> <dl> <dd> <br> - **Minor** — The head derives wait and reservation positions from guest memory separately from the command bytes it later copies and validates. Concurrent modification can leave a valid command snapshot without its required preparation. The base scanned the owned snapshot for that preparation. In the head, a missing rendering-wait entry can fail execution and cause the shared driver failure handler to clear pending work across queues. </dd> </dl> </details> <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: Unavailable - **Branch**: Unavailable - **File**: No configuration file from this repository applied - **Commit**: Unavailable - **Layers**: defaults - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `3099cc99-3c4f-40fd-b47b-1ad89b1441d2` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 1f27e2abfa57f61c340873e878664664142fc5e9 and 4d5207a4c557837589c10b4dc177db1602b5c147. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 9</summary> <dl> <dd> <br> * `core/libs/prx/libSceAgc/Command/src/Packet.cpp` * `core/libs/prx/libSceAgc/tests/RegisterCommands.cpp` * `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Queues/Submission.hpp` * `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/DispatchAhead.cpp` * `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/CommandValidation.cpp` * `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp` * `core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp` * `core/libs/prx/libSceAgcDriver/tests/Pm4.cpp` * `core/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=6815612b-2e0f-42f2-939b-f87cd391320d attempt=a345313b-5bed-46cf-b804-1fba6ca29ddc batch=1/1 -->
MarcZX10 commented 2026-11-29 23:06:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T23:06:44Z.

Review: COMMENTED


Reviewed — comments

The diff and all nine changed files were reviewed at head 4d5207a4c557837589c10b4dc177db1602b5c147; no blocking defect was verified, but I did not run the checks needed to justify approval.

What I ran

I inspected the PR description, commit list, manifest, and complete diff at the stated head. No commands or tests were run by me. Test results in the description are author-reported.

Results

Check Result Note
Diff and changed-file review passed All nine changed files’ added lines were inspected.
Automated checks not run The described Linux and macOS runs were not independently verified.
Negative control not run No negative control was run during this review.

Findings

Blocking

None verified.

Non-blocking

No code-level findings. The reported test results and performance measurements remain author-reported for this review.

Not verified

I did not run tests, build the change, or independently verify the author-reported test and benchmark results. No files were excluded from the changed-file review; the diff excludes files omitted by the prepared review rules.

To get this to a good state

Nothing is required. The author-reported checks and performance measurements are optional context, not independently verified findings.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6105280028 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18914#pullrequestreview-6105280028). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-29T23:06:44Z. **Review:** COMMENTED --- # Reviewed — comments The diff and all nine changed files were reviewed at head `4d5207a4c557837589c10b4dc177db1602b5c147`; no blocking defect was verified, but I did not run the checks needed to justify approval. ## What I ran I inspected the PR description, commit list, manifest, and complete diff at the stated head. No commands or tests were run by me. Test results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and changed-file review | passed | All nine changed files’ added lines were inspected. | | Automated checks | not run | The described Linux and macOS runs were not independently verified. | | Negative control | not run | No negative control was run during this review. | ## Findings ### Blocking None verified. ### Non-blocking No code-level findings. The reported test results and performance measurements remain author-reported for this review. ## Not verified I did not run tests, build the change, or independently verify the author-reported test and benchmark results. No files were excluded from the changed-file review; the diff excludes files omitted by the prepared review rules. ## To get this to a good state Nothing is required. The author-reported checks and performance measurements are optional context, not independently verified findings.
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!18914
No description provided.