refactor(prx): name the LibcInternal math stubs the NID database resolves #15767

Merged
ItsJustChrisE merged 1 commit from upstream-pr/15767 into main 2026-11-08 02:31:01 +00:00
ItsJustChrisE commented 2026-11-04 13:33:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ItsJustChrisE on 2026-11-04T13:33:13Z.


What

Renames 12 sceLibcInternalUnknown_*_nid_no_patch stubs in core/libs/prx/libSceLibcInternal/Export.cpp to the Dinkumware math helper names that tools/nid_names.py resolves from the pinned aerolib database, and drops their APS5_EXPORT lines, the same way #14884 and #15405 did for other libraries:

NID Name
aQURHgjHo-w _Erfc
qwR1gtp-WS0 _FErfc
PG4HVe4X+Oc _LErfc
wUa+oPQvFZ0 _Hypot
DS03EjPDtFo _FHypot
IRUFZywbTT0 _LHypot
ECh+p-LRG6Y _Pow
A98W3Iad6xE _FPow
3Z8jD-HTKr8 _LPow
TLvAYmLtdVw _FRint
fJmOr59K8QY _LRint
Ss3108pBuZY _Nnl

The 12 functions are declared once in include/MathInternals.hpp, in sorted order with the existing _Atan … _Quadph helpers, and still call NotImplemented_nid_no_patch(__func__). No behaviour changes.

Left out on purpose: _Plsw, _Pmsw, _FPlsw, _FPmsw, _LPlsw and _LPmsw in the same file, which #13782 implements, and __atomic_store_n, __atomic_exchange_n and __atomic_compare_exchange_n in InventoryExports.cpp, which #13486 implements.

Tested

Ubuntu 26.04.1 LTS (WSL2), GCC 15.2.0, Ninja, Release, main at b11c7bf84f.

  • compute_nid(name) == nid from tools/nid_names.py for all 12 renames: 12/12 match.
  • cmake --build build --parallel 16: passes on main and on this branch.
  • nm -D --defined-only build/core/libs/libs/libSceLibcInternal.prx: same NID set on main and on this branch (2065 and 2053 symbols). The only difference is the 12 removed sceLibcInternalUnknown_*_nid_no_patch helper symbols. All 12 NIDs are still exported.
  • ctest --test-dir build -R 'public_headers|patched_librar|libcinternal|LibcInternal|libc_internal|guest_' -j 16 --output-on-failure: 1617 tests, 100% passed on both main and this branch. guest_video_out_high_frame_rate is skipped on both (no GPU).
  • python3 tools/check_conventions.py --base origin/main: all conventions checks passed.
  • python3 tools/pr_overlap.py --branch <branch>: no PR shares lines or exports. It could not compare Export.cpp with #5021, #13486 and #13782 because those PRs conflict with main. I compared them by hand: none of them touches the 12 NIDs or names above.
  • Not run: the full ctest suite, the Windows/MinGW build, the relinker-only build (no relinker or tools change) and any title.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5155151322 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15767). Originally posted by [ItsJustChrisE](https://github.com/ItsJustChrisE) on 2026-11-04T13:33:13Z. --- ### What Renames 12 `sceLibcInternalUnknown_*_nid_no_patch` stubs in `core/libs/prx/libSceLibcInternal/Export.cpp` to the Dinkumware math helper names that `tools/nid_names.py` resolves from the pinned aerolib database, and drops their `APS5_EXPORT` lines, the same way #14884 and #15405 did for other libraries: | NID | Name | |---|---| | `aQURHgjHo-w` | `_Erfc` | | `qwR1gtp-WS0` | `_FErfc` | | `PG4HVe4X+Oc` | `_LErfc` | | `wUa+oPQvFZ0` | `_Hypot` | | `DS03EjPDtFo` | `_FHypot` | | `IRUFZywbTT0` | `_LHypot` | | `ECh+p-LRG6Y` | `_Pow` | | `A98W3Iad6xE` | `_FPow` | | `3Z8jD-HTKr8` | `_LPow` | | `TLvAYmLtdVw` | `_FRint` | | `fJmOr59K8QY` | `_LRint` | | `Ss3108pBuZY` | `_Nnl` | The 12 functions are declared once in `include/MathInternals.hpp`, in sorted order with the existing `_Atan` … `_Quadph` helpers, and still call `NotImplemented_nid_no_patch(__func__)`. No behaviour changes. Left out on purpose: `_Plsw`, `_Pmsw`, `_FPlsw`, `_FPmsw`, `_LPlsw` and `_LPmsw` in the same file, which #13782 implements, and `__atomic_store_n`, `__atomic_exchange_n` and `__atomic_compare_exchange_n` in `InventoryExports.cpp`, which #13486 implements. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Ubuntu 26.04.1 LTS (WSL2), GCC 15.2.0, Ninja, Release, `main` at b11c7bf84f5d2f636ff60166cc3371bd071e24d5. - `compute_nid(name) == nid` from `tools/nid_names.py` for all 12 renames: 12/12 match. - `cmake --build build --parallel 16`: passes on `main` and on this branch. - `nm -D --defined-only build/core/libs/libs/libSceLibcInternal.prx`: same NID set on `main` and on this branch (2065 and 2053 symbols). The only difference is the 12 removed `sceLibcInternalUnknown_*_nid_no_patch` helper symbols. All 12 NIDs are still exported. - `ctest --test-dir build -R 'public_headers|patched_librar|libcinternal|LibcInternal|libc_internal|guest_' -j 16 --output-on-failure`: 1617 tests, 100% passed on both `main` and this branch. `guest_video_out_high_frame_rate` is skipped on both (no GPU). - `python3 tools/check_conventions.py --base origin/main`: all conventions checks passed. - `python3 tools/pr_overlap.py --branch <branch>`: no PR shares lines or exports. It could not compare `Export.cpp` with #5021, #13486 and #13782 because those PRs conflict with `main`. I compared them by hand: none of them touches the 12 NIDs or names above. - Not run: the full `ctest` suite, the Windows/MinGW build, the relinker-only build (no relinker or tools change) and any title. ### 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: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!15767
No description provided.