feat(libc): implement the std::__sce_v2 messages virtuals #17296

Open
Danigamer05 wants to merge 30 commits from upstream-pr/17296 into main
Danigamer05 commented 2026-11-08 17:27:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Danigamer05 on 2026-11-08T17:27:13Z.


What

Builds on #17277: this branch contains its commits, and through them #16975, #16949, #16944, #16924, #16919, #16560, #16516, #16214, #16178 and #15923, with current main. It needs none of their code, only their place in LocaleSupport.cpp, so it stacks to avoid conflicts. Until they merge, only the last commit is this PR's change.

Implement the three virtuals of std::__sce_v2::messages<char> and messages<wchar_t>, which _Makeloc builds and use_facet hands to callers that look up translated strings. Before this PR, each of their six slots threw NotImplemented_nid_no_patch. These slots are not exports, so this PR adds no NID.

The behavior comes from the libc.prx bundled with PPSA03671 v01.001.005 (J03848509, SHA-256 483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6), vtables 0x18C8C8 and 0x18CFD0:

  • do_open returns -1: the module has no message catalogs.
  • do_get returns a copy of the default string, built as the module's copy constructor builds it. A default of at most 15 char or 7 wchar_t units is copied with the whole 16-byte buffer it is read from; a longer one gets a capacity from its length, length | 15 or length | 7, and its units are copied with the one after them. The source buffer is chosen by the default's capacity, as the module does.
  • do_close does nothing.

The _Makeloc debt entry lists messages among the working facets.

Tested

