feat(libc): implement the std::__sce_v2 money_put virtuals #17331

Open
Danigamer05 wants to merge 31 commits from upstream-pr/17331 into main
Danigamer05 commented 2026-11-08 18:14:02 +00:00 (Migrated from github.com)

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


What

Builds on #17296: this branch contains its commits, and through them #17277, #16975, #16949, #16944, #16924, #16919, #16560, #16516, #16214, #16178 and #15923, with current main. It needs none of their code beyond the moneypunct virtuals of #17277, which it calls, and 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 two virtuals of std::__sce_v2::money_put<char> and money_put<wchar_t>, which _Makeloc builds and std::put_money calls. Before this PR, each of their four 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 0x18CBC0 and its wchar_t twin, read from the disassembly of do_put (0xDCD70, 0xDD1B0) and of the shared field writer (0xDD610). The writer follows Dinkumware's _Putmfld, as its descendant in microsoft/STL (stl/inc/xlocmon) does, with this module's pattern encoding:

  • The pattern bytes are characters: $ symbol, + sign, v value, x none and space; other bytes are skipped. A space field writes the fill character, not a space.
  • do_put of digits widens 0123456789- through the stream's ctype, takes a leading minus as the sign, keeps the digits up to the first other character, and writes 0 for none.
  • do_put of a long double takes the sign from 0 > value, divides values of at least 1e35 by 1e10 up to 500 times and appends ten zeros per division, prints the rest with sprintf_s("%.0Lf") and widens it. A negative zero or NaN prints with the minus sign sprintf_s gives it, among the digits.
  • The writer pads a value no longer than the absolute fraction digit count with zeros, inserts thousands separators from grouping, takes the currency symbol only under showbase, and fills on the left, inside a none or space field under internal, or on the right. Only the first character of the sign goes in its field; the rest follows the last field. decimal_point, thousands_sep, grouping, frac_digits, the signs, the patterns and curr_symbol are called through the moneypunct facet's vtable, so a facet with other virtuals is honored.

The _Makeloc debt entry now names the facets that still throw, and a new entry records that the digits of a long double come from this library's sprintf_s.

