refactor(libc): name the 12 Cyberpunk stubs the NID database resolves #2301
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2301"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-09T15:04:02Z.
What
tools/nid_names.pyresolves 14libcCyberUnknown*stubs, and the earlier pull requests that implemented them (#492, #1952, #1981) are closed. Two of them are being implemented in their own pull requests,abs(Ye20uNnlglA) in #2316 and__powidf2(H+8UBOwfScI) in #2158, so this leaves those two alone. As in #1145, it renames the other 12 so aNotImplementedfailure names the real function. Behaviour is unchanged: every one still throws.5Lf51jvohTQlibcCyberUnknown03_Mtx_destroy7yMFgcS8EPAlibcCyberUnknown05_Cnd_destroyCyXs2l-1kNAlibcCyberUnknown07_IswctypeJhVR7D4Ax6YlibcCyberUnknown09_WStoulSreZybSRWpUlibcCyberUnknown10_Cnd_initVsP3daJgmVAlibcCyberUnknown11_Cnd_broadcastYaHc3GS7y7glibcCyberUnknown12_Mtx_initgTuXQwP9rrslibcCyberUnknown13_Mtx_unlockiS4aWbUonl0libcCyberUnknown14_Mtx_lockvEaqE-7IZYclibcCyberUnknown16_Cnd_waitrWSuTWY2JN0libcCyberUnknown18vsnprintf_stfNbpqL3D0MlibcCyberUnknown19vsscanf_sEach name hashes to its NID with
compute_nid. The functions follow the_nid_postfixconvention, so theAPS5_EXPORTaliases go.Side effect on the export table: the stubs were also exported under their own names, which
nid_patcherhashed into 12 extra NIDs (for examplecompute_nid("libcCyberUnknown03")) that no Sony module has. Those are gone. The 12 real NIDs above are still exported:libc.prxgoes from 1483 to 1471 exports, and the 12 removed are exactly the hashes of the old stub names.The comments above
vsnprintf_sandvsscanf_s(file-size idiom from #358) are left as they are; #1981 discussed that they don't match the names.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
BUILD_TESTING=ON, ond70b8998.python tools/nid_names.py: 22 unknowns / 14 suggestions before, 10 unknowns / 2 suggestions after (the two left to #2158 and #2316).libc.prxexport table compared withobjdump -pbefore and after, as above.ctest: 506/507 passed (1 skipped by design);guest_sce_netfails on this host onmaintoo, fixed by #2295.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functions (tools/pr_overlap.py: no shared exports; #2158 and #2316 edit the neighbouring stubs, so whichever lands second needs a rebase).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:07:36Z.
Checked all 12 names with
compute_nid(each matches its NID), the diff (rename only, every function still throws, no leftover references to the old names), build + ctest (517/517) on top of currentmain, and a clean merge-tree. Same pattern as #1145. Merging once CI is green; whichever of #2158 / #2316 lands second needs a rebase.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T21:09:48Z.
Progress report (
d70b899→9cea268)➖ System libraries: 84.69% (+0.0%, +12 declared, -12 removed functions)
🆕 12 declared as stubs
_Cnd_broadcast_nid_postfix_Cnd_destroy_nid_postfix_Cnd_init_nid_postfix_Cnd_wait_nid_postfix_Iswctype_nid_postfix_Mtx_destroy_nid_postfix_Mtx_init_nid_postfix_Mtx_lock_nid_postfix_Mtx_unlock_nid_postfix_WStoul_nid_postfixvsnprintf_s_nid_postfixvsscanf_s_nid_postfix🗑️ 12 removed
libcCyberUnknown03libcCyberUnknown05libcCyberUnknown07libcCyberUnknown09libcCyberUnknown10libcCyberUnknown11libcCyberUnknown12libcCyberUnknown13libcCyberUnknown14libcCyberUnknown16libcCyberUnknown18libcCyberUnknown19