Windows 11, MinGW GCC 15.2, Release, head on top of #17277. Not run on Linux or macOS, not run in a title.

  • New test guest_sce_v2_messages: do_open, do_close, and do_get with short, long and short-on-heap defaults for both character types, checking sizes, capacities, the copied inline buffer and the unit after a long default.
  • Differential harness against the module's own code, loaded and relocated, with the facets from each side's _Makeloc. Defaults of 0 to 4,400 units, inline or on the heap, with random bytes after the length and capacities that do not match the length. It compares the result, the returned string's size, capacity, inline buffer or heap contents, and the allocations each side makes: 900,000 calls over 3 seeds (about 396,000 heap defaults and 303,000 allocated results), 0 differences.
  • The libc tests built from this head, without the tests that drive the GPU, audio or controllers (150: every guest_sce_v2_*, locale, string and public_headers test): all pass.
  • Negative control: 5 single-change mutations. The harness catches all 5 and the final test catches all 5; the first test run missed the unit copied after a long default, so the test was strengthened and that mutation rerun.
  • check_conventions, git diff --check: clean. Merges cleanly with main. pr_overlap reports no open PR with the same functions or conflicting code; it could not compare 45 PRs that conflict with main on shared files, and of the 4 that touch LocaleSupport.cpp (#9526, #11172, #12518, #12704) none adds these virtuals.

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: #17277
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5213462621 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296). Originally posted by [Danigamer05](https://github.com/Danigamer05) on 2026-11-08T17:27:13Z. --- ### What Builds on #17277: this branch contains its commits, and through them #16975, #16949, #16944, #16924, #16919, #16560, #16516, #16214, #16178 and #15923, with current `main`. It needs none of their code, only their place in `LocaleSupport.cpp`, so it stacks to avoid conflicts. Until they merge, only the last commit is this PR's change. Implement the three virtuals of `std::__sce_v2::messages<char>` and `messages<wchar_t>`, which `_Makeloc` builds and `use_facet` hands to callers that look up translated strings. Before this PR, each of their six slots threw `NotImplemented_nid_no_patch`. These slots are not exports, so this PR adds no NID. The behavior comes from the `libc.prx` bundled with PPSA03671 v01.001.005 (J03848509, SHA-256 `483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6`), vtables `0x18C8C8` and `0x18CFD0`: - `do_open` returns -1: the module has no message catalogs. - `do_get` returns a copy of the default string, built as the module's copy constructor builds it. A default of at most 15 `char` or 7 `wchar_t` units is copied with the whole 16-byte buffer it is read from; a longer one gets a capacity from its length, `length | 15` or `length | 7`, and its units are copied with the one after them. The source buffer is chosen by the default's capacity, as the module does. - `do_close` does nothing. The `_Makeloc` debt entry lists `messages` among the working facets. ### 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. --> Windows 11, MinGW GCC 15.2, Release, head on top of #17277. Not run on Linux or macOS, not run in a title. - New test `guest_sce_v2_messages`: `do_open`, `do_close`, and `do_get` with short, long and short-on-heap defaults for both character types, checking sizes, capacities, the copied inline buffer and the unit after a long default. - Differential harness against the module's own code, loaded and relocated, with the facets from each side's `_Makeloc`. Defaults of 0 to 4,400 units, inline or on the heap, with random bytes after the length and capacities that do not match the length. It compares the result, the returned string's size, capacity, inline buffer or heap contents, and the allocations each side makes: 900,000 calls over 3 seeds (about 396,000 heap defaults and 303,000 allocated results), 0 differences. - The libc tests built from this head, without the tests that drive the GPU, audio or controllers (150: every `guest_sce_v2_*`, locale, string and `public_headers` test): all pass. - Negative control: 5 single-change mutations. The harness catches all 5 and the final test catches all 5; the first test run missed the unit copied after a long default, so the test was strengthened and that mutation rerun. - `check_conventions`, `git diff --check`: clean. Merges cleanly with `main`. `pr_overlap` reports no open PR with the same functions or conflicting code; it could not compare 45 PRs that conflict with `main` on shared files, and of the 4 that touch `LocaleSupport.cpp` (#9526, #11172, #12518, #12704) none adds these virtuals. ### 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: #17277 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-08 18:33:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-08T18:33:02Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 4860ac9cf3:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_sce_v2_char_facet_virtuals_tests, guest_sce_v2_codecvt_wide_tests, guest_sce_v2_collate_moneypunct_tests, guest_sce_v2_facet_ids_tests, guest_sce_v2_makeloc_tests, guest_sce_v2_messages_tests, guest_sce_v2_num_get_char_tests, guest_sce_v2_num_get_wide_tests, guest_sce_v2_num_put_char_tests, guest_sce_v2_num_put_wide_tests failed to build.
    core/libs/prx/libc/src/LocaleSupport.cpp:2977:49: error: no matching function for call to ‘min(const int64_t&, long long int)’
    
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819098075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-5819098075). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-08T18:33:02Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `4860ac9cf3`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_sce_v2_char_facet_virtuals_tests`, `guest_sce_v2_codecvt_wide_tests`, `guest_sce_v2_collate_moneypunct_tests`, `guest_sce_v2_facet_ids_tests`, `guest_sce_v2_makeloc_tests`, `guest_sce_v2_messages_tests`, `guest_sce_v2_num_get_char_tests`, `guest_sce_v2_num_get_wide_tests`, `guest_sce_v2_num_put_char_tests`, `guest_sce_v2_num_put_wide_tests` failed to build. ``` core/libs/prx/libc/src/LocaleSupport.cpp:2977:49: error: no matching function for call to ‘min(const int64_t&, long long int)’ ``` - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-12 22:02:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T22:02:53Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 49b19761b0:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_sce_v2_char_facet_virtuals_tests, guest_sce_v2_codecvt_wide_tests, guest_sce_v2_collate_moneypunct_tests, guest_sce_v2_facet_ids_tests, guest_sce_v2_makeloc_tests, guest_sce_v2_messages_tests, guest_sce_v2_num_get_char_tests, guest_sce_v2_num_get_wide_tests, guest_sce_v2_num_put_char_tests, guest_sce_v2_num_put_wide_tests failed to build.
    core/libs/prx/libc/src/LocaleSupport.cpp:2994:49: error: no matching function for call to ‘min(const int64_t&, long long int)’
    
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5882709165 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-5882709165). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T22:02:53Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `49b19761b0`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_sce_v2_char_facet_virtuals_tests`, `guest_sce_v2_codecvt_wide_tests`, `guest_sce_v2_collate_moneypunct_tests`, `guest_sce_v2_facet_ids_tests`, `guest_sce_v2_makeloc_tests`, `guest_sce_v2_messages_tests`, `guest_sce_v2_num_get_char_tests`, `guest_sce_v2_num_get_wide_tests`, `guest_sce_v2_num_put_char_tests`, `guest_sce_v2_num_put_wide_tests` failed to build. ``` core/libs/prx/libc/src/LocaleSupport.cpp:2994:49: error: no matching function for call to ‘min(const int64_t&, long long int)’ ``` - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 21:09:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:09:09Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_sce_v2_char_facet_virtuals_tests, guest_sce_v2_codecvt_wide_tests, guest_sce_v2_collate_moneypunct_tests, guest_sce_v2_facet_ids_tests, guest_sce_v2_makeloc_tests, guest_sce_v2_messages_tests, guest_sce_v2_num_get_char_tests, guest_sce_v2_num_get_wide_tests, guest_sce_v2_num_put_char_tests, guest_sce_v2_num_put_wide_tests built cleanly.
  • CTest (guest_sce_v2_makeloc, guest_sce_v2_char_facet_virtuals, guest_sce_v2_num_put_char, guest_sce_v2_num_put_wide, guest_sce_v2_codecvt_wide, guest_sce_v2_collate_moneypunct, guest_sce_v2_messages, guest_sce_v2_num_get_char, guest_sce_v2_num_get_wide, guest_sce_v2_facet_ids):
    1/10 Test  #847: guest_sce_v2_char_facet_virtuals ...   Passed    0.02 sec
    2/10 Test  #846: guest_sce_v2_makeloc ...............   Passed    0.03 sec
    3/10 Test  #848: guest_sce_v2_num_put_char ..........   Passed    0.02 sec
    4/10 Test  #849: guest_sce_v2_num_put_wide ..........   Passed    0.03 sec
    5/10 Test  #850: guest_sce_v2_codecvt_wide ..........   Passed    0.02 sec
    6/10 Test  #851: guest_sce_v2_collate_moneypunct ....   Passed    0.02 sec
    7/10 Test  #852: guest_sce_v2_messages ..............   Passed    0.02 sec
    8/10 Test  #853: guest_sce_v2_num_get_char ..........   Passed    0.03 sec
    9/10 Test  #854: guest_sce_v2_num_get_wide ..........   Passed    0.03 sec
    10/10 Test #1133: guest_sce_v2_facet_ids .............   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 10
    
  • Negative control: with core/libs/prx/libc/include/Api.hpp, core/libs/prx/libc/include/GuestLocale.hpp, core/libs/prx/libc/src/LocaleSupport.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified that the previously reported GCC 13.3 build failure (std::min(const int64_t&, long long int)) in core/libs/prx/libc/src/LocaleSupport.cpp has been resolved and all 10 guest_sce_v2_* test targets build and pass on Linux x86_64.
    • Checked std::__sce_v2::messages<char> and messages<wchar_t> virtual functions (do_open, do_get, do_close) in core/libs/prx/libc/src/LocaleSupport.cpp for SSO threshold logic (15 char / 7 wchar_t), dynamic capacity calculation (length | 15 / length | 7), and null-terminator copying.
    • Verified that guest_sce_v2_messages_tests in core/libs/prx/libc/CMakeLists.txt and GuestSceV2Messages.cpp exercises do_open, do_get (both SSO and heap-allocated strings), and do_close for narrow and wide messages facets, and fails when the implementation is reverted.
    • Confirmed compliance with AGENTS.md rules (tools/check_conventions.py passed, git diff --check clean, and technical debt updated in docs/dev/debt/libc.md).
    • Verified cross-platform LP64 (Linux) and LLP64 (Windows) compatibility across the stacked SceV2 locale changes and test targets.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912944392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-5912944392). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:09:09Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `faf01748c3`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_sce_v2_char_facet_virtuals_tests`, `guest_sce_v2_codecvt_wide_tests`, `guest_sce_v2_collate_moneypunct_tests`, `guest_sce_v2_facet_ids_tests`, `guest_sce_v2_makeloc_tests`, `guest_sce_v2_messages_tests`, `guest_sce_v2_num_get_char_tests`, `guest_sce_v2_num_get_wide_tests`, `guest_sce_v2_num_put_char_tests`, `guest_sce_v2_num_put_wide_tests` built cleanly. - **CTest** (`guest_sce_v2_makeloc`, `guest_sce_v2_char_facet_virtuals`, `guest_sce_v2_num_put_char`, `guest_sce_v2_num_put_wide`, `guest_sce_v2_codecvt_wide`, `guest_sce_v2_collate_moneypunct`, `guest_sce_v2_messages`, `guest_sce_v2_num_get_char`, `guest_sce_v2_num_get_wide`, `guest_sce_v2_facet_ids`): ``` 1/10 Test #847: guest_sce_v2_char_facet_virtuals ... Passed 0.02 sec 2/10 Test #846: guest_sce_v2_makeloc ............... Passed 0.03 sec 3/10 Test #848: guest_sce_v2_num_put_char .......... Passed 0.02 sec 4/10 Test #849: guest_sce_v2_num_put_wide .......... Passed 0.03 sec 5/10 Test #850: guest_sce_v2_codecvt_wide .......... Passed 0.02 sec 6/10 Test #851: guest_sce_v2_collate_moneypunct .... Passed 0.02 sec 7/10 Test #852: guest_sce_v2_messages .............. Passed 0.02 sec 8/10 Test #853: guest_sce_v2_num_get_char .......... Passed 0.03 sec 9/10 Test #854: guest_sce_v2_num_get_wide .......... Passed 0.03 sec 10/10 Test #1133: guest_sce_v2_facet_ids ............. Passed 0.02 sec 100% tests passed, 0 tests failed out of 10 ``` - **Negative control**: with `core/libs/prx/libc/include/Api.hpp`, `core/libs/prx/libc/include/GuestLocale.hpp`, `core/libs/prx/libc/src/LocaleSupport.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified that the previously reported GCC 13.3 build failure (`std::min(const int64_t&, long long int)`) in `core/libs/prx/libc/src/LocaleSupport.cpp` has been resolved and all 10 `guest_sce_v2_*` test targets build and pass on Linux x86_64. - Checked `std::__sce_v2::messages<char>` and `messages<wchar_t>` virtual functions (`do_open`, `do_get`, `do_close`) in `core/libs/prx/libc/src/LocaleSupport.cpp` for SSO threshold logic (15 `char` / 7 `wchar_t`), dynamic capacity calculation (`length | 15` / `length | 7`), and null-terminator copying. - Verified that `guest_sce_v2_messages_tests` in `core/libs/prx/libc/CMakeLists.txt` and `GuestSceV2Messages.cpp` exercises `do_open`, `do_get` (both SSO and heap-allocated strings), and `do_close` for narrow and wide `messages` facets, and fails when the implementation is reverted. - Confirmed compliance with AGENTS.md rules (`tools/check_conventions.py` passed, `git diff --check` clean, and technical debt updated in `docs/dev/debt/libc.md`). - Verified cross-platform LP64 (Linux) and LLP64 (Windows) compatibility across the stacked `SceV2` locale changes and test targets. Looks Good To Me
