feat(libSceLibcInternal): implement the messages facet members #21170

Merged
Herolias merged 1 commit from upstream-pr/21170 into main 2026-11-16 02:08:32 +00:00
Herolias commented 2026-11-15 22:10:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Herolias on 2026-11-15T22:10:01Z.


What

libSceLibcInternal's messages<char> and messages<wchar_t> get, open, close and do_get threw through NotImplemented_nid_no_patch, and libc's exported messages<char> vtable (_ZTVSt8messagesIcE, NID FnEnECMJGag, #10158) was nine zeroed slots, so a virtual call through a facet that uses it jumped to address 0. This change follows the Microsoft STL xlocmes for these.

  • get, open and close (NIDs XxsPrrWJ52I, U2t+WvMQj8A, EeBQ7253LkE; wide Ea+awuQ5Bm8, TPq0HfoACeI, GGoH7e6SZSY) call the facet's do_get, do_open and do_close through its vtable and return what they return. The new GuestLocale::MessagesVtable places them at 0x20, 0x28 and 0x30 past the vtable pointer, after the two destructors and _Incref/_Decref that every facet vtable here starts with; static_asserts pin the offsets. get returns a string by value, so it takes the result pointer first and the facet second, as the collate transform slot already does in GuestLocale.hpp.
  • do_get (NIDs vbgCuYKySLI, UM6rGQxnEMg) ignores the catalog, set and message and returns a copy of the default string. The copy follows basic_string's copy constructor (_Construct_lv_contents) on the 0x28-byte guest string:
    • a default of up to 15 characters (7 16-bit characters for wchar_t) copies the whole 16-byte buffer and records capacity 15 (7);
    • a longer one gets capacity size | 15 (size | 7) and capacity + 1 elements from the shared guest string allocator, with the terminator copied;
    • the default is read through its heap pointer when its capacity is 16 (8) or more, as _Myptr does, so a short string held on the heap is copied inline.
  • libc's messages<char> vtable now holds, in slots 2 to 8, the DestroyCollate, DeleteCollate, RetainFacet and ReleaseFacet functions the collate<char> vtable uses (c66f61ff52), then do_open returning -1, do_get making the copy above and do_close doing nothing. Offset-to-top and typeinfo stay zero, as for collate.
  • libSceLibcInternal reaches libc's copy through two bridges, LibcCopyString_nid_no_patch and LibcCopyWideString_nid_no_patch, next to the existing LibcAssignWideCString_nid_no_patch.
  • do_open returning -1 and do_close doing nothing agree with the firmware 13.42 reading behind 40c1005030, which answers the existing do_open and do_close exports (NIDs HeBwePMtuFs, rRmMX83UL1E, zSehLdHI0FA, AjkxQBlsOOY). Those four are unchanged.

What still throws, and why:

  • A null facet, a facet without a vtable, or an empty slot in get, open or close throws std::invalid_argument without calling anything. The console would fault reading through the null pointer.
  • In do_get: a null result or default, a default whose capacity says heap but whose pointer is null, and a size above max_size() throw std::invalid_argument. max_size() is assumed to be SIZE_MAX - 1 (SIZE_MAX / 2 - 1 for wchar_t), as in the existing basic_string debt entry; the console's value was not read. A copy too large to allocate throws std::bad_alloc from the allocator.
  • messages<char>::_Getcat (NID 96Ev+CE1luE) and the messages constructors still throw; no available source settles their console layout. So nothing in this tree builds a messages facet yet; the wrappers run only on facets the title builds, with its own vtable or libc's.
  • No messages<wchar_t> vtable is exported, so the wide wrappers run only on a facet whose vtable the title supplies.

Debt: docs/dev/debt/changes/feat-messages-facet.md removes the eight "declaration is for import resolution only" entries, adds one Functional entry to libSceLibcInternal.md and changes the messages<char> vtable entry in libc.md. Each entry is under the 1000-character limit.

Overlap:

  • tools/pr_overlap.py --names before starting, for 13 messages names (the narrow members, destructors, _Getcat and vtable, and the wide get, do_get and vtable): the only open pull request it lists is #17300 (refactor, changes requested), which renames the placeholders to their mangled names without implementing them. #17296 implements std::__sce_v2::messages, a different class, under its own SceV2Messages* names.
  • tools/pr_overlap.py --branch feat/messages-facet exits 2. It reports one conflict, #19359, and eight pull requests it cannot compare because they already conflict with main. I compared each with git merge-tree --write-tree against main and against this branch:
    • #19359 deletes _Doraise on the lines directly above the messages<char>::get stub in Export.cpp and PendingExports.hpp, so the two hunks touch. Neither changes the other's lines; the resolution keeps both changes.
    • #17300 rises from 2 to 8 conflict hunks in Export.cpp and from 2 to 3 in Api.hpp, because it renames the same sceLibcInternalPending4_005 to _012 functions this branch implements. The stubs are replaced in place to keep that small.
    • #9526, #11172, #14834, #18135, #19602 and #20059 conflict with main in the files this branch changes, with the same number of hunks as with this branch. #13778 conflicts with main only in files this branch does not change.
    • #17746 and #17296 merge cleanly with both.

Not in this PR:

  • The messages constructors and _Getcat.
  • A messages<wchar_t> vtable export.
  • Other zeroed libc facet vtables (numpunct<char>, codecvt<wchar_t> and others). #11172 wires codecvt<wchar_t>.

Tested

Fedora 44 x86-64, GCC 16.2.1, GNU ld 2.46.1, CMake 4.3.0, Ninja 1.13.2, Release with -DBUILD_TESTING=ON, on main at ff36fea157. I ran no title, homebrew or console, because I have none. Nothing was built or run on Windows or macOS.

  • cmake --build build built the whole tree.
  • The selection from tools/select_tests.py (BUILD.md, "Selective test builds") was 5594 tests, because libc and libSceLibcInternal are linked into almost every test. 5591 passed and 3 failed: agc_driver_image_table_packed_guards, audio_out2_port_layouts and guest_http. All three fail the same way on main at 2454441420, the previous base of this branch: I checked out main in the same tree, rebuilt their executables and ran each alone. The same three failed with this branch on that base. guest_http and audio_out2_port_layouts abort, and agc_driver_image_table_packed_guards logs "invalid format" image-table write-backs. 59 tests skipped themselves: 57 AGC and VideoOut tests, guest_environment_binding_unload and guest_net_raw_protocol. In an earlier run of the selection, two rebases back, guest_kernel_stack_protect also aborted once under -j 16. It passed when run alone and in the final run.
  • guest_libc_internal_messages (new):
    • each of the six get, open and close exports calls only its own slot of a recording vtable, passes the result, facet, catalog, set, message, default, name and locale through unchanged, and returns the slot's result;
    • a null facet, a facet without a vtable and an empty slot throw without calling any slot;
    • do_get for char and wchar_t:
      • short, full-inline and empty defaults copy the 16-byte buffer, tail bytes included, with capacity 15 or 7;
      • a short default held on the heap is copied inline from its heap buffer;
      • a default one past the inline capacity gets capacity size | 15 or size | 7;
      • an embedded NUL is copied with the size kept;
      • a large default (5000 characters, 3000 for wchar_t) gets aligned storage from the large-allocation path;
      • two different catalog, set and message triples give the same copy;
      • a null default, a null result and heap capacity with null storage throw;
    • the char wrappers on a facet whose vtable is libc's exported _ZTVSt8messagesIcE: open returns -1, get copies the default, close returns;
    • every allocation made by the test is freed.
  • guest_locale (extended): libc's messages<char> vtable has zero offset-to-top and typeinfo and non-null slots 2 to 8. It checks destroy, retain and release, open returning -1, close, a short and a long get (capacity length | 15, new storage, same bytes), a null default throwing, and the deleting destructor on a facet from operator new.
  • Negative controls: I made eight one-line changes to the code, rebuilt and ran the two tests, then restored the code. Each change made at least one test fail:
    • copying only size + 1 elements into the inline buffer;
    • not rounding the heap capacity;
    • an inline threshold one lower;
    • choosing the source buffer by size instead of capacity;
    • do_open returning 0;
    • an empty do_close slot;
    • get swapping set and message;
    • the wide do_get using the narrow layout.
  • tools/check_conventions.py --base origin/main reports "All conventions checks passed." With --title and --body set to this title and body, it also passes.
  • tools/debt_fold.py --check passes.
  • tools/pr_overlap.py --branch feat/messages-facet: see Overlap above.

Sources

Microsoft STL links are to 219514876ea86491de191ceaa88632616bbc0f19, the first public release, the pin the std::_MP_* entry in libSceLibcInternal.md already uses.

Behaviour Source
open, get and close call do_open, do_get and do_close and return their result stl/inc/xlocmes lines 38-49
do_open returns -1, do_get returns the default, do_close does nothing stl/inc/xlocmes lines 84-94; do_open and do_close also agree with the firmware 13.42 reading in 40c1005030
The vtable order: destructors, then do_open, do_get, do_close, in declaration order stl/inc/xlocmes lines 79-94; the facet's _Incref/_Decref virtuals in stl/inc/xlocale lines 136-146; the first four slots as in the existing GuestLocale::FacetVtable and the collate<char> vtable (c66f61ff52)
Copy: a size below _BUF_SIZE copies _BUF_SIZE elements and sets capacity _BUF_SIZE - 1; otherwise capacity min(size | _ALLOC_MASK, max_size()), capacity + 1 elements allocated and size + 1 copied stl/inc/xstring lines 2461-2479
_BUF_SIZE 16 / 8 and _ALLOC_MASK 15 / 7 for 1- and 2-byte elements stl/inc/xstring lines 2040-2046
The source is the heap pointer when capacity is at least _BUF_SIZE stl/inc/xstring lines 2047-2066 (_Myptr, _Large_string_engaged)
The 0x28-byte guest string and its allocator GuestLocale::String in core/libs/prx/libc/include/GuestLocale.hpp; GuestStringStorage::Allocate in core/libs/prx/libc/GuestStringStorage.hpp
The vtable is 72 bytes (st_size) in the libc.prx bundled with PPSA26344 #10158

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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:5327737408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21170). Originally posted by [Herolias](https://github.com/Herolias) on 2026-11-15T22:10:01Z. --- ### What libSceLibcInternal's `messages<char>` and `messages<wchar_t>` `get`, `open`, `close` and `do_get` threw through `NotImplemented_nid_no_patch`, and libc's exported `messages<char>` vtable (`_ZTVSt8messagesIcE`, NID `FnEnECMJGag`, #10158) was nine zeroed slots, so a virtual call through a facet that uses it jumped to address 0. This change follows the Microsoft STL `xlocmes` for these. - `get`, `open` and `close` (NIDs `XxsPrrWJ52I`, `U2t+WvMQj8A`, `EeBQ7253LkE`; wide `Ea+awuQ5Bm8`, `TPq0HfoACeI`, `GGoH7e6SZSY`) call the facet's `do_get`, `do_open` and `do_close` through its vtable and return what they return. The new `GuestLocale::MessagesVtable` places them at 0x20, 0x28 and 0x30 past the vtable pointer, after the two destructors and `_Incref`/`_Decref` that every facet vtable here starts with; `static_assert`s pin the offsets. `get` returns a string by value, so it takes the result pointer first and the facet second, as the `collate` `transform` slot already does in `GuestLocale.hpp`. - `do_get` (NIDs `vbgCuYKySLI`, `UM6rGQxnEMg`) ignores the catalog, set and message and returns a copy of the default string. The copy follows `basic_string`'s copy constructor (`_Construct_lv_contents`) on the 0x28-byte guest string: - a default of up to 15 characters (7 16-bit characters for `wchar_t`) copies the whole 16-byte buffer and records capacity 15 (7); - a longer one gets capacity `size | 15` (`size | 7`) and `capacity + 1` elements from the shared guest string allocator, with the terminator copied; - the default is read through its heap pointer when its capacity is 16 (8) or more, as `_Myptr` does, so a short string held on the heap is copied inline. - libc's `messages<char>` vtable now holds, in slots 2 to 8, the `DestroyCollate`, `DeleteCollate`, `RetainFacet` and `ReleaseFacet` functions the `collate<char>` vtable uses (c66f61ff52), then `do_open` returning -1, `do_get` making the copy above and `do_close` doing nothing. Offset-to-top and typeinfo stay zero, as for `collate`. - libSceLibcInternal reaches libc's copy through two bridges, `LibcCopyString_nid_no_patch` and `LibcCopyWideString_nid_no_patch`, next to the existing `LibcAssignWideCString_nid_no_patch`. - `do_open` returning -1 and `do_close` doing nothing agree with the firmware 13.42 reading behind 40c1005030, which answers the existing `do_open` and `do_close` exports (NIDs `HeBwePMtuFs`, `rRmMX83UL1E`, `zSehLdHI0FA`, `AjkxQBlsOOY`). Those four are unchanged. What still throws, and why: - A null facet, a facet without a vtable, or an empty slot in `get`, `open` or `close` throws `std::invalid_argument` without calling anything. The console would fault reading through the null pointer. - In `do_get`: a null result or default, a default whose capacity says heap but whose pointer is null, and a size above `max_size()` throw `std::invalid_argument`. `max_size()` is assumed to be `SIZE_MAX - 1` (`SIZE_MAX / 2 - 1` for `wchar_t`), as in the existing `basic_string` debt entry; the console's value was not read. A copy too large to allocate throws `std::bad_alloc` from the allocator. - `messages<char>::_Getcat` (NID `96Ev+CE1luE`) and the `messages` constructors still throw; no available source settles their console layout. So nothing in this tree builds a `messages` facet yet; the wrappers run only on facets the title builds, with its own vtable or libc's. - No `messages<wchar_t>` vtable is exported, so the wide wrappers run only on a facet whose vtable the title supplies. Debt: `docs/dev/debt/changes/feat-messages-facet.md` removes the eight "declaration is for import resolution only" entries, adds one Functional entry to `libSceLibcInternal.md` and changes the `messages<char> vtable` entry in `libc.md`. Each entry is under the 1000-character limit. Overlap: - `tools/pr_overlap.py --names` before starting, for 13 `messages` names (the narrow members, destructors, `_Getcat` and vtable, and the wide `get`, `do_get` and vtable): the only open pull request it lists is #17300 (refactor, changes requested), which renames the placeholders to their mangled names without implementing them. #17296 implements `std::__sce_v2::messages`, a different class, under its own `SceV2Messages*` names. - `tools/pr_overlap.py --branch feat/messages-facet` exits 2. It reports one conflict, #19359, and eight pull requests it cannot compare because they already conflict with `main`. I compared each with `git merge-tree --write-tree` against `main` and against this branch: - #19359 deletes `_Doraise` on the lines directly above the `messages<char>::get` stub in `Export.cpp` and `PendingExports.hpp`, so the two hunks touch. Neither changes the other's lines; the resolution keeps both changes. - #17300 rises from 2 to 8 conflict hunks in `Export.cpp` and from 2 to 3 in `Api.hpp`, because it renames the same `sceLibcInternalPending4_005` to `_012` functions this branch implements. The stubs are replaced in place to keep that small. - #9526, #11172, #14834, #18135, #19602 and #20059 conflict with `main` in the files this branch changes, with the same number of hunks as with this branch. #13778 conflicts with `main` only in files this branch does not change. - #17746 and #17296 merge cleanly with both. Not in this PR: - The `messages` constructors and `_Getcat`. - A `messages<wchar_t>` vtable export. - Other zeroed libc facet vtables (`numpunct<char>`, `codecvt<wchar_t>` and others). #11172 wires `codecvt<wchar_t>`. ### 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. --> Fedora 44 x86-64, GCC 16.2.1, GNU ld 2.46.1, CMake 4.3.0, Ninja 1.13.2, Release with `-DBUILD_TESTING=ON`, on `main` at ff36fea157. I ran no title, homebrew or console, because I have none. Nothing was built or run on Windows or macOS. - `cmake --build build` built the whole tree. - The selection from `tools/select_tests.py` (BUILD.md, "Selective test builds") was 5594 tests, because libc and libSceLibcInternal are linked into almost every test. 5591 passed and 3 failed: `agc_driver_image_table_packed_guards`, `audio_out2_port_layouts` and `guest_http`. All three fail the same way on `main` at 2454441420, the previous base of this branch: I checked out `main` in the same tree, rebuilt their executables and ran each alone. The same three failed with this branch on that base. `guest_http` and `audio_out2_port_layouts` abort, and `agc_driver_image_table_packed_guards` logs "invalid format" image-table write-backs. 59 tests skipped themselves: 57 AGC and VideoOut tests, `guest_environment_binding_unload` and `guest_net_raw_protocol`. In an earlier run of the selection, two rebases back, `guest_kernel_stack_protect` also aborted once under `-j 16`. It passed when run alone and in the final run. - `guest_libc_internal_messages` (new): - each of the six `get`, `open` and `close` exports calls only its own slot of a recording vtable, passes the result, facet, catalog, set, message, default, name and locale through unchanged, and returns the slot's result; - a null facet, a facet without a vtable and an empty slot throw without calling any slot; - `do_get` for `char` and `wchar_t`: - short, full-inline and empty defaults copy the 16-byte buffer, tail bytes included, with capacity 15 or 7; - a short default held on the heap is copied inline from its heap buffer; - a default one past the inline capacity gets capacity `size | 15` or `size | 7`; - an embedded NUL is copied with the size kept; - a large default (5000 characters, 3000 for `wchar_t`) gets aligned storage from the large-allocation path; - two different catalog, set and message triples give the same copy; - a null default, a null result and heap capacity with null storage throw; - the char wrappers on a facet whose vtable is libc's exported `_ZTVSt8messagesIcE`: `open` returns -1, `get` copies the default, `close` returns; - every allocation made by the test is freed. - `guest_locale` (extended): libc's `messages<char>` vtable has zero offset-to-top and typeinfo and non-null slots 2 to 8. It checks destroy, retain and release, `open` returning -1, `close`, a short and a long `get` (capacity `length | 15`, new storage, same bytes), a null default throwing, and the deleting destructor on a facet from `operator new`. - Negative controls: I made eight one-line changes to the code, rebuilt and ran the two tests, then restored the code. Each change made at least one test fail: - copying only `size + 1` elements into the inline buffer; - not rounding the heap capacity; - an inline threshold one lower; - choosing the source buffer by size instead of capacity; - `do_open` returning 0; - an empty `do_close` slot; - `get` swapping set and message; - the wide `do_get` using the narrow layout. - `tools/check_conventions.py --base origin/main` reports "All conventions checks passed." With `--title` and `--body` set to this title and body, it also passes. - `tools/debt_fold.py --check` passes. - `tools/pr_overlap.py --branch feat/messages-facet`: see Overlap above. ### Sources Microsoft STL links are to `219514876ea86491de191ceaa88632616bbc0f19`, the first public release, the pin the `std::_MP_*` entry in `libSceLibcInternal.md` already uses. | Behaviour | Source | | --- | --- | | `open`, `get` and `close` call `do_open`, `do_get` and `do_close` and return their result | [`stl/inc/xlocmes` lines 38-49](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xlocmes#L38-L49) | | `do_open` returns -1, `do_get` returns the default, `do_close` does nothing | [`stl/inc/xlocmes` lines 84-94](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xlocmes#L84-L94); `do_open` and `do_close` also agree with the firmware 13.42 reading in 40c1005030 | | The vtable order: destructors, then `do_open`, `do_get`, `do_close`, in declaration order | [`stl/inc/xlocmes` lines 79-94](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xlocmes#L79-L94); the facet's `_Incref`/`_Decref` virtuals in [`stl/inc/xlocale` lines 136-146](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xlocale#L136-L146); the first four slots as in the existing `GuestLocale::FacetVtable` and the `collate<char>` vtable (c66f61ff52) | | Copy: a size below `_BUF_SIZE` copies `_BUF_SIZE` elements and sets capacity `_BUF_SIZE - 1`; otherwise capacity `min(size \| _ALLOC_MASK, max_size())`, `capacity + 1` elements allocated and `size + 1` copied | [`stl/inc/xstring` lines 2461-2479](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xstring#L2461-L2479) | | `_BUF_SIZE` 16 / 8 and `_ALLOC_MASK` 15 / 7 for 1- and 2-byte elements | [`stl/inc/xstring` lines 2040-2046](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xstring#L2040-L2046) | | The source is the heap pointer when capacity is at least `_BUF_SIZE` | [`stl/inc/xstring` lines 2047-2066](https://github.com/microsoft/STL/blob/219514876ea86491de191ceaa88632616bbc0f19/stl/inc/xstring#L2047-L2066) (`_Myptr`, `_Large_string_engaged`) | | The 0x28-byte guest string and its allocator | `GuestLocale::String` in `core/libs/prx/libc/include/GuestLocale.hpp`; `GuestStringStorage::Allocate` in `core/libs/prx/libc/GuestStringStorage.hpp` | | The vtable is 72 bytes (`st_size`) in the `libc.prx` bundled with PPSA26344 | #10158 | ### 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) and the licence notice of code adapted from upstream (see AGENTS.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 00:31:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T00:31:50Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_libc_internal_messages_tests, guest_locale_tests built cleanly.
  • CTest (guest_locale, guest_libc_internal_messages):
    1/2 Test #1324: guest_locale .....................   Passed    0.03 sec
    2/2 Test #4002: guest_libc_internal_messages .....   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 2
    
  • Negative control: with core/libs/prx/libSceLibcInternal/Export.cpp, core/libs/prx/libSceLibcInternal/include/Api.hpp, core/libs/prx/libSceLibcInternal/include/PendingExports.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 MessagesVtable layout and static_asserts in core/libs/prx/libc/include/GuestLocale.hpp (open at 0x20, get at 0x28, close at 0x30, sizeof == 0x38) and _ZTVSt8messagesIcE_nid_postfix population in core/libs/prx/libc/src/LocaleSupport.cpp.
    • Checked MessagesSlot null facet, null vtable, and null slot validation in core/libs/prx/libSceLibcInternal/Export.cpp for char and wchar_t messages::get, open, and close exports.
    • Verified CopyStringUnits in core/libs/prx/libc/src/LocaleSupport.cpp for null pointer checks, maxSize bounds, inline vs heap storage selection, SSO 16-byte buffer copy, and heap allocation with (capacity + 1) * unit and (size + 1) * unit copy.
    • Checked ABI signatures, return types, and parameter ordering across PendingExports.hpp, Api.hpp, Export.cpp, and GuestLocale.hpp, as well as LP64/LLP64 type safety.
    • Confirmed AGENTS.md compliance, technical debt fragment documentation in docs/dev/debt/changes/feat-messages-facet.md, and CTest/convention gate results.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5913767460 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21170#pullrequestreview-5913767460). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T00:31:50Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `0bd059835e`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_libc_internal_messages_tests`, `guest_locale_tests` built cleanly. - **CTest** (`guest_locale`, `guest_libc_internal_messages`): ``` 1/2 Test #1324: guest_locale ..................... Passed 0.03 sec 2/2 Test #4002: guest_libc_internal_messages ..... Passed 0.03 sec 100% tests passed, 0 tests failed out of 2 ``` - **Negative control**: with `core/libs/prx/libSceLibcInternal/Export.cpp`, `core/libs/prx/libSceLibcInternal/include/Api.hpp`, `core/libs/prx/libSceLibcInternal/include/PendingExports.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 MessagesVtable layout and static_asserts in core/libs/prx/libc/include/GuestLocale.hpp (open at 0x20, get at 0x28, close at 0x30, sizeof == 0x38) and _ZTVSt8messagesIcE_nid_postfix population in core/libs/prx/libc/src/LocaleSupport.cpp. - Checked MessagesSlot null facet, null vtable, and null slot validation in core/libs/prx/libSceLibcInternal/Export.cpp for char and wchar_t messages<T>::get, open, and close exports. - Verified CopyStringUnits in core/libs/prx/libc/src/LocaleSupport.cpp for null pointer checks, maxSize bounds, inline vs heap storage selection, SSO 16-byte buffer copy, and heap allocation with (capacity + 1) * unit and (size + 1) * unit copy. - Checked ABI signatures, return types, and parameter ordering across PendingExports.hpp, Api.hpp, Export.cpp, and GuestLocale.hpp, as well as LP64/LLP64 type safety. - Confirmed AGENTS.md compliance, technical debt fragment documentation in docs/dev/debt/changes/feat-messages-facet.md, and CTest/convention gate results. 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!21170
No description provided.