Skip to content

feat(libSceAgcDriver): export sceAgcDriverGetHsOffchipParam - #3883

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
hansjm10:feat/agcdriver-get-hs-offchip-param
Oct 12, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
hansjm10:feat/agcdriver-get-hs-offchip-param

Conversation

@hansjm10

Copy link
Copy Markdown
Contributor

What

PS5 FSR4 Showcase (PPSA99011, 01.000.010 from the homebrew catalog) relinks with #3804's --trap-sdk-syscall-stubs (#2136). On main a11c8f7 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 feat(relinker): trap exact SDK syscall stubs on request #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: feat(relinker): trap exact SDK syscall stubs on request #3804 (the title relinks only with it; the code change is independent)
  • AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Progress report (2f4cc89 → bdb0be0)

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

🆕 1 declared as stubs
Library Name
libSceAgcDriver sceAgcDriverGetHsOffchipParam

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 11, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@hansjm10
hansjm10 force-pushed the feat/agcdriver-get-hs-offchip-param branch from 57b171f to 1b4535a Compare October 12, 2026 00:06
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@Dextroid17

Copy link
Copy Markdown
Contributor

#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 oneandonlydean self-assigned this Oct 12, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

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

@blawesom

Copy link
Copy Markdown
Contributor

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.

@hansjm10
hansjm10 force-pushed the feat/agcdriver-get-hs-offchip-param branch from 1b4535a to 2800f45 Compare October 12, 2026 14:33
@blawesom

Copy link
Copy Markdown
Contributor

@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.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 12, 2026
@hansjm10
hansjm10 force-pushed the feat/agcdriver-get-hs-offchip-param branch from 2800f45 to bdb0be0 Compare October 12, 2026 19:33
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@oneandonlydean
oneandonlydean merged commit 15f3aea into boykopovar:main Oct 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants