fix(tools): audit stubs from shared library sources #4951

Merged
Ondra97 merged 1 commit from upstream-pr/4951 into main 2026-10-14 02:54:36 +00:00
Ondra97 commented 2026-10-13 06:06:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-13T06:06:57Z.


What

Import audit classified throwing stubs as implemented when a library reused another library's sources. For example, libScePsml.prx exports scePsmlMfsr2CreateContext (m9JLPc3wOQw) from libScePsml_debug, but its empty local function list hid the stub.

Reuse the existing shared_sources metadata to carry the owner's stub NIDs and names into the shared provider. This preserves explicit NID aliases, runtime postfix handling and implemented native providers. Resolve transitive sharing independently of directory order and reject cycles.

Tested

Windows 11 x64, Python 3.14, based on main ea2bbefb2:

  • Four new regressions failed on the unchanged implementation, then passed with the fix.
  • Import audit: 41/41 tests pass; all Python tools: 250/250 tests pass.
  • Checked the real Psml NID above: now reported as stub, with its function name.
  • Conventions and whitespace checks pass.

Refreshed and inspected all 470 open PR heads. Six share the audit files but change other behaviour; the repository overlap checker reports no overlap. No title run or full runtime build was required for this Python-only change.

Checklist

  • Based on current main; no other open PR implements the same fix
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stub added
  • No notes, investigation Markdown files or images added to the repository
  • New third-party code is a submodule built from source: no dependency added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4839117980 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4951). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-13T06:06:57Z. --- ### What Import audit classified throwing stubs as implemented when a library reused another library's sources. For example, `libScePsml.prx` exports `scePsmlMfsr2CreateContext` (`m9JLPc3wOQw`) from `libScePsml_debug`, but its empty local function list hid the stub. Reuse the existing `shared_sources` metadata to carry the owner's stub NIDs and names into the shared provider. This preserves explicit NID aliases, runtime postfix handling and implemented native providers. Resolve transitive sharing independently of directory order and reject cycles. ### Tested Windows 11 x64, Python 3.14, based on `main` `ea2bbefb2`: - Four new regressions failed on the unchanged implementation, then passed with the fix. - Import audit: 41/41 tests pass; all Python tools: 250/250 tests pass. - Checked the real Psml NID above: now reported as `stub`, with its function name. - Conventions and whitespace checks pass. Refreshed and inspected all 470 open PR heads. Six share the audit files but change other behaviour; the repository overlap checker reports no overlap. No title run or full runtime build was required for this Python-only change. ### Checklist - [x] Based on current `main`; no other open PR implements the same fix - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stub added - [x] No notes, investigation Markdown files or images added to the repository - [x] New third-party code is a submodule built from source: no dependency added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes (Codex)
xXPBSXx commented 2026-10-13 09:10:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T09:10:43Z.


Windows test: head 66edc7463 merged onto current main d379bfd01 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest with the filter ^import_audit$: import_audit passed (1 test(s), 0 failed); python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6142227207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4951#issuecomment-6142227207). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T09:10:43Z. --- Windows test: head `66edc7463` merged onto current `main` `d379bfd01` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest with the filter `^import_audit$`: import_audit passed (1 test(s), 0 failed); `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
coltken95 commented 2026-10-13 18:55:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T18:55:47Z.


Tested on Linux x86-64 (Python 3.13), with 66edc7463 merged into main 9d0a41d5a:

  • With the PR: tools/tests/test_import_audit.py passes.
  • With main's import audit sources and the PR's tests: it fails.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152875025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4951#issuecomment-6152875025). Originally posted by [coltken95](https://github.com/coltken95) on 2026-10-13T18:55:47Z. --- Tested on Linux x86-64 (Python 3.13), with 66edc7463 merged into main 9d0a41d5a: - With the PR: `tools/tests/test_import_audit.py` passes. - With main's import audit sources and the PR's tests: it fails. AI-assisted: yes (Claude Code)
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!4951
No description provided.