Repository navigation
feat(libSceIcu): implement converter stop and skip callbacks - #12692
Conversation
Progress report (bb04a4f → 207ac4b)📈 System libraries: 46.52% (+0.03%, +4 implemented, -4 removed functions) ✅ 4 implemented
🗑️ 4 removed
Changed libraries (implemented exports)
|
rooklz
left a comment
There was a problem hiding this comment.
I tested this on macOS, which the body didn't cover. Head is 63529b3.
Standalone build. I built ConverterCallbacks.cpp with the PR's GuestIcuConverterCallbacks.cpp under ASan and UBSan on macOS 26 arm64 (Apple clang, -fno-sanitize-recover=undefined). The only shim was NotImplemented_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:
- contexts: null,
"i","x","","I","ii","s","c" - reasons 0–7
- 9 initial error values (including 0, negatives and warnings)
- every code point from -2 to 0x110001 for the FROM_U pair
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:
- one edge for each of the 17 default-ignorable ranges
- reason bounds (
> 6, dropped< 0) - the
<= 2gate on both SKIPs, moved to<= 1and<= 3 reason == 0widened to<= 1in FROM STOP and in the FROM SKIP ignorable check- the
'i'byte changed to'I', and the'i'reason gate dropped - the null-context clause dropped
- TO STOP writing the error
- the null-error guard dropped
The 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/main 3a2b919: clean, and pairwise with #10967: clean.- With #12451 it conflicts in the debt file, as the body says.
No changes requested.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@Ninot1Quyi reviewed at 63529b3 against ICU 78.1 @adriadam10 we'll merge this once exact-head CI is green, unless you'd rather merge it yourself. |
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
|
Checked the four callbacks against ICU 78.1 |
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)