feat(libSceLibcInternal): implement UTF codecvt metadata and unshift #19593
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19593"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-11-13T15:30:52Z.
What
Implement five unversioned UTF codecvt metadata/unshift exports that previously threw. The char32 unshift writes next=first and returns ok without reading the facet/state. Char16 unshift writes next=first before reading the state's low 16 bits, returning error for values above 1. Metadata queries use the caller's mode at offset 0x18: char32 encoding is -1 for either header flag and 0 otherwise; char32 max length is 9 or 6; char16 max length is 9 for consume-header, 7 for generate-header, otherwise 6. Unrelated mode bits are ignored.
Clean-room source: readable
libc.prx, SDK 10.00, char32 unshift0xb31b0, encoding0xb2e40, max length0xb2e30; char16 unshift0xb2cf0, max length0xb27d0, cross-checked with SDKtarget/include/xlocale. Raw access widths are preserved: char32 mode one byte, char16 mode four bytes, state two bytes. No reference binaries/extracts are attached or linked; no console measurement is claimed.Unusable output/state/mode memory and address overflow throw as documented host-safety behavior. A completed next-pointer write remains visible if the subsequent char16 state read fails. Full conversion/facet construction and later-firmware equivalence remain unverified.
Coverage measured with tools/progress.py: 424 -> 429 implemented / 706 -> 701 TODO / 1130 total. The five NIDs already existed as throwing exports; selected presence gap is unchanged (0 missing / 5 provided / 0 unknown).
Based on main snapshot
228330220ba. Required pr_overlap.py inspected 1514 open heads and exited 2 with six stale comparisons. All eight reported heads were manually checked: no competing behavior or dependency. #17300 renames four matching throwing stubs; the fifth also still throws. #13782/#19434 have independent umbrella-include insertion conflicts; preserve both headers. The checker used later mainc612c4c9e890; copy/type providers are unchanged, while GuestHeap changed singleton lifetime (these wrappers do not allocate through it). Stale whole-branch merges are not claimed clean.Tested
ctest -R '^guest_(codecvt_utf_metadata|libc_internal_codecvt_char)$' --output-on-failurepassed 2/2 on final head47d5044a0eef.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T19:30:22Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
47d5044a0e:tools/check_conventions.pypassed;git diff --checkclean.guest_codecvt_utf_metadata_testsbuilt cleanly.guest_codecvt_utf_metadata):core/libs/prx/libSceLibcInternal/Err.cpp,core/libs/prx/libSceLibcInternal/include/ErrExports.hpp,core/libs/prx/libSceLibcInternal/libSceLibcInternal.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me