fix(tools): count assembly exports in the duplicate-export check #8777

Merged
fma-rc merged 4 commits from upstream-pr/8777 into main 2026-10-23 00:27:05 +00:00
fma-rc commented 2026-10-21 00:19:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-21T00:19:19Z.


What

The duplicate-export check only saw APS5_VABI name( definitions, so exports written in assembly through APS5_ASM_FUNCTION("name") or APS5_SIGNAL_ASM_FUNCTION("name") were invisible in both directions. #8747 adds throwing setjmp_nid_postfix and longjmp_nid_postfix stubs in libSceLibcInternal, which shadow the assembly ones in libc/src/JumpBuffer.cpp; guest_user_context then aborts with setjmp_nid_postfix not implemented while the check passes. The check now counts assembly exports both as exports a change adds and as existing exports elsewhere. It reads them from the whole file, so a call next to a raw string counts and one inside a block comment does not, and takes only identifier names. A failing git grep stops the check instead of passing it. The assembly pattern goes through the same git grep -f - stdin pattern as #8461, so a large change stays under the Windows command-line limit; a test from @MarcZX10 covers 1,100 export names (more than 32,767 characters).

Tested

Linux and Windows. Three new tests in test_check_conventions_comments.py (a C export shadowing a libc assembly export, an APS5_SIGNAL_ASM_FUNCTION export repeated in another library, an export after a raw string) fail on main and pass here; two more keep an export in a block comment and a name that is not an identifier from changing the result. All 12 shards and the other conventions tests pass (77 tests on Linux, rebased onto 47fa6eecf8). On Windows (WinLibs GCC 15.2 VM, Python 3.13) test_check_conventions_comments.py and the conventions check pass. On #8747's head the check now reports nine duplicates instead of four: the four fe* functions plus setjmp, longjmp, getcontext, sigsetjmp and siglongjmp. The check passes on its own change.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4944396888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-21T00:19:19Z. --- ### What The `duplicate-export` check only saw `APS5_VABI name(` definitions, so exports written in assembly through `APS5_ASM_FUNCTION("name")` or `APS5_SIGNAL_ASM_FUNCTION("name")` were invisible in both directions. #8747 adds throwing `setjmp_nid_postfix` and `longjmp_nid_postfix` stubs in `libSceLibcInternal`, which shadow the assembly ones in `libc/src/JumpBuffer.cpp`; `guest_user_context` then aborts with `setjmp_nid_postfix not implemented` while the check passes. The check now counts assembly exports both as exports a change adds and as existing exports elsewhere. It reads them from the whole file, so a call next to a raw string counts and one inside a block comment does not, and takes only identifier names. A failing `git grep` stops the check instead of passing it. The assembly pattern goes through the same `git grep -f -` stdin pattern as #8461, so a large change stays under the Windows command-line limit; a test from @MarcZX10 covers 1,100 export names (more than 32,767 characters). ### Tested Linux and Windows. Three new tests in `test_check_conventions_comments.py` (a C export shadowing a libc assembly export, an `APS5_SIGNAL_ASM_FUNCTION` export repeated in another library, an export after a raw string) fail on `main` and pass here; two more keep an export in a block comment and a name that is not an identifier from changing the result. All 12 shards and the other conventions tests pass (77 tests on Linux, rebased onto 47fa6eecf8). On Windows (WinLibs GCC 15.2 VM, Python 3.13) `test_check_conventions_comments.py` and the conventions check pass. On #8747's head the check now reports nine duplicates instead of four: the four `fe*` functions plus `setjmp`, `longjmp`, `getcontext`, `sigsetjmp` and `siglongjmp`. The check passes on its own change. ### Checklist - [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
MarcZX10 commented 2026-10-21 00:21:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:21:46Z.

Review: APPROVED


I ran the exact PR-head test_check_conventions_comments.py locally on Linux with the checker and its helper modules: all 76 tests pass. This includes detection of a C export shadowing an assembly export, assembly duplicate exports, raw strings, block comments, and non-identifier names. The hosted conventions, eligibility, intake, and labels checks pass; the relinker matrix is still pending and is outside this Python-only change. #8461 is still open and edits the same duplicate-check method; please preserve the noted merge/rebase coordination if that PR lands first.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5593437117 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#pullrequestreview-5593437117). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:21:46Z. **Review:** APPROVED --- I ran the exact PR-head `test_check_conventions_comments.py` locally on Linux with the checker and its helper modules: all 76 tests pass. This includes detection of a C export shadowing an assembly export, assembly duplicate exports, raw strings, block comments, and non-identifier names. The hosted conventions, eligibility, intake, and labels checks pass; the relinker matrix is still pending and is outside this Python-only change. #8461 is still open and edits the same duplicate-check method; please preserve the noted merge/rebase coordination if that PR lands first.
MarcZX10 commented 2026-10-21 03:19:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:19:16Z.


I checked the reported #8848 failure against this PR. The current duplicates() still passes the export alternation as one argv element; #8848 measured 4,445 names and a 147,788-character pattern, which exceeds Windows CreateProcess even though this PR deduplicates the list. The issue author verified git grep -f against a BOM-free UTF-8 pattern file and got the expected 7,835 matches on Windows. Could this PR include that file-backed search and a regression test for large export sets? That would address the independent Windows failure alongside the assembly-export detection, without a competing PR on the same method. I can’t currently run or stage a patch because this filesystem has 0 bytes available.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307181920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6307181920). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T03:19:16Z. --- I checked the reported #8848 failure against this PR. The current `duplicates()` still passes the export alternation as one argv element; #8848 measured 4,445 names and a 147,788-character pattern, which exceeds Windows `CreateProcess` even though this PR deduplicates the list. The issue author verified `git grep -f` against a BOM-free UTF-8 pattern file and got the expected 7,835 matches on Windows. Could this PR include that file-backed search and a regression test for large export sets? That would address the independent Windows failure alongside the assembly-export detection, without a competing PR on the same method. I can’t currently run or stage a patch because this filesystem has 0 bytes available.
MarcZX10 commented 2026-10-21 03:30:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:30:00Z.


Update on #8848: PR #8461 has now merged, and current main solves the 32K Windows command-line failure by passing git grep -F -f - patterns through stdin. Its PR reports the 400-export WinError 206 regression failing on unchanged main and passing with the fix, including the Windows relinker CI. #8777 still uses the older combined regex as one argv item and predates that merge. Please rebase and preserve the streamed-pattern approach when adding the assembly-export search; otherwise this PR will reintroduce #8848. I prepared a regression locally, but a separate PR would duplicate the fix already merged by #8461.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307312477 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6307312477). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T03:30:00Z. --- Update on #8848: PR #8461 has now merged, and current `main` solves the 32K Windows command-line failure by passing `git grep -F -f -` patterns through stdin. Its PR reports the 400-export WinError 206 regression failing on unchanged main and passing with the fix, including the Windows relinker CI. #8777 still uses the older combined regex as one argv item and predates that merge. Please rebase and preserve the streamed-pattern approach when adding the assembly-export search; otherwise this PR will reintroduce #8848. I prepared a regression locally, but a separate PR would duplicate the fix already merged by #8461.
MarcZX10 commented 2026-10-21 04:18:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T04:18:35Z.

Code review location: tools/check_conventions.py; line 211

@@ -206,21 +208,27 @@ def code(self):
     def duplicates(self, exports):
         if not exports:
             return
-        pattern = r"(^|[^[:alnum:]_])APS5_VABI[[:space:]]+(" + "|".join(exports) + r")[[:space:]]*\("
+        pattern = r"(^|[^[:alnum:]_])(APS5_VABI[[:space:]]+|APS5_(SIGNAL_)?ASM_FUNCTION\([[:space:]]*\")(" + "|".join(exports) + r")([[:space:]]*\(|\")"

This change puts the alternation of every exported name back into one git grep argv element. That recreates the Windows failure reported in #8848: the measured expression there was 147,788 characters, beyond CreateProcess’s command-line limit. The fix for that exact issue is already on main via #8461, which streams patterns to git grep -F -f -. Could this keep the pattern off argv (for example write the regex to a UTF-8 temp file and use -f, while preserving the regex semantics needed for assembly exports)? Otherwise this PR appears to reintroduce the Windows failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4332989376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#discussion_r4332989376). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T04:18:35Z. **Code review location:** `tools/check_conventions.py`; line 211 ~~~~diff @@ -206,21 +208,27 @@ def code(self): def duplicates(self, exports): if not exports: return - pattern = r"(^|[^[:alnum:]_])APS5_VABI[[:space:]]+(" + "|".join(exports) + r")[[:space:]]*\(" + pattern = r"(^|[^[:alnum:]_])(APS5_VABI[[:space:]]+|APS5_(SIGNAL_)?ASM_FUNCTION\([[:space:]]*\")(" + "|".join(exports) + r")([[:space:]]*\(|\")" ~~~~ --- This change puts the alternation of every exported name back into one `git grep` argv element. That recreates the Windows failure reported in #8848: the measured expression there was 147,788 characters, beyond `CreateProcess`’s command-line limit. The fix for that exact issue is already on `main` via #8461, which streams patterns to `git grep -F -f -`. Could this keep the pattern off argv (for example write the regex to a UTF-8 temp file and use `-f`, while preserving the regex semantics needed for assembly exports)? Otherwise this PR appears to reintroduce the Windows failure.
MarcZX10 commented 2026-10-21 04:20:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T04:20:47Z.

Code review location: tools/check_conventions.py; line 211

@@ -206,21 +208,27 @@ def code(self):
     def duplicates(self, exports):
         if not exports:
             return
-        pattern = r"(^|[^[:alnum:]_])APS5_VABI[[:space:]]+(" + "|".join(exports) + r")[[:space:]]*\("
+        pattern = r"(^|[^[:alnum:]_])(APS5_VABI[[:space:]]+|APS5_(SIGNAL_)?ASM_FUNCTION\([[:space:]]*\")(" + "|".join(exports) + r")([[:space:]]*\(|\")"

I prepared the fix and regression on my fork at MarcZX100:codex/pr-8777-stream-pattern (commit f61f189c99). It writes the expanded regex as UTF-8 without a BOM to a temporary file and uses git grep -f, keeping the regex semantics while avoiding the Windows argv limit. The new test builds a 36K+ pattern and still detects the duplicate export. Validation: all 77 test_check_conventions_comments.py tests pass, python tools/check_conventions.py --base upstream/main passes, and git diff --check passes. Direct push to your branch was denied, so you can cherry-pick this commit if it fits your update.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4333000671 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#discussion_r4333000671). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T04:20:47Z. **Code review location:** `tools/check_conventions.py`; line 211 ~~~~diff @@ -206,21 +208,27 @@ def code(self): def duplicates(self, exports): if not exports: return - pattern = r"(^|[^[:alnum:]_])APS5_VABI[[:space:]]+(" + "|".join(exports) + r")[[:space:]]*\(" + pattern = r"(^|[^[:alnum:]_])(APS5_VABI[[:space:]]+|APS5_(SIGNAL_)?ASM_FUNCTION\([[:space:]]*\")(" + "|".join(exports) + r")([[:space:]]*\(|\")" ~~~~ --- I prepared the fix and regression on my fork at `MarcZX100:codex/pr-8777-stream-pattern` (commit `f61f189c99`). It writes the expanded regex as UTF-8 without a BOM to a temporary file and uses `git grep -f`, keeping the regex semantics while avoiding the Windows argv limit. The new test builds a 36K+ pattern and still detects the duplicate export. Validation: all 77 `test_check_conventions_comments.py` tests pass, `python tools/check_conventions.py --base upstream/main` passes, and `git diff --check` passes. Direct push to your branch was denied, so you can cherry-pick this commit if it fits your update.
MarcZX10 commented 2026-10-21 04:39:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T04:39:34Z.

Code review location: tools/check_conventions.py; line 211

@@ -206,21 +208,27 @@ def code(self):
     def duplicates(self, exports):
         if not exports:
             return
-        pattern = r"(^|[^[:alnum:]_])APS5_VABI[[:space:]]+(" + "|".join(exports) + r")[[:space:]]*\("
+        pattern = r"(^|[^[:alnum:]_])(APS5_VABI[[:space:]]+|APS5_(SIGNAL_)?ASM_FUNCTION\([[:space:]]*\")(" + "|".join(exports) + r")([[:space:]]*\(|\")"

This still passes the full alternation as one command-line argument. That reintroduces #8848: current main fixes the Windows 32K limit in #8461 by streaming patterns to git grep -F -f -. Could this expanded scan use the same stdin path (while preserving the assembly-export matching) and add a large-pattern regression test? Deduplicating the names still leaves the measured pattern at 147,788 characters, so the current -E invocation will fail on Windows before grep starts.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4333093480 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#discussion_r4333093480). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T04:39:34Z. **Code review location:** `tools/check_conventions.py`; line 211 ~~~~diff @@ -206,21 +208,27 @@ def code(self): def duplicates(self, exports): if not exports: return - pattern = r"(^|[^[:alnum:]_])APS5_VABI[[:space:]]+(" + "|".join(exports) + r")[[:space:]]*\(" + pattern = r"(^|[^[:alnum:]_])(APS5_VABI[[:space:]]+|APS5_(SIGNAL_)?ASM_FUNCTION\([[:space:]]*\")(" + "|".join(exports) + r")([[:space:]]*\(|\")" ~~~~ --- This still passes the full alternation as one command-line argument. That reintroduces #8848: current main fixes the Windows 32K limit in #8461 by streaming patterns to `git grep -F -f -`. Could this expanded scan use the same stdin path (while preserving the assembly-export matching) and add a large-pattern regression test? Deduplicating the names still leaves the measured pattern at 147,788 characters, so the current `-E` invocation will fail on Windows before grep starts.
MarcZX10 commented 2026-10-21 05:16:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:16:28Z.


I have a one-commit follow-up for the Windows command-line limit in the new ERE matcher: f61f189c994de8893ca345a593812d201a60133b on MarcZX100/AnyPS5:codex/pr-8777-stream-pattern (parent is the current PR head a18480ce). It moves the regex to a temporary git grep -f pattern file and adds a 1,100-export regression (>32,767 characters). On Linux, python3 tools/tests/test_check_conventions_comments.py passes 77/77, check_conventions.py --base upstream/pr-8777-review passes, and git diff --check passes. The overlap check reported #8892 only because it also changes tools/check_conventions.py; manual diff shows #8892 edits env_reference()/the target-ref handling, not this duplicates() logic. I cannot push to your fork, but the branch is available if you want to cherry-pick this commit onto the PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308646184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6308646184). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T05:16:28Z. --- I have a one-commit follow-up for the Windows command-line limit in the new ERE matcher: `f61f189c994de8893ca345a593812d201a60133b` on `MarcZX100/AnyPS5:codex/pr-8777-stream-pattern` (parent is the current PR head `a18480ce`). It moves the regex to a temporary `git grep -f` pattern file and adds a 1,100-export regression (>32,767 characters). On Linux, `python3 tools/tests/test_check_conventions_comments.py` passes 77/77, `check_conventions.py --base upstream/pr-8777-review` passes, and `git diff --check` passes. The overlap check reported #8892 only because it also changes `tools/check_conventions.py`; manual diff shows #8892 edits `env_reference()`/the target-ref handling, not this `duplicates()` logic. I cannot push to your fork, but the branch is available if you want to cherry-pick this commit onto the PR.
xXPBSXx commented 2026-10-21 09:45:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T09:45:39Z.


Linux data point for a18480ce30: WSL2 Ubuntu 24.04 (a virtualised kernel, not bare-metal Linux), Python 3.12, PR head alone (not merged onto main), python3 -I -m unittest discover -s tools/tests -p test_check_conventions_comments.py.

  • With the PR: 76 tests OK.
  • With tools/check_conventions.py restored to the merge-base (the PR's tests kept): 3 failures (test_assembly_export_after_a_raw_string_is_a_duplicate, test_assembly_export_in_another_library_is_a_duplicate, test_export_shadowing_an_assembly_export_is_a_duplicate).
    Not tested: macOS, Windows, a merge onto current main.
    AI-assisted (Claude Code).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312968307 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6312968307). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T09:45:39Z. --- Linux data point for `a18480ce30`: WSL2 Ubuntu 24.04 (a virtualised kernel, not bare-metal Linux), Python 3.12, PR head alone (not merged onto `main`), `python3 -I -m unittest discover -s tools/tests -p test_check_conventions_comments.py`. - With the PR: 76 tests OK. - With `tools/check_conventions.py` restored to the merge-base (the PR's tests kept): 3 failures (test_assembly_export_after_a_raw_string_is_a_duplicate, test_assembly_export_in_another_library_is_a_duplicate, test_export_shadowing_an_assembly_export_is_a_duplicate). Not tested: macOS, Windows, a merge onto current `main`. AI-assisted (Claude Code).
fma-rc commented 2026-10-21 13:15:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-21T13:15:36Z.


Thanks @MarcZX10. Rebased onto current main, which already has #8461's stdin patterns, so the assembly pattern now goes through git grep -f - the same way and your temp file wasn't needed. I kept your 1,100-name test as cbfc92ecac with you as author.

On the new head, 77 tests pass on Linux, and on Windows (WinLibs GCC 15.2, Python 3.13) test_check_conventions_comments.py and the conventions check pass too.

The red relinker (macos-latest, clang++, x86_64) job never got past fetching the PR: git fetch failed with RPC failed; curl 56 Recv failure: Connection reset by peer and bad pack header in the merge step, before anything was built. The other relinker jobs, including the arm64 macOS one, pass on the same head. Could a maintainer rerun it?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6317002818 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6317002818). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-21T13:15:36Z. --- Thanks @MarcZX10. Rebased onto current `main`, which already has #8461's stdin patterns, so the assembly pattern now goes through `git grep -f -` the same way and your temp file wasn't needed. I kept your 1,100-name test as cbfc92ecac with you as author. On the new head, 77 tests pass on Linux, and on Windows (WinLibs GCC 15.2, Python 3.13) `test_check_conventions_comments.py` and the conventions check pass too. The red `relinker (macos-latest, clang++, x86_64)` job never got past fetching the PR: `git fetch` failed with `RPC failed; curl 56 Recv failure: Connection reset by peer` and `bad pack header` in the merge step, before anything was built. The other relinker jobs, including the arm64 macOS one, pass on the same head. Could a maintainer rerun it?
THEMANnt commented 2026-10-21 19:09:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-21T19:09:53Z.


Checked at cbfc92ecac8712c3798117ebb7d486e4ce99fad1 on Windows (Python 3.11.9). The 77 existing tests pass both on the exact head and cherry-picked onto local main; conventions and diff whitespace checks also pass.

I found one P2 gap at tools/check_conventions.py:211: the new grep prefilter excludes valid spaced or multiline assembly macro invocations before the whole-file parser can inspect them. Reusing TestFixtureExportTests.check(), seed libc/src/JumpBuffer.cpp with APS5_ASM_FUNCTION ("setjmp_nid_postfix"), then add the throwing C definition from test_export_shadowing_an_assembly_export_is_a_duplicate in libSceLibcInternal/Export.cpp. The checker exits 0 with All conventions checks passed. Removing just the space before ( restores the duplicate diagnostic and exit 1. Splitting APS5_ASM_FUNCTION( and its string argument across lines also incorrectly passes, as does the spaced signal macro. asm_exports() recognizes these exports, and GCC 15.2 preprocessing with the production macro header confirms the ordinary, spaced and multiline forms expand identically.

Please make candidate discovery conservative enough to retain these files and inspect their parsed exports without requiring the macro and name on the same grep line. Regression tests for an existing spaced/multiline assembly definition shadowed by a C export would cover this. Please retain git grep -f - so the Windows command-line fix stays intact.

AI-assisted: yes (Codex); tests and reproductions were executed locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324296606 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6324296606). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-21T19:09:53Z. --- Checked at cbfc92ecac8712c3798117ebb7d486e4ce99fad1 on Windows (Python 3.11.9). The 77 existing tests pass both on the exact head and cherry-picked onto local main; conventions and diff whitespace checks also pass. I found one P2 gap at `tools/check_conventions.py:211`: the new grep prefilter excludes valid spaced or multiline assembly macro invocations before the whole-file parser can inspect them. Reusing `TestFixtureExportTests.check()`, seed `libc/src/JumpBuffer.cpp` with `APS5_ASM_FUNCTION ("setjmp_nid_postfix")`, then add the throwing C definition from `test_export_shadowing_an_assembly_export_is_a_duplicate` in `libSceLibcInternal/Export.cpp`. The checker exits 0 with `All conventions checks passed.` Removing just the space before `(` restores the duplicate diagnostic and exit 1. Splitting `APS5_ASM_FUNCTION(` and its string argument across lines also incorrectly passes, as does the spaced signal macro. `asm_exports()` recognizes these exports, and GCC 15.2 preprocessing with the production macro header confirms the ordinary, spaced and multiline forms expand identically. Please make candidate discovery conservative enough to retain these files and inspect their parsed exports without requiring the macro and name on the same grep line. Regression tests for an existing spaced/multiline assembly definition shadowed by a C export would cover this. Please retain `git grep -f -` so the Windows command-line fix stays intact. AI-assisted: yes (Codex); tests and reproductions were executed locally.
fma-rc commented 2026-10-21 22:54:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-21T22:54:33Z.


Thanks @THEMANnt, good catch. I rebased onto current main, where 68aeef249a replaced the grep prefilter with a scan of every committed prx source, so the assembly side now goes through asm_exports() on the whole file and the macro and name no longer need to share a line. The git grep -f - path is gone with it, so the Windows command-line limit cannot come back through this check.

e5dc85e483 adds your case: a C export shadowing an existing APS5_ASM_FUNCTION ("…"), a split APS5_ASM_FUNCTION( / name, and a spaced split APS5_SIGNAL_ASM_FUNCTION. All three pass the checker at cbfc92ecac and are reported now. 79 tests pass on Linux, and on Windows the build, ctest, tools tests and conventions check show no failure that main lacks.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328365839 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#issuecomment-6328365839). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-21T22:54:33Z. --- Thanks @THEMANnt, good catch. I rebased onto current `main`, where 68aeef249a replaced the grep prefilter with a scan of every committed prx source, so the assembly side now goes through `asm_exports()` on the whole file and the macro and name no longer need to share a line. The `git grep -f -` path is gone with it, so the Windows command-line limit cannot come back through this check. e5dc85e483 adds your case: a C export shadowing an existing `APS5_ASM_FUNCTION ("…")`, a split `APS5_ASM_FUNCTION(` / name, and a spaced split `APS5_SIGNAL_ASM_FUNCTION`. All three pass the checker at cbfc92ecac and are reported now. 79 tests pass on Linux, and on Windows the build, ctest, tools tests and conventions check show no failure that `main` lacks.
THEMANnt commented 2026-10-22 08:23:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-22T08:23:29Z.

Review: APPROVED


Rechecked at e5dc85e483 on Windows with Python 3.11.9. My earlier spacing/multiline finding is resolved; no blocking findings remain.

  • All 79 exact-head test_check_conventions_comments.py tests pass, including the new spaced/split regression and the 1,100-export case.
  • Independent Git fixtures detect all 16 duplicate cases across eight macro layouts in both directions (C shadowing assembly and assembly shadowing C). These include spaces, split parentheses/arguments, comment separators, signal macros and a second macro on the same line. Three comment/string controls produce no duplicate diagnostic.
  • Against cbfc92ecac, the same probes miss six forward-direction duplicates, including the originally reported space and multiline cases; the revised head detects all six.
  • The exact-head conventions check against current upstream main and git diff --check pass.

The whole-file assembly parsing now reaches all committed PRX sources selected by the scanner, and duplicate discovery no longer constructs an export-name grep pattern or passes it on the Windows command line. This addresses both the original filtering gap and the command-line-length concern.

Nonblocking description nit: the What/Tested text still describes the removed git grep -f - path and the earlier 77-test result; please update it to match the current implementation.

Scope: Python checker and relevant fixtures; I did not rerun native builds, CTest, Linux or macOS validation for this review.

AI-assisted: yes (Codex); the tests and reproductions above were executed locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611262904 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8777#pullrequestreview-5611262904). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-22T08:23:29Z. **Review:** APPROVED --- Rechecked at e5dc85e483dacae3a8b93a12690081bd06778470 on Windows with Python 3.11.9. My earlier spacing/multiline finding is resolved; no blocking findings remain. - All 79 exact-head `test_check_conventions_comments.py` tests pass, including the new spaced/split regression and the 1,100-export case. - Independent Git fixtures detect all 16 duplicate cases across eight macro layouts in both directions (C shadowing assembly and assembly shadowing C). These include spaces, split parentheses/arguments, comment separators, signal macros and a second macro on the same line. Three comment/string controls produce no duplicate diagnostic. - Against cbfc92ecac, the same probes miss six forward-direction duplicates, including the originally reported space and multiline cases; the revised head detects all six. - The exact-head conventions check against current upstream main and `git diff --check` pass. The whole-file assembly parsing now reaches all committed PRX sources selected by the scanner, and duplicate discovery no longer constructs an export-name grep pattern or passes it on the Windows command line. This addresses both the original filtering gap and the command-line-length concern. Nonblocking description nit: the What/Tested text still describes the removed `git grep -f -` path and the earlier 77-test result; please update it to match the current implementation. Scope: Python checker and relevant fixtures; I did not rerun native builds, CTest, Linux or macOS validation for this review. AI-assisted: yes (Codex); the tests and reproductions above were executed locally.
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!8777
No description provided.