Skip to content

feat(libSceNgs2): keep caller data on racks with sceNgs2RackSetUserData and sceNgs2RackGetUserData - #8322

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MarrasFederico:feat/ngs2-rack-user-data
Oct 21, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MarrasFederico:feat/ngs2-rack-user-data

Conversation

@MarrasFederico

Copy link
Copy Markdown
Contributor

What

sceNgs2RackSetUserData and sceNgs2RackGetUserData were declared in libSceNgs2/PendingExports.cpp as throwing stubs. SharpProspero Ngs2.cs describes them as attaching caller data to a rack and reading it back, with the signatures (rackHandle, userData) and (rackHandle, outUserData); shadPS4 declares the same signatures and only logs them.

They now live next to the other rack calls in libSceNgs2.native/src/Rack.cpp, so both libSceNgs2 and libSceNgs2.native export them, and they follow sceNgs2SystemSetUserData and sceNgs2SystemGetUserData:

  • Each rack keeps its own value, which starts at 0 and is independent of its system's and of other racks'.
  • A handle that is not a live rack, including a system handle and a destroyed rack, returns INVALID_RACK_HANDLE (0x804A8202) without writing.
  • The handle is checked before the output pointer; a null output pointer on a live rack throws, as in sceNgs2SystemGetUserData.

The two names leave the libSceNgs2 pending-exports debt entry, and a libSceNgs2.native entry records the sources and that the error order is not measured on a console.

Tested

Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with BUILD_TESTING=ON. Windows was not compiled. No title was run.

  • ngs2_render (TestUserData):
    • Invalid and system handles return INVALID_RACK_HANDLE for both calls and leave the output untouched; an invalid handle with a null output also returns INVALID_RACK_HANDLE.
    • A new rack reads 0. A value set on one rack reads back, a second rack still reads 0, and the system's own user data is unchanged.
    • A null output on a live rack throws.
    • After sceNgs2RackDestroy both calls return INVALID_RACK_HANDLE.
  • The test cannot link against main, where libSceNgs2.native has no such exports. Not storing the value, or checking the output pointer before the handle, makes it fail.
  • All 13 ngs2_* tests pass. The unpatched libSceNgs2.prx and libSceNgs2.native.prx export both functions.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py finds no conflicting lines. It could not compare feat(ngs2): add experimental I3DL2 reverb #1384 and feat(ngs2): decode complete HE-VAG waveform blocks #5797, which conflict with main; neither changes rack user data.

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

@github-actions

Copy link
Copy Markdown

Progress report (02fb1ce → 2b633ab)

📈 System libraries: 65.2% (+0.03%, +2 implemented, -2 removed functions)

✅ 2 implemented
Library Name
libSceNgs2.native sceNgs2RackGetUserData
libSceNgs2.native sceNgs2RackSetUserData
🗑️ 2 removed
Library Name
libSceNgs2 sceNgs2RackGetUserData
libSceNgs2 sceNgs2RackSetUserData

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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 1384 core/libs/prx/libSceNgs2.native/src/Ngs2Internal.hpp
core/libs/prx/libSceNgs2.native/src/Rack.cpp
PR 5797 core/libs/prx/libSceNgs2.native/src/Ngs2Internal.hpp
docs/dev/debt/libSceNgs2.native.md
PR 8609 core/libs/prx/libSceNgs2.native/src/Ngs2Internal.hpp
core/libs/prx/libSceNgs2.native/src/Rack.cpp
docs/dev/debt/libSceNgs2.native.md

@oneandonlydean
oneandonlydean merged commit 141a6a5 into boykopovar:main Oct 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants