fix(tools): recognize guest module identities in import audit #6171

Closed
johnohhh1 wants to merge 1 commit from upstream-pr/6171 into main
johnohhh1 commented 2026-10-15 00:15:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-15T00:15:56Z.


What

Correct a false failing import audit for Middle Ages Ping Pong, PPSA28319 01.000.000. Its Il2CppUserAssemblies.prx declares the SCE identity Il2cppUserAssemblies. The relinker resolves that identity, but the audit reports four absent imports and a missing module.

Read ELF SONAMEs and SCE module identities using the relinker's exact-name precedence and suffix rules. Preserve ambiguity checks, import counts and physical filename requirements for host dependencies. This corrects preflight diagnostics; the title already runs.

Merge order: #7454, then #6171, agreed with #7454's author. The prepared identity-side normalization will be applied with the rebase after #7454 lands; its implementation is not bundled here.

Tested

Head 35bf15c51, rebased cleanly onto synced main 8727ddb29. The tool, tests and documentation are byte-for-byte identical to the earlier October 20 head 98596149e; fresh Linux checks and the saved title audit pass again. The contribution combines declared identities with main's new ModuleNames filename-suffix and Windows case matching. It preserves unscoped guest-import lookup, NID disambiguation normalization, PE support and the Windows host-importer set. Host lookup still receives physical module filenames rather than guest identity aliases.

  • Real title audit: with identical saved main-2626e5ee7 registries/libraries and current source classification, main's tool exits 1 with four absent imports; the PR exits 0 with none. Both retain 2,355 references, 1,052 unique imports and eight stub classifications. No missing host dependencies. This reruns the audit, not the game or native build.
  • Linux: 126 tests pass, one Windows-only skip; registered CTest passes. Conventions against current upstream and whitespace checks pass.
  • Earlier October 20 author-run CI: Windows Server 2025/Python 3.12 and 3.14 each passes 125 tests with two POSIX-only skips; Ubuntu passes 126 with one Windows-only skip. Those runs used 98596149e, whose audit tool/test blobs exactly match this head; Windows was not rerun for this rebase. Fresh local Linux validation also passes all six subprocess CLI checks. The seven regression methods produce 83 failed subcases and zero errors against main's tool. No upstream native CI is claimed.
  • Earlier combination evidence: October 19's prepared resolution with #7454 11840ad87 and our 74c5e7029 passed 122 Linux tests with one skip, plus four cross-feature methods. The author and another contributor report compatible combinations at their recorded pins. These are historical results; the combination will be revalidated after #7454 lands on current main.

Pinned evidence, CI results and replay patch. Historical runtime evidence remains main 2626e5ee7: rendered match and exit 0 after SIGINT at 45.47 s, RTX 5070/NVIDIA 595.99.02, SDL dummy audio. No full-playability, performance, console result or second affected title is claimed. Earlier independent Windows validation applies to the original revision.

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: #7454
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes, Codex; author responsible for the change
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866295955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-10-15T00:15:56Z. --- ### What Correct a false failing import audit for [Middle Ages Ping Pong, PPSA28319 01.000.000](https://github.com/STL1te/MedievalTennis/releases/tag/01.000.000). Its `Il2CppUserAssemblies.prx` declares the SCE identity `Il2cppUserAssemblies`. The relinker resolves that identity, but the audit reports four absent imports and a missing module. Read ELF SONAMEs and SCE module identities using the relinker's exact-name precedence and suffix rules. Preserve ambiguity checks, import counts and physical filename requirements for host dependencies. This corrects preflight diagnostics; the title already runs. **Merge order: #7454, then #6171**, [agreed with #7454's author](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6264417521). The prepared identity-side normalization will be applied with the rebase after #7454 lands; its implementation is not bundled here. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Head `35bf15c51`, rebased cleanly onto synced main `8727ddb29`. The tool, tests and documentation are byte-for-byte identical to the earlier October 20 head `98596149e`; fresh Linux checks and the saved title audit pass again. The contribution combines declared identities with main's new `ModuleNames` filename-suffix and Windows case matching. It preserves unscoped guest-import lookup, NID disambiguation normalization, PE support and the Windows host-importer set. Host lookup still receives physical module filenames rather than guest identity aliases. - **Real title audit:** with identical saved main-`2626e5ee7` registries/libraries and current source classification, main's tool exits 1 with four absent imports; the PR exits 0 with none. Both retain 2,355 references, 1,052 unique imports and eight stub classifications. No missing host dependencies. This reruns the audit, not the game or native build. - **Linux:** 126 tests pass, one Windows-only skip; registered CTest passes. Conventions against current upstream and whitespace checks pass. - **[Earlier October 20 author-run CI](https://github.com/johnohhh1/AnyPS5/actions/runs/39469990531):** Windows Server 2025/Python 3.12 and 3.14 each passes 125 tests with two POSIX-only skips; Ubuntu passes 126 with one Windows-only skip. Those runs used `98596149e`, whose audit tool/test blobs exactly match this head; Windows was not rerun for this rebase. Fresh local Linux validation also passes all six subprocess CLI checks. The seven regression methods produce 83 failed subcases and zero errors against main's tool. No upstream native CI is claimed. - **Earlier combination evidence:** October 19's prepared resolution with #7454 `11840ad87` and our `74c5e7029` passed 122 Linux tests with one skip, plus four cross-feature methods. The author and another contributor report compatible combinations at their recorded pins. These are historical results; the combination will be revalidated after #7454 lands on current main. [Pinned evidence, CI results and replay patch](https://github.com/johnohhh1/AnyPS5/blob/acfdac4f1876e269e77958f31e0452f76b4537c7/validation-evidence/README.md). Historical runtime evidence remains main `2626e5ee7`: rendered match and exit 0 after SIGINT at 45.47 s, RTX 5070/NVIDIA 595.99.02, SDL dummy audio. No full-playability, performance, console result or second affected title is claimed. [Earlier independent Windows validation](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6186502999) applies to the original revision. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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 - [x] Depends on: #7454 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes, Codex; author responsible for the change
ideabsassistenza commented 2026-10-15 07:05:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ideabsassistenza on 2026-10-15T07:05:29Z.


