feat(tools): flag Unknown exports whose NID is already a symbol in the tree #6268
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6268"
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 DavidFB-creator on 2026-10-15T08:31:12Z.
What
Adds an
unknown-nidrule totools/check_conventions.py. An addedAPS5_EXPORT("<NID>", name)whose name marks the NID as unknown (the testtools/nid_names.pyuses:unknownin the name) is an error when a symbol incore/libs/prx(outsidetests/) already gets that NID fromnid_patcher: a_nid_postfixname (definition, declaration or call), anAPS5_VABIfunction, or anAPS5_ASM_FUNCTION/APS5_SIGNAL_ASM_FUNCTION. NIDs followResolveOneName:_nid_postfixand a trailing_nid_disambig<N>are stripped, and_nid_no_patch,_nid_no_patch_cutandSDL_names get none. The reverse is reported too: an added symbol whose NID is an existing Unknown export.#5608 exported
YNw9Xk5iNWofrom libSceVideoOut as a throwing stub,sceVideoOutUnknown_YNw9Xk5iNWo. That is the NID ofMouseIsOpen:MouseIsOpen_nid_postfix, which libSceVideoOut imports from libSceMouse for mouse capture. Depending on load order, VideoOut's call reached its own stub and presentation failed withYNw9Xk5iNWo not implemented. #5738 reverted it, and #5936 renamed the helpers to_nid_no_patch. On #5608's mergea3aeaf884, against its first parent, the rule reports:Refs #6245 and #5595.
v0.1.2(a48c00660) was tagged at 08:56:52 UTC, before #5738 merged at 08:58:38, and its source still has both the stub andMouseIsOpen_nid_postfix(). That fits #6245 (Octopath Traveler, a VideoOut presentation failure namingYNw9Xk5iNWo) and the note on #5381. TheYNw9Xk5iNWoin #5595 is the same helper import, not a title import, which fits the base Onimusha eboot not importing it. This PR does not change either issue's runtime; libraries built from currentmainno longer have the collision.Named aliases are not checked. libc and libSceLibcInternal, and libSceAmpr and libc, share NIDs on purpose (
libc___cxa_finalize,sceAmprLocaleconv), andduplicate-exportstill compares names only. #5849 (ELF exports that patch to the same name in one library) is complementary: it sees neither imports nor other libraries.Tested
Windows 11 Pro (26300), Python 3.13, Git for Windows. No CMake build: the Python tests were run directly.
tools/tests/test_check_conventions_unknown_nids.py(ctestconventions_unknown_nids): 10 tests pass in about 5 s. Againsttools/check_conventions.pyfrommain, the 6 that expect the error fail.maindb81992c5, 22 Unknown exports against 3,890 symbol NIDs, no collision. Ona3aeaf884, one:YNw9Xk5iNWoabove.test_check_conventions_*.py,test_nid_names.pyandtest_import_audit.pypass.test_check_conventions_comments.py(ctestconventions_function_bodies, #5672) took 17.7 to 18.3 s with the change and 18.3 to 19.1 s without, three runs each.python3 tools/check_conventions.py --base origin/mainwith this title and body, andgit diff --check: clean.tools/check_test_registration.py(it needs a configured build), Linux, macOS.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:17:47Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)CMakeLists.txtL155Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
CMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txtCMakeLists.txt