MarcZX10 commented 2026-11-17 21:35:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T21:35:46Z.

Review: COMMENTED


Reviewed messages facets — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head reviewed: bf56220c779453962d012f8191192f654831cd01, base main. The change is the stacked branch as shown in diff.patch; the messages virtuals are the last commit of this PR.
  • Read the title and body, commits.md, manifest.json, files.json and diff.patch. Read the messages virtuals and their registration in core/libs/prx/libc/src/LocaleSupport.cpp, the messages test core/libs/tests/GuestSceV2Messages.cpp, the messages block of core/libs/prx/libc/CMakeLists.txt, and the _Makeloc entries of docs/dev/debt/libc.md.
  • Repository searches at the head with repo_read.py:
python3 repo_read.py search AllocateStringStorage
python3 repo_read.py search _Facet_Register
  • No build and no test run on my side. The test results in the description are the author's.

Results

Check Result Note
Messages code and test read passed Read in full
Rest of the diff read not run Read in part; see Not verified
Test build and run not run Author-reported only
No comments in added code passed Grep found none
_Makeloc debt entry passed Lists messages as working

Findings

Blocking

None.

Non-blocking

  • core/libs/tests/GuestSceV2Messages.cpp:90 — long_ comes from do_get with a 40-unit default, so its buffer is allocated through AllocateStringStorage and never freed. core/libs/tests/GuestSceV2Messages.cpp:95 (copiedEnd) leaks the same way. The process exits right after, so this does not affect the result, but the test allocates two heap strings it never releases.

