feat(tools): add an import audit for converted games #1461
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1461"
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 abderahmane-ai on 2026-10-08T08:02:37Z.
What
Adds
tools/import_audit.py, which classifies every import of a converted game in one pass instead of one failing function per launch (see #1033, #1305).It reads the JSON from
relinker --registryand the built.prxfiles (ELF.dynsymand PE export table, the same view the loader has), and puts each NID and library pair in one class:implemented: a built library exports itstub: exported, but the whole function callsNotImplemented_nid_no_patch, found throughtools/progress.pyabsent: no built library exports it, so the loader failsmodule: the import names a file in--modules, the title's own library; not checkedIt also lists needed libraries that have no file, and imports exported only by a library other than the one they name (they resolve on Linux and can fail on Windows).
--namestakes anaerolib.csv-style file to name absent imports and never downloads one;--jsonwrites the full result stamped with the commit. Exit code is 1 when anything blocks loading.Related: #552 turns a list of missing NIDs into stubs; this produces that list.
Tested
python3 tools/tests/test_import_audit.py(13 tests, registered in CTest asimport_audit): ELF and PE libraries built byte by byte, undefined and local symbols excluded, every reference lands in exactly one class (a check that fails on the residue), invalid registry entries, truncated libraries, a UTF-8 BOM, a missing names file that must not download, and the NID ofsceMsgDialogProgressBarSetValue(wTpfglkmv34, from #906) as an outside anchor.#suffix kept, duplicate references collapsed, postfix kept, module check removed, a done twin not winning over a stub); the tests caught all eight.relinker --registryfrom a relinker built from this branch.python3 tools/check_conventions.py --base origin/mainpasses.libsdoes not build on this host; the readers mirrornid_patcher's), and on a real title.The code, tests and docs were written with AI assistance. I read every line and ran the checks above.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T13:59:21Z.
Rebased on current
main(onlyCMakeLists.txtconflicted: the Python test block moved;import_auditis registered next toprogress_report).Checked: build + ctest green (460/460),
tools/check_conventions.pypasses,import_auditfails whentools/import_audit.pyis reverted, registry fields match whatrelinker --registrywrites on main, and the audit runs against the Linux-built.prxfiles. Not run here: PE libraries from a real Windows build. Merging once CI is green.#1462 is stacked on this one and will need a rebase after the merge.