feat(libSceLibcInternal): raise wide basic_string _Xlen/_Xran and ios_base::failure::_Doraise #19359

Merged
B-Howell merged 7 commits from upstream-pr/19359 into main 2026-11-20 22:31:01 +00:00
B-Howell commented 2026-11-13 05:54:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-13T05:54:03Z.


What

Implements three exports that threw:

  • std::wstring::_Xlen and std::wstring::_Xran (_ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv, ..._XranEv) forward to the existing narrow _ZNKSs5_XlenEv and _ZNKSs5_XranEv, so they throw length_error("string too long") and out_of_range("invalid string position"). The wide basic_string members in BasicString.cpp now call the wide reporters instead of the narrow ones. The two declarations move from InventoryExports2 to typed prototypes in libSceLibcInternal/include/Api.hpp.
  • ios_base::failure::_Doraise (_ZNKSt8ios_base7failure8_DoraiseEv) throws a copy of the failure, with its message and error code, through the existing ios_base::failure table, next to the versioned ios_base::_Throw in libc/src/exception/StandardExceptions.cpp. A null object throws std::invalid_argument. The Export.cpp stub and its pending declaration are removed.
  • The three debt entries are removed from docs/dev/debt/libSceLibcInternal.md.

Tested

Ubuntu WSL2, GCC 11, Release, Ninja, on 18ff848e1bf (main 04202b49a5f).

  • Red control 1: with the new test but the wide reporters and _Doraise throwing NotImplemented_nid_no_patch, guest_libc_internal_basic_string fails: Subprocess aborted, _ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix not implemented.
  • Red control 2: with only _Doraise throwing, it fails: Subprocess aborted, _ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix not implemented.
  • With this change, guest_libc_internal_basic_string passes 3/3. It checks that the wide _Xran and _Xlen are caught as out_of_range and length_error with the narrow messages, and that _Doraise on a system_error built with generic_category code 5 is caught as ios_base::failure and as system_error with the same what(), shares the message, copies the error code, and that a null object throws std::invalid_argument.
  • public_headers passes 65/65.
  • tools/progress.py: libraries done goes from 15580 on main to 15583 (+3) out of 39251.
  • Debt fragment 42ffb8dc8a: merged main c3d38470e0c and moved this PR's debt edits into docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head. debt_fold.py --check and check_conventions.py --base origin/main pass. Documentation only, no build.
  • Main merge 8f97dd00249: merged main 7e6f3f82838, which implemented messages<char> get, open and close next to the removed _Doraise stub in Export.cpp and PendingExports.hpp; kept main's code and this PR's removal of the stub and its declaration. On Ubuntu WSL2, GCC 11, Release, Ninja, guest_libc_internal_basic_string and guest_libc_internal_messages pass 2/2. The debt files match main, debt_fold.py --check and check_conventions.py --base origin/main pass.
  • Main merge 13fada000c9: merged main a2beb603f1e, which implemented the Dinkum thread errors (#20059) and removed their stubs next to this PR's removed _Xlen and _Xran stubs in InventoryExports2.cpp; removed both sets. The diff against main is unchanged from the previous head (the _Xlen, _Xran and _Doraise stubs and declarations removed). The debt files match main and check_conventions.py --base origin/main passes; debt_fold.py --check reports only main's own docs-nkwebkit-drop-readded-count-lines.md fragment, which also fails on main. Merge only, no build.
  • Main merge 46ad40647db: merged main 648ba19b3ed. heditrigui's #22431 changed the _Unlock_spin_lock declaration to void (volatile char* lock, int mode = 0) on the line next to this PR's removed _Xlen declaration in include/InventoryExports2.hpp; kept main's declaration and this PR's removal. On Windows, WinLibs GCC 15.2.0, guest_libc_internal_basic_string and #22431's guest_libc_internal_time_lock pass 2/2. The debt files match main, debt_fold.py --check and check_conventions.py --base origin/main pass.
  • Main merge 5ff14bbefc2: merged main e481b135558. PostMalloy's #24043 implemented bad_exception::_Doraise and removed its stub, which sat directly above this PR's removed wide _Xlen and _Xran stubs in InventoryExports2.cpp, so the two removals conflicted; removed all three stubs. The diff against main is unchanged from the previous head. On Ubuntu WSL2, GCC 11, Release, Ninja, guest_libc_internal_basic_string and #24043's guest_libc_internal_exception_virtuals and guest_libc_internal_libc_forwards pass 3/3. The debt files match main, debt_fold.py --check and check_conventions.py --base origin/main pass.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5290845483 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-13T05:54:03Z. --- ### What Implements three exports that threw: - `std::wstring::_Xlen` and `std::wstring::_Xran` (`_ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv`, `..._XranEv`) forward to the existing narrow `_ZNKSs5_XlenEv` and `_ZNKSs5_XranEv`, so they throw `length_error("string too long")` and `out_of_range("invalid string position")`. The wide `basic_string` members in `BasicString.cpp` now call the wide reporters instead of the narrow ones. The two declarations move from `InventoryExports2` to typed prototypes in `libSceLibcInternal/include/Api.hpp`. - `ios_base::failure::_Doraise` (`_ZNKSt8ios_base7failure8_DoraiseEv`) throws a copy of the failure, with its message and error code, through the existing `ios_base::failure` table, next to the versioned `ios_base::_Throw` in `libc/src/exception/StandardExceptions.cpp`. A null object throws `std::invalid_argument`. The `Export.cpp` stub and its pending declaration are removed. - The three debt entries are removed from `docs/dev/debt/libSceLibcInternal.md`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Ubuntu WSL2, GCC 11, Release, Ninja, on `18ff848e1bf` (main `04202b49a5f`). - Red control 1: with the new test but the wide reporters and `_Doraise` throwing `NotImplemented_nid_no_patch`, `guest_libc_internal_basic_string` fails: `Subprocess aborted`, `_ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix not implemented`. - Red control 2: with only `_Doraise` throwing, it fails: `Subprocess aborted`, `_ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix not implemented`. - With this change, `guest_libc_internal_basic_string` passes 3/3. It checks that the wide `_Xran` and `_Xlen` are caught as `out_of_range` and `length_error` with the narrow messages, and that `_Doraise` on a `system_error` built with `generic_category` code 5 is caught as `ios_base::failure` and as `system_error` with the same `what()`, shares the message, copies the error code, and that a null object throws `std::invalid_argument`. - `public_headers` passes 65/65. - `tools/progress.py`: libraries done goes from 15580 on main to 15583 (+3) out of 39251. - Debt fragment `42ffb8dc8a`: merged main `c3d38470e0c` and moved this PR's debt edits into `docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md`; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head. `debt_fold.py --check` and `check_conventions.py --base origin/main` pass. Documentation only, no build. - Main merge `8f97dd00249`: merged main `7e6f3f82838`, which implemented `messages<char>` `get`, `open` and `close` next to the removed `_Doraise` stub in `Export.cpp` and `PendingExports.hpp`; kept main's code and this PR's removal of the stub and its declaration. On Ubuntu WSL2, GCC 11, Release, Ninja, `guest_libc_internal_basic_string` and `guest_libc_internal_messages` pass 2/2. The debt files match main, `debt_fold.py --check` and `check_conventions.py --base origin/main` pass. - Main merge `13fada000c9`: merged main `a2beb603f1e`, which implemented the Dinkum thread errors (#20059) and removed their stubs next to this PR's removed `_Xlen` and `_Xran` stubs in `InventoryExports2.cpp`; removed both sets. The diff against main is unchanged from the previous head (the `_Xlen`, `_Xran` and `_Doraise` stubs and declarations removed). The debt files match main and `check_conventions.py --base origin/main` passes; `debt_fold.py --check` reports only main's own `docs-nkwebkit-drop-readded-count-lines.md` fragment, which also fails on main. Merge only, no build. - Main merge `46ad40647db`: merged main `648ba19b3ed`. heditrigui's #22431 changed the `_Unlock_spin_lock` declaration to `void (volatile char* lock, int mode = 0)` on the line next to this PR's removed `_Xlen` declaration in `include/InventoryExports2.hpp`; kept main's declaration and this PR's removal. On Windows, WinLibs GCC 15.2.0, `guest_libc_internal_basic_string` and #22431's `guest_libc_internal_time_lock` pass 2/2. The debt files match main, `debt_fold.py --check` and `check_conventions.py --base origin/main` pass. - Main merge `5ff14bbefc2`: merged main `e481b135558`. PostMalloy's #24043 implemented `bad_exception::_Doraise` and removed its stub, which sat directly above this PR's removed wide `_Xlen` and `_Xran` stubs in `InventoryExports2.cpp`, so the two removals conflicted; removed all three stubs. The diff against main is unchanged from the previous head. On Ubuntu WSL2, GCC 11, Release, Ninja, `guest_libc_internal_basic_string` and #24043's `guest_libc_internal_exception_virtuals` and `guest_libc_internal_libc_forwards` pass 3/3. The debt files match main, `debt_fold.py --check` and `check_conventions.py --base origin/main` pass. ### 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
PrivacyOnion commented 2026-11-16 16:54:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T16:54:59Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 8f97dd0024:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_libc_internal_basic_string_tests built cleanly.
  • CTest (guest_libc_internal_basic_string):
    1/1 Test #4081: guest_libc_internal_basic_string ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceLibcInternal/BasicString.cpp, core/libs/prx/libSceLibcInternal/Export.cpp, core/libs/prx/libSceLibcInternal/InventoryExports2.cpp, core/libs/prx/libSceLibcInternal/include/Api.hpp, core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp, core/libs/prx/libSceLibcInternal/include/PendingExports.hpp, core/libs/prx/libc/include/Api.hpp, core/libs/prx/libc/src/exception/StandardExceptions.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified _ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix and _ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfix in core/libs/prx/libSceLibcInternal/BasicString.cpp forward to _ZNKSs5_XranEv_nid_postfix and _ZNKSs5_XlenEv_nid_postfix ([[noreturn]] throwing out_of_range("invalid string position") and length_error("string too long")).
    • Verified all wide string helper functions and exports in core/libs/prx/libSceLibcInternal/BasicString.cpp (WideCapacityFor, WideAllocationBytes, ReserveWide, ClampWide, AssignWide, append, insert) route length and range errors through the wide reporters.
    • Verified _ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix in core/libs/prx/libc/src/exception/StandardExceptions.cpp checks self for null (std::invalid_argument) and calls LibcException::SceV2::ThrowSystemCopy(self, _ZTVNSt8ios_base7failureE_nid_postfix).
    • Verified stub removal and prototype placement across Export.cpp, InventoryExports2.cpp, InventoryExports2.hpp, PendingExports.hpp, libSceLibcInternal/include/Api.hpp, and libc/include/Api.hpp, as well as debt fragment docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md.
    • Verified core/libs/tests/GuestLibcInternalBasicString.cpp exercises the wide reporters and ios_base::failure::_Doraise (including null argument handling and exception catching) with both Linux CTest and Windows contributor test runs passing.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5923932697 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5923932697). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T16:54:59Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `8f97dd0024`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_libc_internal_basic_string_tests` built cleanly. - **CTest** (`guest_libc_internal_basic_string`): ``` 1/1 Test #4081: guest_libc_internal_basic_string ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceLibcInternal/BasicString.cpp`, `core/libs/prx/libSceLibcInternal/Export.cpp`, `core/libs/prx/libSceLibcInternal/InventoryExports2.cpp`, `core/libs/prx/libSceLibcInternal/include/Api.hpp`, `core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp`, `core/libs/prx/libSceLibcInternal/include/PendingExports.hpp`, `core/libs/prx/libc/include/Api.hpp`, `core/libs/prx/libc/src/exception/StandardExceptions.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified `_ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix` and `_ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfix` in `core/libs/prx/libSceLibcInternal/BasicString.cpp` forward to `_ZNKSs5_XranEv_nid_postfix` and `_ZNKSs5_XlenEv_nid_postfix` (`[[noreturn]]` throwing `out_of_range("invalid string position")` and `length_error("string too long")`). - Verified all wide string helper functions and exports in `core/libs/prx/libSceLibcInternal/BasicString.cpp` (`WideCapacityFor`, `WideAllocationBytes`, `ReserveWide`, `ClampWide`, `AssignWide`, `append`, `insert`) route length and range errors through the wide reporters. - Verified `_ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix` in `core/libs/prx/libc/src/exception/StandardExceptions.cpp` checks `self` for null (`std::invalid_argument`) and calls `LibcException::SceV2::ThrowSystemCopy(self, _ZTVNSt8ios_base7failureE_nid_postfix)`. - Verified stub removal and prototype placement across `Export.cpp`, `InventoryExports2.cpp`, `InventoryExports2.hpp`, `PendingExports.hpp`, `libSceLibcInternal/include/Api.hpp`, and `libc/include/Api.hpp`, as well as debt fragment `docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md`. - Verified `core/libs/tests/GuestLibcInternalBasicString.cpp` exercises the wide reporters and `ios_base::failure::_Doraise` (including null argument handling and exception catching) with both Linux CTest and Windows contributor test runs passing. Looks Good To Me