Not verified

  • The module-derived behaviour: the do_get copy rule, the 0x20 messages category, the vtable addresses and the SHA-256 of libc.prx. I have no access to the module binary here.
  • Build and test results: the Windows 11 / MinGW GCC 15.2 run and the 150-test libc run are the author's report. I did not run them.
  • Not read: most of core/libs/prx/libc/src/LocaleSupport.cpp (num_put, num_get, codecvt, collate, moneypunct, money_get/put and time_get/put implementations and their registration), and the hunks of core/libs/prx/libc/include/GuestLocale.hpp beyond the SceV2IosBase change.
  • Not read: core/libs/tests/GuestSceV2CharFacetVirtuals.cpp, GuestSceV2CodecvtWide.cpp, GuestSceV2CollateMoneypunct.cpp, GuestSceV2Makeloc.cpp, GuestSceV2NumGetChar.cpp, GuestSceV2NumGetWide.cpp, GuestSceV2NumPutChar.cpp, GuestSceV2NumPutWide.cpp, and core/libs/prx/libc/include/Api.hpp beyond its added declarations.
  • The messages test target in core/libs/prx/libc/CMakeLists.txt (new line 502) does not list GuestSceV2Exceptions.S, which the _Makeloc test target does. I did not check whether this test needs it.
  • The _Facet_Register change (LocaleSupport.cpp, around the _Facet_Register definition) now prepends a node, and the matching debt sentence was removed. I saw the change in the diff but did not read the surrounding code.

