fix(libc): size the num_put facet vtable to 112 bytes #9698

Merged
mazen320 merged 8 commits from upstream-pr/9698 into main 2026-10-27 05:20:55 +00:00
mazen320 commented 2026-10-22 08:56:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-22T08:56:00Z.


What

Export num_put<char>'s vtable (NID 1kZFcktOm+s) as fourteen zeroed uintptr_t slots so titles that resolve it as data get a 112-byte object matching console title libc.prx (PPSA16833). The previous twelve-slot export was short by two entries. Facet calls through the slots still fault until methods are wired (debt note).

#9038 also touches this array while adding _Getcat and still declares twelve slots on its branch. Prefer landing this size fix first so #9038 can rebase onto fourteen slots (or update its declaration before merge). Not a stack: Depends on stays none.

Tested

  • ctest --test-dir build-win -R guest_locale — passed (Windows MinGW) after rebase onto upstream/main 8b3a6ba88.
  • python tools/check_conventions.py --base upstream/main — passed.
  • Console: 1kZFcktOm+s is STT_OBJECT st_size 112 in PPSA16833 sce_module/libc.prx (dynsym).

Checklist

  • Depends on: #9761
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4964748833 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9698). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-22T08:56:00Z. --- ### What Export `num_put<char>`'s vtable (NID `1kZFcktOm+s`) as fourteen zeroed `uintptr_t` slots so titles that resolve it as data get a 112-byte object matching console title `libc.prx` (PPSA16833). The previous twelve-slot export was short by two entries. Facet calls through the slots still fault until methods are wired (debt note). #9038 also touches this array while adding `_Getcat` and still declares twelve slots on its branch. Prefer landing this size fix first so #9038 can rebase onto fourteen slots (or update its declaration before merge). Not a stack: **Depends on** stays none. ### Tested - `ctest --test-dir build-win -R guest_locale` — passed (Windows MinGW) after rebase onto `upstream/main` `8b3a6ba88`. - `python tools/check_conventions.py --base upstream/main` — passed. - Console: `1kZFcktOm+s` is STT_OBJECT `st_size` 112 in PPSA16833 `sce_module/libc.prx` (dynsym). ### Checklist - Depends on: #9761 - Fixes: none - Unblocks: none - GPUs tested: n/a - AI-assisted: yes
clairtonmichel commented 2026-10-22 09:23:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-22T09:23:17Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):

  • Built cleanly with zero errors.
  • Ran the libc test suite (6/6 tests): 100% passed successfully (0.23s total).
  • num_put facet vtable size fix (112 bytes) is stable. Ready to merge!
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337347128 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9698#issuecomment-6337347128). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-22T09:23:17Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5): - Built cleanly with zero errors. - Ran the libc test suite (6/6 tests): **100% passed successfully (0.23s total)**. - `num_put` facet vtable size fix (112 bytes) is stable. Ready to merge!
MarcZX10 commented 2026-10-22 12:21:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:21:28Z.

Review: CHANGES_REQUESTED


I reviewed the change from 12 to 14 uintptr_t slots and its GuestLocale coverage. The object size matches the 112-byte st_size evidence cited from PPSA16833, and the test verifies all 14 slots are writable. Hosted conventions, eligibility, intake, labels, report, and relinker checks pass; the automatic full Linux/Windows product jobs are skipped. The author reports a Windows MinGW guest_locale test pass; I could not independently execute that test in this Linux checkout.

Please update this branch to current main (8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768); this head is based on 7e2ba73e4c, 13 commits behind. Re-run guest_locale after the update.

Please revise the overlap note and coordinate with #9038 before either change lands. #9038 is open and its branch declares this same num_put vtable with 12 slots while adding _Getcat; if that definition lands after this change without preserving the 14-slot size, it reintroduces the mismatch. Agree on the integration order and declare the dependency if stacking the branches. Also, the checklist currently says Unblocks: titles that import...; the repository asks for a title ID and Game Bring-up discussion link for a title-specific stop. PPSA16833 appears in the evidence, but I found no matching Game Bring-up discussion from the linked repository search; please add the relevant discussion and stop/log context, or use Unblocks: none if this is not tied to a current title stop.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614034045 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9698#pullrequestreview-5614034045). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:21:28Z. **Review:** CHANGES_REQUESTED --- I reviewed the change from 12 to 14 `uintptr_t` slots and its `GuestLocale` coverage. The object size matches the 112-byte `st_size` evidence cited from PPSA16833, and the test verifies all 14 slots are writable. Hosted conventions, eligibility, intake, labels, report, and relinker checks pass; the automatic full Linux/Windows product jobs are skipped. The author reports a Windows MinGW `guest_locale` test pass; I could not independently execute that test in this Linux checkout. Please update this branch to current `main` (`8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768`); this head is based on `7e2ba73e4c`, 13 commits behind. Re-run `guest_locale` after the update. Please revise the overlap note and coordinate with #9038 before either change lands. #9038 is open and its branch declares this same `num_put` vtable with 12 slots while adding `_Getcat`; if that definition lands after this change without preserving the 14-slot size, it reintroduces the mismatch. Agree on the integration order and declare the dependency if stacking the branches. Also, the checklist currently says `Unblocks: titles that import...`; the repository asks for a title ID and Game Bring-up discussion link for a title-specific stop. PPSA16833 appears in the evidence, but I found no matching Game Bring-up discussion from the linked repository search; please add the relevant discussion and stop/log context, or use `Unblocks: none` if this is not tied to a current title stop.
mazen320 commented 2026-10-22 12:26:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-22T12:26:02Z.


Rebased onto current main (8b3a6ba88). Re-ran guest_locale on Windows MinGW after the rebase — passed. Conventions still pass.

On #9038: this PR is only the fourteen-slot size; theirs adds _Getcat and still has twelve slots. Prefer this landing first so they can rebase and keep [14], rather than stacking (no Depends on). Updated the body accordingly and set Unblocks: none (PPSA16833 was measurement evidence only, not a Game Bring-up stop).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6340694328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9698#issuecomment-6340694328). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-22T12:26:02Z. --- Rebased onto current `main` (`8b3a6ba88`). Re-ran `guest_locale` on Windows MinGW after the rebase — passed. Conventions still pass. On #9038: this PR is only the fourteen-slot size; theirs adds `_Getcat` and still has twelve slots. Prefer this landing first so they can rebase and keep `[14]`, rather than stacking (no **Depends on**). Updated the body accordingly and set **Unblocks: none** (PPSA16833 was measurement evidence only, not a Game Bring-up stop).
mazen320 commented 2026-10-22 12:55:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-22T12:55:25Z.


Rebased again onto current main (3ca07d086); guest_locale and conventions still pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341275172 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9698#issuecomment-6341275172). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-22T12:55:25Z. --- Rebased again onto current `main` (`3ca07d086`); `guest_locale` and conventions still pass.
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!9698
No description provided.