refactor(libSceAgc): name exports after the versioned SDK names their NIDs hash to #1215

Merged
polysius merged 2 commits from upstream-pr/1215 into main 2026-10-08 09:05:42 +00:00
polysius commented 2026-10-07 18:00:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by polysius on 2026-10-07T18:00:27Z.


What

Eleven libSceAgc exports are published under a raw NID (APS5_EXPORT) with a made-up or placeholder name. Each NID is the hash of a versioned SDK name. I found eight by hashing the names the tree already exports plus _0000–_9999 suffixes with compute_nid from tools/nid_names.py. The last three come from OpenAGC's include/agc_nids.h, and each of their names hashes to its NID too:

NID Old name Name the NID hashes to
23LRUSvYu1M sceAgcUnknownInitState sceAgcInit_0090
-KRzWekV120 sceAgcUnknown__MKRzWekV120 sceAgcDcbSetIndexSize_0600
Ikfdt-rIqCE sceAgcUnknown_Ikfdt_MrIqCE sceAgcJumpPatchSetTarget_0300
7Wa3aeJgeVU sceAgcUnknown_7Wa3aeJgeVU sceAgcBranchPatchSetThenTarget_0300
rP5xLdOf26k sceAgcUnknown_rP5xLdOf26k sceAgcBranchPatchSetElseTarget_0300
fd5Bp5tGTgo sceAgcUnknownFuseShaderHalves sceAgcFuseShaderHalves_0200
qj7QZpgr9Uw sceAgcDcbContextStateAnotherOp sceAgcDcbContextStateOp_0100
k0E7vkgqAuE sceAgcCreateInterpolantMappingVsPs sceAgcUpdateInterpolantMapping_0100
gQkqkLttcpw sceAgcAcb_gQkqkLttcpw sceAgcAcbAtomicGds_0900
dolOmWH+huQ sceAgcUnknownGetFusedShaderSize sceAgcGetFusedShaderSize_0080
V++UgBtQhn0 sceAgcGetDataPacketPayloadAddressUnk sceAgcGetDataPacketPayloadAddress_0090

The names fit what the tree already does with them. sceAgcDcbSetIndexSize_0600 is SetIndexSize plus a per-instance-object-id bit. sceAgcJumpPatchSetTarget_0300 is JumpPatchSetTarget plus a cache policy. sceAgcFuseShaderHalves_0200 is what sceAgcFuseShaderHalves delegates to. The Kyty-sized writer behind sceAgcDcbContextStateOpGetSize is sceAgcDcbContextStateOp_0100. The last one was declared as a "VsPs" create function, but the NID is UpdateInterpolantMapping.

The functions now carry these names and are exported from them directly, without APS5_EXPORT. The exported NIDs are unchanged, and the extra exports under the hashes of the old made-up names are gone. Behaviour is unchanged: the two BranchPatch _0300 functions, sceAgcAcbAtomicGds_0900 and sceAgcUpdateInterpolantMapping_0100 still call NotImplemented_nid_no_patch.

TechnicalDebt:

  • The "unknown name" lines for qj7QZpgr9Uw, fd5Bp5tGTgo, dolOmWH+huQ and V++UgBtQhn0 are removed.
  • The gQkqkLttcpw line now gives the name and keeps the unknown signature.
  • The GetSize and payload-range lines name the functions they refer to.
  • New lines say the two BranchPatch _0300 signatures and the sceAgcUpdateInterpolantMapping_0100 behaviour are unknown.

OpenAGC still lists qj7QZpgr9Uw and k0E7vkgqAuE as unknown, so those two names may be useful to it as well.

