feat(libSceAgc): implement sceAgcAcbSetFlip and execute flips on compute queues #6794

Merged
fma-rc merged 2 commits from upstream-pr/6794 into main 2026-10-19 18:42:21 +00:00
fma-rc commented 2026-10-16 12:21:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-16T12:21:51Z.


What

Implements sceAgcAcbSetFlip. It writes the same 6-dword flip packet as sceAgcDcbSetFlip. In the PS5 6.00 libSceAgc module both exports are the same 176-byte wrapper around one libSceAgcDriver helper; the only argument that differs selects the release event (CS_DONE for ACB), which our flip packet does not model.

The second commit lets the driver execute that packet on a compute queue. Until now the PM4 validator (Pm4.cpp) accepted a flip only on queue 0 and threw graphics packet in compute queue otherwise. The flip path after validation already handles any queue: it reserves the output, hands it the frame and raises the end-of-pipe interrupt on the submitting queue, the way other compute-queue releases are delivered. Since two workers can now reach the flip, the frame serial became atomic, and a compute flip gets its own frame timing instead of taking queue 0's.

Earlier attempts #1052 and #1585 were closed because no title was shown to reach it. Open PR 6447 writes the same packet for this function among changes to 100 files; this PR is only ACB flips. Death Stranding 2 (PPSA02015) stops on the export on its loading screen, about 1085 s in:

terminate called after throwing an instance of 'std::runtime_error'
  what():  sceAgcAcbSetFlip not implemented

and, with the first commit alone, at 1333 s on the packet it writes:

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC driver: FLIP at DWORD 0: graphics packet in compute queue

Tested

Linux, on main 6a32550fd: agc_commands fails on main with sceAgcAcbSetFlip not implemented; agc_driver_flip (new compute-queue case) fails without the second commit with AGC driver: FLIP at DWORD 0: graphics packet in compute queue. Both pass with this PR.

test RTX 5080 (NVIDIA 615.78.08) Radeon 610M (RADV) lavapipe
agc_commands pass pass pass
agc_driver_flip pass pass pass
agc_driver_flip_stores_small_results pass pass pass
agc_driver_flip_compute pass pass pass

Windows (WinLibs GCC 15.2 UCRT, no GPU): the whole suite builds and runs; the one failure is one main has there too.

Death Stranding 2 on Linux, RTX 5080: with both commits the run passes 1333 s with no refused submission, stays on the loading screen and stops at 1630 s on a heap corruption abort (corrupted size vs. prev_size) that is not in this code. The title does not reach this call on plain main: it also needs the open PRs #6437, #6297, #6277, #6196, #6530, #6300, #6727, #6492 and #6174 (none of them touches this code) and local changes for EQAA targets and image-table residency that are not ready to submit.

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 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
  • Unblocks: PPSA02015
  • GPUs tested: RTX 5080 (NVIDIA 615.78.08), Radeon 610M (RADV, Mesa), lavapipe; Arch Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4888289253 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6794). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-16T12:21:51Z. --- ### What Implements `sceAgcAcbSetFlip`. It writes the same 6-dword flip packet as `sceAgcDcbSetFlip`. In the PS5 6.00 `libSceAgc` module both exports are the same 176-byte wrapper around one `libSceAgcDriver` helper; the only argument that differs selects the release event (CS_DONE for ACB), which our flip packet does not model. The second commit lets the driver execute that packet on a compute queue. Until now the PM4 validator (`Pm4.cpp`) accepted a flip only on queue 0 and threw `graphics packet in compute queue` otherwise. The flip path after validation already handles any queue: it reserves the output, hands it the frame and raises the end-of-pipe interrupt on the submitting queue, the way other compute-queue releases are delivered. Since two workers can now reach the flip, the frame serial became atomic, and a compute flip gets its own frame timing instead of taking queue 0's. Earlier attempts #1052 and #1585 were closed because no title was shown to reach it. Open PR 6447 writes the same packet for this function among changes to 100 files; this PR is only ACB flips. Death Stranding 2 (PPSA02015) stops on the export on its loading screen, about 1085 s in: ``` terminate called after throwing an instance of 'std::runtime_error' what(): sceAgcAcbSetFlip not implemented ``` and, with the first commit alone, at 1333 s on the packet it writes: ``` terminate called after throwing an instance of 'std::runtime_error' what(): AGC driver: FLIP at DWORD 0: graphics packet in compute queue ``` ### Tested Linux, on `main` 6a32550fd: `agc_commands` fails on `main` with `sceAgcAcbSetFlip not implemented`; `agc_driver_flip` (new compute-queue case) fails without the second commit with `AGC driver: FLIP at DWORD 0: graphics packet in compute queue`. Both pass with this PR. | test | RTX 5080 (NVIDIA 615.78.08) | Radeon 610M (RADV) | lavapipe | |---|---|---|---| | `agc_commands` | pass | pass | pass | | `agc_driver_flip` | pass | pass | pass | | `agc_driver_flip_stores_small_results` | pass | pass | pass | | `agc_driver_flip_compute` | pass | pass | pass | Windows (WinLibs GCC 15.2 UCRT, no GPU): the whole suite builds and runs; the one failure is one `main` has there too. Death Stranding 2 on Linux, RTX 5080: with both commits the run passes 1333 s with no refused submission, stays on the loading screen and stops at 1630 s on a heap corruption abort (`corrupted size vs. prev_size`) that is not in this code. The title does not reach this call on plain `main`: it also needs the open PRs #6437, #6297, #6277, #6196, #6530, #6300, #6727, #6492 and #6174 (none of them touches this code) and local changes for EQAA targets and image-table residency that are not ready to submit. ### 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) 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] Unblocks: PPSA02015 - [x] GPUs tested: RTX 5080 (NVIDIA 615.78.08), Radeon 610M (RADV, Mesa), lavapipe; Arch Linux - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 12:22:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T12:22:41Z.