Tested

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

  • New test guest_sce_v2_money_put: the C locale's facets with right, left and internal fill; empty, partial and lone-minus digit strings; long double rounding, sign and negative zero; then moneypunct facets with set fields: grouping, fraction digits (including a negative count), a space field, a multi-character sign, the international facet, and the wchar_t facet with non-ASCII separators and signs.
  • Differential harness against the module's own code, loaded and relocated, with each side's own locale from its _Makeloc. Each call randomizes both moneypunct facets' fields (grouping with CHAR_MAX and negative bytes, symbols and signs of up to 7 characters, fraction digits from -20 to 20, shuffled patterns with stray bytes), the stream's flags and width, the fill, the input (digit strings with stray characters; long double integers, fractions, values up to 1e4000, infinities, NaNs and negative zero), and the stream buffer (direct room, overflow, a rejecting overflow, no buffer, an already failed iterator). It compares every character written, the iterator, the stream's width and flags.
    • With the module's sprintf_s redirected to this library's: 900,000 calls over 3 seeds, 0 differences.
    • With the module's own: 200,000 calls, 2,167 differences, all in the last digits of long double amounts of 2^66 or more, where the two sprintf_s print %.0Lf differently (the new debt entry).
  • The libc tests built from this head, without the tests that drive the GPU, audio or controllers (151: every guest_sce_v2_*, locale, string and public_headers test): all pass.
  • Negative control: 12 single-change mutations, with the harness redirecting sprintf_s. The harness catches 11; the twelfth, dropping the 0 written for an empty digit string, changes nothing, because the writer pads an empty value with the same zeros. The first test run missed 5 (a trailing none field under internal, grouping bytes that change, a minus among the digits, and the 500-division limit, which only an infinity reaches), so the test was strengthened and they were rerun: the final test catches the same 11.
  • 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 52 PRs that conflict with main on shared files. Of the 4 that touch LocaleSupport.cpp, #12518 exports the unversioned std::money_put<char> vtable as zeroed data, a different symbol, and #9526, #11172 and #12704 do not touch money_put.

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: #17296
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5213825232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331). Originally posted by [Danigamer05](https://github.com/Danigamer05) on 2026-11-08T18:14:02Z. --- ### What Builds on #17296: this branch contains its commits, and through them #17277, #16975, #16949, #16944, #16924, #16919, #16560, #16516, #16214, #16178 and #15923, with current `main`. It needs none of their code beyond the `moneypunct` virtuals of #17277, which it calls, and 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 two virtuals of `std::__sce_v2::money_put<char>` and `money_put<wchar_t>`, which `_Makeloc` builds and `std::put_money` calls. Before this PR, each of their four 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 `0x18CBC0` and its `wchar_t` twin, read from the disassembly of `do_put` (`0xDCD70`, `0xDD1B0`) and of the shared field writer (`0xDD610`). The writer follows Dinkumware's `_Putmfld`, as its descendant in microsoft/STL (`stl/inc/xlocmon`) does, with this module's pattern encoding: - The pattern bytes are characters: `$` symbol, `+` sign, `v` value, `x` none and ` ` space; other bytes are skipped. A space field writes the fill character, not a space. - `do_put` of digits widens `0123456789-` through the stream's `ctype`, takes a leading minus as the sign, keeps the digits up to the first other character, and writes `0` for none. - `do_put` of a `long double` takes the sign from `0 > value`, divides values of at least 1e35 by 1e10 up to 500 times and appends ten zeros per division, prints the rest with `sprintf_s("%.0Lf")` and widens it. A negative zero or NaN prints with the minus sign `sprintf_s` gives it, among the digits. - The writer pads a value no longer than the absolute fraction digit count with zeros, inserts thousands separators from `grouping`, takes the currency symbol only under `showbase`, and fills on the left, inside a `none` or `space` field under `internal`, or on the right. Only the first character of the sign goes in its field; the rest follows the last field. `decimal_point`, `thousands_sep`, `grouping`, `frac_digits`, the signs, the patterns and `curr_symbol` are called through the `moneypunct` facet's vtable, so a facet with other virtuals is honored. The `_Makeloc` debt entry now names the facets that still throw, and a new entry records that the digits of a `long double` come from this library's `sprintf_s`. ### 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 #17296. Not run on Linux or macOS, not run in a title. - New test `guest_sce_v2_money_put`: the C locale's facets with right, left and internal fill; empty, partial and lone-minus digit strings; `long double` rounding, sign and negative zero; then `moneypunct` facets with set fields: grouping, fraction digits (including a negative count), a space field, a multi-character sign, the international facet, and the `wchar_t` facet with non-ASCII separators and signs. - Differential harness against the module's own code, loaded and relocated, with each side's own locale from its `_Makeloc`. Each call randomizes both `moneypunct` facets' fields (grouping with `CHAR_MAX` and negative bytes, symbols and signs of up to 7 characters, fraction digits from -20 to 20, shuffled patterns with stray bytes), the stream's flags and width, the fill, the input (digit strings with stray characters; `long double` integers, fractions, values up to 1e4000, infinities, NaNs and negative zero), and the stream buffer (direct room, overflow, a rejecting overflow, no buffer, an already failed iterator). It compares every character written, the iterator, the stream's width and flags. - With the module's `sprintf_s` redirected to this library's: 900,000 calls over 3 seeds, 0 differences. - With the module's own: 200,000 calls, 2,167 differences, all in the last digits of `long double` amounts of 2^66 or more, where the two `sprintf_s` print `%.0Lf` differently (the new debt entry). - The libc tests built from this head, without the tests that drive the GPU, audio or controllers (151: every `guest_sce_v2_*`, locale, string and `public_headers` test): all pass. - Negative control: 12 single-change mutations, with the harness redirecting `sprintf_s`. The harness catches 11; the twelfth, dropping the `0` written for an empty digit string, changes nothing, because the writer pads an empty value with the same zeros. The first test run missed 5 (a trailing `none` field under `internal`, grouping bytes that change, a minus among the digits, and the 500-division limit, which only an infinity reaches), so the test was strengthened and they were rerun: the final test catches the same 11. - `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 52 PRs that conflict with `main` on shared files. Of the 4 that touch `LocaleSupport.cpp`, #12518 exports the unversioned `std::money_put<char>` vtable as zeroed data, a different symbol, and #9526, #11172 and #12704 do not touch `money_put`. ### 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: #17296 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-08 19:51:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-08T19:51:57Z.

Review: CHANGES_REQUESTED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • 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:5819411612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-5819411612). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-08T19:51:57Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `850ca12686`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - 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:19 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


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

  • 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_money_put_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:3143: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:5882700961 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-5882700961). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T22:02:19Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `a9cd4cc3fb`: - **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_money_put_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:3143: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:08:20 +00:00 (Migrated from github.com)

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

