feat(libSceIcu): implement converter stop and skip callbacks #12692
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12692"
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 Ninot1Quyi on 2026-10-29T02:34:51Z.
What
Replace four throwing inventory stubs with typed implementations of
UCNV_FROM_U_CALLBACK_STOP,UCNV_FROM_U_CALLBACK_SKIP,UCNV_TO_U_CALLBACK_STOP, andUCNV_TO_U_CALLBACK_SKIP.STOP preserves the caller's error except for FROM_U's unassigned default-ignorable case. SKIP implements null-context and
"i"policies, including default-ignorable precedence, and leaves lifecycle notifications untouched. Converter argument layouts remain opaque because these callbacks do not access them. Headers expose each export once; add a focused runtime fixture and update the remaining-stub debt count from 107 to 103.Signatures and behavior follow ICU 78.1 ucnv_err.h and ucnv_err.cpp. Names/NIDs are in the pinned PS5 3.20 inventory. This is an independent implementation; no ICU source is vendored or linked.
The debt entry records absent console verification, the ICU 65.1/78.1 difference at U+180F, and guards for undefined upstream inputs. Unaccessed pointers remain unread. Converter execution and other callbacks remain unimplemented.
Overlap: the repository checker scanned all 1,410 open PRs, followed by manual inspection of all 16 ICU candidates. None implements these four functions/NIDs. Mechanical conflicts remain with #10967 (test registration), #12320/#12629/#12630 (debt inventory/count), and #12451 (adjacent debt entry). Preserve both registrations/entries and recount remaining stubs when combining them. #11088/#11115/#11118/#11122/#11132/#11136 already conflict with main and could not be compared automatically; their implementations were checked manually and are distinct. No implementation dependency is required.
Tested
Ubuntu 24.04 x86_64, GCC 13.3, Release, BUILD_TESTING=ON; base
3a2b91981651569163768854a1fcdc7193b6667b.python3 tools/check_conventions.py --base origin/main,git diff --check, andtools/pr_overlap.py --branch codex/icu-nextpassed (overlap findings described above).No game/homebrew, console hardware, Windows or macOS execution was performed.
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 rooklz on 2026-10-29T03:26:39Z.
Review: APPROVED
I tested this on macOS, which the body didn't cover. Head is
63529b3c6d.Standalone build. I built
ConverterCallbacks.cppwith the PR'sGuestIcuConverterCallbacks.cppunder ASan and UBSan on macOS 26 arm64 (Apple clang,-fno-sanitize-recover=undefined). The only shim wasNotImplemented_nid_no_patch. It passes in 0.2 s with no sanitizer reports.Differential against an ICU binary. I compared the four callbacks against Homebrew ICU 78.3's
libicuuc(UCNV_*_CALLBACK_{STOP,SKIP}_78, linked as a binary, not read as source). The inputs were:"i","x","","I","ii","s","c"That is 1,283,462,784 calls with 0 differences (3.4 s). 78.3 agrees with the PR's U+180F range.
Mutants. I ran 31 mutants of
ConverterCallbacks.cpp:> 6, dropped< 0)<= 2gate on both SKIPs, moved to<= 1and<= 3reason == 0widened to<= 1in FROM STOP and in the FROM SKIP ignorable check'i'byte changed to'I', and the'i'reason gate droppedThe PR test kills all 31. 29 of them also change results against ICU 78.3. The other two (null-error guard, dropped
< 0) only affect inputs ICU leaves undefined, and the debt entry already documents them.Other checks.
check_conventions --base 3a2b919816: clean.git merge-treeagainst upstream/main3a2b919816: clean, and pairwise with #10967: clean.No changes requested.