feat(libc): export the time_get facet vtable as data #9456

Merged
mazen320 merged 2 commits from upstream-pr/9456 into main 2026-10-25 17:38:52 +00:00
mazen320 commented 2026-10-21 22:35:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-21T22:35:40Z.


What

Export time_get<char>'s vtable (NID o4kt51-uO48) as thirteen zeroed uintptr_t slots so titles that resolve it as data get a 104-byte object matching console libSceLibcInternal, same pattern as the other facet vtables. Facet calls through the slots still fault until methods are wired (debt note). Additive with #8880 (time_get::id / narrow num_get vtable) and #9038 (other facet _Getcat work): distinct NIDs and symbols; edits land on adjacent lines in the same files.

Tested

  • ctest --test-dir build-win -R guest_locale — passed (Windows MinGW), after rebase onto upstream/main 110a18ba0.
  • python tools/check_conventions.py --base upstream/main — passed.
  • Console: o4kt51-uO48 is STT_OBJECT st_size 104 in firmware libSceLibcInternal.sprx (FTP measurement).

Checklist

  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4959279420 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9456). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-21T22:35:40Z. --- ### What Export `time_get<char>`'s vtable (NID `o4kt51-uO48`) as thirteen zeroed `uintptr_t` slots so titles that resolve it as data get a 104-byte object matching console `libSceLibcInternal`, same pattern as the other facet vtables. Facet calls through the slots still fault until methods are wired (debt note). Additive with #8880 (`time_get::id` / narrow `num_get` vtable) and #9038 (other facet `_Getcat` work): distinct NIDs and symbols; edits land on adjacent lines in the same files. ### Tested - `ctest --test-dir build-win -R guest_locale` — passed (Windows MinGW), after rebase onto `upstream/main` `110a18ba0`. - `python tools/check_conventions.py --base upstream/main` — passed. - Console: `o4kt51-uO48` is STT_OBJECT st_size 104 in firmware `libSceLibcInternal.sprx` (FTP measurement). ### Checklist - Depends on: none - Fixes: none - Unblocks: none - GPUs tested: n/a - AI-assisted: yes
harisibrar1 commented 2026-10-22 04:12:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T04:12:19Z.

Review: APPROVED


Checked against main 6ef5a1c4c and ps5-payload-dev/sdk sce_stubs/libSceLibcInternal.c:

  • _ZTVSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE is .type ..., @object in the SDK table (L11858-11860), and SHA1 with the NID suffix gives o4kt51-uO48, so exporting it as data is correct.
  • 13 slots (104 bytes) match the Itanium/Dinkumware layout: offset-to-top, typeinfo, D1/D0, _Incref/_Decref (the same order as GuestLocale::FacetVtable), and the seven do_* virtuals of time_get. It follows the existing zeroed codecvt/num_put vtables at LocaleSupport.cpp:298/300, and records the placeholder in the debt file, which those two do not.
  • Non-blocking: a virtual call through this object jumps to address 0. Pointing slots 2..12 at one host function that calls NotImplemented_nid_no_patch would turn a facet use into a named failure, matching how other unimplemented paths fail.
  • Builds on Windows (WinLibs GCC 15.2.0 r7, full BUILD_TESTING=ON build) merged onto main 6ef5a1c4c; the only failing step is the existing ImageArrayWindowPastLayerLimit.cpp alignment error that #8310 fixes. Not run here: this machine's Smart App Control blocks freshly built test executables.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609167534 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9456#pullrequestreview-5609167534). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-22T04:12:19Z. **Review:** APPROVED --- Checked against main 6ef5a1c4c and ps5-payload-dev/sdk sce_stubs/libSceLibcInternal.c: - `_ZTVSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE` is `.type ..., @object` in the SDK table (L11858-11860), and SHA1 with the NID suffix gives `o4kt51-uO48`, so exporting it as data is correct. - 13 slots (104 bytes) match the Itanium/Dinkumware layout: offset-to-top, typeinfo, D1/D0, `_Incref`/`_Decref` (the same order as `GuestLocale::FacetVtable`), and the seven `do_*` virtuals of `time_get`. It follows the existing zeroed codecvt/num_put vtables at LocaleSupport.cpp:298/300, and records the placeholder in the debt file, which those two do not. - Non-blocking: a virtual call through this object jumps to address 0. Pointing slots 2..12 at one host function that calls `NotImplemented_nid_no_patch` would turn a facet use into a named failure, matching how other unimplemented paths fail. - Builds on Windows (WinLibs GCC 15.2.0 r7, full `BUILD_TESTING=ON` build) merged onto main 6ef5a1c4c; the only failing step is the existing `ImageArrayWindowPastLayerLimit.cpp` alignment error that #8310 fixes. Not run here: this machine's Smart App Control blocks freshly built test executables. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
MarcZX10 commented 2026-10-22 04:35:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:35:05Z.

Review: DISMISSED


The console object-size evidence and focused guest_locale test are recorded, and the NID differs from #8880’s time_get::id. However, this branch remains based on a6dcea927, 47 commits behind current main (110a18ba01); please rebase and rerun the focused test, conventions and overlap checks. The overlap report also names #8880/#9038 in the shared locale source/test files and several debt-file comparisons it could not complete; manually verify and record a safe additive merge order. The generic Unblocks description does not meet the template requirement: use none or a title ID and its Game bring-up discussion. I did not run local tests for this follow-up.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609306309 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9456#pullrequestreview-5609306309). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:35:05Z. **Review:** DISMISSED --- The console object-size evidence and focused `guest_locale` test are recorded, and the NID differs from #8880’s `time_get::id`. However, this branch remains based on `a6dcea927`, 47 commits behind current main (`110a18ba01`); please rebase and rerun the focused test, conventions and overlap checks. The overlap report also names #8880/#9038 in the shared locale source/test files and several debt-file comparisons it could not complete; manually verify and record a safe additive merge order. The generic `Unblocks` description does not meet the template requirement: use `none` or a title ID and its Game bring-up discussion. I did not run local tests for this follow-up.
mazen320 commented 2026-10-22 04:37:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-22T04:37:23Z.


Rebased onto current main (110a18ba0), reran guest_locale and conventions (both passed). Updated the checklist: Unblocks: none, and recorded Depends on / merge order vs the overlapping locale PRs as requested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6332824394 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9456#issuecomment-6332824394). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-22T04:37:23Z. --- Rebased onto current `main` (`110a18ba0`), reran `guest_locale` and conventions (both passed). Updated the checklist: `Unblocks: none`, and recorded `Depends on` / merge order vs the overlapping locale PRs as requested.
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!9456
No description provided.