To get this to a good state

Nothing is required. The non-blocking point above is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5947004295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-5947004295). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T21:35:46Z. **Review:** COMMENTED --- # Reviewed messages facets — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head reviewed: `bf56220c779453962d012f8191192f654831cd01`, base `main`. The change is the stacked branch as shown in `diff.patch`; the messages virtuals are the last commit of this PR. - Read the title and body, `commits.md`, `manifest.json`, `files.json` and `diff.patch`. Read the messages virtuals and their registration in `core/libs/prx/libc/src/LocaleSupport.cpp`, the messages test `core/libs/tests/GuestSceV2Messages.cpp`, the messages block of `core/libs/prx/libc/CMakeLists.txt`, and the `_Makeloc` entries of `docs/dev/debt/libc.md`. - Repository searches at the head with `repo_read.py`: ``` python3 repo_read.py search AllocateStringStorage python3 repo_read.py search _Facet_Register ``` - No build and no test run on my side. The test results in the description are the author's. ## Results | Check | Result | Note | |---|---|---| | Messages code and test read | passed | Read in full | | Rest of the diff read | not run | Read in part; see Not verified | | Test build and run | not run | Author-reported only | | No comments in added code | passed | Grep found none | | `_Makeloc` debt entry | passed | Lists messages as working | ## Findings ### Blocking None. ### Non-blocking - `core/libs/tests/GuestSceV2Messages.cpp:90` — `long_` comes from `do_get` with a 40-unit default, so its buffer is allocated through `AllocateStringStorage` and never freed. `core/libs/tests/GuestSceV2Messages.cpp:95` (`copiedEnd`) leaks the same way. The process exits right after, so this does not affect the result, but the test allocates two heap strings it never releases. ## Not verified - The module-derived behaviour: the `do_get` copy rule, the `0x20` messages category, the vtable addresses and the SHA-256 of `libc.prx`. I have no access to the module binary here. - Build and test results: the Windows 11 / MinGW GCC 15.2 run and the 150-test libc run are the author's report. I did not run them. - Not read: most of `core/libs/prx/libc/src/LocaleSupport.cpp` (num_put, num_get, codecvt, collate, moneypunct, money_get/put and time_get/put implementations and their registration), and the hunks of `core/libs/prx/libc/include/GuestLocale.hpp` beyond the `SceV2IosBase` change. - Not read: `core/libs/tests/GuestSceV2CharFacetVirtuals.cpp`, `GuestSceV2CodecvtWide.cpp`, `GuestSceV2CollateMoneypunct.cpp`, `GuestSceV2Makeloc.cpp`, `GuestSceV2NumGetChar.cpp`, `GuestSceV2NumGetWide.cpp`, `GuestSceV2NumPutChar.cpp`, `GuestSceV2NumPutWide.cpp`, and `core/libs/prx/libc/include/Api.hpp` beyond its added declarations. - The messages test target in `core/libs/prx/libc/CMakeLists.txt` (new line 502) does not list `GuestSceV2Exceptions.S`, which the `_Makeloc` test target does. I did not check whether this test needs it. - The `_Facet_Register` change (`LocaleSupport.cpp`, around the `_Facet_Register` definition) now prepends a node, and the matching debt sentence was removed. I saw the change in the diff but did not read the surrounding code. ## To get this to a good state Nothing is required. The non-blocking point above is optional.
PrivacyOnion commented 2026-11-20 11:39:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T11:39:25Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_sce_v2_char_facet_virtuals_tests, guest_sce_v2_codecvt_wide_tests, guest_sce_v2_collate_moneypunct_tests, guest_sce_v2_messages_tests, guest_sce_v2_num_get_char_tests, guest_sce_v2_num_get_wide_tests, guest_sce_v2_num_put_char_tests, guest_sce_v2_num_put_wide_tests built cleanly.
  • CTest (guest_sce_v2_char_facet_virtuals, guest_sce_v2_num_put_char, guest_sce_v2_num_put_wide, guest_sce_v2_codecvt_wide, guest_sce_v2_collate_moneypunct, guest_sce_v2_messages, guest_sce_v2_num_get_char, guest_sce_v2_num_get_wide):
    1/8 Test #1132: guest_sce_v2_char_facet_virtuals ...   Passed    0.12 sec
    2/8 Test #1133: guest_sce_v2_num_put_char ..........   Passed    0.13 sec
    3/8 Test #1134: guest_sce_v2_num_put_wide ..........   Passed    0.06 sec
    4/8 Test #1135: guest_sce_v2_codecvt_wide ..........   Passed    0.04 sec
    5/8 Test #1136: guest_sce_v2_collate_moneypunct ....   Passed    0.03 sec
    6/8 Test #1137: guest_sce_v2_messages ..............   Passed    0.03 sec
    7/8 Test #1138: guest_sce_v2_num_get_char ..........   Passed    0.04 sec
    8/8 Test #1139: guest_sce_v2_num_get_wide ..........   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 8
    
  • Negative control: with core/libs/prx/libc/include/GuestLocale.hpp, core/libs/prx/libc/src/LocaleSupport.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified do_open, do_get, and do_close implementations for both narrow char and wide char16_t std::__sce_v2::messages facets in core/libs/prx/libc/src/LocaleSupport.cpp against PPSA03671 v01.001.005 libc.prx specifications.
    • Checked string copying mechanics in SceV2BasicString, ReserveSceV2String, and AssignSceV2String/AssignSceV2WideString, ensuring correct small string optimization thresholds (InlineCapacity: 15 for char, 7 for char16_t) and null termination.
    • Audited memory layout, ABI calling conventions (APS5_VABI), and vtable slot alignment in SceV2MessagesCharVtable and SceV2MessagesWideVtable against GuestLocale::FacetVtable.
    • Verified cross-platform 64-bit cleanliness (LP64 Linux vs LLP64 Windows) in size/capacity representation and pointer arithmetic.
    • Confirmed AGENTS.md compliance, including lack of unauthorized code comments, proper technical debt accounting in docs/dev/debt/libc.md, and test integration in core/libs/prx/libc/CMakeLists.txt.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5992084484 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-5992084484). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-20T11:39:25Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `a38d4007e8`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_sce_v2_char_facet_virtuals_tests`, `guest_sce_v2_codecvt_wide_tests`, `guest_sce_v2_collate_moneypunct_tests`, `guest_sce_v2_messages_tests`, `guest_sce_v2_num_get_char_tests`, `guest_sce_v2_num_get_wide_tests`, `guest_sce_v2_num_put_char_tests`, `guest_sce_v2_num_put_wide_tests` built cleanly. - **CTest** (`guest_sce_v2_char_facet_virtuals`, `guest_sce_v2_num_put_char`, `guest_sce_v2_num_put_wide`, `guest_sce_v2_codecvt_wide`, `guest_sce_v2_collate_moneypunct`, `guest_sce_v2_messages`, `guest_sce_v2_num_get_char`, `guest_sce_v2_num_get_wide`): ``` 1/8 Test #1132: guest_sce_v2_char_facet_virtuals ... Passed 0.12 sec 2/8 Test #1133: guest_sce_v2_num_put_char .......... Passed 0.13 sec 3/8 Test #1134: guest_sce_v2_num_put_wide .......... Passed 0.06 sec 4/8 Test #1135: guest_sce_v2_codecvt_wide .......... Passed 0.04 sec 5/8 Test #1136: guest_sce_v2_collate_moneypunct .... Passed 0.03 sec 6/8 Test #1137: guest_sce_v2_messages .............. Passed 0.03 sec 7/8 Test #1138: guest_sce_v2_num_get_char .......... Passed 0.04 sec 8/8 Test #1139: guest_sce_v2_num_get_wide .......... Passed 0.03 sec 100% tests passed, 0 tests failed out of 8 ``` - **Negative control**: with `core/libs/prx/libc/include/GuestLocale.hpp`, `core/libs/prx/libc/src/LocaleSupport.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified do_open, do_get, and do_close implementations for both narrow char and wide char16_t std::__sce_v2::messages facets in core/libs/prx/libc/src/LocaleSupport.cpp against PPSA03671 v01.001.005 libc.prx specifications. - Checked string copying mechanics in SceV2BasicString, ReserveSceV2String, and AssignSceV2String/AssignSceV2WideString, ensuring correct small string optimization thresholds (InlineCapacity: 15 for char, 7 for char16_t) and null termination. - Audited memory layout, ABI calling conventions (APS5_VABI), and vtable slot alignment in SceV2MessagesCharVtable and SceV2MessagesWideVtable against GuestLocale::FacetVtable. - Verified cross-platform 64-bit cleanliness (LP64 Linux vs LLP64 Windows) in size/capacity representation and pointer arithmetic. - Confirmed AGENTS.md compliance, including lack of unauthorized code comments, proper technical debt accounting in docs/dev/debt/libc.md, and test integration in core/libs/prx/libc/CMakeLists.txt. Looks Good To Me
