feat(libSceIcu): implement UTF-16 set searches and tokenization #10962
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10962"
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 AZLisme on 2026-10-25T11:21:54Z.
What
Implement
u_strspn,u_strcspn,u_strpbrk,u_strtok_randu_memrchr32using ICU 78.1 semantics and public ABI. Searches handle complete code points and bounded embedded NULs; spans return code-unit offsets. Tokenization preserves the one-code-unit supplementary-delimiter overwrite and continuation behavior. Canonical declarations are reachable throughlibSceIcu.hpp.Checked
GuestArena::HostWritescopes cover the continuation pointer and each actual delimiter store. The Windows CTest PATH property retains ICU and kernel directories in one quoted semicolon list. Existing main implementations, throwing unknown exports and their debt are preserved.The declared predecessor #10961 is merged. The agreed landing order continues #10962 → #10963 → #10964 → #10965 → #10966 → #10967 → #11088; this branch does not include the other open topics.
Tested
Current published head:
f5a1913ed0241d33ab21c12e8e98d7e583b8ee82.Windows Build 41295116289, 2026-11-01, tested that head integrated with frozen main
26fa1212b82f76dd49cf12d65e445d6ff3e0844c: 1,679 selected CTests passed, 904 skipped, zero failed. All nine ICU cases passed, includingguest_icu_tokenize. The production ICU module built, linked and was NID-patched. Conventions passed on the same published head.This is selected Windows coverage for those exact inputs. Full-suite, public-header and skip-audit CTests were not run in that job. It is not validation against today's main. Earlier Linux, Windows and private-composition results in the discussion remain historical and do not become tests of a later commit. Console/native ABI and other untested behavior remain documented coverage limits.
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 MarcZX10 on 2026-10-25T11:35:01Z.
Review: CHANGES_REQUESTED
u_strtok_rwrites to guest memory in two places without aGuestArena::HostWritescope: it stores the continuation pointer throughstate(*state = ...) and replaces the delimiter with NUL (*next++ = 0). These are guest-visible writes, so on the shared guest arena they bypass write-watch/shared-backing notification; on Windows, a protected guest destination may also remain inaccessible to a host write. The current tests use ordinarystd::arraystorage and do not exercise the GuestArena path. Please guard the state pointer write and the conditional text terminator write with appropriately sizedHostWritescopes, and handle an unsuccessfulOpen()consistently with the neighboring guest-memory APIs. A focused test against guest-backed memory would verify the regression.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T13:24:43Z.
Review: APPROVED
Reviewed exact updated head
f1a0d6a5526abe3c02469ce8d0e143d9044eaa68. The saved-state pointer is guarded before the initial continuation write, and the delimiter's UTF-16 NUL is guarded only when that write is needed. The early exhausted-state return still avoids dereferencing delimiters, while a rejected later delimiter write leaves the already-recorded initial state as described. The new guest-mapped tests cover state and text outputs, unchanged contents on rejected writes, and canaries; the existing surrogate and aliased-delimiter cases remain.I ran
python3 tools/check_conventions.py --base upstream/main --head HEADandgit diff --check upstream/main...HEAD; both pass. The author reports a Linux guest-mapping run and ICU 78.3 differential coverage. Windows read-only-view cases are present but not claimed as run; hosted product jobs are skipped. The previously requested guest-write protection gap is addressed. #10961 remains the declared integration predecessor.