Skip to content

fix(tools): normalize Windows module suffix case before matching - #9226

Open
AMRYB wants to merge 1 commit into
boykopovar:mainfrom
AMRYB:fix/audit-windows-module-extension-case
Open

AMRYB wants to merge 1 commit into
boykopovar:mainfrom
AMRYB:fix/audit-windows-module-extension-case

Conversation

@AMRYB

@AMRYB AMRYB commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

What

For Windows output, import_audit.py lowercases module names after attempting case-sensitive suffix removal. A supplied sdk-shipping.prx therefore does not match a registry dependency named SDK-Shipping.DEBUG_PRX. The audit reports an absent import, a missing library and a loader stop even though the guest module is present. Uppercase or mixed-case suffixes on the supplied filename cause the same mismatch.

Apply the existing Windows case normalization before removing .prx, .sprx, .suprx or .debug_prx. This matches the order already used by the relinker's ModuleStem. ELF-output matching remains case-sensitive, and reports retain the original registry library names.

Tested

Windows, Python 3.14.7. Base main cecb540a63f6, candidate e3110be3a373. Synthetic PE system libraries and ELF guest modules; no title execution, native relinker build or GPU test is claimed.

  • The new Windows-output regression fails against unchanged main in all four subcases, covering uppercase and mixed-case suffixes on both sides of the lookup. The ELF-output control passes on main and the candidate for all four uppercase suffixes.
  • Separate CLI control using identical binary fixtures and --strict-providers: main exits 1, classifies the import as absent and reports SDK-Shipping.DEBUG_PRX missing; the candidate exits 0, classifies it as a guest module and reports no missing library or unresolved stop. Both retain one import reference.
  • python -m unittest tools.tests.test_import_audit: 124 tests run, 121 passed, 3 skipped for platform/filesystem conditions.
  • python tools/check_test_registration.py --scripts: 170 scripts registered. Conventions and git diff --check pass.
  • python tools/pr_overlap.py --branch fix/audit-windows-module-extension-case --repo boykopovar/AnyPS5 --jobs 8: completed with no confirmed overlap. It could not automatically compare fix(tools): recognize guest module identities in import audit #6171 (35bf15c510cb) and fix(tools): resolve $ORIGIN-prefixed converted module dependencies in import_audit #7454 (11840ad87c40) because those PRs already conflict with main. Their complete tool/test diffs were reviewed manually: they add declared module identities and $ORIGIN handling, respectively; neither changes module_stem or the insertion point of these tests. This is a manual assessment for those two PRs, not an automated clean-merge claim.

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

@xXPBSXx

xXPBSXx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Linux data point for e3110be3a3: WSL2 Ubuntu 24.04 (virtualised kernel, not bare-metal Linux), Python 3.12, PR head alone (not merged onto main; its merge-base is cecb540a6), python3 -I -m unittest discover -s tools/tests -p test_import_audit.py.

  • With the PR: 124 tests OK (1 skipped).
  • With tools/import_audit.py restored to the merge-base (the PR's tests kept): 4 failures (test_windows_module_suffix_case_does_not_report_existing_modules_as_missing).
    Not tested: macOS, Windows, a merge onto current main.
    AI-assisted (Claude Code).

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9720 tools/tests/test_import_audit.py L664

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 6171 tools/import_audit.py
tools/tests/test_import_audit.py
PR 7454 tools/import_audit.py
tools/tests/test_import_audit.py
PR 9372 tools/import_audit.py
tools/tests/test_import_audit.py

@JJenkx

JJenkx commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

FYI: #9720 makes the identical tools/import_audit.py change. Windows test data for both is in #9720 (both pass with their own code and fail with main's).

AI-assisted (Claude Code).

This branch has not been deployed

No deployments
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.

3 participants