MarcZX10 commented 2026-11-20 11:48:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T11:48:23Z.

Review: COMMENTED


Reviewed — comments

The messages facet implementation appears consistent with the described behavior, but the full change is not verified because several changed files were not reviewed.

What I ran

Reviewed head a38d4007e813743a7cc8a0d221370f7536cc52fa using the pinned repo_read.py reader. I read the prepared description, commit list, diff, manifest, and review-folder README; I did not run tests or other commands.

Results

Check Result Note
Messages implementation passed Inspected implementation and focused test
Test execution not run No checks run during this review
Full change review not run Several changed files were not read

Findings

Blocking

None verified in the inspected messages implementation.

Non-blocking

None.

Not verified

The reviewed material included core/libs/prx/libc/CMakeLists.txt, core/libs/prx/libc/include/GuestLocale.hpp, core/libs/prx/libc/src/LocaleSupport.cpp, core/libs/tests/GuestSceV2Messages.cpp, and docs/dev/debt/libc.md (the relevant implementation and test ranges, plus the prepared diff). The changed files core/libs/tests/GuestSceV2CharFacetVirtuals.cpp, core/libs/tests/GuestSceV2CodecvtWide.cpp, core/libs/tests/GuestSceV2CollateMoneypunct.cpp, core/libs/tests/GuestSceV2NumGetChar.cpp, core/libs/tests/GuestSceV2NumGetWide.cpp, core/libs/tests/GuestSceV2NumPutChar.cpp, and core/libs/tests/GuestSceV2NumPutWide.cpp were not read. Their behavior and tests are not verified. No tests were run in this review; platform and in-title behavior were not confirmed.

