feat(tools): suggest real names for Unknown NID stubs from hash-verified DB #542

Merged
Pouare514 merged 2 commits from upstream-pr/542 into main 2026-10-04 23:46:57 +00:00
Pouare514 commented 2026-10-04 16:24:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T16:24:26Z.


What

New stdlib-only tool \ ools/nid_names.py: scans every \APS5_EXPORT(NID, Unknown)\ in core, looks the NID up in the public hash-verified database (zecoxao/sce_symbols aerolib.csv, downloaded once to a local cache or via ANYPS5_NID_DB), and prints the verified real name plus whether it already exists in the tree. --verify recomputes every suggested NID with the project's own Nid::Compute algorithm and fails on mismatch.

Nothing is vendored (12 MB CSV, unlicensed upstream data stays out of the repo). On current main: 150 unknowns, 141 suggestions, verify clean.

Tested

  • Windows, python3: default run prints the table, --nid resolves single NIDs, --verify exits 0, --json emits machine-readable output.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4735858050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/542). Originally posted by [Pouare514](https://github.com/Pouare514) on 2026-10-04T16:24:26Z. --- ### What New stdlib-only tool \ ools/nid_names.py\: scans every \APS5_EXPORT(NID, *Unknown*)\ in core, looks the NID up in the public hash-verified database (zecoxao/sce_symbols aerolib.csv, downloaded once to a local cache or via ANYPS5_NID_DB), and prints the verified real name plus whether it already exists in the tree. --verify recomputes every suggested NID with the project's own Nid::Compute algorithm and fails on mismatch. Nothing is vendored (12 MB CSV, unlicensed upstream data stays out of the repo). On current main: 150 unknowns, 141 suggestions, verify clean. ### Tested - Windows, python3: default run prints the table, --nid resolves single NIDs, --verify exits 0, --json emits machine-readable output. ### Checklist - [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 - [x] Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt - [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 - [ ] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-04 21:19:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:22Z.


Thanks, this is handy. compute_nid matches NidCompute.cpp, and on this branch I get the same 150 unknowns and 141 suggestions with --verify clean. A few things before it goes in:

  1. collect_real_names only finds names with _nid_postfix, but most exports are plain names, so "already-implemented" rarely fires. For example CWVW78Qc3fI (sceMsgDialogUnknown00 in libSceMsgDialog.native) comes out as rename-ready to sceMsgDialogGetStatus, which libSceMsgDialog/Export.cpp already defines. Collecting every APS5_VABI name( definition, like DEFINITION in tools/progress.py, would catch it.
  2. The hash check only runs with --verify, while the output presents every suggestion as verified. It costs nothing, so I'd always run it and mark mismatches.
  3. The download comes from a branch of a third-party repo; pinning a commit in DB_URL would make the results reproducible.

Small one: CONVENTIONS asks for no comments, which covers the module docstring too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984495134 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/542#issuecomment-5984495134). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T21:19:22Z. --- Thanks, this is handy. `compute_nid` matches `NidCompute.cpp`, and on this branch I get the same 150 unknowns and 141 suggestions with `--verify` clean. A few things before it goes in: 1. `collect_real_names` only finds names with `_nid_postfix`, but most exports are plain names, so "already-implemented" rarely fires. For example CWVW78Qc3fI (`sceMsgDialogUnknown00` in libSceMsgDialog.native) comes out as rename-ready to `sceMsgDialogGetStatus`, which `libSceMsgDialog/Export.cpp` already defines. Collecting every `APS5_VABI name(` definition, like `DEFINITION` in `tools/progress.py`, would catch it. 2. The hash check only runs with `--verify`, while the output presents every suggestion as verified. It costs nothing, so I'd always run it and mark mismatches. 3. The download comes from a branch of a third-party repo; pinning a commit in `DB_URL` would make the results reproducible. Small one: CONVENTIONS asks for no comments, which covers the module docstring too.
Pouare514 commented 2026-10-04 22:59:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T22:59:20Z.


Done all four: collect_real_names now collects every APS5_VABI definition like progress.py DEFINITION (plus _nid_postfix-stripped names), so CWVW78Qc3fI correctly reports already-implemented; the hash check always runs and mismatches are marked (RC 1 on mismatch), which made --verify redundant so I removed the flag; DB_URL pins commit 2883963a0a514ba6e77407a08ef4730a65e88254; module docstring removed. Tree scan on this branch: 150 unknowns, 141 suggestions, 0 mismatches.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985375409 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/542#issuecomment-5985375409). Originally posted by [Pouare514](https://github.com/Pouare514) on 2026-10-04T22:59:20Z. --- Done all four: collect_real_names now collects every APS5_VABI definition like progress.py DEFINITION (plus _nid_postfix-stripped names), so CWVW78Qc3fI correctly reports already-implemented; the hash check always runs and mismatches are marked (RC 1 on mismatch), which made --verify redundant so I removed the flag; DB_URL pins commit 2883963a0a514ba6e77407a08ef4730a65e88254; module docstring removed. Tree scan on this branch: 150 unknowns, 141 suggestions, 0 mismatches.
oneandonlydean commented 2026-10-04 23:43:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:48Z.


Thanks, all four are in: every APS5_VABI definition counts as implemented (CWVW78Qc3fI now says already-implemented), the hash check always runs with a non-zero exit on a mismatch, and the database is pinned to 2883963a. On current main I get 149 unknowns, 140 suggestions, 1 already implemented and no mismatches. Ready to merge from my side.

One thing for later, not for this PR: DEFINITION doesn't match the 25 functions on main that are written as function try blocks (int APS5_VABI f() try {, used in libSceVideoOut). None of them is a suggestion today, so it changes nothing yet; (?:noexcept\s*)?(?:try\s*)?\{ would cover them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985701115 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/542#issuecomment-5985701115). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T23:43:48Z. --- Thanks, all four are in: every `APS5_VABI` definition counts as implemented (CWVW78Qc3fI now says already-implemented), the hash check always runs with a non-zero exit on a mismatch, and the database is pinned to 2883963a. On current main I get 149 unknowns, 140 suggestions, 1 already implemented and no mismatches. Ready to merge from my side. One thing for later, not for this PR: `DEFINITION` doesn't match the 25 functions on main that are written as function try blocks (`int APS5_VABI f() try {`, used in libSceVideoOut). None of them is a suggestion today, so it changes nothing yet; `(?:noexcept\s*)?(?:try\s*)?\{` would cover them.
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!542
No description provided.