feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc #14796

Merged
maskym merged 7 commits from upstream-pr/14796 into main 2026-11-10 19:09:17 +00:00
maskym commented 2026-11-01 18:03:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by maskym on 2026-11-01T18:03:31Z.


What

Three libSceLibcInternal inventory placeholders threw on every call: _ZdlPvmRKSt9nothrow_t (NID 7VPIYFpwU2A), _ZdaPvmRKSt9nothrow_t (7lCihI18N9I) and _ZSt17iostream_categoryv (V23qt24VPVs). Their mangled names fix the prototypes: operator delete(void*, std::size_t, const std::nothrow_t&), operator delete[](void*, std::size_t, const std::nothrow_t&) and std::iostream_category(). libc already implements the sized deletes (_ZdlPvm, _ZdaPvm, which release the block on the application heap and ignore the size) and the category, so CxxRuntimeForwards.cpp runs that code under the libSceLibcInternal NIDs, the way #14240 did for the aligned array new and delete in AlignedNew.cpp. The nothrow deletes are noexcept, as the standard forms are. The three inventory stubs and their debt entries are replaced by one entry that records what is and is not verified: the console's libSceLibcInternal.sprx was not read, and whether its deletes share libc.prx's heap or its category object is distinct from libc.prx's is unknown.

Tested

Windows 11 26300, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh), Release, BUILD_TESTING=ON, no title. New guest_libc_internal_cxx_forwards registers a recording application heap and checks that both deletes release the given block exactly once, that a null pointer releases nothing, and that the category pointer is non-null, equal to libc's _ZSt17iostream_categoryv object and stable across calls, with name() iostream: 3 of 3 runs pass. ctest -R '^guest_(libc_internal|init_once|statvfs|fstatvfs|fdopendir|opendir2|utime|posix_spawn|program_name)': 13/13. The patched libSceLibcInternal.prx exports the three NIDs (objdump -p). python tools/check_conventions.py --base origin/main passes; tools/pr_overlap.py lists #14373 and #14659, which add declarations at the same Api.hpp line (text overlap only). Not run on Linux, macOS or a PS5.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5110065398 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14796). Originally posted by [maskym](https://github.com/maskym) on 2026-11-01T18:03:31Z. --- ### What Three `libSceLibcInternal` inventory placeholders threw on every call: `_ZdlPvmRKSt9nothrow_t` (NID `7VPIYFpwU2A`), `_ZdaPvmRKSt9nothrow_t` (`7lCihI18N9I`) and `_ZSt17iostream_categoryv` (`V23qt24VPVs`). Their mangled names fix the prototypes: `operator delete(void*, std::size_t, const std::nothrow_t&)`, `operator delete[](void*, std::size_t, const std::nothrow_t&)` and `std::iostream_category()`. `libc` already implements the sized deletes (`_ZdlPvm`, `_ZdaPvm`, which release the block on the application heap and ignore the size) and the category, so `CxxRuntimeForwards.cpp` runs that code under the `libSceLibcInternal` NIDs, the way #14240 did for the aligned array `new` and `delete` in `AlignedNew.cpp`. The `nothrow` deletes are `noexcept`, as the standard forms are. The three inventory stubs and their debt entries are replaced by one entry that records what is and is not verified: the console's `libSceLibcInternal.sprx` was not read, and whether its deletes share `libc.prx`'s heap or its category object is distinct from `libc.prx`'s is unknown. ### Tested Windows 11 26300, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh), Release, `BUILD_TESTING=ON`, no title. New `guest_libc_internal_cxx_forwards` registers a recording application heap and checks that both deletes release the given block exactly once, that a null pointer releases nothing, and that the category pointer is non-null, equal to `libc`'s `_ZSt17iostream_categoryv` object and stable across calls, with `name()` `iostream`: 3 of 3 runs pass. `ctest -R '^guest_(libc_internal|init_once|statvfs|fstatvfs|fdopendir|opendir2|utime|posix_spawn|program_name)'`: 13/13. The patched `libSceLibcInternal.prx` exports the three NIDs (`objdump -p`). `python tools/check_conventions.py --base origin/main` passes; `tools/pr_overlap.py` lists #14373 and #14659, which add declarations at the same `Api.hpp` line (text overlap only). Not run on Linux, macOS or a PS5. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-01 18:08:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T18:08:00Z.