MarcZX10 commented 2026-11-16 17:01:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T17:01:16Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the implementation and added tests support merging.

What I ran

Reviewed head 8f97dd0024944466020820b59d1b04aa90836bda. I read all 10 changed files listed as reviewed in manifest.json, including the implementation, API declarations, tests, and debt fragment. I did not run commands or tests; reported test results below come from the PR description.

Results

Check Result Note
Source review passed All changed files read
Reported tests not run PR description reports passing checks

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests or builds were run in this review. I excluded no changed files; all 10 files marked reviewed in the manifest were read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5924025179 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5924025179). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T17:01:16Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the implementation and added tests support merging. ## What I ran Reviewed head `8f97dd0024944466020820b59d1b04aa90836bda`. I read all 10 changed files listed as reviewed in `manifest.json`, including the implementation, API declarations, tests, and debt fragment. I did not run commands or tests; reported test results below come from the PR description. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | All changed files read | | Reported tests | not run | PR description reports passing checks | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No tests or builds were run in this review. I excluded no changed files; all 10 files marked `reviewed` in the manifest were read. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-18 05:36:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T05:36:33Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 13fada000c:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_libc_internal_basic_string_tests built cleanly.
  • CTest (guest_libc_internal_basic_string):
    1/1 Test #4235: guest_libc_internal_basic_string ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceLibcInternal/BasicString.cpp, core/libs/prx/libSceLibcInternal/Export.cpp, core/libs/prx/libSceLibcInternal/InventoryExports2.cpp, core/libs/prx/libSceLibcInternal/include/Api.hpp, core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp, core/libs/prx/libSceLibcInternal/include/PendingExports.hpp, core/libs/prx/libc/include/Api.hpp, core/libs/prx/libc/src/exception/StandardExceptions.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified in core/libs/prx/libSceLibcInternal/BasicString.cpp that _ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix and _ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfix correctly forward to _ZNKSs5_XranEv_nid_postfix and _ZNKSs5_XlenEv_nid_postfix, raising out_of_range and length_error respectively.
    • Verified in core/libs/prx/libSceLibcInternal/BasicString.cpp that wide string routines (WideCapacityFor, WideAllocationBytes, ReserveWide, ClampWide, AssignWide, and wide append/insert) invoke the wide _Xlen and _Xran reporter exports on capacity overflow and out-of-bounds positions.
    • Verified in core/libs/prx/libc/src/exception/StandardExceptions.cpp that _ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix checks for nullptr and throws std::invalid_argument, then invokes LibcException::SceV2::ThrowSystemCopy with _ZTVNSt8ios_base7failureE_nid_postfix.
    • Verified in core/libs/prx/libSceLibcInternal/Export.cpp and InventoryExports2.cpp that previous NotImplemented stubs for _ZNKSt8ios_base7failure8_DoraiseEv and wide _Xlen/_Xran were cleanly removed alongside corresponding declarations in InventoryExports2.hpp and PendingExports.hpp.
    • Verified in docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md that debt removal fragments match the removed stubs and adhere to AGENTS.md conventions.
    • Verified in core/libs/tests/GuestLibcInternalBasicString.cpp that CheckReporters and CheckIosFailureDoraise comprehensively test wide reporter exceptions, null argument rejection, system_error upcast catching, and error code preservation.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5951337372 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5951337372). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T05:36:33Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `13fada000c`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_libc_internal_basic_string_tests` built cleanly. - **CTest** (`guest_libc_internal_basic_string`): ``` 1/1 Test #4235: guest_libc_internal_basic_string ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceLibcInternal/BasicString.cpp`, `core/libs/prx/libSceLibcInternal/Export.cpp`, `core/libs/prx/libSceLibcInternal/InventoryExports2.cpp`, `core/libs/prx/libSceLibcInternal/include/Api.hpp`, `core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp`, `core/libs/prx/libSceLibcInternal/include/PendingExports.hpp`, `core/libs/prx/libc/include/Api.hpp`, `core/libs/prx/libc/src/exception/StandardExceptions.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified in core/libs/prx/libSceLibcInternal/BasicString.cpp that _ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix and _ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfix correctly forward to _ZNKSs5_XranEv_nid_postfix and _ZNKSs5_XlenEv_nid_postfix, raising out_of_range and length_error respectively. - Verified in core/libs/prx/libSceLibcInternal/BasicString.cpp that wide string routines (WideCapacityFor, WideAllocationBytes, ReserveWide, ClampWide, AssignWide, and wide append/insert) invoke the wide _Xlen and _Xran reporter exports on capacity overflow and out-of-bounds positions. - Verified in core/libs/prx/libc/src/exception/StandardExceptions.cpp that _ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix checks for nullptr and throws std::invalid_argument, then invokes LibcException::SceV2::ThrowSystemCopy with _ZTVNSt8ios_base7failureE_nid_postfix. - Verified in core/libs/prx/libSceLibcInternal/Export.cpp and InventoryExports2.cpp that previous NotImplemented stubs for _ZNKSt8ios_base7failure8_DoraiseEv and wide _Xlen/_Xran were cleanly removed alongside corresponding declarations in InventoryExports2.hpp and PendingExports.hpp. - Verified in docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md that debt removal fragments match the removed stubs and adhere to AGENTS.md conventions. - Verified in core/libs/tests/GuestLibcInternalBasicString.cpp that CheckReporters and CheckIosFailureDoraise comprehensively test wide reporter exceptions, null argument rejection, system_error upcast catching, and error code preservation. Looks Good To Me