Independent Windows check of 657f16ea286035a8615e2d56614a354cd4559e31, against baseline ab9a4768407d862d1879d7d0ee66bd9c3d9d67a8, using CPython 3.12.14 on Windows 11 x64/NTFS.

  • Complete import-audit module: 82 passed, 3 skipped (85 tests, 10.704 s). The skips are the two POSIX permission tests and source-commit stamping because this check uses extracted files without a Git checkout. The Windows read-only replacement test and symlink-report test both execute and pass.
  • The same six newly added test methods against the baseline tool produce 55 failed assertions/subcases, no errors; all pass with the PR. These include the 33 valid declared-alias combinations, ambiguous/invalid-name refusals and import-count preservation.
  • Six additional subprocess CLI checks from paths containing spaces pass with the PR: section-based SONAME, sectionless SysV/SCE identity, GNU-hash/SCE identity, undeclared filename-case mismatch, ambiguous identity, and multiple aliases. The valid alias cases change exit 1 to 0 with no absent imports or missing modules. Multiple aliases retain four references rather than duplicating the module's own import. An undeclared case mismatch still reports absent/missing on Windows. Ambiguity now exits 2 and preserves the previous JSON report instead of replacing it with an incomplete diagnosis.

Exact tool/test blobs were extracted from Git; the workspace checkout was unchanged. Python/synthetic files only: no title replay, native build, CMake/CTest, GPU or Linux/macOS run. Composition with #5571 or current main was not tested; the overlap still needs handling separately.

AI-assisted testing and reporting: OpenAI Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186502999 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6186502999). Originally posted by [ideabsassistenza](https://github.com/ideabsassistenza) on 2026-10-15T07:05:29Z. --- Independent Windows check of `657f16ea286035a8615e2d56614a354cd4559e31`, against baseline `ab9a4768407d862d1879d7d0ee66bd9c3d9d67a8`, using CPython 3.12.14 on Windows 11 x64/NTFS. - Complete import-audit module: **82 passed, 3 skipped** (85 tests, 10.704 s). The skips are the two POSIX permission tests and source-commit stamping because this check uses extracted files without a Git checkout. The Windows read-only replacement test and symlink-report test both execute and pass. - The same six newly added test methods against the baseline tool produce **55 failed assertions/subcases, no errors**; all pass with the PR. These include the 33 valid declared-alias combinations, ambiguous/invalid-name refusals and import-count preservation. - Six additional subprocess CLI checks from paths containing spaces pass with the PR: section-based SONAME, sectionless SysV/SCE identity, GNU-hash/SCE identity, undeclared filename-case mismatch, ambiguous identity, and multiple aliases. The valid alias cases change exit 1 to 0 with no absent imports or missing modules. Multiple aliases retain four references rather than duplicating the module's own import. An undeclared case mismatch still reports absent/missing on Windows. Ambiguity now exits 2 and preserves the previous JSON report instead of replacing it with an incomplete diagnosis. Exact tool/test blobs were extracted from Git; the workspace checkout was unchanged. Python/synthetic files only: no title replay, native build, CMake/CTest, GPU or Linux/macOS run. Composition with #5571 or current main was not tested; the overlap still needs handling separately. AI-assisted testing and reporting: OpenAI Codex.
johnohhh1 commented 2026-10-18 23:04:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-18T23:04:01Z.


@MarcZX10 @ggkouujere-debug I checked #6171 rebased to a12828cf6 on main fc623324a, together with #7159 at abea0949a and #7454 at 0df919176.

  • 7159 + 6171: combine the PE reader with declared-name collection and preserve the three-value read_modules return. Adapting the companion PE test's unpacking gives 113 passing tests and one Windows-only skip on Linux.
  • 7454 + 6171: preserve both test insertions. The existing suite passes, but new cross-feature checks find eight failures: $ORIGIN/Declared.prx is not normalized before the SCE identity lookup, so six valid-resolution cases fail and two ambiguous identities are missed. Applying strip_origin to the requested names before that lookup resolves all eight; the missing-host-file guard still passes.
  • All three: the candidate resolution passes 114 existing tests with one Windows-only skip, plus all four additional cross-feature methods. The original patches remain separate; I have not added either of your implementations to this PR.

Pinned heads, candidate patches, replay commands and results.

Which merge order would you prefer? I can handle the rebase and the identity-side resolution here after either of yours lands. The PR currently declares no semantic dependency; I will update that once we agree on an order.

There is also fresh author-run Windows and Linux validation of the rebased tool/test files. The actual PPSA28319 audit still changes exit 1 to 0 and four absent imports to zero. This fixes a false preflight failure; the game already runs. If anyone has the same declared-name mismatch on another title, an audit report would help establish the broader impact. PPSA28319 remains our only confirmed affected title.

AI-assisted testing and reporting: OpenAI Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6256276645 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6256276645). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-10-18T23:04:01Z. --- @MarcZX10 @ggkouujere-debug I checked #6171 rebased to `a12828cf6` on main `fc623324a`, together with #7159 at `abea0949a` and #7454 at `0df919176`. - **7159 + 6171:** combine the PE reader with declared-name collection and preserve the three-value `read_modules` return. Adapting the companion PE test's unpacking gives 113 passing tests and one Windows-only skip on Linux. - **7454 + 6171:** preserve both test insertions. The existing suite passes, but new cross-feature checks find eight failures: `$ORIGIN/Declared.prx` is not normalized before the SCE identity lookup, so six valid-resolution cases fail and two ambiguous identities are missed. Applying `strip_origin` to the requested names before that lookup resolves all eight; the missing-host-file guard still passes. - **All three:** the candidate resolution passes 114 existing tests with one Windows-only skip, plus all four additional cross-feature methods. The original patches remain separate; I have not added either of your implementations to this PR. [Pinned heads, candidate patches, replay commands and results](https://github.com/johnohhh1/AnyPS5/blob/f79c6b9becb81c4676f4d09da47226a25b274e4d/validation-evidence/README.md#overlap-integration). Which merge order would you prefer? I can handle the rebase and the identity-side resolution here after either of yours lands. The PR currently declares no semantic dependency; I will update that once we agree on an order. There is also [fresh author-run Windows and Linux validation of the rebased tool/test files](https://github.com/johnohhh1/AnyPS5/actions/runs/39174439746). The actual PPSA28319 audit still changes exit 1 to 0 and four absent imports to zero. This fixes a false preflight failure; the game already runs. If anyone has the same declared-name mismatch on another title, an audit report would help establish the broader impact. PPSA28319 remains our only confirmed affected title. AI-assisted testing and reporting: OpenAI Codex.
ggkouujere-debug commented 2026-10-19 09:49:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ggkouujere-debug on 2026-10-19T09:49:19Z.


Thank you for the thorough analysis! I've verified the combination locally: merged both PRs, applied strip_origin before the identity lookup as you suggested, and all 114 tests pass.

