feat(agc): implement the DCB and ACB marker span builders #2847

Closed
alfalfa-star wants to merge 1 commit from upstream-pr/2847 into main
alfalfa-star commented 2026-10-10 16:36:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-10T16:36:50Z.


What

Implements the four libSceAgc marker span builders that still called NotImplemented_nid_no_patch:

  • sceAgcDcbPushMarkerSpan, sceAgcDcbSetMarkerSpan
  • sceAgcAcbPushMarkerSpan, sceAgcAcbSetMarkerSpan

They take the marker text with an explicit length, (buffer, text, length, color), and write the same custom NOP packet (PUSH_MARKER, 0x0b) as sceAgc*PushMarker. The span's bytes are copied and a terminator is added, so the driver's existing marker check (unterminated marker text) accepts the packet. The Set forms are a push and a pop, as sceAgc*SetMarker already are. The color is not encoded, as with the existing markers.

Agc::Marker::Push gets a length overload, and the NUL-terminated form now calls it with no change in output. A null text with a non-zero length, or a length above the 0x4000-dword packet limit, throws.

The signature comes from OpenAGC only, so it is recorded in TechnicalDebt. OpenAGC writes a color dword and the text without a terminator; this PR keeps the packet the driver already parses.

Tested

Linux (Arch, GCC), Release build:

  • agc_commands: new testMarkerSpans checks that a span is cut at its length, that a full-dword span gets a terminator dword, that the DCB and ACB packets match, that a span gives the same packet as the marker of the same text, and that the set form is a push and pop pair. It also checks that invalid arguments throw without touching the buffer.
  • Full ctest on main 57f96fd2: 698/698 passed (4 skipped for lack of a display).
  • tools/check_conventions.py --base upstream/main passed.
  • tools/progress.py: +4 implemented in libSceAgc.

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 in TechnicalDebt
  • 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. Touches libSceAgc/tests/Commands.cpp like #2848, so whichever merges second needs a rebase
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812781064 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-10T16:36:50Z. --- ### What Implements the four libSceAgc marker span builders that still called `NotImplemented_nid_no_patch`: - `sceAgcDcbPushMarkerSpan`, `sceAgcDcbSetMarkerSpan` - `sceAgcAcbPushMarkerSpan`, `sceAgcAcbSetMarkerSpan` They take the marker text with an explicit length, `(buffer, text, length, color)`, and write the same custom NOP packet (`PUSH_MARKER`, 0x0b) as `sceAgc*PushMarker`. The span's bytes are copied and a terminator is added, so the driver's existing marker check (`unterminated marker text`) accepts the packet. The `Set` forms are a push and a pop, as `sceAgc*SetMarker` already are. The color is not encoded, as with the existing markers. `Agc::Marker::Push` gets a length overload, and the NUL-terminated form now calls it with no change in output. A null text with a non-zero length, or a length above the 0x4000-dword packet limit, throws. The signature comes from [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/main/src/cb_builders.c) only, so it is recorded in TechnicalDebt. OpenAGC writes a color dword and the text without a terminator; this PR keeps the packet the driver already parses. ### Tested Linux (Arch, GCC), Release build: - `agc_commands`: new `testMarkerSpans` checks that a span is cut at its length, that a full-dword span gets a terminator dword, that the DCB and ACB packets match, that a span gives the same packet as the marker of the same text, and that the set form is a push and pop pair. It also checks that invalid arguments throw without touching the buffer. - Full `ctest` on `main` 57f96fd2: 698/698 passed (4 skipped for lack of a display). - `tools/check_conventions.py --base upstream/main` passed. - `tools/progress.py`: +4 implemented in libSceAgc. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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. Touches `libSceAgc/tests/Commands.cpp` like #2848, so whichever merges second needs a rebase - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-10 16:37:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T16:37:13Z.


Progress report (57f96fd → afae8b4)