MarcZX10 commented 2026-11-18 06:55:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T06:55:38Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the exact-head implementation and tests support merging.

What I ran

Reviewed head 13fada000c97dfd10c0624f958950f7fad012e21. Read the prepared diff and changed source context using repo_read.py; no test commands were run. The description reports tests on earlier revisions, not this exact head.

Results

Check Result Note
Diff and source review passed All changed files were included and read
Tests on reviewed head not run Earlier runs are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

The description’s reported test results were not independently reproduced on this head. No build or runtime checks were run. Read: BasicString.cpp, Export.cpp, InventoryExports2.cpp, include/Api.hpp in both changed libraries, include/InventoryExports2.hpp, include/PendingExports.hpp, StandardExceptions.cpp, GuestLibcInternalBasicString.cpp, and the debt fragment. Excluded by rule: none.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5952013455 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5952013455). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T06:55:38Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the exact-head implementation and tests support merging. ## What I ran Reviewed head `13fada000c97dfd10c0624f958950f7fad012e21`. Read the prepared diff and changed source context using `repo_read.py`; no test commands were run. The description reports tests on earlier revisions, not this exact head. ## Results | Check | Result | Note | |---|---|---| | Diff and source review | passed | All changed files were included and read | | Tests on reviewed head | not run | Earlier runs are author-reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The description’s reported test results were not independently reproduced on this head. No build or runtime checks were run. Read: `BasicString.cpp`, `Export.cpp`, `InventoryExports2.cpp`, `include/Api.hpp` in both changed libraries, `include/InventoryExports2.hpp`, `include/PendingExports.hpp`, `StandardExceptions.cpp`, `GuestLibcInternalBasicString.cpp`, and the debt fragment. Excluded by rule: none. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-18 09:55:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T09:55:06Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 46ad40647d:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_libc_internal_basic_string_tests built cleanly.
  • CTest (guest_libc_internal_basic_string):
    1/1 Test #4242: guest_libc_internal_basic_string ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceLibcInternal/BasicString.cpp, core/libs/prx/libSceLibcInternal/Export.cpp, core/libs/prx/libSceLibcInternal/InventoryExports2.cpp, core/libs/prx/libSceLibcInternal/include/Api.hpp, core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp, core/libs/prx/libSceLibcInternal/include/PendingExports.hpp, core/libs/prx/libc/include/Api.hpp, core/libs/prx/libc/src/exception/StandardExceptions.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified std::wstring _Xran and _Xlen exports (_ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix and _ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfix) in core/libs/prx/libSceLibcInternal/BasicString.cpp forward to the narrow exports, throwing out_of_range and length_error respectively.
    • Verified WideCapacityFor, WideAllocationBytes, ReserveWide, ClampWide, AssignWide, and wide append/insert call the wide string exception reporters instead of the narrow ones.
    • Verified ios_base::failure::_Doraise in core/libs/prx/libc/src/exception/StandardExceptions.cpp correctly checks for null self and throws std::invalid_argument, then invokes LibcException::SceV2::ThrowSystemCopy with _ZTVNSt8ios_base7failureE_nid_postfix.
    • Verified removal of obsolete stubs and declarations in Export.cpp, InventoryExports2.cpp, InventoryExports2.hpp, and PendingExports.hpp.
    • Verified the technical debt fragment in docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md properly tracks the removed stubs in accordance with AGENTS.md.
    • Verified comprehensive test coverage in core/libs/tests/GuestLibcInternalBasicString.cpp testing wide reporters, null pointer rejection, and system_error/ios_base::failure unwinding behavior.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5954259146 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5954259146). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T09:55:06Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `46ad40647d`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_libc_internal_basic_string_tests` built cleanly. - **CTest** (`guest_libc_internal_basic_string`): ``` 1/1 Test #4242: guest_libc_internal_basic_string ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceLibcInternal/BasicString.cpp`, `core/libs/prx/libSceLibcInternal/Export.cpp`, `core/libs/prx/libSceLibcInternal/InventoryExports2.cpp`, `core/libs/prx/libSceLibcInternal/include/Api.hpp`, `core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp`, `core/libs/prx/libSceLibcInternal/include/PendingExports.hpp`, `core/libs/prx/libc/include/Api.hpp`, `core/libs/prx/libc/src/exception/StandardExceptions.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified std::wstring _Xran and _Xlen exports (_ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix and _ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfix) in core/libs/prx/libSceLibcInternal/BasicString.cpp forward to the narrow exports, throwing out_of_range and length_error respectively. - Verified WideCapacityFor, WideAllocationBytes, ReserveWide, ClampWide, AssignWide, and wide append/insert call the wide string exception reporters instead of the narrow ones. - Verified ios_base::failure::_Doraise in core/libs/prx/libc/src/exception/StandardExceptions.cpp correctly checks for null self and throws std::invalid_argument, then invokes LibcException::SceV2::ThrowSystemCopy with _ZTVNSt8ios_base7failureE_nid_postfix. - Verified removal of obsolete stubs and declarations in Export.cpp, InventoryExports2.cpp, InventoryExports2.hpp, and PendingExports.hpp. - Verified the technical debt fragment in docs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md properly tracks the removed stubs in accordance with AGENTS.md. - Verified comprehensive test coverage in core/libs/tests/GuestLibcInternalBasicString.cpp testing wide reporters, null pointer rejection, and system_error/ios_base::failure unwinding behavior. Looks Good To Me
