feat(libSceLibcInternal): implement wide time_put::_Init #24899

Merged
0x70776c merged 1 commit from upstream-pr/24899 into main 2026-11-25 04:31:28 +00:00
0x70776c commented 2026-11-21 10:01:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 0x70776c on 2026-11-21T10:01:27Z.


What

Implement std::time_put<wchar_t>::_Init(const std::_Locinfo&) (_ZNSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_InitERKSt8_Locinfo, NID ZolDcuDSD0Q) in libSceLibcInternal:

  • Validate self and info pointers via RequireArgument and install &g_timePutWideVtable.facet without touching references or bytes past the 0x10-byte GuestLocale::Facet header.
  • Update GuestLibcInternalTimeGetFields tests to verify _Init installs the vtable, preserves guarded storage and references, and rejects null self or info.
  • Remove the resolved Unverified debt entry via docs/dev/debt/changes/feat-libcinternal-wide-time-put-init.md.

Tested

  • python3 tools/debt_fold.py --check
  • python3 tools/check_conventions.py --base origin/main
  • cmake --build build --target libSceLibcInternal guest_libc_internal_time_get_fields_tests -j16
  • ctest --test-dir build -R '^(guest_libc_internal_time_get_fields|public_headers)$' -V (2/2 passed)

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
  • 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
  • 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:5426668053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24899). Originally posted by [0x70776c](https://github.com/0x70776c) on 2026-11-21T10:01:27Z. --- ### What Implement `std::time_put<wchar_t>::_Init(const std::_Locinfo&)` (`_ZNSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_InitERKSt8_Locinfo`, NID `ZolDcuDSD0Q`) in `libSceLibcInternal`: - Validate `self` and `info` pointers via `RequireArgument` and install `&g_timePutWideVtable.facet` without touching `references` or bytes past the 0x10-byte `GuestLocale::Facet` header. - Update `GuestLibcInternalTimeGetFields` tests to verify `_Init` installs the vtable, preserves guarded storage and `references`, and rejects null `self` or `info`. - Remove the resolved `Unverified` debt entry via `docs/dev/debt/changes/feat-libcinternal-wide-time-put-init.md`. ### Tested - `python3 tools/debt_fold.py --check` - `python3 tools/check_conventions.py --base origin/main` - `cmake --build build --target libSceLibcInternal guest_libc_internal_time_get_fields_tests -j16` - `ctest --test-dir build -R '^(guest_libc_internal_time_get_fields|public_headers)$' -V` (2/2 passed) ### Checklist - [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 and the licence notice of code adapted from upstream - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [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-21 10:03:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T10:03:12Z.

Review: CHANGES_REQUESTED


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

  • Conventions: tools/check_conventions.py failed.
    (pull request): error: [pr-template] Fill in the pull request template: answer AI-assisted with yes or no
    (pull request): error: [pr-template] Fill in the pull request template: fill Depends on with #N or none
    2 findings, 2 errors; GitHub shows at most 10 error annotations, the job summary lists all
    
  • Build: guest_libc_internal_time_get_fields_tests built cleanly.
  • CTest (guest_libc_internal_time_get_fields):
    1/1 Test #4520: guest_libc_internal_time_get_fields ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004519487 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24899#pullrequestreview-6004519487). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-21T10:03:12Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `772aa4e036`: - **Conventions**: `tools/check_conventions.py` failed. ``` (pull request): error: [pr-template] Fill in the pull request template: answer AI-assisted with yes or no (pull request): error: [pr-template] Fill in the pull request template: fill Depends on with #N or none 2 findings, 2 errors; GitHub shows at most 10 error annotations, the job summary lists all ``` - **Build**: `guest_libc_internal_time_get_fields_tests` built cleanly. - **CTest** (`guest_libc_internal_time_get_fields`): ``` 1/1 Test #4520: guest_libc_internal_time_get_fields ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` Requesting changes for the points above.
MarcZX10 commented 2026-11-21 10:04:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T10:04:36Z.

Review: APPROVED


Reviewed — looks good

The change implements wide time_put::_Init by validating both arguments and assigning only the facet vtable; the added tests cover reference preservation, guarded storage, and null arguments.

What I ran

Reviewed head 772aa4e03685a2fc23533f1069f9db2687ce513b using repo_read.py-backed review tools. No build or tests were run during this review.

Results

Check Result Note
Changed code review passed Implementation and tests read
Build and tests not run Only author-reported in description

Findings

Blocking

None.

Non-blocking

None.

Not verified

Build and test results were not independently verified. Read all three changed files: core/libs/prx/libSceLibcInternal/TimeGetFields.cpp, core/libs/tests/GuestLibcInternalTimeGetFields.cpp, and docs/dev/debt/changes/feat-libcinternal-wide-time-put-init.md. No changed files were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004523700 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24899#pullrequestreview-6004523700). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T10:04:36Z. **Review:** APPROVED --- # Reviewed — looks good The change implements wide `time_put::_Init` by validating both arguments and assigning only the facet vtable; the added tests cover reference preservation, guarded storage, and null arguments. ## What I ran Reviewed head `772aa4e03685a2fc23533f1069f9db2687ce513b` using `repo_read.py`-backed review tools. No build or tests were run during this review. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Implementation and tests read | | Build and tests | not run | Only author-reported in description | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Build and test results were not independently verified. Read all three changed files: `core/libs/prx/libSceLibcInternal/TimeGetFields.cpp`, `core/libs/tests/GuestLibcInternalTimeGetFields.cpp`, and `docs/dev/debt/changes/feat-libcinternal-wide-time-put-init.md`. No changed files were excluded. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-22 15:16:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T15:16:57Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_libc_internal_time_get_fields_tests built cleanly.
  • CTest (guest_libc_internal_time_get_fields):
    1/1 Test #4601: guest_libc_internal_time_get_fields ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceLibcInternal/TimeGetFields.cpp reverted to main and the new tests kept, the suite fails:
    1/1 Test #4601: guest_libc_internal_time_get_fields ...Subprocess aborted***Exception:   0.36 sec
    0% tests passed, 1 tests failed out of 1
    
    Restoring the change makes it pass again.
  • Code reading:
    • core/libs/prx/libSceLibcInternal/TimeGetFields.cpp: verified _ZNSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_InitERKSt8_Locinfo_nid_postfix checks self != nullptr && info != nullptr via RequireArgument
    • core/libs/prx/libSceLibcInternal/TimeGetFields.cpp: verified facet vtable installation sets self->vtable to &g_timePutWideVtable.facet without modifying references or exceeding the 0x10-byte Facet header
    • core/libs/tests/GuestLibcInternalTimeGetFields.cpp: verified CheckB2AdditionalCtorsAndGetcat and CheckGroup1ConstructionAndLifetime exercise positive initialization, reference preservation, guard word preservation, and null self/info rejection
    • docs/dev/debt/changes/feat-libcinternal-wide-time-put-init.md: verified debt fragment properly removes the unresolved wide time_put _Init entry

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6012976085 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24899#pullrequestreview-6012976085). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-22T15:16:57Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `23e2685273`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_libc_internal_time_get_fields_tests` built cleanly. - **CTest** (`guest_libc_internal_time_get_fields`): ``` 1/1 Test #4601: guest_libc_internal_time_get_fields ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceLibcInternal/TimeGetFields.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/1 Test #4601: guest_libc_internal_time_get_fields ...Subprocess aborted***Exception: 0.36 sec 0% tests passed, 1 tests failed out of 1 ``` Restoring the change makes it pass again. - **Code reading**: - core/libs/prx/libSceLibcInternal/TimeGetFields.cpp: verified _ZNSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_InitERKSt8_Locinfo_nid_postfix checks self != nullptr && info != nullptr via RequireArgument - core/libs/prx/libSceLibcInternal/TimeGetFields.cpp: verified facet vtable installation sets self->vtable to &g_timePutWideVtable.facet without modifying references or exceeding the 0x10-byte Facet header - core/libs/tests/GuestLibcInternalTimeGetFields.cpp: verified CheckB2AdditionalCtorsAndGetcat and CheckGroup1ConstructionAndLifetime exercise positive initialization, reference preservation, guard word preservation, and null self/info rejection - docs/dev/debt/changes/feat-libcinternal-wide-time-put-init.md: verified debt fragment properly removes the unresolved wide time_put _Init entry Looks Good To Me
MarcZX10 commented 2026-11-22 15:36:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T15:36:59Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 23e2685273ef02bd45114f445328f56be8a18e45. Read the prepared description, commit summary, manifest and diff, plus the changed implementation and test ranges through repo_read.py. I did not run build or test commands.

Results

Check Result Note
Diff review passed Implementation and added tests inspected
Build and tests not run Claims in the description were not independently verified

Findings

Blocking

None.

Non-blocking

None.

Not verified

The PR description's reported debt check, conventions check, build and CTest results were not run independently. I read the changed lines in TimeGetFields.cpp and GuestLibcInternalTimeGetFields.cpp; the three-line debt change is visible in the diff. I did not inspect the full changed files or verify other repository behavior. The prepared bundle reports these three files as included; files.json was unavailable through the reader. The relevant implementation and test ranges were read at the pinned head.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6013051486 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24899#pullrequestreview-6013051486). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T15:36:59Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this; the points below are optional. ## What I ran Reviewed head `23e2685273ef02bd45114f445328f56be8a18e45`. Read the prepared description, commit summary, manifest and diff, plus the changed implementation and test ranges through `repo_read.py`. I did not run build or test commands. ## Results | Check | Result | Note | |---|---|---| | Diff review | passed | Implementation and added tests inspected | | Build and tests | not run | Claims in the description were not independently verified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The PR description's reported debt check, conventions check, build and CTest results were not run independently. I read the changed lines in `TimeGetFields.cpp` and `GuestLibcInternalTimeGetFields.cpp`; the three-line debt change is visible in the diff. I did not inspect the full changed files or verify other repository behavior. The prepared bundle reports these three files as included; `files.json` was unavailable through the reader. The relevant implementation and test ranges were read at the pinned head. ## To get this to a good state Nothing is required.
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!24899
No description provided.