feat(libSceLibcInternal): name 53 runtime helper exports from their NIDs #13840

Merged
CodingBreadd merged 1 commit from upstream-pr/13840 into main 2026-11-01 03:28:20 +00:00
CodingBreadd commented 2026-10-31 08:57:37 +00:00 (Migrated from github.com)

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


What

Names 53 of the 58 locale, stdio, time, exit and thread helpers among the 120 sceLibcInternalUnknown_*_nid_no_patch exports of libSceLibcInternal, such as _Fopen, _Printf, _Getfld, _Getctyptab, _Makeloc, _Gentime, _Getzone, _Atqexit, _Call_onceEx and _Lock_spin_lock. 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.

Every renamed export still throws through NotImplemented_nid_no_patch, keeps the no-parameter import-resolution convention and is declared once in include/RuntimeInternals.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 5 keep their aliases: #13724 implements _Mtxdst, _Mtxinit, _Mtxlock and _Mtxunlock, and the _Nnl stub directly follows the blocks #13724 deletes, so renaming it would make the two conflict. The umbrella include goes first so it does not touch the line #13782 appends after. This branch merges cleanly with #13724, #13782 and #13835, which names the math helpers. #13273, #11749, #11750, #11751, #12924 and #12896 change libSceLibcInternal but none of these exports, and #5021 changes only sceLibcHeapGetTraceInfo in the same file.

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. 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:5096121539 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13840). Originally posted by [CodingBreadd](https://github.com/CodingBreadd) on 2026-10-31T08:57:37Z. --- ### What Names 53 of the 58 locale, stdio, time, exit and thread helpers among the 120 `sceLibcInternalUnknown_*_nid_no_patch` exports of libSceLibcInternal, such as `_Fopen`, `_Printf`, `_Getfld`, `_Getctyptab`, `_Makeloc`, `_Gentime`, `_Getzone`, `_Atqexit`, `_Call_onceEx` and `_Lock_spin_lock`. 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. Every renamed export still throws through `NotImplemented_nid_no_patch`, keeps the no-parameter import-resolution convention and is declared once in `include/RuntimeInternals.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 5 keep their aliases: #13724 implements `_Mtxdst`, `_Mtxinit`, `_Mtxlock` and `_Mtxunlock`, and the `_Nnl` stub directly follows the blocks #13724 deletes, so renaming it would make the two conflict. The umbrella include goes first so it does not touch the line #13782 appends after. This branch merges cleanly with #13724, #13782 and #13835, which names the math helpers. #13273, #11749, #11750, #11751, #12924 and #12896 change libSceLibcInternal but none of these exports, and #5021 changes only `sceLibcHeapGetTraceInfo` in the same file. ### 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. `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)
MarcZX10 commented 2026-10-31 09:07:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T09:07:18Z.

Review: APPROVED


Reviewed — looks good

At head ed98d46807d4448543a0656f666d09d81aa61a6c, all 53 renamed helpers map to their existing import NIDs, remain throwing stubs, and have no blocking ABI or convention issue in the reviewed diff.

What I ran

Reviewed the exact head ed98d46807d4448543a0656f666d09d81aa61a6c. The branch's merge base is 45e39c7ad16c93871809eee8c81c3865596e883f; a local merge preview against current main 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab was clean. Checks ran on Linux 6.1.0-54-amd64 with Python 3.11.2; GCC 12.2 was available but I did not compile.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13840 --no-negative-controls --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13840
python3 tools/pr_abi_audit.py --base 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab --head ed98d46807d4448543a0656f666d09d81aa61a6c --json
python3 tools/check_conventions.py --base 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab --head ed98d46807d4448543a0656f666d09d81aa61a6c --title 'feat(libSceLibcInternal): name 53 runtime helper exports from their NIDs' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13840/pr-body.md
python3 tools/nid_names.py --from-file /tmp/anyps5-13840-names-exact.txt --json
git worktree add --detach /tmp/anyps5-13840-header-audit ed98d46807d4448543a0656f666d09d81aa61a6c
python3 /tmp/anyps5-13840-header-audit/core/libs/tests/test_public_headers.py --audit-only
git worktree remove /tmp/anyps5-13840-header-audit

I compared all 53 computed name NIDs with the export IDs removed by this patch and checked the base debt inventory. The precheck's isolated checkout lacked two local-only helper scripts (pr_abi_audit.py and pr_test_quality.py); I ran both from the workspace against these exact SHAs.

Results

Check Result
Diff, conventions, and PR template Passed.
Current-main merge preview Clean against 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab; no declared dependency.
ABI/NID review 53 renamed exports; all 53 computed names map to the removed export IDs; no duplicate names or IDs; all 53 names already occur in the base debt file. ABI audit emitted 53 expected export-removed warnings for replacing aliases, with no other finding.
Public-header audit Passed on the exact head: 393 libraries, 24,977 exports.
Test-quality heuristic Passed with no findings; this PR changes no tests.
Hosted CI Eligibility, intake, conventions, labels, portability, and report passed. Windows was in progress; Linux and specialized relinker jobs were skipped.
Local build and CTest Not run. The author reports a Windows 11/WinLibs build, unchanged 662-NID export tables, and two focused tests passing; I did not independently reproduce those runs.
Unedited outputs from checks
All conventions checks passed.
393 libraries, 24977 exports: unique declarations and umbrella coverage verified
old aliases: 53; new declarations: 53; matching computed NIDs: 53/53
unmatched old NIDs: 0; duplicate new names: 0; names absent from base debt: 0
ABI removal warnings correspond exactly to renamed stubs: True; other ABI findings: 0
{
  "findings": [],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

git diff --check produced no output and exited 0. The ABI auditor reported passed_with_warnings: its 53 warnings are the old aliases removed by this rename; the name-to-NID comparison above matched all 53 to their replacement symbols. The wrapper's missing-helper message was:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13840/head-ed98d46807d4-f11d9cce/tools/pr_abi_audit.py': [Errno 2] No such file or directory

The same missing-helper condition affected the wrapper's heuristic invocation; both helper checks were run directly from the workspace. Hosted status at review time:

conventions	pass	21s	https://github.com/boykopovar/AnyPS5/actions/runs/41186690047/job/124494942117
labels	pass	9s	https://github.com/boykopovar/AnyPS5/actions/runs/41186690035/job/124494942001
windows	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211072
library-portability	pass	1m39s	https://github.com/boykopovar/AnyPS5/actions/runs/41186690060/job/124494941543
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211697
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211752
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211902
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211759
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211871
eligibility	pass	3s	https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124494941650
intake	pass	17s	https://github.com/boykopovar/AnyPS5/actions/runs/41186690056/job/124494942052
report	pass	1m4s	https://github.com/boykopovar/AnyPS5/actions/runs/41186690136/job/124494941840

Findings

Blocking

None found.

Non-blocking

The PR intentionally records names for import resolution only; prototypes and runtime behavior remain unverified, and the functions still throw through NotImplemented_nid_no_patch. The author's Windows build/test evidence is useful but not independently reproduced here.

Sources

Not verified

No local C++ build, CTest, runtime import test, or console/title test was performed. Hosted Windows was in progress; hosted Linux was skipped. Function prototypes and runtime behavior remain unresolved as the PR states.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722105691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13840#pullrequestreview-5722105691). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T09:07:18Z. **Review:** APPROVED --- # Reviewed — looks good At head `ed98d46807d4448543a0656f666d09d81aa61a6c`, all 53 renamed helpers map to their existing import NIDs, remain throwing stubs, and have no blocking ABI or convention issue in the reviewed diff. ## What I ran Reviewed the exact head `ed98d46807d4448543a0656f666d09d81aa61a6c`. The branch's merge base is `45e39c7ad16c93871809eee8c81c3865596e883f`; a local merge preview against current `main` `809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab` was clean. Checks ran on Linux 6.1.0-54-amd64 with Python 3.11.2; GCC 12.2 was available but I did not compile. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13840 --no-negative-controls --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13840 python3 tools/pr_abi_audit.py --base 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab --head ed98d46807d4448543a0656f666d09d81aa61a6c --json python3 tools/check_conventions.py --base 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab --head ed98d46807d4448543a0656f666d09d81aa61a6c --title 'feat(libSceLibcInternal): name 53 runtime helper exports from their NIDs' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13840/pr-body.md python3 tools/nid_names.py --from-file /tmp/anyps5-13840-names-exact.txt --json git worktree add --detach /tmp/anyps5-13840-header-audit ed98d46807d4448543a0656f666d09d81aa61a6c python3 /tmp/anyps5-13840-header-audit/core/libs/tests/test_public_headers.py --audit-only git worktree remove /tmp/anyps5-13840-header-audit ``` I compared all 53 computed name NIDs with the export IDs removed by this patch and checked the base debt inventory. The precheck's isolated checkout lacked two local-only helper scripts (`pr_abi_audit.py` and `pr_test_quality.py`); I ran both from the workspace against these exact SHAs. ## Results | Check | Result | |---|---| | Diff, conventions, and PR template | Passed. | | Current-main merge preview | Clean against `809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab`; no declared dependency. | | ABI/NID review | 53 renamed exports; all 53 computed names map to the removed export IDs; no duplicate names or IDs; all 53 names already occur in the base debt file. ABI audit emitted 53 expected `export-removed` warnings for replacing aliases, with no other finding. | | Public-header audit | Passed on the exact head: 393 libraries, 24,977 exports. | | Test-quality heuristic | Passed with no findings; this PR changes no tests. | | Hosted CI | Eligibility, intake, conventions, labels, portability, and report passed. Windows was in progress; Linux and specialized relinker jobs were skipped. | | Local build and CTest | Not run. The author reports a Windows 11/WinLibs build, unchanged 662-NID export tables, and two focused tests passing; I did not independently reproduce those runs. | <details><summary>Unedited outputs from checks</summary> ```text All conventions checks passed. ``` ```text 393 libraries, 24977 exports: unique declarations and umbrella coverage verified ``` ```text old aliases: 53; new declarations: 53; matching computed NIDs: 53/53 unmatched old NIDs: 0; duplicate new names: 0; names absent from base debt: 0 ABI removal warnings correspond exactly to renamed stubs: True; other ABI findings: 0 ``` ```json { "findings": [], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` `git diff --check` produced no output and exited 0. The ABI auditor reported `passed_with_warnings`: its 53 warnings are the old aliases removed by this rename; the name-to-NID comparison above matched all 53 to their replacement symbols. The wrapper's missing-helper message was: ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13840/head-ed98d46807d4-f11d9cce/tools/pr_abi_audit.py': [Errno 2] No such file or directory ``` The same missing-helper condition affected the wrapper's heuristic invocation; both helper checks were run directly from the workspace. Hosted status at review time: ```text conventions pass 21s https://github.com/boykopovar/AnyPS5/actions/runs/41186690047/job/124494942117 labels pass 9s https://github.com/boykopovar/AnyPS5/actions/runs/41186690035/job/124494942001 windows pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211072 library-portability pass 1m39s https://github.com/boykopovar/AnyPS5/actions/runs/41186690060/job/124494941543 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211697 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211752 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211902 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211759 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124495211871 eligibility pass 3s https://github.com/boykopovar/AnyPS5/actions/runs/41186690087/job/124494941650 intake pass 17s https://github.com/boykopovar/AnyPS5/actions/runs/41186690056/job/124494942052 report pass 1m4s https://github.com/boykopovar/AnyPS5/actions/runs/41186690136/job/124494941840 ``` </details> ## Findings ### Blocking None found. ### Non-blocking The PR intentionally records names for import resolution only; prototypes and runtime behavior remain unverified, and the functions still throw through `NotImplemented_nid_no_patch`. The author's Windows build/test evidence is useful but not independently reproduced here. ## Sources - [Renamed definitions and export table at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/ed98d46807d4448543a0656f666d09d81aa61a6c/core/libs/prx/libSceLibcInternal/Export.cpp) - [Runtime helper declarations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/ed98d46807d4448543a0656f666d09d81aa61a6c/core/libs/prx/libSceLibcInternal/include/RuntimeInternals.hpp) - [Throwing-stub rule at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab/AGENTS.md#L3-L4) - [NID naming checker at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab/tools/nid_names.py) ## Not verified No local C++ build, CTest, runtime import test, or console/title test was performed. Hosted Windows was in progress; hosted Linux was skipped. Function prototypes and runtime behavior remain unresolved as the PR states.
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!13840
No description provided.