Skip to content

fix(tools): resolve unscoped registry imports from guest modules - #8093

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
eliasbruno124-dev:fix/import-audit-unscoped-guest-exports
Oct 20, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
eliasbruno124-dev:fix/import-audit-unscoped-guest-exports

Conversation

@eliasbruno124-dev

Copy link
Copy Markdown
Contributor

What

For registry entries with an empty library name, the Windows loader searches host libraries and bundled guest modules. import_audit.py considered guest exports only when library is None, so it could report an available function as absent and identify the wrong startup blocker. Include guest exports for empty-library entries while preserving literal-symbol precedence, NID fallback and named-library lookup.

Observed with Call of Duty: Modern Warfare III, PPSA01649/01.055.000: the supplied libSceAppContent.sprx resolves SWVxsi-ZBlw, gpGZDB4ZlrI and S5eMvWnbbXg, but the audit reports all three absent. The correction removes those false positives and identifies sceNpAppLauncherInitialize as the first unresolved root import, matching the native log. MW3 still fails before guest entry; this is a diagnostic fix, not a gameplay or performance change.

Tested

  • Windows 11 Pro, CPython 3.12.14, base bf2c63f85: eight new subcases fail before the change and pass after it. They cover sectioned ELF, sectionless SysV/GNU ELF, converted PE, repeated references and genuine missing imports; the unrelated named-provider control remains a failure.
  • Complete import-audit suite: 114 pass, three skip (two POSIX tests and unavailable Windows symlink privilege). Registered CTest passes in 7.42 seconds. Conventions and whitespace checks pass.
  • Replay with identical MW3 registry/libraries/modules: absent classifications 38 to 35; reference/import totals and stub/missing-library findings unchanged; both audits exit 1. Native evidence uses frozen main 6d89a7bd8 with all 15 supplied code inputs. Loader logs confirm those three resolve; the runtime hashes and original metadata are unchanged.
  • Overlap check: upstream comparator functions examined all 698 open PRs from a complete GitHub-plugin snapshot (gh is not authenticated locally). No confirmed overlap; fix(tools): resolve $ORIGIN-prefixed converted module dependencies in import_audit #7454 could not be compared because it conflicts with main. Its patch was reviewed manually: it normalizes $ORIGIN paths and does not change this lookup. fix(tools): recognize guest module identities in import audit #6171 handles module identities; feat: optionally fail import audits on referenced throwing stubs #7440 adds strict stub checking. No dependency on these PRs.
  • Linux/macOS were not run locally. No new native build or game data is included.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

Copy link
Copy Markdown

Some 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.

Pull request Shared files not compared
PR 7454 tools/import_audit.py
tools/tests/test_import_audit.py

@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
@oneandonlydean
oneandonlydean merged commit 87a32d1 into boykopovar:main Oct 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants