fix(tools): check exports through local ABI aliases #12654

Merged
SnekPolylepis merged 3 commits from upstream-pr/12654 into main 2026-10-29 23:18:51 +00:00
SnekPolylepis commented 2026-10-29 00:28:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SnekPolylepis on 2026-10-29T00:28:34Z.


Overlap: Alias expansion is now limited to export checks. A local merge simulation with #9966 head db01701db succeeds without conflicts; the two PRs address different behavior.

Latest validation: Merged main 3a2b91981 into head 95b34beae4. Windows: conventions, diff check, and 196 conventions tests pass (Python 3.13).

Replaces #9568, which the open-PR limit bot closed. The branch is unchanged apart from merging current main.

Refresh: October 26 refresh: merged current upstream main at c8254c160. Windows conventions and git diff --check pass; 181 conventions tests pass (Python 3.13). The earlier test results below refer to the previous head.

What

Local calling-convention aliases such as #define NATIVE_SYSV APS5_VABI currently hide exports from the conventions checker's duplicate-export and silent-stub checks. Expand local single-line object-like aliases only for export checks, including alias chains, redefinitions, undefinitions and cycles. The shared C++ masking helper retains its existing behavior.

Add regression cases showing that aliased exports cannot bypass either check. This changes tooling only and adds no dependencies.

Tested

  • Head 3146d358b0: All 197 conventions tests, including the focused alias and declaration tests, pass on Windows (Python 3.13); conventions and git diff --check pass. A merge simulation with #9966 is clean.

  • Windows, Python 3.13: all 151 conventions tests passed; final focused suite of 16 tests passed again before pushing.

  • Ubuntu 24.04 / WSL, Python 3.12: all 151 conventions tests passed from the committed snapshot in a native Linux Git checkout.

  • Conventions self-check and git diff --check passed.

  • Reproduced hidden duplicate exports on an existing local branch; the updated checker rejects them.

  • Earlier head: tools/pr_overlap.py --branch fix/abi-alias-export-check reported no overlap at the time. Related PR #8777 covers assembly exports; merge-tree check with its fetched head was clean.

Scope: local single-line object-like aliases only; this does not implement a full C++ preprocessor.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5059928215 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12654). Originally posted by [SnekPolylepis](https://github.com/SnekPolylepis) on 2026-10-29T00:28:34Z. --- **Overlap:** Alias expansion is now limited to export checks. A local merge simulation with #9966 head `db01701db` succeeds without conflicts; the two PRs address different behavior. **Latest validation:** Merged main 3a2b91981 into head 95b34beae4. Windows: conventions, diff check, and 196 conventions tests pass (Python 3.13). Replaces #9568, which the open-PR limit bot closed. The branch is unchanged apart from merging current `main`. **Refresh:** October 26 refresh: merged current upstream main at c8254c160. Windows conventions and git diff --check pass; 181 conventions tests pass (Python 3.13). The earlier test results below refer to the previous head. ### What Local calling-convention aliases such as `#define NATIVE_SYSV APS5_VABI` currently hide exports from the conventions checker's duplicate-export and silent-stub checks. Expand local single-line object-like aliases only for export checks, including alias chains, redefinitions, undefinitions and cycles. The shared C++ masking helper retains its existing behavior. Add regression cases showing that aliased exports cannot bypass either check. This changes tooling only and adds no dependencies. ### Tested - Head `3146d358b0`: All 197 conventions tests, including the focused alias and declaration tests, pass on Windows (Python 3.13); conventions and `git diff --check` pass. A merge simulation with #9966 is clean. - Windows, Python 3.13: all 151 conventions tests passed; final focused suite of 16 tests passed again before pushing. - Ubuntu 24.04 / WSL, Python 3.12: all 151 conventions tests passed from the committed snapshot in a native Linux Git checkout. - Conventions self-check and `git diff --check` passed. - Reproduced hidden duplicate exports on an existing local branch; the updated checker rejects them. - Earlier head: `tools/pr_overlap.py --branch fix/abi-alias-export-check` reported no overlap at the time. Related PR #8777 covers assembly exports; merge-tree check with its fetched head was clean. Scope: local single-line object-like aliases only; this does not implement a full C++ preprocessor. <!-- 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. --> ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
THEMANnt commented 2026-10-29 06:49:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T06:49:18Z.

Review: APPROVED


Reviewed 33b94bc073fca30cb236f72908615d51097ca200 against 3a2b91981651569163768854a1fcdc7193b6667b. Conventions scanning expands local object-like ABI alias chains at the relevant source line, respects undef/redefinition and cycles, and shares that expansion with duplicate-export scanning. Comment/string masking and line counts are preserved. No actionable finding in this scoped review.

Windows/Python 3.11 validation: head 27 passed, 0 skipped; baseline 19 passed, 0 skipped. Both changed conventions suites pass. Old production fails the alias-export checks and also lacks the new helper API; missing-helper errors alone are not behavioral proof. No production export implementation was changed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693878622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12654#pullrequestreview-5693878622). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-29T06:49:18Z. **Review:** APPROVED --- Reviewed `33b94bc073fca30cb236f72908615d51097ca200` against `3a2b91981651569163768854a1fcdc7193b6667b`. Conventions scanning expands local object-like ABI alias chains at the relevant source line, respects undef/redefinition and cycles, and shares that expansion with duplicate-export scanning. Comment/string masking and line counts are preserved. No actionable finding in this scoped review. Windows/Python 3.11 validation: head 27 passed, 0 skipped; baseline 19 passed, 0 skipped. Both changed conventions suites pass. Old production fails the alias-export checks and also lacks the new helper API; missing-helper errors alone are not behavioral proof. No production export implementation was changed.
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!12654
No description provided.