feat(libSceAgcDriver): export sceAgcDriverGetHsOffchipParam #3883

Merged
hansjm10 merged 1 commit from upstream-pr/3883 into main 2026-10-12 21:00:47 +00:00
hansjm10 commented 2026-10-11 18:37:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hansjm10 on 2026-10-11T18:37:55Z.


What

PS5 FSR4 Showcase (PPSA99011, 01.000.010 from the homebrew catalog) relinks with #3804's --trap-sdk-syscall-stubs (#2136). On main a11c8f7f7 it then stops in the loader:

./app.elf: symbol lookup error: ./app.elf: undefined symbol: r28hEh6cNH0

r28hEh6cNH0 is sceAgcDriverGetHsOffchipParam (tools/nid_names.py). It is the title's only absent import: tools/import_audit.py counts 213 of 215 implemented, 1 throwing stub and this one.

The change declares it in libSceAgcDriver/Unimplemented.cpp as a throwing stub. The two uint16_t output pointers and int32_t return follow ps5-vulkan, the Vulkan layer the showcase pins at 4bb0c8b. Its callers sit only on tessellation paths (graphics_queue_ps5.c L2241), which the showcase does not reach at start-up. What the two values mean and their initial state are unknown. sceAgcDriverSetHsOffchipParam keeps nothing here, so the getter has nothing to return. The TechnicalDebt entry records this.

#2384 (closed by the new-contributor intake) declared the same function as (void*, void*) among 44 others, without a title.

Tested

