feat(tools): split guarded exports into a partial import_audit class #9372

Merged
mehmetbayoglu merged 7 commits from upstream-pr/9372 into main 2026-10-25 00:29:15 +00:00
mehmetbayoglu commented 2026-10-21 19:32:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mehmetbayoglu on 2026-10-21T19:32:17Z.


What

import_audit counted every export whose source reaches NotImplemented_nid_no_patch as a stub, so an implemented export that throws only for an unknown input (as CONTRIBUTING asks) looked the same as one that does nothing. Exports are now split:

  • stub: the body reaches NotImplemented_nid_no_patch on every path, directly or through a helper that always reaches it.
  • partial: it reaches it only under a condition (if, else, a loop, switch, a ternary, a short-circuit or a lambda). Preprocessor branches inside the body are expanded: each combination of #if, #elif and #else alternatives is checked on its own (an #if without #else has an empty alternative), and the export is partial when at least one combination does not reach the throw, stub when all do. An export wrapped in a preprocessor block from outside its body keeps its class.

The JSON and text reports gain a partial class next to implemented, stub, absent and module. source_stubs keeps its result for other callers; progress.py and the progress page are unchanged.

Tested

  • Windows 11 Pro, Python 3.11: python -m unittest tools/tests/test_import_audit.py runs 124 tests, all pass (3 skipped, as on main). New cases cover a direct throw, a throw through a helper, and a throw under each kind of condition.
  • test_unscoped_registry_imports_use_guest_module_exports, added on main after this change was written, now expects "partial": 0 in unique_by_class.
  • Open PRs #8718, #8719 and #9241 edit nearby lines of tools/import_audit.py (weak imports, Windows suffixes, NID-only exports); none classifies stubs, so whichever merges second only needs a rebase.

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 (#8718 and #8719 are merged and this is rebased on them)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4957232298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372). Originally posted by [mehmetbayoglu](https://github.com/mehmetbayoglu) on 2026-10-21T19:32:17Z. --- ### What `import_audit` counted every export whose source reaches `NotImplemented_nid_no_patch` as a stub, so an implemented export that throws only for an unknown input (as CONTRIBUTING asks) looked the same as one that does nothing. Exports are now split: - **stub:** the body reaches `NotImplemented_nid_no_patch` on every path, directly or through a helper that always reaches it. - **partial:** it reaches it only under a condition (`if`, `else`, a loop, `switch`, a ternary, a short-circuit or a lambda). Preprocessor branches inside the body are expanded: each combination of `#if`, `#elif` and `#else` alternatives is checked on its own (an `#if` without `#else` has an empty alternative), and the export is partial when at least one combination does not reach the throw, stub when all do. An export wrapped in a preprocessor block from outside its body keeps its class. The JSON and text reports gain a `partial` class next to `implemented`, `stub`, `absent` and `module`. `source_stubs` keeps its result for other callers; `progress.py` and the progress page are unchanged. ### Tested - Windows 11 Pro, Python 3.11: `python -m unittest tools/tests/test_import_audit.py` runs 124 tests, all pass (3 skipped, as on `main`). New cases cover a direct throw, a throw through a helper, and a throw under each kind of condition. - `test_unscoped_registry_imports_use_guest_module_exports`, added on `main` after this change was written, now expects `"partial": 0` in `unique_by_class`. - Open PRs #8718, #8719 and #9241 edit nearby lines of `tools/import_audit.py` (weak imports, Windows suffixes, NID-only exports); none classifies stubs, so whichever merges second only needs a rebase. ### 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 (#8718 and #8719 are merged and this is rebased on them) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
xXPBSXx commented 2026-10-22 03:14:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-22T03:14:21Z.


Linux data point for 7052d21d53 (WSL2, Ubuntu 24.04, kernel 6.18 - a virtualised kernel, not bare-metal Linux; Python 3.12.3), this head merged onto main a6dcea927 (clean merge), python3 -I tools/tests/test_import_audit.py:

  • With the PR: 124 tests OK, 1 skipped (Windows read-only behaviour).
  • Without it (the PR's test_import_audit.py on top of main without the PR's source change): FAILED (16 failures, 2 errors).
    Not tested: macOS, Windows.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331782055 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6331782055). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-22T03:14:21Z. --- Linux data point for `7052d21d53` (WSL2, Ubuntu 24.04, kernel 6.18 - a virtualised kernel, not bare-metal Linux; Python 3.12.3), this head merged onto `main` `a6dcea927` (clean merge), `python3 -I tools/tests/test_import_audit.py`: - With the PR: 124 tests OK, 1 skipped (Windows read-only behaviour). - Without it (the PR's `test_import_audit.py` on top of `main` without the PR's source change): FAILED (16 failures, 2 errors). Not tested: macOS, Windows. AI-assisted (Claude Code).