Progress report (6a32550 → 66cc672)

📈 System libraries: 89.46% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAgc sceAgcAcbSetFlip
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6215409440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6794#issuecomment-6215409440). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T12:22:41Z. --- <!-- progress-report --> ### Progress report (6a32550 → 66cc672) 📈 **System libraries**: 89.46% (+0.02%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcAcbSetFlip` | </details>
MarcZX10 commented 2026-10-16 12:23:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T12:23:13Z.


The conventions failure is only the PR-template Depends on field: the validator requires Depends on: #N or Depends on: none directly on the checklist line. This PR lists integration-only prerequisites in prose, so please keep the checklist line in the accepted form (likely Depends on: none, since you state there is no code dependency) and move the runtime/integration context to the description above. The failed run reported this as its sole finding; eligibility, intake and progress report pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6215418287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6794#issuecomment-6215418287). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T12:23:13Z. --- The conventions failure is only the PR-template `Depends on` field: the validator requires `Depends on: #N` or `Depends on: none` directly on the checklist line. This PR lists integration-only prerequisites in prose, so please keep the checklist line in the accepted form (likely `Depends on: none`, since you state there is no code dependency) and move the runtime/integration context to the description above. The failed run reported this as its sole finding; eligibility, intake and progress report pass.
github-actions[bot] commented 2026-10-16 12:35:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T12:35:01Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5115 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6501 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6549 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6215615339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6794#issuecomment-6215615339). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T12:35:01Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5115](https://www.github.com/boykopovar/AnyPS5/pull/5115) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6549](https://www.github.com/boykopovar/AnyPS5/pull/6549) | `core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` |
fma-rc commented 2026-10-16 15:39:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-16T15:39:48Z.


Thanks, fixed: the checklist line is now Depends on: none and the prerequisites are listed in the description. The conventions check passes on the edit.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6219045997 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6794#issuecomment-6219045997). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-16T15:39:48Z. --- Thanks, fixed: the checklist line is now `Depends on: none` and the prerequisites are listed in the description. The conventions check passes on the edit.
adriadam10 commented 2026-10-19 18:43:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T18:43:59Z.


Checked the ACB flip packet against sceAgcDcbSetFlip, the compute-queue flip path (no flip hold on non-zero queues, own frame timing, EOP raised on the submitting queue) and the new agc_commands / agc_driver_flip cases, which fail on main with the errors quoted in the description; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6274626920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6794#issuecomment-6274626920). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T18:43:59Z. --- Checked the ACB flip packet against `sceAgcDcbSetFlip`, the compute-queue flip path (no flip hold on non-zero queues, own frame timing, EOP raised on the submitting queue) and the new `agc_commands` / `agc_driver_flip` cases, which fail on main with the errors quoted in the description; merged.
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!6794
No description provided.