Review: DISMISSED


Reviewed — changes requested

The new wrappers assume that libSceLibcInternal shares libc's application heap and iostream_category object, but the PR records that both console behaviors are unverified.

What I ran

Reviewed head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958; Git's merge preview against that base was clean. Environment: Linux 6.1, Python 3.11.2, Git 2.39.5; no C++ compiler invocation.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...92b77cf73639ed1848e5f9ec99967ef89fa1a576
python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 --title 'feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/pr-body.md
python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalCxxForwards.cpp docs/dev/debt/libSceLibcInternal.md
python3 /tmp/anyps5-pr-14796-exact/core/libs/tests/test_public_headers.py --audit-only
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14796
Command results and complete precheck table

git diff --check exited 0 with empty stdout. Conventions output:

All conventions checks passed.

Public-header audit output:

399 libraries, 26743 exports: unique declarations and umbrella coverage verified

ABI audit output summary:

ABI audit: passed_with_warnings
sceLibcInternalExport6_062_V23qt24VPVs_nid_no_patch: export-removed: This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional.
sceLibcInternalUnknown6_031_7lCihI18N9I_nid_no_patch: export-removed: This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional.
sceLibcInternalUnknown6_036_7VPIYFpwU2A_nid_no_patch: export-removed: This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional.

Test-quality heuristic output:

