refactor(prx): name the Xml, NKWebKit, Jsc and FreeTypeOl stubs the NID database resolves #12457
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12457"
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 simnJS on 2026-10-28T14:29:45Z.
What
tools/nid_names.pyalready resolves 775 of the 803*Unknown_*exports onmainthrough its pinned aerolib database, and every suggestion passes itscompute_nid(name) == nidcheck (statusrename-ready). This names the 542 of them in four libraries that no open pull request touches. Behaviour is unchanged: every body still throws throughNotImplemented_nid_no_patch, and the exported NID set of each library is the same as onmain. A title that reaches one of them now fails with the real symbol in the message instead ofsceXmlUnknown_+kAtAhAVcd0, as in #1145.sce::Xmlmangled symbol, declared in a newinclude/Api.hppthatlibSceXml.hppincludesWK*),WTFSetLogChannelLevel,JSObjectSetPrivate; theApi.hppdeclarations are renamed in placeDeprecated::ScriptValue1,JSObjectHasPropertyForKey,JSValueMakeString,JSWeakObjectMapCreate,WTFLogAlwaysV; declarations appended toApi.hppsceFreeTypeOl<Name>_nid_no_patchthat keeps its NID alias: the 83FTA_*module and format helpers,FT_Add_Module,FT_Alloc,FT_Attach_Stream,FT_CMap_Done,FT_CMap_New,FT_Done_GlyphSlot,FT_Done_Memory,FT_Free,FT_Get_Module_Interface_ZN3sce4Json17InitParameterRttiC1E…in libSceJson2): the throwing function carries the symbol name and the NID is derived from it, so the explicitAPS5_EXPORTalias goes away. Each name gets exactly one header declaration, aspublic_headersrequires.49032fe9ed,379b8a550d): libSceFreeType defines theFT_*symbols, so a same-named export here would be a duplicate export; the helper takes the symbol's name withoutFT_(FTA_becomesFta) and keeps the alias.FT_AllocandFT_Freeget exactly the helper names #12004 gives them (sceFreeTypeOlAlloc_nid_no_patch,sceFreeTypeOlFree_nid_no_patch), so those lines merge with #12004 and #12373 without a conflict.Export.cppstarted with 150 copies of the same#include "prx/libSceNKWebKit/include/Api.hpp"; they collapse to one.Every name fits its library: all 150 libSceXml names are
sce::Xml, the libSceJsc and libSceNKWebKit names are JavaScriptCore/WTF/Inspector/bmalloc and WebCore/WebKit symbols, the libSceFreeTypeOl names are FreeType's. As an independent check, hashing every identifier of the bundled FreeType 2.13.3 tree (3rdparty/freetype, 58467 identifiers) gives the same names for the seven libSceFreeTypeOl NIDs whose functions still exist in 2.13.3 (FT_Add_Module,FT_Attach_Stream,FT_CMap_Done,FT_CMap_New,FT_Done_GlyphSlot,FT_Done_Memory,FT_Get_Module_Interface), and 106 libSceFreeTypeOt NIDs;FT_Alloc/FT_Free(removed from FreeType before 2.13) and Sony'sFTA_*helpers come from the database only.Left out on purpose:
Export.cppis edited by 25 open pull requests that rename or remove these aliases as they implement them (#10582 … #10613, #11426, #11613, #12370 and others).tools/progress.py: unchanged, 46.65 % (+542 declared, -542 removed: the same throwing stubs under their real names).Reproduce from
main(the whole change except the debt text):Tested
Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7 (x86_64-ucrt-posix-seh), Release,
BUILD_TESTING=ON, onmain750cf6cf48. No title run: nothing changes behaviour.libSceXml.prx,libSceNKWebKit.prx,libSceJsc.prxandlibSceFreeTypeOl.prx; their PE export tables (objdump -p) hold exactly the NIDsmain's sources declare (150, 150, 160 and 92, plus the two sharedFT_Outline_Get*Borderexports in libSceFreeTypeOl), none missing, none added.compute_nidof every exported function name are the same set before and after; noUnknownexport is left in the four files.python tools/nid_names.py: 803 unknowns before, 261 after (libSceFreeTypeOt 126, libSceIcu 107, and the 28 without a database entry).guest_freetype_outline_border_*(libSceFreeTypeOl and libSceFreeTypeOt, raw and patched) andguest_jsc_string, the tests that link these libraries: pass, 3 runs each (--repeat until-fail:3).public_headers,public_headers_compile_*,conventions_*,test_registrationandtest_script_registration: 107/107 pass.test_public_headers.py --audit-only: 368 libraries, 13511 exports verified.python tools/check_conventions.py --base origin/mainwith this title and body: all checks pass.python tools/pr_overlap.py --branch refactor/name-nid-database-stubs: no overlap with the 1328 open pull requests. Three share a file: #12004 and #12373 (libSceFreeTypeOl/Export.cpp, where they rename the same two helpers to the same names) and #12442 (libSceJsc/Export.cpp,include/Api.hpp,docs/dev/debt/libSceJsc.md);git merge-treewith each head gives no conflict.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T14:34:25Z.
Review: COMMENTED
I checked the exact head
fa4dd26fa7againstupstream/main446bd8776c. The 150 former explicit NID aliases in each of libSceXml, libSceJsc and libSceNKWebKit resolve to names in the PR source whosecompute_nid(name)matches the original NID (450/450); all 92 libSceFreeTypeOl aliases remain present.python3 tools/nid_names.pyreports 261 unknowns with 233 suggestions, consistent with the described remaining unknowns, andpython3 tools/check_conventions.py --base upstream/mainpasses. I did not run a C++ build or title test, and Windows/report CI is still in progress, so this is a source/convention check rather than full runtime validation.Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T14:50:24Z.
Review: APPROVED
I checked head
fa4dd26fa7on macOS 15 (Apple clang, libc++, arm64 host; Python 3.13). This adds macOS evidence to the Windows run in the body and to @MarcZX10's source check. The libs lane is not built on macOS, so I did not run the guest tests.pr_overlap.source_exportsover all of the library's sources, atfa4dd26fa7~1and at the head. The sets are identical: libSceXml 150/150, libSceNKWebKit 150/150, libSceJsc 160/160, libSceFreeTypeOl 92/92. None is only in base, none only in head, and no NID has more than one name.aerolib.csv. Every NID is in the database,compute_nid(symbol) == nidholds, and every helper name equals the symbol after the stated mapping:FT_removed,FTA_→Fta, underscores dropped. 92/92, no mismatch.APS5_VABIdefinition undercore/libs/prxfor names defined in more than one library. There are 14 at base and the same 14 at head, all pre-existing (MsgDialog/.native, LibreSsl/LibreSsl3 and so on). The 450 new names add none, so no WTF/JSC name is shared between libSceJsc and libSceNKWebKit.test_public_headers.py --audit-onlyreports 13061 → 13511 exports verified, which is +450 declarations, one per new name. I ran all 64public_headers_compile_*batches with Apple clang-Werrorand they pass. Batches 6 and 50 fail on arm64 atWindowsFormatting.hpp:658(thelong doublestatic_assert, libc, which this PR does not touch); with-arch x86_64they pass.clang++ -arch x86_64 -std=c++20 -fsyntax-only -Werror -Wallon the fourExport.cppgives 0 errors at both base and head.tools/progress.py --modulegives the same counts before and after (Xml 0/150, NKWebKit 0/150, Jsc 4/160, FreeTypeOl 0/92).nid_names.py --jsongoes from 803 rows (775 rename-ready, 28 unknown) to 261 (233 rename-ready, 28 unknown), which matches the body.upstream/mainb4757928c0, #12442, #12004 and #12373 in one octopus merge. It is clean, with only an auto-merge inlibSceFreeTypeOl/Export.cpp. On the merge, the NID sets are unchanged against the head (same four counts), the header audit passes with 13516 exports, the Jsc and FreeTypeOl TUs compile with 0 errors, and there are still 14 duplicate names.check_conventions.py --base upstream/mainpasses with this title and body.Debt hunks: these are wording updates only (the stub prefix is replaced by the symbol families, plus a link to the database). They make no behaviour claim.
AI-assisted: yes