To get this to a good state

Nothing is required for the inspected messages implementation. The unreviewed changed files need review before a formal approval is justified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5992179988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-5992179988). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T11:48:23Z. **Review:** COMMENTED --- # Reviewed — comments The messages facet implementation appears consistent with the described behavior, but the full change is not verified because several changed files were not reviewed. ## What I ran Reviewed head `a38d4007e813743a7cc8a0d221370f7536cc52fa` using the pinned `repo_read.py` reader. I read the prepared description, commit list, diff, manifest, and review-folder README; I did not run tests or other commands. ## Results | Check | Result | Note | |---|---|---| | Messages implementation | passed | Inspected implementation and focused test | | Test execution | not run | No checks run during this review | | Full change review | not run | Several changed files were not read | ## Findings ### Blocking None verified in the inspected messages implementation. ### Non-blocking None. ## Not verified The reviewed material included `core/libs/prx/libc/CMakeLists.txt`, `core/libs/prx/libc/include/GuestLocale.hpp`, `core/libs/prx/libc/src/LocaleSupport.cpp`, `core/libs/tests/GuestSceV2Messages.cpp`, and `docs/dev/debt/libc.md` (the relevant implementation and test ranges, plus the prepared diff). The changed files `core/libs/tests/GuestSceV2CharFacetVirtuals.cpp`, `core/libs/tests/GuestSceV2CodecvtWide.cpp`, `core/libs/tests/GuestSceV2CollateMoneypunct.cpp`, `core/libs/tests/GuestSceV2NumGetChar.cpp`, `core/libs/tests/GuestSceV2NumGetWide.cpp`, `core/libs/tests/GuestSceV2NumPutChar.cpp`, and `core/libs/tests/GuestSceV2NumPutWide.cpp` were not read. Their behavior and tests are not verified. No tests were run in this review; platform and in-title behavior were not confirmed. ## To get this to a good state Nothing is required for the inspected messages implementation. The unreviewed changed files need review before a formal approval is justified.
MarcZX10 commented 2026-11-21 07:16:21 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

