feat(libSceLibcInternal): name 45 math helper exports from their NIDs #13835

Merged
CodingBreadd merged 1 commit from upstream-pr/13835 into main 2026-11-02 00:43:59 +00:00
CodingBreadd commented 2026-10-31 08:47:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CodingBreadd on 2026-10-31T08:47:45Z.


What

Names 45 of the 62 math helpers among the 120 sceLibcInternalUnknown_*_nid_no_patch exports of libSceLibcInternal. Each new name is a PS5 3.20 import name already listed under "Additional imported names" in the libSceLibcInternal debt file, and its tools/nid_names.py hash equals the stub's NID: the double, float and long double families of _Atan, _Dtento, _Logpoly, _Quad and _Quadph, plus _FSincos, _LSincos, _FTan, _LTan, _FTgamma, _LTgamma and the 24 _FXp_* and _LXp_* helpers.

Every renamed export still throws through NotImplemented_nid_no_patch, keeps the no-parameter import-resolution convention and is declared once in include/MathInternals.hpp. No other library exports these names. Missing-import and unimplemented-call errors now name the function instead of the alias. The debt entry is unchanged: it already lists these names as declared for import resolution only, with unverified prototypes and behavior, and that is what remains open.

The other 17 math helpers keep their aliases. Open pull requests implement 14 of them: _Hypot, _FHypot and _LHypot in #12363, _FRint and _LRint in #12364, _Erfc, _FErfc and _LErfc in #12365, and the _Plsw and _Pmsw families in #13782. The _Pow, _FPow and _LPow stubs directly follow blocks #13782 deletes, so renaming them would make the two conflict. This branch merges cleanly with #13724 and #13782. #13273, #11749, #11750, #11751, #12924 and #12896 change libSceLibcInternal but none of these exports, and #5021 changes only sceLibcHeapGetTraceInfo in the same file. #13840 names the locale, stdio, time, exit and thread helpers.

Tested

Windows 11, WinLibs GCC 15.2.0 (UCRT, POSIX, SEH). Built libSceLibcInternal and the patched libSceLibcInternal.prx from this branch and from main; both patched export tables hold the same 662 NIDs. ctest -R "^(guest_getopt|guest_inet_address)$": 2/2 passed. test_public_headers.py --audit-only and header compile batches 3, 4, 5 and 26 (the ones holding the libSceLibcInternal headers) pass, run directly: on this loaded machine an earlier ctest run of the batch holding MathInternals.hpp passed in 27 s but hit its 30 s timeout when run in parallel. tools/check_conventions.py --base origin/main passes. No title tested.

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:5096059917 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13835). Originally posted by [CodingBreadd](https://github.com/CodingBreadd) on 2026-10-31T08:47:45Z. --- ### What Names 45 of the 62 math helpers among the 120 `sceLibcInternalUnknown_*_nid_no_patch` exports of libSceLibcInternal. Each new name is a PS5 3.20 import name already listed under "Additional imported names" in the libSceLibcInternal debt file, and its `tools/nid_names.py` hash equals the stub's NID: the double, float and long double families of `_Atan`, `_Dtento`, `_Logpoly`, `_Quad` and `_Quadph`, plus `_FSincos`, `_LSincos`, `_FTan`, `_LTan`, `_FTgamma`, `_LTgamma` and the 24 `_FXp_*` and `_LXp_*` helpers. Every renamed export still throws through `NotImplemented_nid_no_patch`, keeps the no-parameter import-resolution convention and is declared once in `include/MathInternals.hpp`. No other library exports these names. Missing-import and unimplemented-call errors now name the function instead of the alias. The debt entry is unchanged: it already lists these names as declared for import resolution only, with unverified prototypes and behavior, and that is what remains open. The other 17 math helpers keep their aliases. Open pull requests implement 14 of them: `_Hypot`, `_FHypot` and `_LHypot` in #12363, `_FRint` and `_LRint` in #12364, `_Erfc`, `_FErfc` and `_LErfc` in #12365, and the `_Plsw` and `_Pmsw` families in #13782. The `_Pow`, `_FPow` and `_LPow` stubs directly follow blocks #13782 deletes, so renaming them would make the two conflict. This branch merges cleanly with #13724 and #13782. #13273, #11749, #11750, #11751, #12924 and #12896 change libSceLibcInternal but none of these exports, and #5021 changes only `sceLibcHeapGetTraceInfo` in the same file. #13840 names the locale, stdio, time, exit and thread helpers. ### 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. --> Windows 11, WinLibs GCC 15.2.0 (UCRT, POSIX, SEH). Built `libSceLibcInternal` and the patched `libSceLibcInternal.prx` from this branch and from `main`; both patched export tables hold the same 662 NIDs. `ctest -R "^(guest_getopt|guest_inet_address)$"`: 2/2 passed. `test_public_headers.py --audit-only` and header compile batches 3, 4, 5 and 26 (the ones holding the libSceLibcInternal headers) pass, run directly: on this loaded machine an earlier `ctest` run of the batch holding `MathInternals.hpp` passed in 27 s but hit its 30 s timeout when run in parallel. `tools/check_conventions.py --base origin/main` passes. No title tested. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> 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!13835
No description provided.