Tested

  • Windows 11 (ARM64, x64 MinGW-w64 GCC 15.2.0 under emulation): full build, --target libs, and ctest.
  • agc_command_tests, agc_context_state_size_tests, agc_shader_fusion, agc_branch_patch and agc_payload_range pass.
  • The rest of the suite shows no new failures against main on this machine. The failures that remain are device-capability ones, since the Adreno X1-45 has no f64 and no 64-bit or float atomics, plus temp-file cleanup flakes in the Python relinker tests.
  • objdump -p libs/libSceAgc.prx: each of the eleven NIDs is exported once, and no made-up name remains.
  • compute_nid(name) == nid for all eleven.

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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4776488108 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1215). Originally posted by [polysius](https://github.com/polysius) on 2026-10-07T18:00:27Z. --- ### What Eleven libSceAgc exports are published under a raw NID (`APS5_EXPORT`) with a made-up or placeholder name. Each NID is the hash of a versioned SDK name. I found eight by hashing the names the tree already exports plus `_0000`–`_9999` suffixes with `compute_nid` from `tools/nid_names.py`. The last three come from OpenAGC's [`include/agc_nids.h`](https://github.com/OpenAGC/OpenAGC/blob/main/include/agc_nids.h), and each of their names hashes to its NID too: | NID | Old name | Name the NID hashes to | |---|---|---| | `23LRUSvYu1M` | `sceAgcUnknownInitState` | `sceAgcInit_0090` | | `-KRzWekV120` | `sceAgcUnknown__MKRzWekV120` | `sceAgcDcbSetIndexSize_0600` | | `Ikfdt-rIqCE` | `sceAgcUnknown_Ikfdt_MrIqCE` | `sceAgcJumpPatchSetTarget_0300` | | `7Wa3aeJgeVU` | `sceAgcUnknown_7Wa3aeJgeVU` | `sceAgcBranchPatchSetThenTarget_0300` | | `rP5xLdOf26k` | `sceAgcUnknown_rP5xLdOf26k` | `sceAgcBranchPatchSetElseTarget_0300` | | `fd5Bp5tGTgo` | `sceAgcUnknownFuseShaderHalves` | `sceAgcFuseShaderHalves_0200` | | `qj7QZpgr9Uw` | `sceAgcDcbContextStateAnotherOp` | `sceAgcDcbContextStateOp_0100` | | `k0E7vkgqAuE` | `sceAgcCreateInterpolantMappingVsPs` | `sceAgcUpdateInterpolantMapping_0100` | | `gQkqkLttcpw` | `sceAgcAcb_gQkqkLttcpw` | `sceAgcAcbAtomicGds_0900` | | `dolOmWH+huQ` | `sceAgcUnknownGetFusedShaderSize` | `sceAgcGetFusedShaderSize_0080` | | `V++UgBtQhn0` | `sceAgcGetDataPacketPayloadAddressUnk` | `sceAgcGetDataPacketPayloadAddress_0090` | The names fit what the tree already does with them. `sceAgcDcbSetIndexSize_0600` is SetIndexSize plus a per-instance-object-id bit. `sceAgcJumpPatchSetTarget_0300` is JumpPatchSetTarget plus a cache policy. `sceAgcFuseShaderHalves_0200` is what `sceAgcFuseShaderHalves` delegates to. The Kyty-sized writer behind `sceAgcDcbContextStateOpGetSize` is `sceAgcDcbContextStateOp_0100`. The last one was declared as a "VsPs" create function, but the NID is `UpdateInterpolantMapping`. The functions now carry these names and are exported from them directly, without `APS5_EXPORT`. The exported NIDs are unchanged, and the extra exports under the hashes of the old made-up names are gone. Behaviour is unchanged: the two BranchPatch `_0300` functions, `sceAgcAcbAtomicGds_0900` and `sceAgcUpdateInterpolantMapping_0100` still call `NotImplemented_nid_no_patch`. TechnicalDebt: - The "unknown name" lines for `qj7QZpgr9Uw`, `fd5Bp5tGTgo`, `dolOmWH+huQ` and `V++UgBtQhn0` are removed. - The `gQkqkLttcpw` line now gives the name and keeps the unknown signature. - The GetSize and payload-range lines name the functions they refer to. - New lines say the two BranchPatch `_0300` signatures and the `sceAgcUpdateInterpolantMapping_0100` behaviour are unknown. OpenAGC still lists `qj7QZpgr9Uw` and `k0E7vkgqAuE` as unknown, so those two names may be useful to it as well. ### Tested - Windows 11 (ARM64, x64 MinGW-w64 GCC 15.2.0 under emulation): full build, `--target libs`, and `ctest`. - `agc_command_tests`, `agc_context_state_size_tests`, `agc_shader_fusion`, `agc_branch_patch` and `agc_payload_range` pass. - The rest of the suite shows no new failures against `main` on this machine. The failures that remain are device-capability ones, since the Adreno X1-45 has no f64 and no 64-bit or float atomics, plus temp-file cleanup flakes in the Python relinker tests. - `objdump -p libs/libSceAgc.prx`: each of the eleven NIDs is exported once, and no made-up name remains. - `compute_nid(name) == nid` for all eleven. ### 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 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 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-08 04:37:14 +00:00 (Migrated from github.com)

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


Progress report (cea1ef1 → f7424ea)

➖ System libraries: 86.02% (+0.0%, +7 implemented, +4 declared, -11 removed functions)

✅ 7 implemented
Library Name
libSceAgc sceAgcDcbContextStateOp_0100
libSceAgc sceAgcDcbSetIndexSize_0600
libSceAgc sceAgcFuseShaderHalves_0200
libSceAgc sceAgcGetDataPacketPayloadAddress_0090
libSceAgc sceAgcGetFusedShaderSize_0080
libSceAgc sceAgcInit_0090
libSceAgc sceAgcJumpPatchSetTarget_0300
🆕 4 declared as stubs
Library Name
libSceAgc sceAgcAcbAtomicGds_0900
libSceAgc sceAgcBranchPatchSetElseTarget_0300
libSceAgc sceAgcBranchPatchSetThenTarget_0300
libSceAgc sceAgcUpdateInterpolantMapping_0100
🗑️ 11 removed
Library Name
libSceAgc sceAgcAcb_gQkqkLttcpw
libSceAgc sceAgcCreateInterpolantMappingVsPs
libSceAgc sceAgcDcbContextStateAnotherOp
libSceAgc sceAgcGetDataPacketPayloadAddressUnk
libSceAgc sceAgcUnknownFuseShaderHalves
libSceAgc sceAgcUnknownGetFusedShaderSize
libSceAgc sceAgcUnknownInitState
libSceAgc sceAgcUnknown_7Wa3aeJgeVU
libSceAgc sceAgcUnknown_Ikfdt_MrIqCE
libSceAgc sceAgcUnknown__MKRzWekV120
libSceAgc sceAgcUnknown_rP5xLdOf26k
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6052349759 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1215#issuecomment-6052349759). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T04:37:14Z. --- <!-- progress-report --> ### Progress report (cea1ef1 → f7424ea) ➖ **System libraries**: 86.02% (+0.0%, +7 implemented, +4 declared, -11 removed functions) <details> <summary>✅ 7 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcDcbContextStateOp_0100` | | libSceAgc | `sceAgcDcbSetIndexSize_0600` | | libSceAgc | `sceAgcFuseShaderHalves_0200` | | libSceAgc | `sceAgcGetDataPacketPayloadAddress_0090` | | libSceAgc | `sceAgcGetFusedShaderSize_0080` | | libSceAgc | `sceAgcInit_0090` | | libSceAgc | `sceAgcJumpPatchSetTarget_0300` | </details> <details> <summary>🆕 4 declared as stubs</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcAcbAtomicGds_0900` | | libSceAgc | `sceAgcBranchPatchSetElseTarget_0300` | | libSceAgc | `sceAgcBranchPatchSetThenTarget_0300` | | libSceAgc | `sceAgcUpdateInterpolantMapping_0100` | </details> <details> <summary>🗑️ 11 removed</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcAcb_gQkqkLttcpw` | | libSceAgc | `sceAgcCreateInterpolantMappingVsPs` | | libSceAgc | `sceAgcDcbContextStateAnotherOp` | | libSceAgc | `sceAgcGetDataPacketPayloadAddressUnk` | | libSceAgc | `sceAgcUnknownFuseShaderHalves` | | libSceAgc | `sceAgcUnknownGetFusedShaderSize` | | libSceAgc | `sceAgcUnknownInitState` | | libSceAgc | `sceAgcUnknown_7Wa3aeJgeVU` | | libSceAgc | `sceAgcUnknown_Ikfdt_MrIqCE` | | libSceAgc | `sceAgcUnknown__MKRzWekV120` | | libSceAgc | `sceAgcUnknown_rP5xLdOf26k` | </details>
adriadam10 commented 2026-10-08 09:05:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T09:05:39Z.


Checked that compute_nid of all eleven names matches its NID, that each NID is exported exactly once from the built libSceAgc.prx with no leftover old name in the tree, and build + full ctest (428/428, incl. the four AGC tests you touched) on top of current main; CI is green. TechnicalDebt lines look right. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6056513291 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1215#issuecomment-6056513291). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T09:05:39Z. --- Checked that `compute_nid` of all eleven names matches its NID, that each NID is exported exactly once from the built `libSceAgc.prx` with no leftover old name in the tree, and build + full ctest (428/428, incl. the four AGC tests you touched) on top of current main; CI is green. TechnicalDebt lines look right. Merging.
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!1215
No description provided.