feat(libSceAgc): implement sceAgcDcbSetIndexIndirectArgs #7696

Merged
MaxLikesCode merged 1 commit from upstream-pr/7696 into main 2026-10-21 10:52:40 +00:00
MaxLikesCode commented 2026-10-19 00:54:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MaxLikesCode on 2026-10-19T00:54:40Z.


What

Implements sceAgcDcbSetIndexIndirectArgs and sceAgcDcbSetIndexIndirectArgsGetSize, which threw NotImplemented_nid_no_patch.

sceAgcDcbSetIndexIndirectArgs(buffer, attributeAddress, attributeIndex) writes a 4-dword INDEX_ATTRIBUTES_INDIRECT packet (opcode 0x91): header 0xc0029100, the low and high dwords of the attribute address, and the attribute index. The size query returns 16 bytes.

Where the behaviour comes from:

  • Console measurement. The prosper console oracle called the console's own builder with three argument patterns and recorded the packets (agcbuild.golden.tsv L172-L174). The size query returned 16 (agc.golden.tsv L67).
  • Signature. OpenAGC reverse-engineered the builder as (cb, uint64_t address, uint32_t offset). Its encoding matches the measured bytes.
  • Packet layout. It is the packet PAL's BuildIndexAttributesIndirect writes. The AnyPS5 driver already executes it, and testIndexAttributesIndirect in agc_driver_pm4 runs exactly this layout.

The old declaration was (buffer, uint32_t dataOffsetInBytes). The console reads a 64-bit address from the second argument, so the signature changes.

The console clears the low four address bits and keeps the low 16 bits of the index. Here a nonzero address that is not 16-byte aligned, or an index above 0xffff, throws, as sceAgcDcbSetIndexBuffer already throws for a misaligned address. A null address is written as 0, as on the console. Both points are recorded in docs/dev/debt/libSceAgc.md. The INDEX_ATTRIBUTES_INDIRECT entry in docs/dev/debt/libSceAgcDriver.md said the packet was not measured on a PS5. It now says the console's builder writes it.

tools/progress.py on main ad502d717: libraries 3719/4065 (91.49%) before, 3721/4065 (91.54%) after.