JJenkx commented 2026-10-22 05:33:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T05:33:14Z.


Windows data point on real titles, given as data only. I took 22 PS5 titles whose eboot.bin and bundled modules (sce_module, Unity Media/Modules and Media/Plugins) I'd unwrapped and converted with relinker --windows --registry.

For each title I ran both tools/import_audit.py versions on the same registries, against the same built libraries and each version's own --source tree:

  • main at d9c99c9ba4
  • this PR merged onto main (4952ee563a, clean merge)

The setup was Windows 11 22621 with Python 3.15. I didn't pass --modules, so both versions count the titles' own module imports as absent in the same way; only the stub and partial columns are compared here.

title     main.stub pr.stub pr.partial main.impl pr.impl main.abs pr.abs
PPSA01528        13       6          7       996     996        4      4
PPSA01546       117      86         31      1272    1272      718    718
PPSA01826       119      85         34      1215    1215      448    448
PPSA02630       109      80         29      1152    1152      362    362
PPSA02849        12       6          6       973     973        4      4
PPSA03364        13       7          6       530     530       35     35
PPSA03659        15       9          6      1024    1024        4      4
PPSA04158       122      91         31      1333    1333      820    820
PPSA05106       121      90         31      1334    1334      721    721
PPSA05986        19      13          6      1049    1049        4      4
PPSA06369       121      90         31      1333    1333      721    721
PPSA06652        11       4          7       938     938        6      6
PPSA08102        15       9          6       995     995        4      4
PPSA09346         8       2          6       951     951        4      4
PPSA09614       128      97         31      1366    1366      771    771
PPSA09809       121      90         31      1351    1351      721    721
PPSA15552         2       1          1       387     387        0      0
PPSA16064       136      99         37      1298    1298      893    893
PPSA19591        23      15          8      1085    1085        6      6
PPSA25872         8       2          6       976     976        6      6
PPSA27616         8       2          6       952     952        6      6
PPSA35169        21      20          1       748     748        2      2

Totals across the 22 titles:

  • 358 imports move from stub to partial, and 904 stay stub.
  • No import changes class in any other way: implemented and absent are identical in every title.

The most common moves to partial:

  • sceSystemServiceParamGetInt (22 of 22 titles): it returns the language, date and time formats, time zone and so on, and throws only for the registry-backed IDs.
  • sceAjmBatchStart, sceAjmInstanceCreate and sceAjmBatchJobInitialize (20 titles each).
  • sceSystemServiceLoadExec.
  • sce::Np::CppWebApi container members.

Those that stay stub:

  • __tls_get_addr.
  • sceAgcDriverRequestCaptureStart / Stop / TriggerCapture: for example, sceAgcDriverTriggerCapture is just NotImplemented_nid_no_patch(__func__); return 0;.
  • sceAgcAcbSetWorkload*.
  • sceNpTrophy2GetRewardIcon.

I read the source of sceAjmBatchStart (partial) and sceAgcDriverTriggerCapture (stub), and both match the new classes. On main, every title's report listed sceSystemServiceParamGetInt as a stub that "throws when called", which is wrong for the common parameter IDs.

