fix(conventions): ignore non-code duplicate export matches #5780
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5780"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-14T10:18:39Z.
What
The duplicate-export checker can match an
APS5_VABIdeclaration inside a comment or string and report a real export as a duplicate. Mask non-code tokens before matching each source line and inspecting its function body. Keep line numbers intact, including Unicode separators, and cache the masked source per file.The branch is based on main
47a266cf975f00f7fba94013467d03bfa5e355e9. The masking is applied inside main's existinghitsloop after its batchedself.read(...); the batch-read behavior is retained.Tested
macOS 27.0.1 arm64, Python 3.12.14: all 109 tests in the convention suites pass, including batched-read coverage and all 10 wrapped-declaration cases. The 10 wrapped-declaration cases also pass on Python 3.9.6.
Negative control: with unchanged main's checker and this branch's tests, 5 wrapped-declaration cases fail and 5 pass. The failures reproduce the comment, raw-string and source-line bugs that this change fixes. The trusted main checker accepts the committed patch, title and template; whitespace checks pass. No runtime or GPU behavior changes.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:51:36Z.
Review: DISMISSED
The approach looks right:
cpp_textkeeps newlines, so line numbers still matchgit grep, and the new cases intools/tests/test_check_conventions_wrapped_declarations.pypass on this head (9 tests).One blocker: the PR conflicts with
mainintools/check_conventions.py.duplicates()onmainnow reads blobs in one batch (self.read(...)andhits), so the masking has to be re-applied on top of that loop. I can't push a rebase to your branch (maintainer edits are disabled), so please rebase and re-run the five convention suites, plus the negative control againstmain's checker.Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-15T13:24:11Z.
@adriadam10 Rebased onto main
2e5dd5aa144af1bf90a214a6341bf3e1b4e6d47aas89db679b980ae372eb3d4ce2327f4baa1e281f8b. The fix retains main'shitscollection andself.read(...)batch, then masks/caches each source within that loop.Fresh macOS 27.0.1 arm64 / Python 3.12.14 checks:
ctest --test-dir <relinker-only-build> -R '^conventions_' --output-on-failure --parallel 2: 14/14 registrations pass, covering all current convention suites, including batch-read process counts and the 9 wrapped-declaration cases.The description now records the fresh results. Manually reviewed the bot's remaining shared checker patches: #6078's environment rule and #6268's Unknown-NID rule do not implement this masking; no combined-tree test is claimed. #5766 is already merged in the new base.
AI-assisted: yes (OpenAI Codex).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T18:34:27Z.
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.
tools/check_conventions.pyImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:53:00Z.
Picking this up while @adriadam10 is away: we will merge it once full CI and an independent review pass on this head.