MarcZX10 commented 2026-11-18 10:05:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T10:05:24Z.

Review: APPROVED


Reviewed — looks good

Nothing in the reviewed change blocks merging; the inspected implementation and reported checks support approval.

What I ran

Reviewed head 46ad40647dbf2d0e9bd794fc60a7a49ccdf35999. No commands or tests were run in this review; reported test results below are from the PR description.

Results

Check Result Note
Source review passed All 10 changed files read
Reported tests not run Description reports basic string and public header tests passing
Merged preview not run Not run in this review

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

No build or test was performed. The test outcomes and environment in the description were not independently verified. The review folder did not contain files.json; manifest.json listed all 10 changed files as included, and all 10 changed files were read. The full text of review/README.md was not read. No other operating systems or console behavior were checked.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5954438751 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5954438751). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T10:05:24Z. **Review:** APPROVED --- # Reviewed — looks good Nothing in the reviewed change blocks merging; the inspected implementation and reported checks support approval. ## What I ran Reviewed head `46ad40647dbf2d0e9bd794fc60a7a49ccdf35999`. No commands or tests were run in this review; reported test results below are from the PR description. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | All 10 changed files read | | Reported tests | not run | Description reports basic string and public header tests passing | | Merged preview | not run | Not run in this review | ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [BasicString.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/46ad40647dbf2d0e9bd794fc60a7a49ccdf35999/core/libs/prx/libSceLibcInternal/BasicString.cpp#L204-L210) adds wide reporters that delegate to the existing narrow reporters, and the changed wide-string paths call them. - [StandardExceptions.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/46ad40647dbf2d0e9bd794fc60a7a49ccdf35999/core/libs/prx/libc/src/exception/StandardExceptions.cpp#L783-L786) rejects null and copies the system error using the ios failure vtable. The inspected helper copies the message and error code and throws using the supplied exception table. - [GuestLibcInternalBasicString.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/46ad40647dbf2d0e9bd794fc60a7a49ccdf35999/core/libs/tests/GuestLibcInternalBasicString.cpp#L158-L188) covers reporter exception types/messages and ios failure type, message, code, system_error catch, and null input. ## Not verified No build or test was performed. The test outcomes and environment in the description were not independently verified. The review folder did not contain `files.json`; `manifest.json` listed all 10 changed files as included, and all 10 changed files were read. The full text of `review/README.md` was not read. No other operating systems or console behavior were checked. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-20 18:50:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T18:50:49Z.