Not checked: the other 356 moved entries one by one, or macOS.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333551522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6333551522). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T05:33:14Z. --- Windows data point on real titles, given as data only. I took 22 PS5 titles whose `eboot.bin` and bundled modules (`sce_module`, Unity `Media/Modules` and `Media/Plugins`) I'd unwrapped and converted with `relinker --windows --registry`. For each title I ran both `tools/import_audit.py` versions on the same registries, against the same built libraries and each version's own `--source` tree: - `main` at d9c99c9ba4 - this PR merged onto `main` (4952ee563a, clean merge) The setup was Windows 11 22621 with Python 3.15. I didn't pass `--modules`, so both versions count the titles' own module imports as absent in the same way; only the stub and partial columns are compared here. ``` title main.stub pr.stub pr.partial main.impl pr.impl main.abs pr.abs PPSA01528 13 6 7 996 996 4 4 PPSA01546 117 86 31 1272 1272 718 718 PPSA01826 119 85 34 1215 1215 448 448 PPSA02630 109 80 29 1152 1152 362 362 PPSA02849 12 6 6 973 973 4 4 PPSA03364 13 7 6 530 530 35 35 PPSA03659 15 9 6 1024 1024 4 4 PPSA04158 122 91 31 1333 1333 820 820 PPSA05106 121 90 31 1334 1334 721 721 PPSA05986 19 13 6 1049 1049 4 4 PPSA06369 121 90 31 1333 1333 721 721 PPSA06652 11 4 7 938 938 6 6 PPSA08102 15 9 6 995 995 4 4 PPSA09346 8 2 6 951 951 4 4 PPSA09614 128 97 31 1366 1366 771 771 PPSA09809 121 90 31 1351 1351 721 721 PPSA15552 2 1 1 387 387 0 0 PPSA16064 136 99 37 1298 1298 893 893 PPSA19591 23 15 8 1085 1085 6 6 PPSA25872 8 2 6 976 976 6 6 PPSA27616 8 2 6 952 952 6 6 PPSA35169 21 20 1 748 748 2 2 ``` **Totals across the 22 titles:** - 358 imports move from `stub` to `partial`, and 904 stay `stub`. - No import changes class in any other way: `implemented` and `absent` are identical in every title. **The most common moves to `partial`:** - `sceSystemServiceParamGetInt` (22 of 22 titles): it returns the language, date and time formats, time zone and so on, and throws only for the registry-backed IDs. - `sceAjmBatchStart`, `sceAjmInstanceCreate` and `sceAjmBatchJobInitialize` (20 titles each). - `sceSystemServiceLoadExec`. - `sce::Np::CppWebApi` container members. **Those that stay `stub`:** - `__tls_get_addr`. - `sceAgcDriverRequestCaptureStart` / `Stop` / `TriggerCapture`: for example, `sceAgcDriverTriggerCapture` is just `NotImplemented_nid_no_patch(__func__); return 0;`. - `sceAgcAcbSetWorkload*`. - `sceNpTrophy2GetRewardIcon`. I read the source of `sceAjmBatchStart` (partial) and `sceAgcDriverTriggerCapture` (stub), and both match the new classes. On `main`, every title's report listed `sceSystemServiceParamGetInt` as a stub that "throws when called", which is wrong for the common parameter IDs. Not checked: the other 356 moved entries one by one, or macOS.
mehmetbayoglu commented 2026-10-22 05:48:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mehmetbayoglu on 2026-10-22T05:48:27Z.


Thanks @xXPBSXx and @JJenkx for the independent runs. The 22-title comparison is exactly the effect intended: 358 guarded exports move from stub to partial, and implemented and absent stay identical. __tls_get_addr staying a stub is expected here; #9059 implements it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333754354 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6333754354). Originally posted by [mehmetbayoglu](https://github.com/mehmetbayoglu) on 2026-10-22T05:48:27Z. --- Thanks @xXPBSXx and @JJenkx for the independent runs. The 22-title comparison is exactly the effect intended: 358 guarded exports move from stub to partial, and implemented and absent stay identical. `__tls_get_addr` staying a stub is expected here; #9059 implements it.
mehmetbayoglu commented 2026-10-22 06:47:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mehmetbayoglu on 2026-10-22T06:47:01Z.