📈 System libraries: 84.64% (+0.12%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceAgc sceAgcAcbPushMarkerSpan
libSceAgc sceAgcAcbSetMarkerSpan
libSceAgc sceAgcDcbPushMarkerSpan
libSceAgc sceAgcDcbSetMarkerSpan
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099773835 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#issuecomment-6099773835). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T16:37:13Z. --- <!-- progress-report --> ### Progress report (57f96fd → afae8b4) 📈 **System libraries**: 84.64% (+0.12%, +4 implemented functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcAcbPushMarkerSpan` | | libSceAgc | `sceAgcAcbSetMarkerSpan` | | libSceAgc | `sceAgcDcbPushMarkerSpan` | | libSceAgc | `sceAgcDcbSetMarkerSpan` | </details>
oneandonlydean commented 2026-10-10 19:17:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T19:17:59Z.


Which title calls sceAgcDcbPushMarkerSpan or the other span builders on main? With the title ID and the log line where it stops this can go in; otherwise I'll close it until one does.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101235640 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#issuecomment-6101235640). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T19:17:59Z. --- Which title calls `sceAgcDcbPushMarkerSpan` or the other span builders on main? With the title ID and the log line where it stops this can go in; otherwise I'll close it until one does.
screamm commented 2026-10-10 22:41:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-10T22:41:43Z.


Windows validation of the current head afae8b42 merged onto main 262c0316.

Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including the libs target.

  • ctest -j8 -E "^agc_driver_|^video_out_flip" passes 462/462, including the agc_command unit tests this change extends.
  • The GPU execution tests (agc_driver_*) were not run; on this host two of them fail on unchanged main for unrelated reasons (#2755/#2777 family).

Validation run with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102960988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#issuecomment-6102960988). Originally posted by [screamm](https://github.com/screamm) on 2026-10-10T22:41:43Z. --- Windows validation of the current head `afae8b42` merged onto `main` `262c0316`. Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including the `libs` target. - `ctest -j8 -E "^agc_driver_|^video_out_flip"` passes 462/462, including the `agc_command` unit tests this change extends. - The GPU execution tests (`agc_driver_*`) were not run; on this host two of them fail on unchanged `main` for unrelated reasons (#2755/#2777 family). Validation run with Claude Code assistance.
adriadam10 commented 2026-10-11 00:08:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T00:08:51Z.

Review: CHANGES_REQUESTED


Build and agc_commands pass here on the PR merged onto main, and the new test fails without the change, so the code and test look fine. Two things block merging:

  • @oneandonlydean's question is unanswered: which title calls any of the four *MarkerSpan builders? Please add the title ID and the log line where it stops, or a link to the Discussion thread. Nothing in the Astro's Playroom imports uses them either.
  • The signature (buffer, text, length, color) rests on OpenAGC alone. prosper lists all four as unmeasured (its probe calls faulted on console), so there is no measured source. Without a title calling them, an unverified argument order and layout is guesswork that main currently rejects by throwing. If a title does call them, a disassembly or call-site excerpt showing the argument registers would settle it.

Once a title is named, this can go in; the Windows run from @screamm is appreciated.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5481280918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#pullrequestreview-5481280918). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T00:08:51Z. **Review:** CHANGES_REQUESTED --- Build and `agc_commands` pass here on the PR merged onto main, and the new test fails without the change, so the code and test look fine. Two things block merging: - @oneandonlydean's question is unanswered: which title calls any of the four `*MarkerSpan` builders? Please add the title ID and the log line where it stops, or a link to the Discussion thread. Nothing in the Astro's Playroom imports uses them either. - The signature `(buffer, text, length, color)` rests on OpenAGC alone. prosper lists all four as `unmeasured` (its probe calls faulted on console), so there is no measured source. Without a title calling them, an unverified argument order and layout is guesswork that main currently rejects by throwing. If a title does call them, a disassembly or call-site excerpt showing the argument registers would settle it. Once a title is named, this can go in; the Windows run from @screamm is appreciated.
Silverash-i8 commented 2026-10-11 01:57:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T01:57:35Z.


Windows run, since the PR has no Intel or Windows results yet: Windows 11, WinLibs GCC 15.2.0 r7, Release, merged onto main d31b57a4 in one build with #3217, #3202, #3167, #3137, #2863, #2849 and #2847, on an RTX 5060 Laptop and the Arrow Lake iGPU (ANYPS5_GPU=Intel).

  • agc_commands and agc_initialization (Commands.cpp) pass.

Full ctest of that build on both GPUs has no failure that isn't also on plain main here (guest_filesystem needs the symlink privilege, #3169; the Intel ones are listed on #2114 and #3207).

AI-assisted (Claude Code); I ran this on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6104402035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#issuecomment-6104402035). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T01:57:35Z. --- Windows run, since the PR has no Intel or Windows results yet: Windows 11, WinLibs GCC 15.2.0 r7, Release, merged onto `main` d31b57a4 in one build with #3217, #3202, #3167, #3137, #2863, #2849 and #2847, on an RTX 5060 Laptop and the Arrow Lake iGPU (`ANYPS5_GPU=Intel`). - `agc_commands` and `agc_initialization` (`Commands.cpp`) pass. Full `ctest` of that build on both GPUs has no failure that isn't also on plain `main` here (`guest_filesystem` needs the symlink privilege, #3169; the Intel ones are listed on #2114 and #3207). AI-assisted (Claude Code); I ran this on my machine.
alfalfa-star commented 2026-10-11 09:45:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-11T09:45:09Z.


No title I can run reaches the marker span builders on current main (90c152e8):

  • LEGO Horizon Adventures (PPSA14632) aborts after about 35 s at color views of several array slices are unsupported (#2102). My local test branch gets past that and other stops; there it played 385 s with scripted input, through New Game and a save, without calling the marker span builders.
  • Kena: Bridge of Spirits (PPSA01802) crashes in game code after about 60 s, with no not implemented line before it.

I'm converting this to a draft until a title stops at it. Then I'll post the title ID and the log line and mark it ready.

On the signature: no second source exists. sharpemu, REmu, shadPS4 and SharpProspero only list the four names, and prosper's probes faulted on console (agcbuild.unmeasured.tsv). So (buffer, text, length, color) rests on OpenAGC alone, as the PR says. When a title reaches one of them, I'll add the call site's argument registers.

Tested: Linux, GCC, Release, RX 9070 XT (RADV): full ctest 813/813 (4 video_out_flip_* skipped) on main 90c152e8 merged with this branch, #2849, #2850 and #2852; tools/check_conventions.py passes.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107712472 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#issuecomment-6107712472). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-11T09:45:09Z. --- No title I can run reaches the marker span builders on current `main` (90c152e8): - LEGO Horizon Adventures (PPSA14632) aborts after about 35 s at `color views of several array slices are unsupported` (#2102). My local test branch gets past that and other stops; there it played 385 s with scripted input, through New Game and a save, without calling the marker span builders. - Kena: Bridge of Spirits (PPSA01802) crashes in game code after about 60 s, with no `not implemented` line before it. I'm converting this to a draft until a title stops at it. Then I'll post the title ID and the log line and mark it ready. On the signature: no second source exists. sharpemu, REmu, shadPS4 and SharpProspero only list the four names, and prosper's probes faulted on console (`agcbuild.unmeasured.tsv`). So `(buffer, text, length, color)` rests on OpenAGC alone, as the PR says. When a title reaches one of them, I'll add the call site's argument registers. **Tested:** Linux, GCC, Release, RX 9070 XT (RADV): full `ctest` 813/813 (4 `video_out_flip_*` skipped) on `main` 90c152e8 merged with this branch, #2849, #2850 and #2852; `tools/check_conventions.py` passes. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-14 02:39:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:39:58Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159669205 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2847#issuecomment-6159669205). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:39:58Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Pull request closed

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!2847
No description provided.