fix(conventions): restrict silent stub exemptions to their section #3326

Merged
reyani-dev merged 2 commits from upstream-pr/3326 into main 2026-10-11 07:58:47 +00:00
reyani-dev commented 2026-10-11 07:47:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T07:47:48Z.


What

Carries item 7 of @cookie42073-cmd's #3321 (the author is under the intake threshold). The commit is theirs, unchanged (cf5e04c9, cherry-picked onto current main). One docs commit of mine follows.

check_conventions.py exempted a silent-stub export when any line of docs/dev/TechnicalDebt.md linked its file or named it with a path in its library, not just lines in the Silent stubs section the rule message points to. A file link under "Unknown function info" (for a different NID in the same file) could therefore exempt every silent stub later added to that file. silent_stub_debt now keeps only the lines inside the Silent stubs heading, up to the next heading of the same or a higher level. SilentStubSectionTests covers:

  • entries in other sections and after the section;
  • file and by-name entries inside it;
  • a by-name entry in another library;
  • a different function in the same library;
  • subsections.

One existing case. Over the last 200 commits of main, the stricter rule finds exactly one export that passed only through such a link: sceAudioInInit (#3006), whose return 0; was exempted by the "Unknown function info" link for X+4jdIS75P0 in the same libSceAudioIn/Export.cpp. The second commit lists it by name under Silent stubs, with #3006's reason (no library-wide setup, as sceAudioOutInit; each sceAudioInOpen opens its own SDL capture device). That keeps the history clean under the new rule without re-exempting the whole file.

Item 7 of #3321.

Tested

Windows 11 (10.0.26200), Python 3.12.6, on main 2bb78d2c:

  • Every tools/tests/test_*.py passes.
  • With check_conventions.py reverted to main, 6 of the new subtests fail (the out-of-section and after-section cases); with the change they pass.
  • check_conventions.py --base upstream/main~200 --head HEAD:
    • main's checker passes;
    • this checker without the debt line reports only [silent-stub] ... sceAudioInInit;
    • with the debt line it passes.
  • pr_overlap.py reports only #2150, which edits a neighbouring line of TechnicalDebt.md (L45) for a different function; at most a one-line rebase.

No workflow runs the tools tests, and nothing here is platform-specific.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4817513759 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3326). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T07:47:48Z. --- ### What Carries item 7 of @cookie42073-cmd's #3321 (the author is under the intake threshold). The commit is theirs, unchanged (`cf5e04c9`, cherry-picked onto current `main`). One docs commit of mine follows. `check_conventions.py` exempted a silent-stub export when *any* line of `docs/dev/TechnicalDebt.md` linked its file or named it with a path in its library, not just lines in the **Silent stubs** section the rule message points to. A file link under "Unknown function info" (for a different NID in the same file) could therefore exempt every silent stub later added to that file. `silent_stub_debt` now keeps only the lines inside the `Silent stubs` heading, up to the next heading of the same or a higher level. `SilentStubSectionTests` covers: - entries in other sections and after the section; - file and by-name entries inside it; - a by-name entry in another library; - a different function in the same library; - subsections. **One existing case.** Over the last 200 commits of `main`, the stricter rule finds exactly one export that passed only through such a link: `sceAudioInInit` (#3006), whose `return 0;` was exempted by the "Unknown function info" link for `X+4jdIS75P0` in the same `libSceAudioIn/Export.cpp`. The second commit lists it by name under Silent stubs, with #3006's reason (no library-wide setup, as `sceAudioOutInit`; each `sceAudioInOpen` opens its own SDL capture device). That keeps the history clean under the new rule without re-exempting the whole file. Item 7 of #3321. ### Tested Windows 11 (10.0.26200), Python 3.12.6, on `main` `2bb78d2c`: - Every `tools/tests/test_*.py` passes. - With `check_conventions.py` reverted to `main`, 6 of the new subtests fail (the out-of-section and after-section cases); with the change they pass. - `check_conventions.py --base upstream/main~200 --head HEAD`: - `main`'s checker passes; - this checker without the debt line reports only `[silent-stub] ... sceAudioInInit`; - with the debt line it passes. - `pr_overlap.py` reports only #2150, which edits a neighbouring line of `TechnicalDebt.md` (L45) for a different function; at most a one-line rebase. No workflow runs the tools tests, and nothing here is platform-specific. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-11 07:50:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T07:50:30Z.


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
#2150 docs/dev/TechnicalDebt.md L45
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106846625 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3326#issuecomment-6106846625). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T07:50:30Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #2150 | `docs/dev/TechnicalDebt.md` [L45](https://github.com/boykopovar/AnyPS5/blob/b490b387efa511c36b2c1bdfd44bf520f37c9b8f/docs/dev/TechnicalDebt.md#L45) | | |
adriadam10 commented 2026-10-11 07:58:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:58:44Z.


Checked on Linux: all tools/tests pass; the new SilentStubSectionTests fail with main's check_conventions.py (6 subtests) and pass with the change; check_conventions.py --base main~200 passes on the merged result, including the sceAudioInInit line. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106907586 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3326#issuecomment-6106907586). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:58:44Z. --- Checked on Linux: all `tools/tests` pass; the new `SilentStubSectionTests` fail with `main`'s `check_conventions.py` (6 subtests) and pass with the change; `check_conventions.py --base main~200` passes on the merged result, including the `sceAudioInInit` line. Merging.
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!3326
No description provided.