Tested

  • Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, full Release build with BUILD_TESTING=ON and the Windows CI configure flags, on this branch rebased on main a373e85e5. There are no warnings in the changed files.
  • agc_commands passes with a new case. The packet for address 0x1111111122222220 and index 0x4444 equals the console's packet for its third pattern, whose address differs only in the low four bits the console clears. The size matches the packet, a null address writes 0, and a misaligned address and an index above 0xffff throw without writing. Changing the opcode, the alignment, the index mask or the size each makes the test fail.
  • agc_driver_pm4 passes.
  • After rebasing onto main ad502d717, agc_commands, agc_initialization and agc_driver_pm4 pass again.
  • Full suite with python tools/select_tests.py ctest build --output-on-failure --timeout 120 --parallel 4: 1547 of 1548 pass. tools/check_skips.py --job windows reports all 514 skips as expected. The one failure is agc_driver_bda_device with vkWaitForFences graphics: Vulkan result 2, which is #7584 on main.
  • python tools/check_conventions.py --base origin/main passes. python tools/pr_overlap.py --branch reports no open PR changing the same lines or exports.
  • Not tested: a console, a title or homebrew. No title is known to call these functions.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200. The new test runs on the CPU, and the full suite's GPU tests ran on this GPU.
  • AI-assisted: yes. Written with Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4914319050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7696). Originally posted by [MaxLikesCode](https://github.com/MaxLikesCode) on 2026-10-19T00:54:40Z. --- ### What Implements `sceAgcDcbSetIndexIndirectArgs` and `sceAgcDcbSetIndexIndirectArgsGetSize`, which threw `NotImplemented_nid_no_patch`. `sceAgcDcbSetIndexIndirectArgs(buffer, attributeAddress, attributeIndex)` writes a 4-dword INDEX_ATTRIBUTES_INDIRECT packet (opcode 0x91): header `0xc0029100`, the low and high dwords of the attribute address, and the attribute index. The size query returns 16 bytes. Where the behaviour comes from: - **Console measurement.** The prosper console oracle called the console's own builder with three argument patterns and recorded the packets ([agcbuild.golden.tsv L172-L174](https://github.com/mattias800/prosper/blob/3ea5cb9a846b6dcd00f5073360462bbda4f72288/prosper/tests/data/console_oracle/agcbuild.golden.tsv#L172-L174)). The size query returned 16 ([agc.golden.tsv L67](https://github.com/mattias800/prosper/blob/3ea5cb9a846b6dcd00f5073360462bbda4f72288/prosper/tests/data/console_oracle/agc.golden.tsv#L67)). - **Signature.** [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/3c7e8072f0d7684e930454794fd5c02056946d73/src/game_compat.c#L1742-L1757) reverse-engineered the builder as `(cb, uint64_t address, uint32_t offset)`. Its encoding matches the measured bytes. - **Packet layout.** It is the packet PAL's `BuildIndexAttributesIndirect` writes. The AnyPS5 driver already executes it, and `testIndexAttributesIndirect` in `agc_driver_pm4` runs exactly this layout. The old declaration was `(buffer, uint32_t dataOffsetInBytes)`. The console reads a 64-bit address from the second argument, so the signature changes. The console clears the low four address bits and keeps the low 16 bits of the index. Here a nonzero address that is not 16-byte aligned, or an index above 0xffff, throws, as `sceAgcDcbSetIndexBuffer` already throws for a misaligned address. A null address is written as 0, as on the console. Both points are recorded in `docs/dev/debt/libSceAgc.md`. The INDEX_ATTRIBUTES_INDIRECT entry in `docs/dev/debt/libSceAgcDriver.md` said the packet was not measured on a PS5. It now says the console's builder writes it. `tools/progress.py` on `main` ad502d717: libraries 3719/4065 (91.49%) before, 3721/4065 (91.54%) after. ### Tested - Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, full Release build with `BUILD_TESTING=ON` and the Windows CI configure flags, on this branch rebased on `main` a373e85e5. There are no warnings in the changed files. - `agc_commands` passes with a new case. The packet for address `0x1111111122222220` and index `0x4444` equals the console's packet for its third pattern, whose address differs only in the low four bits the console clears. The size matches the packet, a null address writes 0, and a misaligned address and an index above 0xffff throw without writing. Changing the opcode, the alignment, the index mask or the size each makes the test fail. - `agc_driver_pm4` passes. - After rebasing onto `main` ad502d717, `agc_commands`, `agc_initialization` and `agc_driver_pm4` pass again. - Full suite with `python tools/select_tests.py ctest build --output-on-failure --timeout 120 --parallel 4`: 1547 of 1548 pass. `tools/check_skips.py --job windows` reports all 514 skips as expected. The one failure is `agc_driver_bda_device` with `vkWaitForFences graphics: Vulkan result 2`, which is #7584 on `main`. - `python tools/check_conventions.py --base origin/main` passes. `python tools/pr_overlap.py --branch` reports no open PR changing the same lines or exports. - Not tested: a console, a title or homebrew. No title is known to call these functions. ### 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) - [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: NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200. The new test runs on the CPU, and the full suite's GPU tests ran on this GPU. - [x] AI-assisted: yes. Written with Claude Code (Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 01:15:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T01:15:09Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6549 docs/dev/debt/libSceAgcDriver.md L174-175

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 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5499 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6612 docs/dev/debt/libSceAgcDriver.md
PR 6636 docs/dev/debt/libSceAgcDriver.md
PR 6639 docs/dev/debt/libSceAgcDriver.md
PR 6801 docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
PR 6959 docs/dev/debt/libSceAgcDriver.md
PR 6973 docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7659 docs/dev/debt/libSceAgcDriver.md
PR 7800 docs/dev/debt/libSceAgcDriver.md
PR 7803 docs/dev/debt/libSceAgcDriver.md
PR 7911 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8115 docs/dev/debt/libSceAgcDriver.md
PR 8365 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8564 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8971 docs/dev/debt/libSceAgcDriver.md
PR 9020 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6257573329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7696#issuecomment-6257573329). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T01:15:09Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6549](https://www.github.com/boykopovar/AnyPS5/pull/6549) | `docs/dev/debt/libSceAgcDriver.md` [L174-175](https://github.com/boykopovar/AnyPS5/blob/27fabb6b7d1832209d7f145df747ee94da303b58/docs/dev/debt/libSceAgcDriver.md#L174-L175) | | | 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 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6612](https://www.github.com/boykopovar/AnyPS5/pull/6612) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6639](https://www.github.com/boykopovar/AnyPS5/pull/6639) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6801](https://www.github.com/boykopovar/AnyPS5/pull/6801) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6867](https://www.github.com/boykopovar/AnyPS5/pull/6867) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6959](https://www.github.com/boykopovar/AnyPS5/pull/6959) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7449](https://www.github.com/boykopovar/AnyPS5/pull/7449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7659](https://www.github.com/boykopovar/AnyPS5/pull/7659) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7803](https://www.github.com/boykopovar/AnyPS5/pull/7803) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7911](https://www.github.com/boykopovar/AnyPS5/pull/7911) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8115](https://www.github.com/boykopovar/AnyPS5/pull/8115) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8365](https://www.github.com/boykopovar/AnyPS5/pull/8365) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8542](https://www.github.com/boykopovar/AnyPS5/pull/8542) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8564](https://www.github.com/boykopovar/AnyPS5/pull/8564) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8592](https://www.github.com/boykopovar/AnyPS5/pull/8592) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8971](https://www.github.com/boykopovar/AnyPS5/pull/8971) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 9020](https://www.github.com/boykopovar/AnyPS5/pull/9020) | `docs/dev/debt/libSceAgcDriver.md` |
github-actions[bot] commented 2026-10-19 17:07:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T17:07:41Z.


Progress report (ad502d7 → 5140b08)

📈 System libraries: 91.54% (+0.05%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceAgc sceAgcDcbSetIndexIndirectArgs
libSceAgc sceAgcDcbSetIndexIndirectArgsGetSize
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceAgc sceAgcDcbSetIndexIndirectArgsGetSize
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272776450 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7696#issuecomment-6272776450). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T17:07:41Z. --- <!-- progress-report --> ### Progress report (ad502d7 → 5140b08) 📈 **System libraries**: 91.54% (+0.05%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcDcbSetIndexIndirectArgs` | | libSceAgc | `sceAgcDcbSetIndexIndirectArgsGetSize` | </details> <details> <summary>⚪ 1 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcDcbSetIndexIndirectArgsGetSize` | </details>
adriadam10 commented 2026-10-21 10:53:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T10:53:11Z.


Checked the packet (opcode 0x91, 4 dwords, size 16) against the prosper console oracle rows and OpenAGC's signature, the new test (fails on main, where this threw), and the debt entries; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314183872 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7696#issuecomment-6314183872). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-21T10:53:11Z. --- Checked the packet (opcode 0x91, 4 dwords, size 16) against the prosper console oracle rows and OpenAGC's signature, the new test (fails on main, where this threw), and the debt entries; 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!7696
No description provided.