Pushed 3d9fbbf7ad after @JJenkx's note on #9059: a NotImplemented_nid_no_patch call inside an #if, #ifdef or #ifndef block opened in the export's own body now makes it partial (it throws on some hosts only), while an export wrapped in a preprocessor block from outside its body keeps its class. __tls_get_addr from #9059 now classifies as partial. The test gains three cases (a throw in the #else branch, a throwing helper under #ifdef, and an always-throwing export wrapped from outside), and the 124 tool tests pass on Windows. The 22-title comparison above predates this commit, so exports with host branches may now also move from stub to partial.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6334600713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6334600713). Originally posted by [mehmetbayoglu](https://github.com/mehmetbayoglu) on 2026-10-22T06:47:01Z. --- Pushed 3d9fbbf7ad after @JJenkx's note on #9059: a `NotImplemented_nid_no_patch` call inside an `#if`, `#ifdef` or `#ifndef` block opened in the export's own body now makes it partial (it throws on some hosts only), while an export wrapped in a preprocessor block from outside its body keeps its class. `__tls_get_addr` from #9059 now classifies as partial. The test gains three cases (a throw in the `#else` branch, a throwing helper under `#ifdef`, and an always-throwing export wrapped from outside), and the 124 tool tests pass on Windows. The 22-title comparison above predates this commit, so exports with host branches may now also move from stub to partial.
MarcZX10 commented 2026-10-22 06:51:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T06:51:47Z.

Review: CHANGES_REQUESTED


I ran the exact head 3d9fbbf7adf554a53a32951771f21f2b0efabdc2 locally: - python3 -I tools/tests/test_import_audit.py: 124 tests passed, 1 skipped. - python3 tools/check_conventions.py --base upstream/main --head refs/review/9372: passed. - git diff --check: passed. - Current-main merge-tree check: clean. I found a classification edge case not covered by the suite. For an export whose body is: cpp #if defined(_WIN32) NotImplemented_nid_no_patch(__func__); #else NotImplemented_nid_no_patch(__func__); #endif unconditional_calls() returns no stub call and the export becomes partial. Both preprocessor alternatives throw unconditionally, so this should remain stub. I reproduced this against the exact head. Please add a regression covering all mutually exclusive branches and classify the export as stub when every viable branch reaches the throwing call. The current line-based depth check sees a guarded call but does not account for #else/#elif alternatives. I withdraw the queue-based title-evidence hold. It is fine to keep submitting PRs; maintainers will handle them in due course. The current hosted Ubuntu and ASan relinker checks pass; macOS and Windows relinker checks remain pending, and product builds are skipped. The remaining implementation concern is the preprocessor-classification regression described above.

I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5610283081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#pullrequestreview-5610283081). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T06:51:47Z. **Review:** CHANGES_REQUESTED --- I ran the exact head `3d9fbbf7adf554a53a32951771f21f2b0efabdc2` locally: - `python3 -I tools/tests/test_import_audit.py`: 124 tests passed, 1 skipped. - `python3 tools/check_conventions.py --base upstream/main --head refs/review/9372`: passed. - `git diff --check`: passed. - Current-main merge-tree check: clean. I found a classification edge case not covered by the suite. For an export whose body is: ```cpp #if defined(_WIN32) NotImplemented_nid_no_patch(__func__); #else NotImplemented_nid_no_patch(__func__); #endif ``` `unconditional_calls()` returns no stub call and the export becomes `partial`. Both preprocessor alternatives throw unconditionally, so this should remain `stub`. I reproduced this against the exact head. Please add a regression covering all mutually exclusive branches and classify the export as `stub` when every viable branch reaches the throwing call. The current line-based depth check sees a guarded call but does not account for `#else`/`#elif` alternatives. I withdraw the queue-based title-evidence hold. It is fine to keep submitting PRs; maintainers will handle them in due course. The current hosted Ubuntu and ASan relinker checks pass; macOS and Windows relinker checks remain pending, and product builds are skipped. The remaining implementation concern is the preprocessor-classification regression described above. I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
mehmetbayoglu commented 2026-10-22 06:57:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mehmetbayoglu on 2026-10-22T06:57:08Z.


@MarcZX10 Thanks, you were right. Pushed 72664d1ef9: preprocessor branches in the body are now expanded, each combination of #if/#elif/#else alternatives is checked on its own (an #if without #else gets an empty alternative), and the export is a stub when every combination reaches the throw. New regressions cover all branches throwing (#if/#else and #if/#elif/#else), a nested case where one combination returns (partial), and an export wrapped from outside (stub). All 124 tests pass, and over core/libs/prx the classification moves by 2 exports compared with the first version.

