feat(libc): implement std::collate<char>::transform #11793

Merged
edubox merged 1 commit from upstream-pr/11793 into main 2026-11-04 04:49:32 +00:00
edubox commented 2026-10-27 07:38:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-27T07:38:22Z.


What

Implement std::collate<char>::transform (XaSxLBnqcWE), which forwards to the facet's do_transform and returns its std::string result, as the console's libc.prx does. This was the only libc import missing from Life is Strange (PPSA28099), so the title had to keep using its own libc.prx.

Console evidence: in the libc.prx shipped by PPSA33016, XaSxLBnqcWE is a 0x19-byte function at 0x8b700 that loads self->vtable, calls slot 0x28 (do_transform) with the same arguments, and returns the result pointer.

Tested

  • guest_locale_tests passes. The new check calls the public transform entry point on a collate facet whose vtable is installed and checks the returned string.
  • Life is Strange PPSA28099 (UE4): without this export the loader stops at undefined symbol: XaSxLBnqcWE. With it, the title loads, runs for 22 s and reaches the existing presentation blocker compute shader ... converted float image with 16-bit data with no undefined symbol or loader crash.

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
  • Fixes: none
  • Unblocks: none (PPSA28099 has no Game bring-up discussion)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5030315823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11793). Originally posted by [edubox](https://github.com/edubox) on 2026-10-27T07:38:22Z. --- ### What Implement `std::collate<char>::transform` (`XaSxLBnqcWE`), which forwards to the facet's `do_transform` and returns its `std::string` result, as the console's `libc.prx` does. This was the only libc import missing from Life is Strange (PPSA28099), so the title had to keep using its own `libc.prx`. Console evidence: in the `libc.prx` shipped by PPSA33016, `XaSxLBnqcWE` is a 0x19-byte function at 0x8b700 that loads `self->vtable`, calls slot 0x28 (`do_transform`) with the same arguments, and returns the result pointer. ### Tested - `guest_locale_tests` passes. The new check calls the public `transform` entry point on a collate facet whose vtable is installed and checks the returned string. - Life is Strange PPSA28099 (UE4): without this export the loader stops at `undefined symbol: XaSxLBnqcWE`. With it, the title loads, runs for 22 s and reaches the existing presentation blocker `compute shader ... converted float image with 16-bit data` with no undefined symbol or loader crash. ### 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](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 - [x] Fixes: none - [x] Unblocks: none (PPSA28099 has no Game bring-up discussion) - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-02 01:44:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:44:39Z.

Review: APPROVED


Windows 11, WinLibs GCC 15.2.0 r7, Release. Head a9017c5515 merged into upstream/main 93dbd0f82a:

  • guest_locale passes.
  • Without the change (main's LocaleSupport.cpp and Api.hpp), GuestLocale.cpp doesn't compile (_ZNKSt7collateIcE9transformEPKcS2__nid_postfix not declared), as expected for a new export.

Checked against the layout: GuestLocale.hpp pins CollateVtable::compare at 0x20 and hash at 0x30 with static_asserts, so transform is the 0x28 slot your libc.prx read shows the console calling. The hidden result pointer in rdi and this in rsi match the Itanium ABI return of std::string by value.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731306171 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11793#pullrequestreview-5731306171). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T01:44:39Z. **Review:** APPROVED --- Windows 11, WinLibs GCC 15.2.0 r7, Release. Head a9017c5515 merged into upstream/main 93dbd0f82a: - `guest_locale` passes. - Without the change (main's `LocaleSupport.cpp` and `Api.hpp`), `GuestLocale.cpp` doesn't compile (`_ZNKSt7collateIcE9transformEPKcS2__nid_postfix` not declared), as expected for a new export. Checked against the layout: `GuestLocale.hpp` pins `CollateVtable::compare` at 0x20 and `hash` at 0x30 with `static_assert`s, so `transform` is the 0x28 slot your `libc.prx` read shows the console calling. The hidden result pointer in `rdi` and `this` in `rsi` match the Itanium ABI return of `std::string` by value.
BunnyFl commented 2026-11-02 01:45:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:45:01Z.

Review: APPROVED


Duplicate of my approval above, posted twice after a GitHub API error. Please ignore this one.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731307619 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11793#pullrequestreview-5731307619). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T01:45:01Z. **Review:** APPROVED --- Duplicate of my approval above, posted twice after a GitHub API error. Please ignore this one.
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!11793
No description provided.