{
  "findings": [
    {
      "path": "core/libs/tests/GuestLibcInternalCxxForwards.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Complete precheck table (the failed tool rows are launch errors in the local isolated checkout, not findings against the PR):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...92b77cf73639ed1848e5f9ec99967ef89fa1a576
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 --title feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14796 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000 --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalCxxForwards.cpp docs/dev/debt/libSceLibcInternal.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Raw precheck stderr for the missing local helper files:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000/tools/pr_test_quality.py': [Errno 2] No such file or directory

Hosted check output at review time:

conventions	pending	0
eligibility	pending	0
intake	pending	0
labels	pending	0
library-portability	pending	0
report	pending	0

Results

Check Result Note
Diff and conventions passed No whitespace or convention issues found.
Export and header audit passed Three prior stub names are replaced by the same NID aliases.
Test registration passed CMake registers the added test.
Public-header audit passed Unique declarations and umbrella coverage verified.
Merge preview passed Clean against the stated base.
Hosted CI not run All six checks were pending.
C++ build and runtime tests not run Initial review does not build; author-reported test runs are not independently verified.

Negative control

Not run: the new C++ test requires a built target. No negative-control result is claimed.

Findings

Blocking

The wrappers delegate both sized nothrow deletes to libc's delete exports and return libc's iostream_category object. The PR's debt entry says it has not been verified that the console's libSceLibcInternal uses the same application heap or shares that category object. The host test confirms the chosen forwarding behavior, not that it matches the console ABI. The repository rule says to throw and record debt when general behavior is unknown. Please provide commit-pinned console or equivalent ABI evidence for these cross-library assumptions, or keep the unverified exports throwing and record the gap until that evidence is available.

Non-blocking

None.

Sources

Not verified

No build, C++ runtime test, Linux/macOS/Windows run, or PS5-console comparison was performed by me. The Windows test and export results in the PR description are author-reported. Hosted checks were pending at the time of review.

To get this to a good state

Add evidence establishing the console's heap and category-object behavior, or restore throwing implementations for the unverified exports and retain the debt entry. I will re-run the same no-build checks and review the exact new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729491837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14796#pullrequestreview-5729491837). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T18:08:00Z. **Review:** DISMISSED --- # Reviewed — changes requested The new wrappers assume that `libSceLibcInternal` shares `libc`'s application heap and `iostream_category` object, but the PR records that both console behaviors are unverified. ## What I ran Reviewed head `92b77cf73639ed1848e5f9ec99967ef89fa1a576` against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`; Git's merge preview against that base was clean. Environment: Linux 6.1, Python 3.11.2, Git 2.39.5; no C++ compiler invocation. ```sh git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...92b77cf73639ed1848e5f9ec99967ef89fa1a576 python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 --title 'feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/pr-body.md python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalCxxForwards.cpp docs/dev/debt/libSceLibcInternal.md python3 /tmp/anyps5-pr-14796-exact/core/libs/tests/test_public_headers.py --audit-only python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14796 ``` <details><summary>Command results and complete precheck table</summary> `git diff --check` exited 0 with empty stdout. Conventions output: ```text All conventions checks passed. ``` Public-header audit output: ```text 399 libraries, 26743 exports: unique declarations and umbrella coverage verified ``` ABI audit output summary: ```text ABI audit: passed_with_warnings sceLibcInternalExport6_062_V23qt24VPVs_nid_no_patch: export-removed: This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional. sceLibcInternalUnknown6_031_7lCihI18N9I_nid_no_patch: export-removed: This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional. sceLibcInternalUnknown6_036_7VPIYFpwU2A_nid_no_patch: export-removed: This APS5_VABI declaration, definition, or explicit alias appeared in the changed base files but not in the corresponding head files; verify that removing it is intentional. ``` Test-quality heuristic output: ```json { "findings": [ { "path": "core/libs/tests/GuestLibcInternalCxxForwards.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` Complete precheck table (the `failed` tool rows are launch errors in the local isolated checkout, not findings against the PR): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...92b77cf73639ed1848e5f9ec99967ef89fa1a576` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 --title feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 92b77cf73639ed1848e5f9ec99967ef89fa1a576 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14796 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000 --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalCxxForwards.cpp docs/dev/debt/libSceLibcInternal.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | Raw precheck stderr for the missing local helper files: ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14796-92b77cf73639/head-92b77cf73639-7ef63000/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` Hosted check output at review time: ```text conventions pending 0 eligibility pending 0 intake pending 0 labels pending 0 library-portability pending 0 report pending 0 ``` </details> ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace or convention issues found. | | Export and header audit | passed | Three prior stub names are replaced by the same NID aliases. | | Test registration | passed | CMake registers the added test. | | Public-header audit | passed | Unique declarations and umbrella coverage verified. | | Merge preview | passed | Clean against the stated base. | | Hosted CI | not run | All six checks were pending. | | C++ build and runtime tests | not run | Initial review does not build; author-reported test runs are not independently verified. | ## Negative control Not run: the new C++ test requires a built target. No negative-control result is claimed. ## Findings ### Blocking The wrappers delegate both sized nothrow deletes to `libc`'s delete exports and return `libc`'s `iostream_category` object. The PR's debt entry says it has not been verified that the console's `libSceLibcInternal` uses the same application heap or shares that category object. The host test confirms the chosen forwarding behavior, not that it matches the console ABI. The repository rule says to throw and record debt when general behavior is unknown. Please provide commit-pinned console or equivalent ABI evidence for these cross-library assumptions, or keep the unverified exports throwing and record the gap until that evidence is available. ### Non-blocking None. ## Sources - [Repository rule for unknown behavior, pinned to the reviewed base](https://github.com/boykopovar/AnyPS5/blob/f2d874c1fdccf781c0fa5d86619bb5dd8894b958/AGENTS.md#L7) - [The wrappers and their libc forwarding calls at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/92b77cf73639ed1848e5f9ec99967ef89fa1a576/core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp#L12-L25) - [The PR's debt entry states the console behavior remains unverified](https://github.com/boykopovar/AnyPS5/blob/92b77cf73639ed1848e5f9ec99967ef89fa1a576/docs/dev/debt/libSceLibcInternal.md#L400) ## Not verified No build, C++ runtime test, Linux/macOS/Windows run, or PS5-console comparison was performed by me. The Windows test and export results in the PR description are author-reported. Hosted checks were pending at the time of review. ## To get this to a good state Add evidence establishing the console's heap and category-object behavior, or restore throwing implementations for the unverified exports and retain the debt entry. I will re-run the same no-build checks and review the exact new head.
MarcZX10 commented 2026-11-01 19:35:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:35:31Z.

Review: COMMENTED


Reviewed — no blocking findings

The duplicate declaration that MarcZX10's earlier review found is fixed, and the three forwards match the libc functions they call. Approval waits for the macOS jobs, which were queued at review time.

What I ran

  • Head 9cc66f0e5d26c6ff813c0b63902979f5054b97a8 (two commits on top of base f2d874c1fd: 92b77cf736, then 9cc66f0e5d). 7 files, +125/-21. I read the whole diff.
  • Checked each new export's NID with tools/nid_names.py compute_nid on its mangled name: _ZdlPvmRKSt9nothrow_t → 7VPIYFpwU2A, _ZdaPvmRKSt9nothrow_t → 7lCihI18N9I, _ZSt17iostream_categoryv → V23qt24VPVs, all three match the NIDs they export.
  • Traced the libc targets: _ZdlPvm_nid_postfix and _ZdaPvm_nid_postfix call ApplicationHeapFree_nid_no_patch for non-null pointers (StdioExtras.cpp lines 141-147), which is the release the test counts. _ZSt17iostream_categoryv_nid_postfix returns &std::iostream_category() (CxxAbiSupport.cpp line 104).
  • Declarations: the name is now declared once, in the libc header (libc/include/Api.hpp line 152). At 92b77cf736 a second local declaration sat in CxxRuntimeForwards.cpp; the fix commit removed it.
  • Removed the three NotImplemented entries that these names replace from InventoryExports6.cpp, so no NID is exported twice in the library.
  • Precheck report at this exact head (head and base unchanged at completion). Its ABI and test-quality rows failed because their helpers are not in the head tree; the test-quality flag is the path-matching false positive described below.

Results

Check Result Note
Diff check passed
Conventions and PR template passed
Mergeability and dependencies passed depends on none
NIDs of the three forwards passed each mangled name hashes to the NID it exports
Declarations of the libc targets passed declared once in the libc header
Path of the sized deletes passed reaches ApplicationHeapFree, which the test counts
Test registration passed add_test_executable in CMake; the heuristic flag is a false positive
Build and runtime tests not run no build
Negative controls not run no build
Hosted CI not run conventions, eligibility, labels, library portability, register-context (ubuntu), relinker (ubuntu, windows, asan), report, windows passed; macOS jobs queued
Commands and unedited precheck output

Commands:

  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14796 --output-dir <scratch>/precheck/14796 (report.md in that directory).
  • NIDs: tools/nid_names.py compute_nid on the three mangled names, compared with the explicit APS5_EXPORT strings.
  • Hosted checks: gh api repos/boykopovar/AnyPS5/commits/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/check-runs.

Precheck table (unedited):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...9cc66f0e5d26c6ff813c0b63902979f5054b97a8
conventions_and_pr_template passed /marc/Conlyse-VIEJO/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 9cc66f0e5d26c6ff813c0b63902979f5054b97a8 --title feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc --body /dev/shm/reviewer-run/precheck/14796/pr-body.md
changed_export_abi_audit failed /marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 9cc66f0e5d26c6ff813c0b63902979f5054b97a8 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /marc/Conlyse-VIEJO/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14796 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14796/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /marc/Conlyse-VIEJO/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14796/head-9cc66f0e5d26-23cc442f/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14796/head-9cc66f0e5d26-23cc442f --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/prx/libc/include/Api.hpp core/libs/tests/GuestLibcInternalCxxForwards.cpp docs/dev/debt/libSceLibcInternal.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run here. The test needs a build.

Findings

Blocking

None.

Non-blocking

  • _ZSt17iostream_categoryv_nid_postfix is declared and defined without APS5_VABI (libc/include/Api.hpp line 152, CxxAbiSupport.cpp line 104), while the guest export that calls it is APS5_VABI (CxxRuntimeForwards.cpp line 20). The call passes no arguments, so the result is the same, but the two declarations use different conventions. Matching them would remove the question.
  • The forwards assume that the console's libSceLibcInternal shares libc's application heap and its iostream_category object. The debt entry records both as unverified. Whether to ship on that assumption is a maintainer decision.
  • GuestLibcInternalCxxForwards.cpp is flagged by the test-quality heuristic only because its CMake registration uses a full path; the test is registered.

Sources

Not verified

  • The console's libSceLibcInternal.sprx was not read; the heap and category assumptions are unverified, as the debt entry says.
  • No build or test run; the macOS jobs had not finished at review time.

To get this to a good state

  • Nothing blocking. Optionally match the APS5_VABI convention on the category declaration. Approval waits for the macOS jobs on this head.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729873660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14796#pullrequestreview-5729873660). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T19:35:31Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The duplicate declaration that MarcZX10's earlier review found is fixed, and the three forwards match the libc functions they call. Approval waits for the macOS jobs, which were queued at review time. ## What I ran - Head `9cc66f0e5d26c6ff813c0b63902979f5054b97a8` (two commits on top of base `f2d874c1fd`: `92b77cf736`, then `9cc66f0e5d`). 7 files, +125/-21. I read the whole diff. - Checked each new export's NID with `tools/nid_names.py` `compute_nid` on its mangled name: `_ZdlPvmRKSt9nothrow_t` → `7VPIYFpwU2A`, `_ZdaPvmRKSt9nothrow_t` → `7lCihI18N9I`, `_ZSt17iostream_categoryv` → `V23qt24VPVs`, all three match the NIDs they export. - Traced the libc targets: `_ZdlPvm_nid_postfix` and `_ZdaPvm_nid_postfix` call `ApplicationHeapFree_nid_no_patch` for non-null pointers (`StdioExtras.cpp` lines 141-147), which is the release the test counts. `_ZSt17iostream_categoryv_nid_postfix` returns `&std::iostream_category()` (`CxxAbiSupport.cpp` line 104). - Declarations: the name is now declared once, in the libc header (`libc/include/Api.hpp` line 152). At `92b77cf736` a second local declaration sat in `CxxRuntimeForwards.cpp`; the fix commit removed it. - Removed the three NotImplemented entries that these names replace from `InventoryExports6.cpp`, so no NID is exported twice in the library. - Precheck report at this exact head (head and base unchanged at completion). Its ABI and test-quality rows failed because their helpers are not in the head tree; the test-quality flag is the path-matching false positive described below. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | | | Mergeability and dependencies | passed | depends on none | | NIDs of the three forwards | passed | each mangled name hashes to the NID it exports | | Declarations of the libc targets | passed | declared once in the libc header | | Path of the sized deletes | passed | reaches ApplicationHeapFree, which the test counts | | Test registration | passed | `add_test_executable` in CMake; the heuristic flag is a false positive | | Build and runtime tests | not run | no build | | Negative controls | not run | no build | | Hosted CI | not run | conventions, eligibility, labels, library portability, register-context (ubuntu), relinker (ubuntu, windows, asan), report, windows passed; macOS jobs queued | <details><summary>Commands and unedited precheck output</summary> Commands: - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14796 --output-dir <scratch>/precheck/14796` (report.md in that directory). - NIDs: `tools/nid_names.py` `compute_nid` on the three mangled names, compared with the explicit `APS5_EXPORT` strings. - Hosted checks: `gh api repos/boykopovar/AnyPS5/commits/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/check-runs`. Precheck table (unedited): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...9cc66f0e5d26c6ff813c0b63902979f5054b97a8` | | conventions_and_pr_template | passed | `/marc/Conlyse-VIEJO/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 9cc66f0e5d26c6ff813c0b63902979f5054b97a8 --title feat(libSceLibcInternal): forward the sized nothrow deletes and iostream_category to libc --body /dev/shm/reviewer-run/precheck/14796/pr-body.md` | | changed_export_abi_audit | failed | `/marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 9cc66f0e5d26c6ff813c0b63902979f5054b97a8 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/marc/Conlyse-VIEJO/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14796 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14796/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/marc/Conlyse-VIEJO/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14796/head-9cc66f0e5d26-23cc442f/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14796/head-9cc66f0e5d26-23cc442f --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/prx/libc/include/Api.hpp core/libs/tests/GuestLibcInternalCxxForwards.cpp docs/dev/debt/libSceLibcInternal.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | </details> ## Negative control Not run here. The test needs a build. ## Findings **Blocking** None. **Non-blocking** - `_ZSt17iostream_categoryv_nid_postfix` is declared and defined without `APS5_VABI` (`libc/include/Api.hpp` line 152, `CxxAbiSupport.cpp` line 104), while the guest export that calls it is `APS5_VABI` (`CxxRuntimeForwards.cpp` line 20). The call passes no arguments, so the result is the same, but the two declarations use different conventions. Matching them would remove the question. - The forwards assume that the console's `libSceLibcInternal` shares libc's application heap and its `iostream_category` object. The debt entry records both as unverified. Whether to ship on that assumption is a maintainer decision. - `GuestLibcInternalCxxForwards.cpp` is flagged by the test-quality heuristic only because its CMake registration uses a full path; the test is registered. ## Sources - Forwards: https://github.com/boykopovar/AnyPS5/blob/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp#L1-L25 - libc declaration of the category: https://github.com/boykopovar/AnyPS5/blob/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/core/libs/prx/libc/include/Api.hpp#L152 - libc sized delete path: https://github.com/boykopovar/AnyPS5/blob/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/core/libs/prx/libc/src/StdioExtras.cpp#L141-L147 - Test: https://github.com/boykopovar/AnyPS5/blob/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/core/libs/tests/GuestLibcInternalCxxForwards.cpp - Debt entry: https://github.com/boykopovar/AnyPS5/blob/9cc66f0e5d26c6ff813c0b63902979f5054b97a8/docs/dev/debt/libSceLibcInternal.md ## Not verified - The console's `libSceLibcInternal.sprx` was not read; the heap and category assumptions are unverified, as the debt entry says. - No build or test run; the macOS jobs had not finished at review time. ## To get this to a good state - Nothing blocking. Optionally match the `APS5_VABI` convention on the category declaration. Approval waits for the macOS jobs on this head.
adriadam10 commented 2026-11-06 20:01:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-06T20:01:52Z.

Review: CHANGES_REQUESTED


Thanks, the NIDs, signatures, the two sized nothrow deletes, the test and the debt entry check out. One blocker:

  • core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp:21: sceLibcInternalIostreamCategory_nid_no_patch calls _ZSt17iostream_categoryv_nid_postfix. After NID patching that call becomes an import of V23qt24VPVs, which libSceLibcInternal also exports, so on Linux it can bind to the forwarder itself and recurse forever (reported by @GiannisG1 above; #13730's patched_self_imports reproduces it). guest_libc_internal_cxx_forwards links the libraries directly, so it cannot see it. The two deletes are not affected (lYDzBVE5mZs and FOt55ZNaVJk differ from the exported NIDs).
    Fix: have the forwarder not go through the patched import, e.g. move the body into a _nid_no_patch function in libc that both libc's export and this forwarder call (what #13730 does for the other eight), or return &std::iostream_category() directly. Please keep the test comparing against libc's object.

Once that is changed this can merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5806207983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14796#pullrequestreview-5806207983). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-11-06T20:01:52Z. **Review:** CHANGES_REQUESTED --- Thanks, the NIDs, signatures, the two sized nothrow deletes, the test and the debt entry check out. One blocker: - `core/libs/prx/libSceLibcInternal/CxxRuntimeForwards.cpp:21`: `sceLibcInternalIostreamCategory_nid_no_patch` calls `_ZSt17iostream_categoryv_nid_postfix`. After NID patching that call becomes an import of `V23qt24VPVs`, which `libSceLibcInternal` also exports, so on Linux it can bind to the forwarder itself and recurse forever (reported by @GiannisG1 above; #13730's `patched_self_imports` reproduces it). `guest_libc_internal_cxx_forwards` links the libraries directly, so it cannot see it. The two deletes are not affected (`lYDzBVE5mZs` and `FOt55ZNaVJk` differ from the exported NIDs). Fix: have the forwarder not go through the patched import, e.g. move the body into a `_nid_no_patch` function in `libc` that both libc's export and this forwarder call (what #13730 does for the other eight), or return `&std::iostream_category()` directly. Please keep the test comparing against libc's object. Once that is changed this can merge.
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!14796
No description provided.