On intake: this is a tooling change and no title stops on it, so it does not meet the named-title rule. The use case is bring-up triage; JJenkx's 22-title comparison above shows 358 imports that audits currently report as throwing on every call. I'll leave it to the maintainers whether that is worth an exception; otherwise I'm happy to hold it as a draft until the queue is below the threshold.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6334758080 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6334758080). Originally posted by [mehmetbayoglu](https://github.com/mehmetbayoglu) on 2026-10-22T06:57:08Z. --- @MarcZX10 Thanks, you were right. Pushed 72664d1ef9: preprocessor branches in the body are now expanded, each combination of `#if`/`#elif`/`#else` alternatives is checked on its own (an `#if` without `#else` gets an empty alternative), and the export is a stub when every combination reaches the throw. New regressions cover all branches throwing (`#if`/`#else` and `#if`/`#elif`/`#else`), a nested case where one combination returns (partial), and an export wrapped from outside (stub). All 124 tests pass, and over `core/libs/prx` the classification moves by 2 exports compared with the first version. On intake: this is a tooling change and no title stops on it, so it does not meet the named-title rule. The use case is bring-up triage; JJenkx's 22-title comparison above shows 358 imports that audits currently report as throwing on every call. I'll leave it to the maintainers whether that is worth an exception; otherwise I'm happy to hold it as a draft until the queue is below the threshold.
JJenkx commented 2026-10-22 13:21:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T13:21:36Z.


