feat(libc): export the money_put facet vtable as data #12518

Merged
mazen320 merged 2 commits from upstream-pr/12518 into main 2026-11-10 20:00:59 +00:00
mazen320 commented 2026-10-28 16:58:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-28T16:58:27Z.


What

Export money_put<char>'s vtable (NID zdCex1HjCCM) as eight zeroed uintptr_t slots so titles that resolve it as data get a 64-byte object matching console title libc.prx (PPSA26344). Facet calls through the slots still fault until methods are wired (debt note).

Stacked on #12511 (money_get), which is stacked on #12510 (time_put). Tip includes both so GuestLocale.cpp / docs/dev/debt/libc.md keep all three tests and debt entries. Distinct from #12511.

Tested

  • guest_locale_tests — passed (Windows MinGW).
  • python tools/check_conventions.py --base upstream/main — passed.
  • Console: zdCex1HjCCM is STT_OBJECT st_size 64 in PPSA26344 sce_module/libc.prx (dynsym via PT_DYNAMIC; FTP from the console).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (#12511 landed)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (libc data export)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5054415883 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12518). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-28T16:58:27Z. --- ### What Export `money_put<char>`'s vtable (NID `zdCex1HjCCM`) as eight zeroed `uintptr_t` slots so titles that resolve it as data get a 64-byte object matching console title `libc.prx` (PPSA26344). Facet calls through the slots still fault until methods are wired (debt note). Stacked on #12511 (`money_get`), which is stacked on #12510 (`time_put`). Tip includes both so `GuestLocale.cpp` / `docs/dev/debt/libc.md` keep all three tests and debt entries. Distinct from #12511. ### Tested - `guest_locale_tests` — passed (Windows MinGW). - `python tools/check_conventions.py --base upstream/main` — passed. - Console: `zdCex1HjCCM` is STT_OBJECT `st_size` 64 in PPSA26344 `sce_module/libc.prx` (dynsym via PT_DYNAMIC; FTP from the console). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (#12511 landed) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a (libc data export) - [x] AI-assisted: yes
MarcZX10 commented 2026-10-28 17:00:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T17:00:26Z.

Review: CHANGES_REQUESTED


The new money_put<char> object and its 64-byte console evidence are narrowly scoped, but current integration conflicts need author coordination before this can be considered merge-ready. I compared current head 48dc9738e6c5 with open #12510 (937a5651db81) and #12511 (a6d158d3b82a) using git merge-tree: the #12510 combination conflicts in GuestLocale.cpp and docs/dev/debt/libc.md; the #12511 combination also conflicts in LocaleSupport.cpp. The branch combines cleanly with current main, so these are specifically the concurrent facet PRs. CONTRIBUTING.md requires agreeing which overlapping PR goes first and declaring that relationship as Depends on; the current checklist says none and the body’s keep-both note does not record an agreed order. Please coordinate with both authors and update the checklist/branches so the symbol, regression test and debt entries all survive. Hosted checks are still pending, so I have not approved.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5686564172 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12518#pullrequestreview-5686564172). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T17:00:26Z. **Review:** CHANGES_REQUESTED --- The new `money_put<char>` object and its 64-byte console evidence are narrowly scoped, but current integration conflicts need author coordination before this can be considered merge-ready. I compared current head `48dc9738e6c5` with open #12510 (`937a5651db81`) and #12511 (`a6d158d3b82a`) using `git merge-tree`: the #12510 combination conflicts in `GuestLocale.cpp` and `docs/dev/debt/libc.md`; the #12511 combination also conflicts in `LocaleSupport.cpp`. The branch combines cleanly with current main, so these are specifically the concurrent facet PRs. CONTRIBUTING.md requires agreeing which overlapping PR goes first and declaring that relationship as `Depends on`; the current checklist says `none` and the body’s keep-both note does not record an agreed order. Please coordinate with both authors and update the checklist/branches so the symbol, regression test and debt entries all survive. Hosted checks are still pending, so I have not approved.
MarcZX10 commented 2026-10-28 19:03:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T19:03:09Z.

Review: APPROVED


Re-checked — approval for the current head

I reviewed head f1a39a4878b750176fa767802f286379a578dda9 against current main 319621ba2e578bd053b0baba2877fe70520e0737. The money_put<char> data export, regression test, and remaining debt entry are consistent, and the declared stack is #12510 → #12511 → #12518. I found no blocking correctness issue.

What I ran

Environment: Debian 12 x86_64, GCC 12.2, CMake/Ninja build in /tmp/AnyPS5-review-12518.

git diff --check upstream/main...pr/12518
git merge-tree --write-tree upstream/main pr/12518
ctest --test-dir build -R '^guest_locale$' --output-on-failure
readelf -Ws build/core/libs/libs/unpatched/libc.prx | grep 'money_put'

I also inspected the changed implementation, test, technical-debt entry, PR description, contribution rules, and current hosted checks.

Results

Check Result
Whitespace and patch checks Passed; no output
Merge with current main Clean
guest_locale test Passed, 1/1
Linux ELF object money_put<char> vtable is a 64-byte global object
Hosted conventions, eligibility, labels, Ubuntu register/relinker, Windows relinker, and relinker ASan Passed
Hosted Linux product build Skipped by workflow
Hosted Windows full build Configure and changed host-only test linking passed; CTest steps were skipped
macOS matrix jobs Still queued at the time of this review
Raw output
3f32fd9561cfb012905bcb98478f740733bfa66e
1/1 Test #547: guest_locale .....................   Passed    0.01 sec
100% tests passed, 0 tests failed out of 1
903: 00000000001473c0    64 OBJECT  GLOBAL DEFAULT   25 _ZTVSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE_nid_postfix
3188: 00000000001473c0    64 OBJECT  GLOBAL DEFAULT   25 _ZTVSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE_nid_postfix

The prior negative-control build removed only the new vtable definition from the isolated worktree; linking then failed with undefined references to the exact money_put<char> symbol. The definition was restored, the target rebuilt, and the focused test passed again.

Negative control

Removing the new vtable definition caused the isolated build to fail at link time on references to that symbol, confirming the test target depends on the export. Restoring the definition returned the focused test to passing. This checks symbol presence; it does not independently test writable memory behavior.

Findings

Blocking: None found.

Non-blocking: The PR overlaps locale files with #10158, #10200, #10165, and #9761. The author has acknowledged the keep-both rebase plan if one lands first, and the current branch merges cleanly with main. Re-run the locale test after any such rebase. Some unrelated macOS jobs are still queued.

Sources

Not verified

I did not independently test on Windows or a PS5 console. The Windows test and console measurement in the PR description are author-reported. Linux product CI was skipped; only the focused Linux locale target was built and run locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5688171325 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12518#pullrequestreview-5688171325). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T19:03:09Z. **Review:** APPROVED --- # Re-checked — approval for the current head I reviewed head `f1a39a4878b750176fa767802f286379a578dda9` against current `main` `319621ba2e578bd053b0baba2877fe70520e0737`. The `money_put<char>` data export, regression test, and remaining debt entry are consistent, and the declared stack is #12510 → #12511 → #12518. I found no blocking correctness issue. ### What I ran Environment: Debian 12 x86_64, GCC 12.2, CMake/Ninja build in `/tmp/AnyPS5-review-12518`. ```sh git diff --check upstream/main...pr/12518 git merge-tree --write-tree upstream/main pr/12518 ctest --test-dir build -R '^guest_locale$' --output-on-failure readelf -Ws build/core/libs/libs/unpatched/libc.prx | grep 'money_put' ``` I also inspected the changed implementation, test, technical-debt entry, PR description, contribution rules, and current hosted checks. ### Results | Check | Result | |---|---| | Whitespace and patch checks | Passed; no output | | Merge with current `main` | Clean | | `guest_locale` test | Passed, 1/1 | | Linux ELF object | `money_put<char>` vtable is a 64-byte global object | | Hosted conventions, eligibility, labels, Ubuntu register/relinker, Windows relinker, and relinker ASan | Passed | | Hosted Linux product build | Skipped by workflow | | Hosted Windows full build | Configure and changed host-only test linking passed; CTest steps were skipped | | macOS matrix jobs | Still queued at the time of this review | <details><summary>Raw output</summary> ```text 3f32fd9561cfb012905bcb98478f740733bfa66e ``` ```text 1/1 Test #547: guest_locale ..................... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` ```text 903: 00000000001473c0 64 OBJECT GLOBAL DEFAULT 25 _ZTVSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE_nid_postfix 3188: 00000000001473c0 64 OBJECT GLOBAL DEFAULT 25 _ZTVSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE_nid_postfix ``` The prior negative-control build removed only the new vtable definition from the isolated worktree; linking then failed with undefined references to the exact `money_put<char>` symbol. The definition was restored, the target rebuilt, and the focused test passed again. </details> ### Negative control Removing the new vtable definition caused the isolated build to fail at link time on references to that symbol, confirming the test target depends on the export. Restoring the definition returned the focused test to passing. This checks symbol presence; it does not independently test writable memory behavior. ### Findings **Blocking:** None found. **Non-blocking:** The PR overlaps locale files with #10158, #10200, #10165, and #9761. The author has acknowledged the keep-both rebase plan if one lands first, and the current branch merges cleanly with `main`. Re-run the locale test after any such rebase. Some unrelated macOS jobs are still queued. ### Sources - [Implementation at reviewed head](https://github.com/boykopovar/AnyPS5/blob/f1a39a4878b750176fa767802f286379a578dda9/core/libs/prx/libc/src/LocaleSupport.cpp) - [Locale test at reviewed head](https://github.com/boykopovar/AnyPS5/blob/f1a39a4878b750176fa767802f286379a578dda9/core/libs/tests/GuestLocale.cpp) - [Technical-debt entry at reviewed head](https://github.com/boykopovar/AnyPS5/blob/f1a39a4878b750176fa767802f286379a578dda9/docs/dev/debt/libc.md) ### Not verified I did not independently test on Windows or a PS5 console. The Windows test and console measurement in the PR description are author-reported. Linux product CI was skipped; only the focused Linux locale target was built and run locally.
MarcZX10 commented 2026-10-29 08:04:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:04:04Z.

Review: APPROVED


Reviewed exact head 370fb1e8a43dbeb87862f244e96b6acd818b5d55 against current main 4c7d275bef89.

The current stack order is recorded as #12510 → #12511 → #12518, and the checklist declares #12511 as this PR's dependency. The current head retains the three facet objects, canonical declarations and slot-count assertions across the stack. The time_put<char> object is 7 slots (56 bytes); each money facet is 8 slots (64 bytes). The associated debt entries describe these as zeroed, data-only vtables whose virtual methods remain unsupported. The focused test checks zero initialization and writable storage for each object. The merge preview against current main is clean, and git diff --check passes.

The author reports guest_locale_tests and conventions passing on the immediately preceding integrated stack tip e372f083 (based on main 14b3441f3d). I compared that main to current 4c7d275bef89; none of the four changed paths in this stack (GuestLocale.hpp, LocaleSupport.cpp, GuestLocale.cpp, or docs/dev/debt/libc.md) changed in between. I therefore found no new code or integration issue on this rebase.

I did not independently build or run the test in this workspace. The current exact-head hosted matrix was still pending when I checked it; Linux product tests are skipped by workflow policy. This approval records the code review and does not claim those pending jobs passed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694526746 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12518#pullrequestreview-5694526746). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:04:04Z. **Review:** APPROVED --- Reviewed exact head `370fb1e8a43dbeb87862f244e96b6acd818b5d55` against current `main` `4c7d275bef89`. The current stack order is recorded as #12510 → #12511 → #12518, and the checklist declares #12511 as this PR's dependency. The current head retains the three facet objects, canonical declarations and slot-count assertions across the stack. The `time_put<char>` object is 7 slots (56 bytes); each money facet is 8 slots (64 bytes). The associated debt entries describe these as zeroed, data-only vtables whose virtual methods remain unsupported. The focused test checks zero initialization and writable storage for each object. The merge preview against current `main` is clean, and `git diff --check` passes. The author reports `guest_locale_tests` and conventions passing on the immediately preceding integrated stack tip `e372f083` (based on `main` `14b3441f3d`). I compared that main to current `4c7d275bef89`; none of the four changed paths in this stack (`GuestLocale.hpp`, `LocaleSupport.cpp`, `GuestLocale.cpp`, or `docs/dev/debt/libc.md`) changed in between. I therefore found no new code or integration issue on this rebase. I did not independently build or run the test in this workspace. The current exact-head hosted matrix was still pending when I checked it; Linux product tests are skipped by workflow policy. This approval records the code review and does not claim those pending jobs passed.
MarcZX10 commented 2026-10-30 04:21:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T04:21:04Z.

Review: APPROVED


Reviewed — looks good

The money_put<char> export adds the documented 64-byte placeholder beside the earlier two entries, with matching test coverage and debt documentation.

What I ran

Reviewed head e401496fc14d2872d1f4f8fb4e5b2fc0b456c547 against current main 5ecef095b61e7a406b279c97896f3a8a6fbd6353; merge preview tree 1370ff0306d65bfa9f84a520f783ee4adc55bfeb.

git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-12518
git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-12518

Results

Check Result
Merge preview Clean
Diff check Passed; no output
Hosted conventions and Windows build Passed
Linux/product and specialized platform checks Skipped or still queued

Not verified

I did not run a local build/test or independently inspect the console image. The title-image symbol-size evidence and MinGW test result are reported by the author. This PR depends on #12511 and is ordered third after #12510 and #12511.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708041559 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12518#pullrequestreview-5708041559). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T04:21:04Z. **Review:** APPROVED --- # Reviewed — looks good The `money_put<char>` export adds the documented 64-byte placeholder beside the earlier two entries, with matching test coverage and debt documentation. ## What I ran Reviewed head `e401496fc14d2872d1f4f8fb4e5b2fc0b456c547` against current main `5ecef095b61e7a406b279c97896f3a8a6fbd6353`; merge preview tree `1370ff0306d65bfa9f84a520f783ee4adc55bfeb`. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-12518 git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-12518 ``` ## Results | Check | Result | |---|---| | Merge preview | Clean | | Diff check | Passed; no output | | Hosted conventions and Windows build | Passed | | Linux/product and specialized platform checks | Skipped or still queued | ## Not verified I did not run a local build/test or independently inspect the console image. The title-image symbol-size evidence and MinGW test result are reported by the author. This PR depends on #12511 and is ordered third after #12510 and #12511.
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!12518
No description provided.