The messages virtuals match the stated behavior in the inspected source; one test fixture may read beyond its backing string allocation.

What I ran

Inspected the prepared diff and source at head 07fda02256d1f751de8687e835649e9cc3740df6; no build or tests were run.

Results

Check Result Note
Diff and messages implementation passed Target behavior inspected
Build and tests not run No commands run
Full changed-file review not run Several changed files unread

Findings

Blocking

None.

Non-blocking

  • core/libs/tests/GuestSceV2Messages.cpp:98-104: the short-on-heap fixture points at a std::basic_string with only two characters but claims capacity 31. The implementation copies the full inline buffer for a short default, so this fixture can read beyond the string's allocated storage. Back it with a buffer sized to the claimed capacity before testing this case.

Not verified

Read review/description.md, review/commits.md, review/manifest.json, review/diff.patch, the complete GuestSceV2Messages.cpp, and the messages implementation in LocaleSupport.cpp. Did not read the other changed files, including the broader locale facet additions and tests; those changes are not reviewed here. Did not verify author-reported test results or run a negative control.

To get this to a good state

Nothing is required. The test-fixture point above is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003756210 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-6003756210). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T07:16:21Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The messages virtuals match the stated behavior in the inspected source; one test fixture may read beyond its backing string allocation. ## What I ran Inspected the prepared diff and source at head `07fda02256d1f751de8687e835649e9cc3740df6`; no build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and messages implementation | passed | Target behavior inspected | | Build and tests | not run | No commands run | | Full changed-file review | not run | Several changed files unread | ## Findings ### Blocking None. ### Non-blocking - `core/libs/tests/GuestSceV2Messages.cpp:98-104`: the short-on-heap fixture points at a `std::basic_string` with only two characters but claims capacity 31. The implementation copies the full inline buffer for a short default, so this fixture can read beyond the string's allocated storage. Back it with a buffer sized to the claimed capacity before testing this case. ## Not verified Read `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/diff.patch`, the complete `GuestSceV2Messages.cpp`, and the messages implementation in `LocaleSupport.cpp`. Did not read the other changed files, including the broader locale facet additions and tests; those changes are not reviewed here. Did not verify author-reported test results or run a negative control. ## To get this to a good state Nothing is required. The test-fixture point above is optional.
ligmaSec commented 2026-12-03 13:12:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:12:35Z.

Review: COMMENTED


Built the branch’s locale implementation and matching headers against the existing Linux runtime. The focused GuestSceV2Messages fixture passed.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170470707 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17296#pullrequestreview-6170470707). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:12:35Z. **Review:** COMMENTED --- Built the branch’s locale implementation and matching headers against the existing Linux runtime. The focused `GuestSceV2Messages` fixture passed. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/17296:upstream-pr/17296'
git switch 'upstream-pr/17296'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/17296'
git switch 'upstream-pr/17296'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/17296'
git switch 'upstream-pr/17296'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/17296'
git switch 'main'
git merge --squash 'upstream-pr/17296'
git switch 'main'
git merge --ff-only 'upstream-pr/17296'
git switch 'main'
git merge 'upstream-pr/17296'
git push origin 'main'
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!17296
No description provided.