fix(tools): ignore comments and literals in progress scanning #2181

Closed
ArjenS-LA wants to merge 1 commit from upstream-pr/2181 into main
ArjenS-LA commented 2026-10-09 10:46:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-09T10:46:10Z.


What

The library progress scanner counted commented-out or quoted APS5_VABI definitions and treated braces inside literals as function boundaries. For example, a "}" string before NotImplemented_nid_no_patch made a pending export appear implemented. import_audit.py uses the same scanner.

Mask C++ comments, ordinary/raw strings and character literals before scanning definitions, bodies and local stub wrappers. Handle escaped newlines and match stub calls by complete name with optional whitespace/comments before (, avoiding matches in longer identifiers or diagnostic text. Add regression coverage in the existing progress tests.

Tested

Windows, Python 3.14.3:

  • New regression cases fail against the original scanner and pass with the fix.
  • python -m unittest discover -s tools/tests: 27 tests passed, including progress reporting and import audits.
  • Full-tree before/after scan: identical per-library results, 2,578 implemented functions out of 3,044.
  • Generated and checked all five progress artifacts: JSON, HTML, SVG map and two badges; unchanged-snapshot comparison is empty.
  • python tools/check_conventions.py --base origin/main and git diff --check origin/main...HEAD pass.

Open-PR changed-file checks were refreshed before implementation, during validation and before publication; no other PR changes tools/progress.py or tools/tests/test_progress.py. Related #1323 changes the separate conventions checker.

No C++ runtime changes; no title or hardware testing.

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; C++ comments in tests are fixture data
  • Unimplemented paths throw; no runtime exports or silent stubs changed
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source; none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes — OpenAI Codex assisted with implementation, tests and this description
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4799361317 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2181). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-09T10:46:10Z. --- ### What The library progress scanner counted commented-out or quoted `APS5_VABI` definitions and treated braces inside literals as function boundaries. For example, a `"}"` string before `NotImplemented_nid_no_patch` made a pending export appear implemented. `import_audit.py` uses the same scanner. Mask C++ comments, ordinary/raw strings and character literals before scanning definitions, bodies and local stub wrappers. Handle escaped newlines and match stub calls by complete name with optional whitespace/comments before `(`, avoiding matches in longer identifiers or diagnostic text. Add regression coverage in the existing progress tests. ### Tested Windows, Python 3.14.3: - New regression cases fail against the original scanner and pass with the fix. - `python -m unittest discover -s tools/tests`: 27 tests passed, including progress reporting and import audits. - Full-tree before/after scan: identical per-library results, 2,578 implemented functions out of 3,044. - Generated and checked all five progress artifacts: JSON, HTML, SVG map and two badges; unchanged-snapshot comparison is empty. - `python tools/check_conventions.py --base origin/main` and `git diff --check origin/main...HEAD` pass. Open-PR changed-file checks were refreshed before implementation, during validation and before publication; no other PR changes `tools/progress.py` or `tools/tests/test_progress.py`. Related #1323 changes the separate conventions checker. No C++ runtime changes; no title or hardware testing. ### 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; C++ comments in tests are fixture data - [x] Unimplemented paths throw; no runtime exports or silent stubs changed - [x] No notes, investigation files or images added to the repository - [x] New third-party code is a submodule built from source; none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes — OpenAI Codex assisted with implementation, tests and this description
github-actions[bot] commented 2026-10-09 11:28:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T11:28:28Z.


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
#2193 tools/progress.py L75
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079957753 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2181#issuecomment-6079957753). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T11:28:28Z. --- <!-- 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 | |---|---|---|---| | #2193 | `tools/progress.py` [L75](https://github.com/boykopovar/AnyPS5/blob/8b393b6e9a8ade9188d4f74a0293e0efd9828597/tools/progress.py#L75) | | |
rmz-24 commented 2026-10-09 13:09:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T13:09:43Z.


Windows run (Windows 11 Pro 25H2, Python 3.14), 13e6aa2e cherry-picked onto main d70b8998:

  • tools/tests/test_progress.py: 6/6 pass.
  • With tools/progress.py reset to main and the new tests kept: FAILED (failures=15), so the tests catch what the change fixes.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081539003 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2181#issuecomment-6081539003). Originally posted by [rmz-24](https://github.com/rmz-24) on 2026-10-09T13:09:43Z. --- Windows run (Windows 11 Pro 25H2, Python 3.14), 13e6aa2e cherry-picked onto `main` d70b8998: - `tools/tests/test_progress.py`: 6/6 pass. - With `tools/progress.py` reset to `main` and the new tests kept: `FAILED (failures=15)`, so the tests catch what the change fixes. AI-assisted: yes
oneandonlydean commented 2026-10-09 20:09:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:09:40Z.


Closing: the full-tree scan in your description gives the same per-library counts as main, so nothing is miscounted today. Please reopen if a source file on main gets counted wrong.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088437198 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2181#issuecomment-6088437198). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:09:40Z. --- Closing: the full-tree scan in your description gives the same per-library counts as main, so nothing is miscounted today. Please reopen if a source file on main gets counted wrong.

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