Windows rerun on head 72664d1ef9, as data only. I used the same 22 titles' relinker registries as my earlier comment. The head was merged onto main 8b3a6ba88d, with libraries built from main 8b3a6ba88d + #9628 and --source set to the merged tree's core/libs/prx (main's own tree for the main side). Python 3.15 on Windows 11.

implemented partial stub absent
main 23358 0 1162 6260
this PR 23358 267 895 6260

Per title, the only change is stub to partial: 1 to 30 imports per title (27 for seven titles, 30 for PPSA16064). No import changes any other class. Raw outputs are <title>.main.txt and <title>.pr.txt, available on request.

My earlier figure of 358 came from an older main and is not comparable. The previous head (da54c652e3) classifies 0 imports as partial against today's main sources, so I could not separate the effect of the preprocessor-branch commits from main's movement since then.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341808402 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6341808402). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T13:21:36Z. --- Windows rerun on head 72664d1ef9, as data only. I used the same 22 titles' relinker registries as my earlier comment. The head was merged onto `main` 8b3a6ba88d, with libraries built from `main` 8b3a6ba88d + #9628 and `--source` set to the merged tree's `core/libs/prx` (`main`'s own tree for the `main` side). Python 3.15 on Windows 11. | | implemented | partial | stub | absent | |---|---|---|---|---| | `main` | 23358 | 0 | 1162 | 6260 | | this PR | 23358 | 267 | 895 | 6260 | Per title, the only change is stub to partial: 1 to 30 imports per title (27 for seven titles, 30 for PPSA16064). No import changes any other class. Raw outputs are `<title>.main.txt` and `<title>.pr.txt`, available on request. My earlier figure of 358 came from an older `main` and is not comparable. The previous head (da54c652e3) classifies 0 imports as partial against today's `main` sources, so I could not separate the effect of the preprocessor-branch commits from `main`'s movement since then. AI-assisted (Claude Code).
mehmetbayoglu commented 2026-10-22 13:25:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mehmetbayoglu on 2026-10-22T13:25:04Z.


Thanks @JJenkx for the rerun on 72664d1ef9. That is the expected shape: 267 imports move from stub to partial against today's main, and implemented, absent and the other stubs stay identical across the 22 titles. I'll treat 267 as the current figure in place of the earlier 358.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341881039 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#issuecomment-6341881039). Originally posted by [mehmetbayoglu](https://github.com/mehmetbayoglu) on 2026-10-22T13:25:04Z. --- Thanks @JJenkx for the rerun on 72664d1ef9. That is the expected shape: 267 imports move from stub to partial against today's `main`, and implemented, absent and the other stubs stay identical across the 22 titles. I'll treat 267 as the current figure in place of the earlier 358.
MarcZX10 commented 2026-10-22 22:39:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T22:39:07Z.

Review: APPROVED


I rechecked the exact current head 72664d1ef99aca45fc3b6f17ddbd0653e4eae2eb. The branch-variant expansion now treats each mutually exclusive #if/#elif/#else choice separately and correctly keeps an export classified as a stub when every combination reaches the throwing call; the regression covers all-throw alternatives, a mixed nested case, and an export wrapped from outside its body. I ran python3 -I tools/tests/test_import_audit.py on the exact PR head: 124 tests passed, 2 skipped. I also generated a clean synthetic merge with current upstream/main 853baf3bb95e3a6fb8f1b58d0f7b5bd4cba2d306 and reran the suite: 124 passed, 2 skipped. Current-head hosted eligibility, conventions, relinker matrix and ASan checks are green; product build jobs are skipped by the repository path policy. I found no remaining blocker in the requested fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5621738185 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#pullrequestreview-5621738185). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T22:39:07Z. **Review:** APPROVED --- I rechecked the exact current head `72664d1ef99aca45fc3b6f17ddbd0653e4eae2eb`. The branch-variant expansion now treats each mutually exclusive `#if`/`#elif`/`#else` choice separately and correctly keeps an export classified as a stub when every combination reaches the throwing call; the regression covers all-throw alternatives, a mixed nested case, and an export wrapped from outside its body. I ran `python3 -I tools/tests/test_import_audit.py` on the exact PR head: 124 tests passed, 2 skipped. I also generated a clean synthetic merge with current `upstream/main` `853baf3bb95e3a6fb8f1b58d0f7b5bd4cba2d306` and reran the suite: 124 passed, 2 skipped. Current-head hosted eligibility, conventions, relinker matrix and ASan checks are green; product build jobs are skipped by the repository path policy. I found no remaining blocker in the requested fix.
THEMANnt commented 2026-10-24 23:38:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-24T23:38:05Z.

Review: CHANGES_REQUESTED


Reviewed 075bb421b82e against 495b7c10abc2. Changes requested for an unconditional stub incorrectly classified as partial, allowing a strict audit to succeed.

tools/import_audit.py:545–549 — Preserve unconditional throws inside ordinary blocks

The brace-depth test in unconditional_calls ignores NotImplemented_nid_no_patch inside a plain compound statement. For int APS5_VABI sceAlways(int value) { { NotImplemented_nid_no_patch(__func__); } return 0; }, there is no conditional path: every invocation reaches the throw. Nevertheless, the submitted code classifies the export as partial. Using the actual CLI audit path with a synthetic ELF provider, registry and source tree, --strict-stubs returns 0 for this form. Removing only the inner braces yields stub and exit 1. On the pristine baseline both forms are stub and exit 1. This directly reproduces an author-introduced regression without changing production source.

Please inspect ordinary unconditional compound statements while retaining the distinction from conditional or deferred lambda bodies. Add a regression requiring both direct and plain-block throws to remain stubs and fail strict audits; retain genuinely conditional successful paths as partial.

Validation: Windows x64 / CPython 3.11: full import-audit suite 126 passed, 3 skipped; 129 total. Baseline: 124 passed, 3 skipped; 127 total. New-tests/old-code control has 16 schema-expectation failures and two missing-new-API errors; those are not the evidence for this finding. The independent two-form head/baseline reproduction above is decisive. Conventions, whitespace and registration pass. Effective hosted relinker matrix/ASan and conventions succeed; an earlier cancelled conventions run is superseded. Product jobs are skipped.

Scope: This finding concerns static classification and strict CLI status. Fixtures use real audit/report code and synthetic source/ELF files; no full application or title execution is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640615265 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#pullrequestreview-5640615265). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-24T23:38:05Z. **Review:** CHANGES_REQUESTED --- Reviewed [075bb421b82e](https://github.com/boykopovar/AnyPS5/commit/075bb421b82ed5e91d3dced797d3917695487aa7) against [495b7c10abc2](https://github.com/boykopovar/AnyPS5/commit/495b7c10abc2ef0db115b5e12c86786e0bd51a08). Changes requested for an unconditional stub incorrectly classified as partial, allowing a strict audit to succeed. **`tools/import_audit.py:545–549` — Preserve unconditional throws inside ordinary blocks** The brace-depth test in `unconditional_calls` ignores `NotImplemented_nid_no_patch` inside a plain compound statement. For `int APS5_VABI sceAlways(int value) { { NotImplemented_nid_no_patch(__func__); } return 0; }`, there is no conditional path: every invocation reaches the throw. Nevertheless, the submitted code classifies the export as `partial`. Using the actual CLI audit path with a synthetic ELF provider, registry and source tree, `--strict-stubs` returns **0** for this form. Removing only the inner braces yields `stub` and exit **1**. On the pristine baseline both forms are `stub` and exit **1**. This directly reproduces an author-introduced regression without changing production source. Please inspect ordinary unconditional compound statements while retaining the distinction from conditional or deferred lambda bodies. Add a regression requiring both direct and plain-block throws to remain stubs and fail strict audits; retain genuinely conditional successful paths as partial. **Validation:** Windows x64 / CPython 3.11: full import-audit suite 126 passed, 3 skipped; 129 total. Baseline: 124 passed, 3 skipped; 127 total. New-tests/old-code control has 16 schema-expectation failures and two missing-new-API errors; those are not the evidence for this finding. The independent two-form head/baseline reproduction above is decisive. Conventions, whitespace and registration pass. Effective hosted relinker matrix/ASan and conventions succeed; an earlier cancelled conventions run is superseded. Product jobs are skipped. **Scope:** This finding concerns static classification and strict CLI status. Fixtures use real audit/report code and synthetic source/ELF files; no full application or title execution is claimed.
THEMANnt commented 2026-10-25 00:06:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-25T00:06:02Z.

Review: APPROVED


Re-reviewed 1ee2fe9ff97fa6a09f24622a3e65fbeb2342a09c against 38d463a6cfd2bbddc147a34e8b14f5b6f661607a. The blocking finding in my previous review is resolved; no further actionable findings in this focused re-review.

Source review: unconditional_calls now recursively inspects ordinary compound statements while preserving conditional/deferred-body exclusions. Inspected the updated author diff and surrounding classification flow. The strict-stub test now covers the plain-block case for both weak and strong imports. Rebase changes were compared against the new merge base rather than treated as new author changes.

Validation: Windows x64 / Python 3.11: tools/tests/test_import_audit.py -v, 135 passed, 3 skipped; 138 total. New merge-base suite: 133 passed, 3 skipped; 136 total. Independently reran the actual CLI with synthetic provider/registry/source fixtures: direct, plain-block and nested-block throws are stub with strict exit 1; conditional and deferred-lambda throws are partial with strict exit 0. This directly checks the prior reproduced defect without editing production code. Grafted baseline tests have schema/API incompatibilities and are not the evidence for resolution. Conventions, whitespace and script registration passed. Current hosted relinker matrix, ASan and conventions succeeded; full-product jobs were skipped.

Scope: Static classification and Python audit behavior; no full application or title execution.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640691747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9372#pullrequestreview-5640691747). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-25T00:06:02Z. **Review:** APPROVED --- Re-reviewed `1ee2fe9ff97fa6a09f24622a3e65fbeb2342a09c` against `38d463a6cfd2bbddc147a34e8b14f5b6f661607a`. The blocking finding in my previous review is resolved; no further actionable findings in this focused re-review. **Source review:** `unconditional_calls` now recursively inspects ordinary compound statements while preserving conditional/deferred-body exclusions. Inspected the updated author diff and surrounding classification flow. The strict-stub test now covers the plain-block case for both weak and strong imports. Rebase changes were compared against the new merge base rather than treated as new author changes. **Validation:** Windows x64 / Python 3.11: `tools/tests/test_import_audit.py -v`, 135 passed, 3 skipped; 138 total. New merge-base suite: 133 passed, 3 skipped; 136 total. Independently reran the actual CLI with synthetic provider/registry/source fixtures: direct, plain-block and nested-block throws are `stub` with strict exit 1; conditional and deferred-lambda throws are `partial` with strict exit 0. This directly checks the prior reproduced defect without editing production code. Grafted baseline tests have schema/API incompatibilities and are not the evidence for resolution. Conventions, whitespace and script registration passed. Current hosted relinker matrix, ASan and conventions succeeded; full-product jobs were skipped. **Scope:** Static classification and Python audit behavior; no full application or title execution.
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!9372
No description provided.