I agree with your proposed merge order: #7454 first, then #6171 with your rebase. Please proceed with the identity-side resolution on your end.

Appreciate the collaboration!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6264417521 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6264417521). Originally posted by [ggkouujere-debug](https://github.com/ggkouujere-debug) on 2026-10-19T09:49:19Z. --- Thank you for the thorough analysis! I've verified the combination locally: merged both PRs, applied `strip_origin` before the identity lookup as you suggested, and all 114 tests pass. I agree with your proposed merge order: #7454 first, then #6171 with your rebase. Please proceed with the identity-side resolution on your end. Appreciate the collaboration!
joedeangelis533-bot commented 2026-10-19 14:32:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by joedeangelis533-bot on 2026-10-19T14:32:48Z.


@johnohhh1 @ggkouujere-debug I'll queue our Windows host-library capitalization fix after both of these PRs, preserving the order recorded above: #7454 -> #6171 -> our follow-up. The follow-up will declare Depends on: #7454, #6171; its eventual rebase will retain host_modules for host-file lookup and add the PE importer set alongside it.

Our branch changes only Windows host dependency lookup. Its seven regression tests cover capitalization, transitive gaps, ELF and converted PE module providers, mixed ELF/PE graphs, ambiguous variants/report preservation, and cycles. ELF name lookup stays case sensitive.

Validation on Windows/Python 3.12.14:

  • Standalone on main bcdee66d1: 112 passes, 3 platform skips (115 total); rebase preserves the previously tested tool/test blobs exactly.
  • Isolated combination of #6171 a12828cf6, #7454 11840ad87 and our change on main 3686960c5: 120 passes, 3 skips (123 total). The audit/tool test files on that main snapshot and bcdee66d1 are identical.
  • The local resolution preserves upstream PE module support, the three-value read_modules return, and normalization with strip_origin before the requested-name identity lookup, as discussed here. Six valid SCE-identity/$ORIGIN cases and two ambiguity/report-preservation cases also pass.

I'll open the standalone follow-up with these dependencies and take its rebase after both land. The combined resolution is compatibility evidence, not extra implementation in that follow-up. No game runtime, full native build, Linux/macOS, or performance claim.

AI-assisted implementation, testing and communication: OpenAI Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6269733077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6269733077). Originally posted by [joedeangelis533-bot](https://github.com/joedeangelis533-bot) on 2026-10-19T14:32:48Z. --- <!-- anyps5-windows-host-case-order-v1 --> @johnohhh1 @ggkouujere-debug I'll queue our Windows host-library capitalization fix after both of these PRs, preserving the order recorded [above](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6264417521): **#7454 -> #6171 -> our follow-up**. The follow-up will declare `Depends on: #7454, #6171`; its eventual rebase will retain `host_modules` for host-file lookup and add the PE importer set alongside it. [Our branch](https://github.com/joedeangelis533-bot/AnyPS5/tree/fix/audit-windows-host-library-case) changes only Windows host dependency lookup. Its seven regression tests cover capitalization, transitive gaps, ELF and converted PE module providers, mixed ELF/PE graphs, ambiguous variants/report preservation, and cycles. ELF name lookup stays case sensitive. Validation on Windows/Python 3.12.14: - Standalone on main `bcdee66d1`: 112 passes, 3 platform skips (115 total); rebase preserves the previously tested tool/test blobs exactly. - Isolated combination of #6171 `a12828cf6`, #7454 `11840ad87` and our change on main `3686960c5`: 120 passes, 3 skips (123 total). The audit/tool test files on that main snapshot and `bcdee66d1` are identical. - The local resolution preserves upstream PE module support, the three-value `read_modules` return, and normalization with `strip_origin` before the requested-name identity lookup, as discussed here. Six valid SCE-identity/$ORIGIN cases and two ambiguity/report-preservation cases also pass. I'll open the standalone follow-up with these dependencies and take its rebase after both land. The combined resolution is compatibility evidence, not extra implementation in that follow-up. No game runtime, full native build, Linux/macOS, or performance claim. AI-assisted implementation, testing and communication: OpenAI Codex.
johnohhh1 commented 2026-10-19 17:39:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-19T17:39:45Z.


Thanks @ggkouujere-debug — recorded the agreed order #7454 → #6171 in Depends on and the description.

Rebased this PR onto main b6583dd86 as 74c5e7029, resolving the new conflict after #7159 merged. The resolution retains PE guest modules, main's Windows host-importer set and Unicode diagnostics, and passes physical host_modules to the host checker. The existing PE reader regression now checks its three-value result.

Fresh author-run CI: Windows/Python 3.12 and 3.14 each passes 120 tests with two POSIX-only skips; Linux passes 121 with one Windows-only skip. Six CLI cases pass on each runner. The baseline control still gives 83 failed subcases and zero errors. No new native build or title run.

The prepared combination with #7454 11840ad87 retains the Windows lookup changes, passes 122 tests with one Windows-only skip on Linux, and passes all four cross-feature methods. The identity-side strip_origin normalization is ready for the rebase after #7454 lands; your implementation stays separate from this PR.

AI-assisted implementation, testing and reporting: OpenAI Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273398647 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171#issuecomment-6273398647). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-10-19T17:39:45Z. --- Thanks @ggkouujere-debug — recorded the agreed order **#7454 → #6171** in `Depends on` and the description. Rebased this PR onto main `b6583dd86` as `74c5e7029`, resolving the new conflict after #7159 merged. The resolution retains PE guest modules, main's Windows host-importer set and Unicode diagnostics, and passes physical `host_modules` to the host checker. The existing PE reader regression now checks its three-value result. [Fresh author-run CI](https://github.com/johnohhh1/AnyPS5/actions/runs/39295544635): Windows/Python 3.12 and 3.14 each passes 120 tests with two POSIX-only skips; Linux passes 121 with one Windows-only skip. Six CLI cases pass on each runner. The baseline control still gives 83 failed subcases and zero errors. No new native build or title run. The [prepared combination with #7454 `11840ad87`](https://github.com/johnohhh1/AnyPS5/blob/4f8e016da6e0731476fc9c35563af6d0ea457a15/validation-evidence/README.md#coordination-and-integration) retains the Windows lookup changes, passes 122 tests with one Windows-only skip on Linux, and passes all four cross-feature methods. The identity-side `strip_origin` normalization is ready for the rebase after #7454 lands; your implementation stays separate from this PR. AI-assisted implementation, testing and reporting: OpenAI Codex.
thepoppfish commented 2026-10-25 08:11:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T08:11:43Z.

Review: CHANGES_REQUESTED


Reviewed exact head 35bf15c510cb50ee8152d911c686e5eccdb95c15. I found two additional interactions between declared aliases and the existing filename matcher; details are in the inline comments.

Independent Windows 11 build 26200 / Python 3.14.7 / Git 2.55.0.windows.3 validation:

  • python -m unittest discover -s tools/tests -p test_import_audit.py -v: 127 tests run in 16.019 s; 124 pass and 3 skip (two POSIX permission tests and the symlink test, which lacks the Windows privilege on this host).
  • Conventions against main 2742004ed28f765c7147db0e0269ff5868e9eb6f and git diff --check origin/main...HEAD pass.
  • Additional synthetic checks: requesting Declared.prx resolves with the physical Declared.prx provider and two unrelated Declared identities. Changing only the requested suffix to .sprx, .suprx, or .debug_prx changes exit 0 to exit 2. The same four cases all exit 0 with current main's tool. Failed PR cases preserve the existing report.
  • With a PE built library selecting Windows matching, an SCE identity Declared does not resolve declared.prx by itself (exit 1). Adding the valid Declared.prx reference makes both resolve (exit 0). A SONAME Declared.prx also resolves a case-mismatched request on this head. The relinker folds physical filenames in findGuest, while matchesIdentity compares declared identities exactly; this result should not depend on another registry entry.

Replay from the exact PR checkout, using its existing synthetic-image helpers:

from pathlib import Path
import json, sys
sys.path.insert(0, str(Path("tools/tests").resolve()))
import test_import_audit as t

def probe(requests, physical, tag, declared, windows=False, duplicate=False):
    work = t.Workspace()
    try:
        (work.libs / "libc.prx").write_bytes(t.build_pe([]) if windows else t.exporting())
        names = [] if duplicate else [(tag, declared)]
        (work.modules / physical).write_bytes(t.build_elf(
            [("AAAAAAAAAAA", 1, t.GLOBAL_FUNCTION)], module_names=names))
        if duplicate:
            for filename in ("first.prx", "second.prx"):
                (work.modules / filename).write_bytes(t.build_elf([], module_names=[(tag, declared)]))
        registry = work.root / "game.registry.json"
        t.write_registry(registry, [("AAAAAAAAAAA", name) for name in requests])
        registry.with_name("game.needed.json").write_text(json.dumps(requests), encoding="utf-8")
        code, _, error = work.run(registry)
        print(requests, "exit", code, error.strip())
    finally:
        work.close()

for suffix in (".prx", ".sprx", ".suprx", ".debug_prx"):
    probe(["Declared" + suffix], "Declared.prx", 0x61000043, "Declared", duplicate=True)
for requests in (["declared.prx"], ["Declared.prx", "declared.prx"]):
    probe(requests, "Provider.prx", 0x61000043, "Declared", windows=True)
probe(["declared.prx"], "Provider.prx", 14, "Declared.prx", windows=True)

The relinker comparison was source inspection of GuestModuleBuilder.cpp at this head, not a native relinker execution. No C++ build, game, console or GPU test was run. The existing #7454-first order and its planned normalization remain separate from these findings.

AI-assisted review and testing: yes (OpenAI Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5642193558 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6171#pullrequestreview-5642193558). Originally posted by [thepoppfish](https://github.com/thepoppfish) on 2026-10-25T08:11:43Z. **Review:** CHANGES_REQUESTED --- Reviewed exact head `35bf15c510cb50ee8152d911c686e5eccdb95c15`. I found two additional interactions between declared aliases and the existing filename matcher; details are in the inline comments. Independent Windows 11 build 26200 / Python 3.14.7 / Git 2.55.0.windows.3 validation: - `python -m unittest discover -s tools/tests -p test_import_audit.py -v`: 127 tests run in 16.019 s; 124 pass and 3 skip (two POSIX permission tests and the symlink test, which lacks the Windows privilege on this host). - Conventions against main `2742004ed28f765c7147db0e0269ff5868e9eb6f` and `git diff --check origin/main...HEAD` pass. - Additional synthetic checks: requesting `Declared.prx` resolves with the physical `Declared.prx` provider and two unrelated `Declared` identities. Changing only the requested suffix to `.sprx`, `.suprx`, or `.debug_prx` changes exit 0 to exit 2. The same four cases all exit 0 with current main's tool. Failed PR cases preserve the existing report. - With a PE built library selecting Windows matching, an SCE identity `Declared` does not resolve `declared.prx` by itself (exit 1). Adding the valid `Declared.prx` reference makes both resolve (exit 0). A SONAME `Declared.prx` also resolves a case-mismatched request on this head. The relinker folds physical filenames in `findGuest`, while `matchesIdentity` compares declared identities exactly; this result should not depend on another registry entry. Replay from the exact PR checkout, using its existing synthetic-image helpers: ```python from pathlib import Path import json, sys sys.path.insert(0, str(Path("tools/tests").resolve())) import test_import_audit as t def probe(requests, physical, tag, declared, windows=False, duplicate=False): work = t.Workspace() try: (work.libs / "libc.prx").write_bytes(t.build_pe([]) if windows else t.exporting()) names = [] if duplicate else [(tag, declared)] (work.modules / physical).write_bytes(t.build_elf( [("AAAAAAAAAAA", 1, t.GLOBAL_FUNCTION)], module_names=names)) if duplicate: for filename in ("first.prx", "second.prx"): (work.modules / filename).write_bytes(t.build_elf([], module_names=[(tag, declared)])) registry = work.root / "game.registry.json" t.write_registry(registry, [("AAAAAAAAAAA", name) for name in requests]) registry.with_name("game.needed.json").write_text(json.dumps(requests), encoding="utf-8") code, _, error = work.run(registry) print(requests, "exit", code, error.strip()) finally: work.close() for suffix in (".prx", ".sprx", ".suprx", ".debug_prx"): probe(["Declared" + suffix], "Declared.prx", 0x61000043, "Declared", duplicate=True) for requests in (["declared.prx"], ["Declared.prx", "declared.prx"]): probe(requests, "Provider.prx", 0x61000043, "Declared", windows=True) probe(["declared.prx"], "Provider.prx", 14, "Declared.prx", windows=True) ``` The relinker comparison was source inspection of `GuestModuleBuilder.cpp` at this head, not a native relinker execution. No C++ build, game, console or GPU test was run. The existing #7454-first order and its planned normalization remain separate from these findings. AI-assisted review and testing: yes (OpenAI Codex).

Pull request closed

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!6171
No description provided.