Review: APPROVED


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

  • 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_money_put_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_money_put, guest_sce_v2_num_get_char, guest_sce_v2_num_get_wide, guest_sce_v2_facet_ids):
    1/11 Test  #846: guest_sce_v2_makeloc ...............   Passed    0.03 sec
    2/11 Test  #847: guest_sce_v2_char_facet_virtuals ...   Passed    0.03 sec
    3/11 Test  #848: guest_sce_v2_num_put_char ..........   Passed    0.02 sec
    4/11 Test  #849: guest_sce_v2_num_put_wide ..........   Passed    0.02 sec
    5/11 Test  #850: guest_sce_v2_codecvt_wide ..........   Passed    0.02 sec
    6/11 Test  #851: guest_sce_v2_collate_moneypunct ....   Passed    0.02 sec
    7/11 Test  #852: guest_sce_v2_messages ..............   Passed    0.02 sec
    8/11 Test  #853: guest_sce_v2_money_put .............   Passed    0.02 sec
    9/11 Test  #854: guest_sce_v2_num_get_char ..........   Passed    0.02 sec
    10/11 Test  #855: guest_sce_v2_num_get_wide ..........   Passed    0.02 sec
    11/11 Test #1134: guest_sce_v2_facet_ids .............   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 11
    
  • 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 std::minstd::int64_t LP64/LLP64 mismatch in core/libs/prx/libc/src/LocaleSupport.cpp is resolved and all 11 guest_sce_v2_* test targets build and pass on Linux (GCC 13.3) and Windows (GCC 15.2 UCRT).
    • Checked SceV2IosBase layout and static_assert offsets (flags at 0x18, precision at 0x20, width at 0x28, streamNodes at 0x30, callbackNodes at 0x38, locale at 0x40) in core/libs/prx/libc/include/GuestLocale.hpp.
    • Checked templated InsertSeparators in core/libs/prx/libc/src/LocaleSupport.cpp for char and wchar_t support and safe unsigned/signed group step bounds checking.
    • Verified mechanical gates (tools/check_conventions.py, git diff --check) and negative control test behavior for guest_sce_v2_money_put.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912941536 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-5912941536). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:08:20Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `edd201a22c`: - **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_money_put_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_money_put`, `guest_sce_v2_num_get_char`, `guest_sce_v2_num_get_wide`, `guest_sce_v2_facet_ids`): ``` 1/11 Test #846: guest_sce_v2_makeloc ............... Passed 0.03 sec 2/11 Test #847: guest_sce_v2_char_facet_virtuals ... Passed 0.03 sec 3/11 Test #848: guest_sce_v2_num_put_char .......... Passed 0.02 sec 4/11 Test #849: guest_sce_v2_num_put_wide .......... Passed 0.02 sec 5/11 Test #850: guest_sce_v2_codecvt_wide .......... Passed 0.02 sec 6/11 Test #851: guest_sce_v2_collate_moneypunct .... Passed 0.02 sec 7/11 Test #852: guest_sce_v2_messages .............. Passed 0.02 sec 8/11 Test #853: guest_sce_v2_money_put ............. Passed 0.02 sec 9/11 Test #854: guest_sce_v2_num_get_char .......... Passed 0.02 sec 10/11 Test #855: guest_sce_v2_num_get_wide .......... Passed 0.02 sec 11/11 Test #1134: guest_sce_v2_facet_ids ............. Passed 0.02 sec 100% tests passed, 0 tests failed out of 11 ``` - **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 std::min<std::int64_t> LP64/LLP64 mismatch in core/libs/prx/libc/src/LocaleSupport.cpp is resolved and all 11 guest_sce_v2_* test targets build and pass on Linux (GCC 13.3) and Windows (GCC 15.2 UCRT). - Checked SceV2IosBase layout and static_assert offsets (flags at 0x18, precision at 0x20, width at 0x28, streamNodes at 0x30, callbackNodes at 0x38, locale at 0x40) in core/libs/prx/libc/include/GuestLocale.hpp. - Checked templated InsertSeparators<Text> in core/libs/prx/libc/src/LocaleSupport.cpp for char and wchar_t support and safe unsigned/signed group step bounds checking. - Verified mechanical gates (tools/check_conventions.py, git diff --check) and negative control test behavior for guest_sce_v2_money_put. Looks Good To Me
