Repository navigation
feat(libSceIcu): implement UTF-8 macro helpers - #12693
Conversation
Progress report (bb04a4f → d5b612c)📈 System libraries: 46.51% (+0.02%, +4 implemented functions) ✅ 4 implemented
Changed libraries (implemented exports)
|
|
I checked this on macOS, since the body lists only Ubuntu (the linux lane was skipped and only windows ran). Setup. macOS 26 arm64, Apple clang, ASan+UBSan. I built Comparison with a separately built ICU. I compared against Homebrew's ICU 78.3
Result: 300,510,996 calls, 0 differences. To make sure the harness can see a difference, I changed Mutants (27). Each mutant was checked two ways: does the PR test catch it, and does the ICU comparison see a difference.
These four rows in --- a/core/libs/tests/GuestIcuUtf8.cpp
+++ b/core/libs/tests/GuestIcuUtf8.cpp
@@ -82,6 +82,10 @@
strict == -2 ? 0xd800 : e0, strict == -2 ? 0 : 2, 2);
Sequence({0xed, 0xa0}, strict, strict == -2 ? e1 : e0, strict == -2 ? 2 : 1, e0, 1, 1);
Sequence({0x80, 0x80, 0x80, 0x80}, strict, e0, 1, e0, 3, 3);
+ Sequence({0xe0, 0xa0, 0x80}, strict, 0x800, 3, 0x800, 0, 0);
+ Sequence({0xe0, 0x9f, 0xbf}, strict, e0, 1, e0, 2, 2);
+ Sequence({0xef, 0xbf, 0xbe}, strict, strict > 0 ? e2 : 0xfffe, 3, strict > 0 ? e2 : 0xfffe, 0, 0);
+ Sequence({0xf0, 0x9f, 0xbf, 0xbe}, strict, strict > 0 ? e3 : 0x1fffe, 4, strict > 0 ? e3 : 0x1fffe, 0, 0);
}
}I only compared host behaviour with upstream ICU. Like the debt entry says, nothing here is checked against the console. AI-assisted: yes |
Cover the E0 9F/A0 boundary and the U+FFFE/U+1FFFE strictness rules across all int8 strict modes and both tested origins. Addresses boykopovar#12693 (comment)
|
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.
|
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
|
Re-reviewed on head d5b612c after main moved Checked the merge with current |
What
Add four missing PS5 inventory exports:
utf8_nextCharSafeBody,utf8_prevCharSafeBody,utf8_appendCharSafeBody, andutf8_back1SafeBody. These NIDs are absent from current main rather than existing unknown stubs.Implement forward/reverse decoding, append and backward positioning with ICU's macro-helper semantics: strictness modes, surrogate/noncharacter rules, malformed-prefix byte consumption, NUL-terminated forward input, length-dependent legacy errors, and append flag preservation. In particular, the append body encodes ASCII as two bytes because the calling macro handles ordinary ASCII inline; the helper must preserve that upstream behavior.
Behavior follows pinned ICU 78.1 utf_impl.cpp and utf8.h. All four names/NIDs appear in the PS5 3.20 inventory. The implementation uses independent generic parsing/encoding logic; no ICU source is vendored or linked.
Add canonical public declarations, a runtime fixture and technical debt describing unverified console ABI/behavior and guarded undefined inputs, including signed index arithmetic overflow.
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. #12630 needs mechanical integration of CMake registrations and adjacent debt entries. #11088/#11115/#11118/#11122/#11132/#11136 already conflict with main and could not be compared automatically; manual inspection found distinct implementations, with a shared header insertion point requiring both includes to be retained. 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-utf8passed (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)