Linux (Debian 12), GCC 14.4, Release; RADV GFX1036, Mesa 22.3.6. The showcase was relinked with #3804 (0a6247532); the SELFs were unwrapped to plain ELFs first, and their embedded SHA-256 matched.

  • Before (main libs): the loader stops on undefined symbol: r28hEh6cNH0.
  • After: the title starts ([debug:0] FSR4_SHOWCASE_BEGIN heap=0). The next stop is sceSysmoduleLoadModuleInternal: unknown id 2147483796 (0x80000094, libSceAgc), handled in a follow-up PR. The getter is not called.
  • Without #3804: relinked on plain main with the deprecated debugging switch --skip-syscall-check, the title shows the same before and after stops.
  • No test added: CONTRIBUTING asks not to test that a symbol is exported.
  • python3 tools/check_conventions.py --base origin/main passes.

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: #3804 (the title relinks only with it; the code change is independent)
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4821382302 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3883). Originally posted by [hansjm10](https://github.com/hansjm10) on 2026-10-11T18:37:55Z. --- ### What PS5 FSR4 Showcase (PPSA99011, 01.000.010 from the homebrew catalog) relinks with #3804's `--trap-sdk-syscall-stubs` (#2136). On `main` a11c8f7f7 it then stops in the loader: ``` ./app.elf: symbol lookup error: ./app.elf: undefined symbol: r28hEh6cNH0 ``` `r28hEh6cNH0` is `sceAgcDriverGetHsOffchipParam` (`tools/nid_names.py`). It is the title's only absent import: `tools/import_audit.py` counts 213 of 215 implemented, 1 throwing stub and this one. The change declares it in `libSceAgcDriver/Unimplemented.cpp` as a throwing stub. The two `uint16_t` output pointers and `int32_t` return follow ps5-vulkan, the Vulkan layer the showcase pins at [`4bb0c8b`](https://github.com/blackbearreloaded/ps5-vulkan/blob/4bb0c8b1423698a7369efc22b829bf16a99e7128/native/tess_driver_import_stub.c#L10). Its callers sit only on tessellation paths ([`graphics_queue_ps5.c` L2241](https://github.com/blackbearreloaded/ps5-vulkan/blob/4bb0c8b1423698a7369efc22b829bf16a99e7128/native/graphics_queue_ps5.c#L2241)), which the showcase does not reach at start-up. What the two values mean and their initial state are unknown. `sceAgcDriverSetHsOffchipParam` keeps nothing here, so the getter has nothing to return. The TechnicalDebt entry records this. #2384 (closed by the new-contributor intake) declared the same function as `(void*, void*)` among 44 others, without a title. ### Tested Linux (Debian 12), GCC 14.4, Release; RADV GFX1036, Mesa 22.3.6. The showcase was relinked with #3804 (`0a6247532`); the SELFs were unwrapped to plain ELFs first, and their embedded SHA-256 matched. - Before (`main` libs): the loader stops on `undefined symbol: r28hEh6cNH0`. - After: the title starts (`[debug:0] FSR4_SHOWCASE_BEGIN heap=0`). The next stop is `sceSysmoduleLoadModuleInternal: unknown id 2147483796` (`0x80000094`, libSceAgc), handled in a follow-up PR. The getter is not called. - Without #3804: relinked on plain `main` with the deprecated debugging switch `--skip-syscall-check`, the title shows the same before and after stops. - No test added: CONTRIBUTING asks not to test that a symbol is exported. - `python3 tools/check_conventions.py --base origin/main` passes. ### 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: #3804 (the title relinks only with it; the code change is independent) - [x] AI-assisted: yes (Claude Code)
github-actions[bot] commented 2026-10-11 18:38:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T18:38:19Z.


Progress report (2f4cc89 → bdb0be0)

📉 System libraries: 86.34% (-0.02%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libSceAgcDriver sceAgcDriverGetHsOffchipParam
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112347183 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3883#issuecomment-6112347183). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T18:38:19Z. --- <!-- progress-report --> ### Progress report (2f4cc89 → bdb0be0) 📉 **System libraries**: 86.34% (-0.02%, +1 declared functions) <details> <summary>🆕 1 declared as stubs</summary> | Library | Name | | - | - | | libSceAgcDriver | `sceAgcDriverGetHsOffchipParam` | </details>
Dextroid17 commented 2026-10-12 01:09:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T01:09:18Z.


#4182: agc_vector_window is a real registered test, APS5_SPIRV_OPT=none is a real optimizer-disable switch read in SpirvOptimizer.cpp, and APPEND is the right call — it preserves the test's existing ANYPS5_NO_SHADER_CACHE=1 environment entry rather than replacing it, matching how this file already appends to other tests' environments. Without this the test strips the window before its own structural assertion can see it and genuinely fails (functionArrays==1 etc. all false), not silently passes against a weaker check.

#3883: the stub follows this file's own pattern exactly (NotImplemented_nid_no_patch, matching the sibling declared right above it), and the NID is independently re-derivable in-tree — ComputeNid("sceAgcDriverGetHsOffchipParam") reproduces r28hEh6cNH0 using this project's own hash function, not an external lookup. One thing worth being plain about: the signature (two uint16_t* outputs) comes entirely from a third-party reverse-engineering project (ps5-vulkan), not from anything in this tree or from hardware — nothing here corroborates it, and the only related in-tree function, the setter sceAgcDriverSetHsOffchipParam, takes three uint64_t by value, which doesn't confirm or contradict it either way. The TechnicalDebt entry is honest about that ("unknown"), which is the right call given the evidence.

One thing to flag before merging: open PR #3648 also edits the same block of docs/dev/TechnicalDebt.md this PR appends to, which isn't listed in the "Depends on" line — worth a quick check for a textual conflict on whichever lands second.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115967300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3883#issuecomment-6115967300). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T01:09:18Z. --- #4182: `agc_vector_window` is a real registered test, `APS5_SPIRV_OPT=none` is a real optimizer-disable switch read in `SpirvOptimizer.cpp`, and `APPEND` is the right call — it preserves the test's existing `ANYPS5_NO_SHADER_CACHE=1` environment entry rather than replacing it, matching how this file already appends to other tests' environments. Without this the test strips the window before its own structural assertion can see it and genuinely fails (`functionArrays==1` etc. all false), not silently passes against a weaker check. #3883: the stub follows this file's own pattern exactly (`NotImplemented_nid_no_patch`, matching the sibling declared right above it), and the NID is independently re-derivable in-tree — `ComputeNid("sceAgcDriverGetHsOffchipParam")` reproduces `r28hEh6cNH0` using this project's own hash function, not an external lookup. One thing worth being plain about: the signature (two `uint16_t*` outputs) comes entirely from a third-party reverse-engineering project (ps5-vulkan), not from anything in this tree or from hardware — nothing here corroborates it, and the only related in-tree function, the setter `sceAgcDriverSetHsOffchipParam`, takes three `uint64_t` by value, which doesn't confirm or contradict it either way. The TechnicalDebt entry is honest about that ("unknown"), which is the right call given the evidence. One thing to flag before merging: open PR #3648 also edits the same block of `docs/dev/TechnicalDebt.md` this PR appends to, which isn't listed in the "Depends on" line — worth a quick check for a textual conflict on whichever lands second. Written with AI assistance.
oneandonlydean commented 2026-10-12 09:04:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T09:04:55Z.


docs/dev/TechnicalDebt.md conflicts with main now; please rebase. The full build was green on 1b4535aaa, so I'll rebuild and merge after that.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6121121570 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3883#issuecomment-6121121570). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T09:04:55Z. --- `docs/dev/TechnicalDebt.md` conflicts with `main` now; please rebase. The full build was green on 1b4535aaa, so I'll rebuild and merge after that.
blawesom commented 2026-10-12 13:32:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T13:32:06Z.


Rebase handoff — rebased onto current main (only a TechnicalDebt.md union conflict; both entries kept), authorship unchanged.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 952/952 passed

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/3883
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 6060207f5.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125312977 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3883#issuecomment-6125312977). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-12T13:32:06Z. --- **Rebase handoff** — rebased onto current `main` (only a `TechnicalDebt.md` union conflict; both entries kept), authorship unchanged. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): - builds; `tools/check_conventions.py --base origin/main` passes - **full suite: 952/952 passed** **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/3883 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `6060207f5`.
blawesom commented 2026-10-12 14:36:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T14:36:10Z.


@oneandonlydean the rebased branch is ready — blawesom:rebase/3883 (head $(git -C /tmp/opencode/rb rev-parse --short rebase/3883), the TechnicalDebt.md union resolved with both entries kept). Full local suite passed on it (952/952, Linux/RADV), conventions green.

@hansjm10 if you'd rather take it yourself, the pick-up is one command:

git fetch https://github.com/blawesom/AnyPS5 rebase/3883
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Happy to re-push if main moves again before this merges.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6126429446 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3883#issuecomment-6126429446). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-12T14:36:10Z. --- @oneandonlydean the rebased branch is ready — `blawesom:rebase/3883` (head `$(git -C /tmp/opencode/rb rev-parse --short rebase/3883)`, the `TechnicalDebt.md` union resolved with both entries kept). Full local suite passed on it (952/952, Linux/RADV), conventions green. @hansjm10 if you'd rather take it yourself, the pick-up is one command: ``` git fetch https://github.com/blawesom/AnyPS5 rebase/3883 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Happy to re-push if main moves again before this merges.
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!3883
No description provided.