MarcZX10 commented 2026-11-17 21:31:57 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Partial review of money_put — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 46eba50533f0702ee02a2ea774f3413bbdec8f4e from the review folder only (description.md, commits.md, manifest.json, files.json, diff.patch). I read the money_put writer and its two do_put entry points in LocaleSupport.cpp (diff lines 1116–1128, 2553–2724), plus the #include change. No build, no test run, no repository reader calls.

Results

Check Result Note
Build and tests not run Not built here
money_put writer passed Read by hand, not executed
Rest of the diff not run Most of the diff not read

Findings

Blocking

None found in the code I read.

Non-blocking

  • core/libs/prx/libc/src/LocaleSupport.cpp (diff.patch lines 2596–2597, 2621, 2661–2665): the insertion at line 2597 pads value to fractionDigits + 1 characters. After that, the value.size() <= fractionDigits branch at line 2661 and the matching term in valueWidth at line 2621 can never be true. The output is correct, but the branch is dead code. Dropping it would make the writer easier to follow.

Not verified

  • Most of the diff: num_get, num_put, ctype, numpunct, codecvt, collate, moneypunct, messages, and their tests (core/libs/tests/*.cpp, core/libs/prx/libc/CMakeLists.txt, docs/dev/debt/libc.md). I did not read them, so this review does not cover the whole PR.
  • The description says only the last commit is this PR's change, but the diff against main contains the stacked commits as well. I did not check whether that matches the stack the author intends.
  • The layout of SonyLconv (chars[] indices used in SetSceV2MoneyFormats) and of SceV2IosBase (width, flags) against their declarations. The author's differential test covers this against the module, which I did not run.
  • The ios_base functions (_Addstd, _Ios_base_dtor) show as removed and re-added at other positions in the diff. I did not confirm the moved bodies are identical.
  • The sprintf_s output for long double values of 2^66 or more, which the author reports differs from the module's own sprintf_s. This is recorded in the technical debt entry, not checked here.
  • The author's test results (151 libc tests, differential harness, mutation runs) are author-reported. I did not run them.

To get this to a good state

Nothing is required.

Optional: remove the dead branch noted above. Before a formal approval, someone should read the rest of the diff and rerun the libc tests on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5946954960 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-5946954960). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T21:31:57Z. **Review:** COMMENTED --- # Partial review of money_put — no blocking findings Nothing blocks this; the points below are optional. **What I ran** Reviewed head `46eba50533f0702ee02a2ea774f3413bbdec8f4e` from the review folder only (`description.md`, `commits.md`, `manifest.json`, `files.json`, `diff.patch`). I read the `money_put` writer and its two `do_put` entry points in `LocaleSupport.cpp` (diff lines 1116–1128, 2553–2724), plus the `#include` change. No build, no test run, no repository reader calls. **Results** | Check | Result | Note | |---|---|---| | Build and tests | not run | Not built here | | `money_put` writer | passed | Read by hand, not executed | | Rest of the diff | not run | Most of the diff not read | **Findings** **Blocking** None found in the code I read. **Non-blocking** - `core/libs/prx/libc/src/LocaleSupport.cpp` (diff.patch lines 2596–2597, 2621, 2661–2665): the insertion at line 2597 pads `value` to `fractionDigits + 1` characters. After that, the `value.size() <= fractionDigits` branch at line 2661 and the matching term in `valueWidth` at line 2621 can never be true. The output is correct, but the branch is dead code. Dropping it would make the writer easier to follow. **Not verified** - Most of the diff: `num_get`, `num_put`, `ctype`, `numpunct`, `codecvt`, `collate`, `moneypunct`, `messages`, and their tests (`core/libs/tests/*.cpp`, `core/libs/prx/libc/CMakeLists.txt`, `docs/dev/debt/libc.md`). I did not read them, so this review does not cover the whole PR. - The description says only the last commit is this PR's change, but the diff against `main` contains the stacked commits as well. I did not check whether that matches the stack the author intends. - The layout of `SonyLconv` (`chars[]` indices used in `SetSceV2MoneyFormats`) and of `SceV2IosBase` (`width`, `flags`) against their declarations. The author's differential test covers this against the module, which I did not run. - The `ios_base` functions (`_Addstd`, `_Ios_base_dtor`) show as removed and re-added at other positions in the diff. I did not confirm the moved bodies are identical. - The `sprintf_s` output for `long double` values of 2^66 or more, which the author reports differs from the module's own `sprintf_s`. This is recorded in the technical debt entry, not checked here. - The author's test results (151 libc tests, differential harness, mutation runs) are author-reported. I did not run them. **To get this to a good state** Nothing is required. Optional: remove the dead branch noted above. Before a formal approval, someone should read the rest of the diff and rerun the libc tests on this head.
PrivacyOnion commented 2026-11-20 11:39:49 +00:00 (Migrated from github.com)

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

Review: APPROVED


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

  • 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_money_put_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_money_put, guest_sce_v2_num_get_char, guest_sce_v2_num_get_wide):
    1/9 Test #1139: guest_sce_v2_num_get_char ..........   Passed    0.02 sec
    2/9 Test #1132: guest_sce_v2_char_facet_virtuals ...   Passed    0.03 sec
    3/9 Test #1140: guest_sce_v2_num_get_wide ..........   Passed    0.02 sec
    4/9 Test #1136: guest_sce_v2_collate_moneypunct ....   Passed    0.02 sec
    5/9 Test #1135: guest_sce_v2_codecvt_wide ..........   Passed    0.02 sec
    6/9 Test #1134: guest_sce_v2_num_put_wide ..........   Passed    0.02 sec
    7/9 Test #1133: guest_sce_v2_num_put_char ..........   Passed    0.02 sec
    8/9 Test #1137: guest_sce_v2_messages ..............   Passed    0.02 sec
    9/9 Test #1138: guest_sce_v2_money_put .............   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 9
    
  • 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 SceV2IosBase struct layout and offset static_asserts (flags at 0x18, precision at 0x20, width at 0x28, streamNodes at 0x30, callbackNodes at 0x38, locale at 0x40) in core/libs/prx/libc/include/GuestLocale.hpp
    • Verified SceV2BasicString, SceV2InputIterator, and facet vtable alignments and sizes against Dinkumware ABI specifications in core/libs/prx/libc/src/LocaleSupport.cpp
    • Verified templated InsertSeparators bounds checking and unsigned/signed group step handling for both char and char16_t/wchar_t streams
    • Verified GetSceV2Floating and GetSceV2ClassicFloatingField digit parsing, exponent clamp boundaries, and guest errno preservation across conversion calls
    • Verified CMake test harness wiring and cross-platform compilation/CTest execution on Linux x86_64 and Windows GCC 15.2 UCRT environments

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5992089074 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-5992089074). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-20T11:39:49Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `bf11a35015`: - **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_money_put_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_money_put`, `guest_sce_v2_num_get_char`, `guest_sce_v2_num_get_wide`): ``` 1/9 Test #1139: guest_sce_v2_num_get_char .......... Passed 0.02 sec 2/9 Test #1132: guest_sce_v2_char_facet_virtuals ... Passed 0.03 sec 3/9 Test #1140: guest_sce_v2_num_get_wide .......... Passed 0.02 sec 4/9 Test #1136: guest_sce_v2_collate_moneypunct .... Passed 0.02 sec 5/9 Test #1135: guest_sce_v2_codecvt_wide .......... Passed 0.02 sec 6/9 Test #1134: guest_sce_v2_num_put_wide .......... Passed 0.02 sec 7/9 Test #1133: guest_sce_v2_num_put_char .......... Passed 0.02 sec 8/9 Test #1137: guest_sce_v2_messages .............. Passed 0.02 sec 9/9 Test #1138: guest_sce_v2_money_put ............. Passed 0.01 sec 100% tests passed, 0 tests failed out of 9 ``` - **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 SceV2IosBase struct layout and offset static_asserts (flags at 0x18, precision at 0x20, width at 0x28, streamNodes at 0x30, callbackNodes at 0x38, locale at 0x40) in core/libs/prx/libc/include/GuestLocale.hpp - Verified SceV2BasicString, SceV2InputIterator, and facet vtable alignments and sizes against Dinkumware ABI specifications in core/libs/prx/libc/src/LocaleSupport.cpp - Verified templated InsertSeparators<Text> bounds checking and unsigned/signed group step handling for both char and char16_t/wchar_t streams - Verified GetSceV2Floating and GetSceV2ClassicFloatingField digit parsing, exponent clamp boundaries, and guest errno preservation across conversion calls - Verified CMake test harness wiring and cross-platform compilation/CTest execution on Linux x86_64 and Windows GCC 15.2 UCRT environments Looks Good To Me
MarcZX10 commented 2026-11-20 12:28:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T12:28:30Z.

Review: COMMENTED


Reviewed — comments

Changes are required before merge: no blocking defect was verified, but the review is incomplete because the large shared implementation and the other changed tests were not fully inspected.

What I ran

Inspected the prepared diff and selected source ranges at head bf11a35015a364ef11f5c2371e6b848e3cb10af4 using repo_read.py. No build, test, or merged-preview check was run by me.

Results

Check Result Note
Prepared diff inspection passed Read the money output implementation and test
Build and tests not run Author-reported results only
Full changed-file review not run Several changed files were not read in full

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

The money output logic and its focused test, locale layout, and relevant technical debt entry were read. The prepared diff was read only through line 300 of 4321; LocaleSupport.cpp only through selected ranges; the remaining changed tests and CMake changes were not inspected. All files listed as changed in the manifest are included, but not all were read. Author-reported Windows build/tests, differential harness, negative control, and convention checks were not run by me; Linux, macOS, and console behavior were not verified.

To get this to a good state

Nothing is required. Optional: complete review of the remaining diff and changed files before making a formal approval decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5992646129 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-5992646129). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T12:28:30Z. **Review:** COMMENTED --- # Reviewed — comments Changes are required before merge: no blocking defect was verified, but the review is incomplete because the large shared implementation and the other changed tests were not fully inspected. ## What I ran Inspected the prepared diff and selected source ranges at head `bf11a35015a364ef11f5c2371e6b848e3cb10af4` using `repo_read.py`. No build, test, or merged-preview check was run by me. ## Results | Check | Result | Note | |---|---|---| | Prepared diff inspection | passed | Read the money output implementation and test | | Build and tests | not run | Author-reported results only | | Full changed-file review | not run | Several changed files were not read in full | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified The money output logic and its focused test, locale layout, and relevant technical debt entry were read. The prepared diff was read only through line 300 of 4321; `LocaleSupport.cpp` only through selected ranges; the remaining changed tests and CMake changes were not inspected. All files listed as changed in the manifest are included, but not all were read. Author-reported Windows build/tests, differential harness, negative control, and convention checks were not run by me; Linux, macOS, and console behavior were not verified. ## To get this to a good state Nothing is required. Optional: complete review of the remaining diff and changed files before making a formal approval decision.
MarcZX10 commented 2026-11-21 07:17:19 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this review; the change is not approved because the full stacked change has not been reviewed.

What I ran

Read the prepared diff at head 95cc41c2757eee263229cd58c2965a0548b7e129 and targeted source and test ranges through repo_read.py. No commands or tests were run.

Results

Check Result Note
Prepared diff and metadata passed Inspected
Targeted money formatting code passed No concrete defect found
Tests not run Author-reported only
Full stacked change review not run Most changed files not read

Findings

Blocking

None identified in the code read.

Non-blocking

None.

Not verified

Read description.md, commits.md, manifest.json, and diff.patch, plus core/libs/prx/libc/include/GuestLocale.hpp, the money formatting implementation in core/libs/prx/libc/src/LocaleSupport.cpp, and core/libs/tests/GuestSceV2MoneyPut.cpp. All changed files are listed as included in the manifest; the other changed files were not read: core/libs/prx/libc/CMakeLists.txt, the remaining sections of LocaleSupport.cpp, core/libs/tests/GuestSceV2CharFacetVirtuals.cpp, GuestSceV2CodecvtWide.cpp, GuestSceV2CollateMoneypunct.cpp, GuestSceV2Messages.cpp, GuestSceV2NumGetChar.cpp, GuestSceV2NumGetWide.cpp, GuestSceV2NumPutChar.cpp, GuestSceV2NumPutWide.cpp, and docs/dev/debt/libc.md. Build and test results in the PR description were not independently verified.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed files before making a formal approval decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003759590 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-6003759590). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T07:17:19Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this review; the change is not approved because the full stacked change has not been reviewed. ## What I ran Read the prepared diff at head `95cc41c2757eee263229cd58c2965a0548b7e129` and targeted source and test ranges through `repo_read.py`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Prepared diff and metadata | passed | Inspected | | Targeted money formatting code | passed | No concrete defect found | | Tests | not run | Author-reported only | | Full stacked change review | not run | Most changed files not read | ## Findings ### Blocking None identified in the code read. ### Non-blocking None. ## Not verified Read `description.md`, `commits.md`, `manifest.json`, and `diff.patch`, plus `core/libs/prx/libc/include/GuestLocale.hpp`, the money formatting implementation in `core/libs/prx/libc/src/LocaleSupport.cpp`, and `core/libs/tests/GuestSceV2MoneyPut.cpp`. All changed files are listed as included in the manifest; the other changed files were not read: `core/libs/prx/libc/CMakeLists.txt`, the remaining sections of `LocaleSupport.cpp`, `core/libs/tests/GuestSceV2CharFacetVirtuals.cpp`, `GuestSceV2CodecvtWide.cpp`, `GuestSceV2CollateMoneypunct.cpp`, `GuestSceV2Messages.cpp`, `GuestSceV2NumGetChar.cpp`, `GuestSceV2NumGetWide.cpp`, `GuestSceV2NumPutChar.cpp`, `GuestSceV2NumPutWide.cpp`, and `docs/dev/debt/libc.md`. Build and test results in the PR description were not independently verified. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed files before making a formal approval decision.
ligmaSec commented 2026-12-03 13:12:33 +00:00 (Migrated from github.com)

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

Review: COMMENTED


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

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170470203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17331#pullrequestreview-6170470203). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:12:33Z. **Review:** COMMENTED --- Built the branch’s locale implementation and matching headers against the existing Linux runtime. The focused `GuestSceV2MoneyPut` 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/17331:upstream-pr/17331'
git switch 'upstream-pr/17331'

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