Review: APPROVED


Reviewed — looks good

The change implements the three reported exports, and the reviewed source plus the author-reported checks support merging at head 5ff14bbefc21ecad6482a686c45388cc6c3e897d.

What I ran

Read the prepared diff and targeted source ranges with repo_read.py at the exact head. No build or tests were run during this review; the checks in the description are author-reported.

Results

Check Result Note
Diff and targeted source review passed Implementations and call sites inspected
Build and tests in this review not run Author-reported checks are separate

Findings

Blocking

None.

Non-blocking

None.

Not verified

Did not read every line of the changed files or run tests. Read the diff and targeted ranges in BasicString.cpp, StandardExceptions.cpp, the relevant API headers, Export.cpp, and GuestLibcInternalBasicString.cpp. The manifest lists nine changed files, all included in the prepared bundle; I did not inspect the remaining changed-file bodies in full. files.json was not available through the reader. Build and test claims in the description were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5997798021 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5997798021). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T18:50:49Z. **Review:** APPROVED --- # Reviewed — looks good The change implements the three reported exports, and the reviewed source plus the author-reported checks support merging at head `5ff14bbefc21ecad6482a686c45388cc6c3e897d`. ## What I ran Read the prepared diff and targeted source ranges with `repo_read.py` at the exact head. No build or tests were run during this review; the checks in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Implementations and call sites inspected | | Build and tests in this review | not run | Author-reported checks are separate | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Did not read every line of the changed files or run tests. Read the diff and targeted ranges in `BasicString.cpp`, `StandardExceptions.cpp`, the relevant API headers, `Export.cpp`, and `GuestLibcInternalBasicString.cpp`. The manifest lists nine changed files, all included in the prepared bundle; I did not inspect the remaining changed-file bodies in full. `files.json` was not available through the reader. Build and test claims in the description were not independently verified. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-20 18:58:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T18:58:41Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 5ff14bbefc:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_libc_internal_basic_string_tests built cleanly.
  • CTest (guest_libc_internal_basic_string):
    1/1 Test #4437: guest_libc_internal_basic_string ...   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceLibcInternal/BasicString.cpp, core/libs/prx/libSceLibcInternal/Export.cpp, core/libs/prx/libSceLibcInternal/InventoryExports2.cpp, core/libs/prx/libSceLibcInternal/include/Api.hpp, core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp, core/libs/prx/libSceLibcInternal/include/PendingExports.hpp, core/libs/prx/libc/include/Api.hpp, core/libs/prx/libc/src/exception/StandardExceptions.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified std::wstring::_Xlen and _Xran forward safely to _ZNKSs5_XlenEv_nid_postfix and _ZNKSs5_XranEv_nid_postfix, matching Dinkumware ABI semantics.
    • Verified callers in BasicString.cpp (ClampWide, WideCapacityFor, WideAllocationBytes, ReserveWide, AssignWide, insert, append) consistently invoke wide reporters on overflow/out-of-range.
    • Verified _ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix null check throws std::invalid_argument before calling LibcException::SceV2::ThrowSystemCopy with _ZTVNSt8ios_base7failureE_nid_postfix.
    • Verified PR diff, removed debt entries in claude-libcinternal-wide-xlen-doraise.md fragment, and headers Api.hpp / InventoryExports2.hpp / PendingExports.hpp.
    • Verified GuestLibcInternalBasicString.cpp tests cover wide _Xlen, wide _Xran, failure::_Doraise message/error_code propagation, base system_error catch, and null-argument exception.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5997885389 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19359#pullrequestreview-5997885389). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-20T18:58:41Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `5ff14bbefc`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_libc_internal_basic_string_tests` built cleanly. - **CTest** (`guest_libc_internal_basic_string`): ``` 1/1 Test #4437: guest_libc_internal_basic_string ... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceLibcInternal/BasicString.cpp`, `core/libs/prx/libSceLibcInternal/Export.cpp`, `core/libs/prx/libSceLibcInternal/InventoryExports2.cpp`, `core/libs/prx/libSceLibcInternal/include/Api.hpp`, `core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp`, `core/libs/prx/libSceLibcInternal/include/PendingExports.hpp`, `core/libs/prx/libc/include/Api.hpp`, `core/libs/prx/libc/src/exception/StandardExceptions.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified std::wstring::_Xlen and _Xran forward safely to _ZNKSs5_XlenEv_nid_postfix and _ZNKSs5_XranEv_nid_postfix, matching Dinkumware ABI semantics. - Verified callers in BasicString.cpp (ClampWide, WideCapacityFor, WideAllocationBytes, ReserveWide, AssignWide, insert, append) consistently invoke wide reporters on overflow/out-of-range. - Verified _ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix null check throws std::invalid_argument before calling LibcException::SceV2::ThrowSystemCopy with _ZTVNSt8ios_base7failureE_nid_postfix. - Verified PR diff, removed debt entries in claude-libcinternal-wide-xlen-doraise.md fragment, and headers Api.hpp / InventoryExports2.hpp / PendingExports.hpp. - Verified GuestLibcInternalBasicString.cpp tests cover wide _Xlen, wide _Xran, failure::_Doraise message/error_code propagation, base system_error catch, and null-argument exception. Looks Good To Me
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!19359
No description provided.