feat(libSceIcu): implement property and case exports from ICU tables #13578

Merged
KernelPanicNT merged 7 commits from upstream-pr/13578 into main 2026-11-11 05:26:40 +00:00
KernelPanicNT commented 2026-10-30 18:43:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by KernelPanicNT on 2026-10-30T18:43:41Z.


What

Source of the behaviour

ICU 78.1, tag release-78.1, commit 049e0d6a4206. The library already follows this release (see the version and escape entries in libSceIcu.md); its Unicode version is 17.0 (uchar.h#L64), the value #13457 returns from u_getUnicodeVersion.

AnyPS5 lines that change (at b11c7bf84f5d):

What this adds

ICU becomes a submodule at 3rdparty/icu, pinned to the commit above (shallow = true, since the repository history is large). cmake/Icu.cmake builds icu_common, a static library made of the 53 icu4c/source/common files these exports reach plus stubdata/stubdata.cpp, with UCONFIG_NO_FILE_IO=1. The property, case, bidi, name and NFC tables are compiled-in *_data.h headers, so no .dat file, data directory or host ICU is involved, and nothing is read from the host file system. ICU keeps its versioned symbol names (u_charType_78), is built with hidden visibility and is linked with --exclude-libs like Opus, so libSceIcu.prx exports none of it (nm -D shows 0 ICU symbols). Windows adds 19 files (wintz.cpp and the locale and resource-bundle code it and putil.cpp reach only on Win32).

49 exports call ICU and keep the guest ABI the library already uses: UChar32 is int32_t, UBool one byte, enums int32_t, UErrorCode* an int32_t*, UChar char16_t:

  • u_charType, u_enumCharTypes, u_islower, u_isupper, u_istitle, u_isdigit, u_isxdigit, u_isalpha, u_isalnum, u_isdefined, u_isbase, u_iscntrl, u_ispunct, u_isgraph, u_isprint, u_isIDStart, u_isIDPart, u_isIDIgnorable, u_isJavaIDStart, u_isJavaIDPart, u_isUAlphabetic, u_isULowercase, u_isUUppercase
  • u_charDigitValue, u_digit, u_getNumericValue, u_charAge, u_getCombiningClass, u_charDirection, u_isMirrored, u_charMirror, u_getBidiPairedBracket, u_foldCase
  • u_getPropertyEnum, u_getPropertyName, u_getPropertyValueEnum, u_getPropertyValueName, u_getIntPropertyMinValue, u_getIntPropertyMaxValue, u_hasBinaryProperty, u_getIntPropertyValue
  • u_strFoldCase, u_strToLower, u_strToUpper, u_strCaseCompare, u_strcasecmp, u_strncasecmp, u_memcasecmp, u_caseInsensitivePrefixMatch

Behaviour is ICU's for every input, with these exceptions:

  • u_hasBinaryProperty and u_getIntPropertyValue throw NotImplemented_nid_no_patch for properties whose source is a data file (emoji properties, NFKD/NFKC_Inert, NFKD/NFKC_Quick_Check, Changes_When_NFKC_Casefolded, Indic_Positional_Category, Indic_Syllabic_Category, Vertical_Orientation), and u_getIntPropertyMaxValue for the last three. Without the file ICU would answer 0 or false, which would be made up.
  • u_strToLower and u_strToUpper throw NotImplemented_nid_no_patch for a null locale when ICU would map the string, because the result then depends on the device's default locale. An empty locale is root, as in ICU, and failed input codes and invalid arguments return as in ICU. A named locale goes through ucase_getCaseLocale and ustrcase_mapWithOverlap, which is what u_strToLower does for a non-null locale; calling them directly keeps uloc_getDefault and the locale and resource-bundle code out of the Linux build.
  • Where ICU dereferences a null pointer (a null UErrorCode* in the string mappers and the prefix match, a null string with a nonzero length in the comparisons, a null second match length) or receives a length below -1, which ICU turns into pointer arithmetic before the string, the export throws std::invalid_argument.
  • u_enumCharTypes forwards ICU's callback to the guest function through a System V ABI trampoline, so a guest callback works on Windows.

These five exports therefore still count as stubs; the other 44 no longer reach NotImplemented_nid_no_patch.

Why ICU's tables instead of hand-written sets

#12630 implemented u_isspace and four similar classifiers with fixed ranges, and those stay as they are. That works for a few short sets, but these exports need the General_Category, numeric value, age, case mappings and folding, bidi class, mirroring and paired brackets, combining class and the property and value names for all 1,114,112 code points, about 100 properties in all. Hand-transcribing them would mean several hundred kilobytes of tables that nobody can review against the Unicode Character Database, and they would drift from the 17.0 data that ICU 78.1 ships. The submodule uses the tables ICU generates from that data, at the release the library already follows, compiled from source as AGENTS.md asks for third-party code.

Excluded exports

  • u_getUnicodeVersion and u_strCompareIter: #13457.
  • u_isISOControl, u_forDigit and the other 18 exports #12320 implements.
  • u_charName, u_charFromName, u_enumCharNames: need unames.icu.
  • u_getFC_NFKC_Closure: needs NFKC data.
  • u_getBinaryPropertySet, u_getIntPropertyMap: they return ICU USet and UCPMap objects that only uset_* and ucpmap_* functions can read, and this library exports none of those.
  • Converter, resource-bundle and locale_getKeywordsStart stubs: not property or case data.

Overlap (tools/pr_overlap.py --branch feat/icu-submodule-properties)

  • #15346 (opened after this PR) implements u_charDigitValue and u_digit with its own decimal-range table. Here both call ICU, and u_charDigitValue is checked against UnicodeData.txt for every code point. Whichever PR merges second has to drop the other's version.
  • #14123, #12320, #13486 (Export.cpp, Identified.hpp or libSceIcu.hpp) and #14050, #14144, #14340, #14443, #12738, #10963–#10967 (libSceIcu/CMakeLists.txt, debt file): other ICU exports. None implements any of these 49; only the appended lines conflict.
  • #14421, #14435, #14448, #12928, #15186, #1835, #5021 (.gitmodules) and #14264, #7642, #9508, #9539, #10193, #13928, #13929, #14212 (CMakeLists.txt): they add other submodules or libraries, none of them ICU; only neighbouring lines conflict.

Tested

Linux (GitHub Codespace, AMD EPYC 7763, 4 cores, Ubuntu 24.04, g++ 14, Ninja, Release), on main at b11c7bf84f5d with the submodule checked out by git submodule update --init --depth 1 3rdparty/icu (commit 049e0d6a4206):

  • ctest -R "^guest_icu_": 18/18 passed, the 15 ICU tests on main and the new guest_icu_properties, guest_icu_case_mapping and guest_icu_unicode_data.
  • guest_icu_unicode_data uses icu4c/source/data/unidata/UnicodeData.txt from the submodule as the oracle. CMake passes the path in, and the test reads the file when it runs and fails if the file is missing or malformed. For all 1,114,112 code points (299,382 listed, with First/Last ranges expanded) it compares u_charType, u_getCombiningClass, u_charDigitValue and u_charDirection with the file, and the u_enumCharTypes ranges with the same table. Unlisted code points must be Cn, class 0 and no digit. Bidi is not compared for them, because the submodule has no DerivedBidiClass.txt. INT32_MIN, -1, 0x110000 and INT32_MAX must return Cn, 0, -1 and L, which is what ICU returns outside its tries.
  • guest_icu_properties and guest_icu_case_mapping check values from the Unicode Character Database (for example U+20C1 SAUDI RIYAL SIGN, new in 17.0: category Sc and age 17.0), locale mappings (tr, az, lt, el, final sigma), preflighting, in-place mapping, error codes and the cases that throw.
  • Negative controls for guest_icu_unicode_data: changing a single code point in the middle of a range (U+7A00 for u_charType, U+0F72 for u_getCombiningClass, U+0AE9 for u_charDigitValue, U+05D3 for u_charDirection, the surrogate U+DB80 for u_charType) gives exactly one mismatch each, while guest_icu_properties and guest_icu_case_mapping still pass with it. Shifting one block for each export (U+8000 for u_charType, U+1DC0 for u_getCombiningClass, U+1D7CE for u_charDigitValue, U+10900 for u_charDirection) gives 182, 19, 50 and 204 mismatches. Mapping out-of-range input to U+0041 gives 4. The 49 bodies replaced by NotImplemented_nid_no_patch(__func__) fail with u_charType_nid_postfix not implemented; on the earlier head the same control failed guest_icu_properties and guest_icu_case_mapping (u_strToUpper_nid_postfix not implemented). With UnicodeData.txt moved away the test fails with cannot open, and with the file truncated it fails on the cut line. With the change restored all pass.
  • icu_common cold build without ccache: 19 s on 4 cores (54 files). The depth-1 checkout is 329 MB of working tree plus 95 MB under .git/modules.
  • tools/check_conventions.py --base origin/main and tools/check_test_registration.py pass.
  • tools/progress.py --compare: libSceIcu 75/2661 → 119/2661, +44 implemented, 5 still counted as stubs (u_hasBinaryProperty, u_getIntPropertyValue, u_getIntPropertyMaxValue, u_strToLower, u_strToUpper).
  • Windows: CodingBreadd built the earlier head d8ee336 with WinLibs GCC 15.2.0 (MinGW, UCRT); the 8 ICU tests of that head passed (comment).

Not tested: this head on Windows (MinGW), including guest_icu_unicode_data, and macOS. The 19 Windows-only sources were first found by forcing every ICU symbol that putil.cpp, wintz.cpp, locmap.cpp, udata.cpp and umapfile.cpp reference to be undefined in a Linux link and reading the linker map, not by building with MinGW. Not compared with a console.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5089397653 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13578). Originally posted by [KernelPanicNT](https://github.com/KernelPanicNT) on 2026-10-30T18:43:41Z. --- ### What **Source of the behaviour** ICU 78.1, tag `release-78.1`, commit [`049e0d6a4206`](https://github.com/unicode-org/icu/tree/049e0d6a4206/icu4c/source/common). The library already follows this release (see the version and escape entries in [`libSceIcu.md`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/docs/dev/debt/libSceIcu.md)); its Unicode version is 17.0 ([`uchar.h#L64`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/unicode/uchar.h#L64)), the value #13457 returns from `u_getUnicodeVersion`. - Prototypes: [`uchar.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/unicode/uchar.h), [`ustring.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/unicode/ustring.h), [`ucasemap_imp.h#L57`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ucasemap_imp.h#L57) (`u_caseInsensitivePrefixMatch`). - Character properties: [`uchar.cpp`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uchar.cpp) (`u_charType` [L50](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uchar.cpp#L50), `u_enumCharTypes` [L77](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uchar.cpp#L77), `u_getNumericValue` [L356](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uchar.cpp#L356), `u_charAge` [L524](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uchar.cpp#L524)) over [`uchar_props_data.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uchar_props_data.h); case data [`ucase.cpp#L1625-L1656`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ucase.cpp#L1625-L1656) over [`ucase_props_data.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ucase_props_data.h); bidi [`ubidi_props.cpp#L237-L255`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ubidi_props.cpp#L237-L255) over [`ubidi_props_data.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ubidi_props_data.h); combining class [`normalizer2.cpp#L551`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/normalizer2.cpp#L551) over the built-in NFC data ([`normalizer2impl.h#L40`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/normalizer2impl.h#L40), [`norm2_nfc_data.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/norm2_nfc_data.h)); names [`propname.cpp#L290-L322`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/propname.cpp#L290-L322) over [`propname_data.h`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/propname_data.h). - Binary and enumerated properties: [`uprops.cpp#L399-L485`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uprops.cpp#L399-L485) and [`#L714-L789`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uprops.cpp#L714-L789). The source of each property, used to decide which ones need a data file, is [`uprops_getSource`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uprops.cpp#L791); the data-file loaders are [`ulayout_load`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/uprops.cpp#L97) (InPC, InSC, vo), [`emojiprops.cpp`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/emojiprops.cpp) and [`loadednormalizer2impl.cpp`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/loadednormalizer2impl.cpp) (NFKC, NFKC_CF). - String case mapping and comparison: [`ustrcase.cpp`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ustrcase.cpp) (argument checks [L1356-L1377](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ustrcase.cpp#L1356-L1377), `u_strFoldCase` [L1423](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ustrcase.cpp#L1423), `_cmpFold`, which reads both strings without checks, [L1481](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ustrcase.cpp#L1481), public wrappers [L1854-L1905](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ustrcase.cpp#L1854-L1905)); the locale step [`ustrcase_locale.cpp#L31-L65`](https://github.com/unicode-org/icu/blob/049e0d6a4206/icu4c/source/common/ustrcase_locale.cpp#L31-L65), where a null locale means `uloc_getDefault()`. AnyPS5 lines that change (at [`b11c7bf84f5d`](https://github.com/boykopovar/AnyPS5/tree/b11c7bf84f5d)): - The 49 named stubs of #13410 removed from [`Export.cpp#L92-L413`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/Export.cpp#L92-L413) and their declarations from [`Identified.hpp#L22-L79`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/Identified.hpp#L22-L79). - Build: [`CMakeLists.txt#L662`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/CMakeLists.txt#L662) (new `include(cmake/Icu.cmake)` after Opus), [`.gitmodules#L78`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/.gitmodules#L78), [`libSceIcu/CMakeLists.txt#L11`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/CMakeLists.txt#L11) and [`#L164`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/CMakeLists.txt#L164), [`libSceIcu.hpp#L17`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/libSceIcu.hpp#L17). `Properties.cpp` and `CaseMapping.cpp` include only their own headers, because the guest `UCharIterator` that [`Iterator.hpp`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/Iterator.hpp) declares clashes with ICU's. - Debt: [`libSceIcu.md#L54`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/docs/dev/debt/libSceIcu.md#L54) (new entry before it) and [`#L56-L57`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/docs/dev/debt/libSceIcu.md#L56-L57) (93 stubs become 44, 73 named stubs become 24). - Left as is: the hand-written sets of #12630 in [`Space.cpp`](https://github.com/boykopovar/AnyPS5/blob/b11c7bf84f5d/core/libs/prx/libSceIcu/Space.cpp). **What this adds** ICU becomes a submodule at `3rdparty/icu`, pinned to the commit above (`shallow = true`, since the repository history is large). `cmake/Icu.cmake` builds `icu_common`, a static library made of the 53 `icu4c/source/common` files these exports reach plus `stubdata/stubdata.cpp`, with `UCONFIG_NO_FILE_IO=1`. The property, case, bidi, name and NFC tables are compiled-in `*_data.h` headers, so no `.dat` file, data directory or host ICU is involved, and nothing is read from the host file system. ICU keeps its versioned symbol names (`u_charType_78`), is built with hidden visibility and is linked with `--exclude-libs` like Opus, so `libSceIcu.prx` exports none of it (`nm -D` shows 0 ICU symbols). Windows adds 19 files (`wintz.cpp` and the locale and resource-bundle code it and `putil.cpp` reach only on Win32). 49 exports call ICU and keep the guest ABI the library already uses: `UChar32` is `int32_t`, `UBool` one byte, enums `int32_t`, `UErrorCode*` an `int32_t*`, `UChar` `char16_t`: - `u_charType`, `u_enumCharTypes`, `u_islower`, `u_isupper`, `u_istitle`, `u_isdigit`, `u_isxdigit`, `u_isalpha`, `u_isalnum`, `u_isdefined`, `u_isbase`, `u_iscntrl`, `u_ispunct`, `u_isgraph`, `u_isprint`, `u_isIDStart`, `u_isIDPart`, `u_isIDIgnorable`, `u_isJavaIDStart`, `u_isJavaIDPart`, `u_isUAlphabetic`, `u_isULowercase`, `u_isUUppercase` - `u_charDigitValue`, `u_digit`, `u_getNumericValue`, `u_charAge`, `u_getCombiningClass`, `u_charDirection`, `u_isMirrored`, `u_charMirror`, `u_getBidiPairedBracket`, `u_foldCase` - `u_getPropertyEnum`, `u_getPropertyName`, `u_getPropertyValueEnum`, `u_getPropertyValueName`, `u_getIntPropertyMinValue`, `u_getIntPropertyMaxValue`, `u_hasBinaryProperty`, `u_getIntPropertyValue` - `u_strFoldCase`, `u_strToLower`, `u_strToUpper`, `u_strCaseCompare`, `u_strcasecmp`, `u_strncasecmp`, `u_memcasecmp`, `u_caseInsensitivePrefixMatch` Behaviour is ICU's for every input, with these exceptions: - `u_hasBinaryProperty` and `u_getIntPropertyValue` throw `NotImplemented_nid_no_patch` for properties whose source is a data file (emoji properties, NFKD/NFKC_Inert, NFKD/NFKC_Quick_Check, Changes_When_NFKC_Casefolded, Indic_Positional_Category, Indic_Syllabic_Category, Vertical_Orientation), and `u_getIntPropertyMaxValue` for the last three. Without the file ICU would answer 0 or false, which would be made up. - `u_strToLower` and `u_strToUpper` throw `NotImplemented_nid_no_patch` for a null locale when ICU would map the string, because the result then depends on the device's default locale. An empty locale is root, as in ICU, and failed input codes and invalid arguments return as in ICU. A named locale goes through `ucase_getCaseLocale` and `ustrcase_mapWithOverlap`, which is what `u_strToLower` does for a non-null locale; calling them directly keeps `uloc_getDefault` and the locale and resource-bundle code out of the Linux build. - Where ICU dereferences a null pointer (a null `UErrorCode*` in the string mappers and the prefix match, a null string with a nonzero length in the comparisons, a null second match length) or receives a length below -1, which ICU turns into pointer arithmetic before the string, the export throws `std::invalid_argument`. - `u_enumCharTypes` forwards ICU's callback to the guest function through a System V ABI trampoline, so a guest callback works on Windows. These five exports therefore still count as stubs; the other 44 no longer reach `NotImplemented_nid_no_patch`. **Why ICU's tables instead of hand-written sets** #12630 implemented `u_isspace` and four similar classifiers with fixed ranges, and those stay as they are. That works for a few short sets, but these exports need the General_Category, numeric value, age, case mappings and folding, bidi class, mirroring and paired brackets, combining class and the property and value names for all 1,114,112 code points, about 100 properties in all. Hand-transcribing them would mean several hundred kilobytes of tables that nobody can review against the Unicode Character Database, and they would drift from the 17.0 data that ICU 78.1 ships. The submodule uses the tables ICU generates from that data, at the release the library already follows, compiled from source as AGENTS.md asks for third-party code. **Excluded exports** - `u_getUnicodeVersion` and `u_strCompareIter`: #13457. - `u_isISOControl`, `u_forDigit` and the other 18 exports #12320 implements. - `u_charName`, `u_charFromName`, `u_enumCharNames`: need `unames.icu`. - `u_getFC_NFKC_Closure`: needs NFKC data. - `u_getBinaryPropertySet`, `u_getIntPropertyMap`: they return ICU `USet` and `UCPMap` objects that only `uset_*` and `ucpmap_*` functions can read, and this library exports none of those. - Converter, resource-bundle and `locale_getKeywordsStart` stubs: not property or case data. **Overlap** (`tools/pr_overlap.py --branch feat/icu-submodule-properties`) - #15346 (opened after this PR) implements `u_charDigitValue` and `u_digit` with its own decimal-range table. Here both call ICU, and `u_charDigitValue` is checked against `UnicodeData.txt` for every code point. Whichever PR merges second has to drop the other's version. - #14123, #12320, #13486 (`Export.cpp`, `Identified.hpp` or `libSceIcu.hpp`) and #14050, #14144, #14340, #14443, #12738, #10963–#10967 (`libSceIcu/CMakeLists.txt`, debt file): other ICU exports. None implements any of these 49; only the appended lines conflict. - #14421, #14435, #14448, #12928, #15186, #1835, #5021 (`.gitmodules`) and #14264, #7642, #9508, #9539, #10193, #13928, #13929, #14212 (`CMakeLists.txt`): they add other submodules or libraries, none of them ICU; only neighbouring lines conflict. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux (GitHub Codespace, AMD EPYC 7763, 4 cores, Ubuntu 24.04, g++ 14, Ninja, Release), on `main` at `b11c7bf84f5d` with the submodule checked out by `git submodule update --init --depth 1 3rdparty/icu` (commit `049e0d6a4206`): - `ctest -R "^guest_icu_"`: 18/18 passed, the 15 ICU tests on `main` and the new `guest_icu_properties`, `guest_icu_case_mapping` and `guest_icu_unicode_data`. - `guest_icu_unicode_data` uses `icu4c/source/data/unidata/UnicodeData.txt` from the submodule as the oracle. CMake passes the path in, and the test reads the file when it runs and fails if the file is missing or malformed. For all 1,114,112 code points (299,382 listed, with `First`/`Last` ranges expanded) it compares `u_charType`, `u_getCombiningClass`, `u_charDigitValue` and `u_charDirection` with the file, and the `u_enumCharTypes` ranges with the same table. Unlisted code points must be Cn, class 0 and no digit. Bidi is not compared for them, because the submodule has no `DerivedBidiClass.txt`. `INT32_MIN`, -1, 0x110000 and `INT32_MAX` must return Cn, 0, -1 and L, which is what ICU returns outside its tries. - `guest_icu_properties` and `guest_icu_case_mapping` check values from the Unicode Character Database (for example U+20C1 SAUDI RIYAL SIGN, new in 17.0: category Sc and age 17.0), locale mappings (`tr`, `az`, `lt`, `el`, final sigma), preflighting, in-place mapping, error codes and the cases that throw. - Negative controls for `guest_icu_unicode_data`: changing a single code point in the middle of a range (U+7A00 for `u_charType`, U+0F72 for `u_getCombiningClass`, U+0AE9 for `u_charDigitValue`, U+05D3 for `u_charDirection`, the surrogate U+DB80 for `u_charType`) gives exactly one mismatch each, while `guest_icu_properties` and `guest_icu_case_mapping` still pass with it. Shifting one block for each export (U+8000 for `u_charType`, U+1DC0 for `u_getCombiningClass`, U+1D7CE for `u_charDigitValue`, U+10900 for `u_charDirection`) gives 182, 19, 50 and 204 mismatches. Mapping out-of-range input to U+0041 gives 4. The 49 bodies replaced by `NotImplemented_nid_no_patch(__func__)` fail with `u_charType_nid_postfix not implemented`; on the earlier head the same control failed `guest_icu_properties` and `guest_icu_case_mapping` (`u_strToUpper_nid_postfix not implemented`). With `UnicodeData.txt` moved away the test fails with `cannot open`, and with the file truncated it fails on the cut line. With the change restored all pass. - `icu_common` cold build without ccache: 19 s on 4 cores (54 files). The depth-1 checkout is 329 MB of working tree plus 95 MB under `.git/modules`. - `tools/check_conventions.py --base origin/main` and `tools/check_test_registration.py` pass. - `tools/progress.py --compare`: libSceIcu 75/2661 → 119/2661, +44 implemented, 5 still counted as stubs (`u_hasBinaryProperty`, `u_getIntPropertyValue`, `u_getIntPropertyMaxValue`, `u_strToLower`, `u_strToUpper`). - Windows: CodingBreadd built the earlier head `d8ee336` with WinLibs GCC 15.2.0 (MinGW, UCRT); the 8 ICU tests of that head passed ([comment](https://github.com/boykopovar/AnyPS5/pull/13578#issuecomment-6531987168)). Not tested: this head on Windows (MinGW), including `guest_icu_unicode_data`, and macOS. The 19 Windows-only sources were first found by forcing every ICU symbol that `putil.cpp`, `wintz.cpp`, `locmap.cpp`, `udata.cpp` and `umapfile.cpp` reference to be undefined in a Linux link and reading the linker map, not by building with MinGW. Not compared with a console. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
CnRJay commented 2026-11-01 19:51:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:51:05Z.

Review: COMMENTED


Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement; Unblocks: none is allowed. The technical points below are unaffected.

The source pinning to ICU 78.1 and the Unicode 17.0 consistency with #13457 is good. Two requests.

  1. There is no title ID and no log line showing a title reaching any of the property/case exports on main ("Unblocks: none"). 14 files and +843 lines of ICU table-driven behaviour need a consumer named; which title calls these, and with which arguments?

  2. Table-derived exports are only as good as their coverage of the full code point range. Does the test sweep every code point 0..0x10FFFF against an independent oracle (ICU itself), including surrogates and out-of-range inputs, or only spot values? A boundary-only test would not catch a table offset error in the middle of the range. Please state what the oracle is.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729927711 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13578#pullrequestreview-5729927711). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:51:05Z. **Review:** COMMENTED --- **Correction (2026-11-01):** the title-ID/log demand below is not a CONTRIBUTING requirement; `Unblocks: none` is allowed. The technical points below are unaffected. The source pinning to ICU 78.1 and the Unicode 17.0 consistency with #13457 is good. Two requests. 1. There is no title ID and no log line showing a title reaching any of the property/case exports on main ("Unblocks: none"). 14 files and +843 lines of ICU table-driven behaviour need a consumer named; which title calls these, and with which arguments? 2. Table-derived exports are only as good as their coverage of the full code point range. Does the test sweep every code point `0..0x10FFFF` against an independent oracle (ICU itself), including surrogates and out-of-range inputs, or only spot values? A boundary-only test would not catch a table offset error in the middle of the range. Please state what the oracle is.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13578
No description provided.