feat(libSceIcu): implement the collator over ICU 78.1 #23196
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23196"
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 Divad27 on 2026-11-18T20:07:47Z.
What
Implements the collator C API of
libSceIcuover ICU 78.1, the version firmware 13.42 reports, on top of #16971's source-built data:ucol_open,ucol_close,ucol_getAttribute,ucol_setAttribute,ucol_getStrength,ucol_setStrength,ucol_strcollanducol_strcollUTF8. The first 21 commits are #16971's head6248105ca4, unchanged. This pull request adds the last six. The branch merges intomainfd653794a1without conflicts.cmake/Icu.cmakebuilds the 30 collator sources of ICU'si18ndirectory intoicu_i18n, andcmake/IcuDataFilter.jsonaddscoll_ucadataandcoll_tree.CollatorHost.cppcalls ICU in its own translation unit, becauseRecoveredSignatures.hppdeclares its ownUColAttributeandUColAttributeValue.ucol_openreturned, so a foreign or closed handle throws instead of reaching ICU. Strings, locale IDs andUErrorCodevalues go throughGuestCopyIn_nid_no_patchandGuestCopyOut_nid_no_patch; NUL-terminated strings are read page by page, anderrnois kept.U_ILLEGAL_ARGUMENT_ERRORbefore the conversion, which is what ICU's own checks return for them, so no out-of-range number is converted to an ICU enumeration.ucol_getContractionsAndExpansions,ucol_getKeywordValues,ucol_getKeywordValuesForLocale,ucol_getRules,ucol_strcollIter) keep their early returns as onmain. They read and write the status through the same helpers as the implemented exports.ucol_getStrength,ucol_setStrength,ucol_strcollanducol_strcollUTF8move fromRecoveredInventory.cpptoCollator.cppwith their ICU signatures. That file has 4 placeholders left. The count is in the pending change offeat-libsceicu-field-position-iterator.md, now 4 instead of 8, becausetools/debt_fold.pytakes one pending change per entry.colltree bundled,ucol_countAvailable(#24180) answers 145 locales instead of 0. Itsemptytest mode becomesbundledand checks that list, and its debt entry says so.Size on Windows at this head merged with
main:libSceIcu.prx12,741,177 bytes,libharfbuzz.prx12,104,960 bytes,icudt78l.dat8,318,832 bytes as before the rebase. Measured on97d90120a8, the collation data (the root data and every locale tailoring) added 3,372,032 bytes to both libraries, because both linkicu_common, which carries the data package since #16971, althoughlibharfbuzzdoes not use it. The rest of thelibSceIcu.prxgrowth there, about 380 KiB, was code.Once #16971's fragment is folded, the debt fragment here will also add the collation data to its "Source-built data" entry;
tools/debt_fold.pycannot change an entry that another pending fragment adds.Tested
Windows 11 10.0.26300, WinLibs GCC 15.2.0 r7, Release:
mainfd653794a1, as the Build workflow tests it, headd3ea0d7ad2:ctest -R "icu|harfbuzz|public_headers" --parallel 4passes 187 of 187 (103 ICU, 19 harfbuzz, 65public_headers), includingguest_icu_collator_availability_bundledand_data,guest_icu_locale_table_fallbackwith #16971'sde_ZZcase, andguest_icu_utf_conversions(0.17 s).guest_icu_collator_availability_empty, which expected nocolltree and is now thebundledmode, andguest_icu_utf_conversionsover its 10 s limit, which #26783 has since made faster onmain.tests/Collator.cpp: explicit and NUL-terminated lengths, null strings, strings across page boundaries (5,000 units), strength and attribute changes, invalid attributes and values (status 1 from 0 and from -128), theucol_strcollUTF8early return,desortingäbeforezagainstsvsorting it after, closed and foreign handles, and unreadable strings, locale IDs and status pointers (std::runtime_error,errnokept). #23850'sUcolQuerieschecks run unchanged.f02872cf4e: with the operands ofucol_strcollswapped inCollatorHost.cpp,guest_icu_recovered_signaturesfails attests/Collator.cpp:310.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkpass.tools/pr_overlap.py --namesfor the eight functions anducol_countAvailable/ucol_getAvailable: the only other open pull requests with them are #27178 to #27186, which build on this one.--branch: apart from #16971's own overlaps, #26931 changes the same helpers inCollator.cpp(it drops theirerrnosaves); whichever merges second needs a small rebase.a8701e7cb9: Ubuntu 24.04, GCC 13.3, Ninja, Release;tools/check_conventions.pypasses and the eight ICU tests it ran pass. Not rerun on this head; I have no Linux machine here.a8701e7cb9: macOS 27.2.1 (Apple M4), AppleClang 21.0.0, x86-64 Release under Rosetta 2,ctest -R "icu|harfbuzz" -j 4passes 89 of 89 both with and without the four commits here.libSceIcu.prxgrows from 7,668,792 to 11,298,424 bytes, whilelibharfbuzz.prxstays at 2,694,640 bytes there, so the duplicated data is specific to the Windows link.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)🤖 Generated with Claude Code
https://claude.ai/code/session_012mnDkgWagzS5fp41ue5TZh
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T21:39:40Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
a8701e7cb9:tools/check_conventions.pypassed.guest_icu_break_iterator_tests,guest_icu_data_tests,guest_icu_recovered_signatures_testsbuilt cleanly.guest_icu_recovered_signatures,guest_icu_break_iterator,guest_icu_break_unicode_0,guest_icu_break_unicode_1,guest_icu_break_unicode_2,guest_icu_break_unicode_3,guest_icu_data_registration,guest_icu_break_allocator):core/libs/prx/libSceIcu/Collator.cpp,core/libs/prx/libSceIcu/Configuration.cpp,core/libs/prx/libSceIcu/Export.cpp,core/libs/prx/libSceIcu/RecoveredInventory.cpp,core/libs/prx/libSceIcu/RecoveredInventory.hpp,core/libs/prx/libSceIcu/RecoveredSignatures.hpp,core/libs/prx/libSceIcu/include/InventoryExports.hpp,core/libs/prx/libSceIcu/libSceIcu.hpp,core/libs/prx/libSceIcu/BreakIterator.cpp,core/libs/prx/libSceIcu/CollatorHost.cpp,core/libs/prx/libSceIcu/Data.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T09:56:26Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected collator and ICU data changes show no verified blocking defect; this review is incomplete because not every changed file was read.
What I ran
Reviewed head
97d90120a8282378b95b4d6559d1b7d51a3de487using the prepared diff and pinnedrepo_read.pyreader. No build or test commands were run.Results
Findings
Blocking
None verified in the files inspected.
Non-blocking
None.
Sources
Behavior inspected at the pinned head: Collator.cpp, CollatorHost.cpp, IcuData.cmake, and Configuration.cpp.
Not verified
Read:
description.md,commits.md,manifest.json,diff.patch; changed source filesCollator.cpp,CollatorHost.cpp,Configuration.cpp,Data.cpp,RecoveredSignatures.hpp,tests/Collator.cpp,CMakeLists.txt,Icu.cmake,IcuData.cmake, andIcuDataFilter.json. Other changed files listed in the manifest were not read; no test, build, platform, or console behavior was independently verified.To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files and run the relevant tests on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T12:54:19Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the implementation and tests provide evidence for the described ICU collator and break-iterator behavior.
What I ran
e7b1d1ecd4eced97aeb9a0cdb1201a725dd301d1usingrepo_read.pytools.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,cmake/IcuData.cmake,cmake/Icu.cmake(search results),core/libs/prx/libSceIcu/Collator.cpp,core/libs/prx/libSceIcu/CollatorHost.cpp,core/libs/prx/libSceIcu/CollatorHost.hpp,core/libs/prx/libSceIcu/BreakIterator.cpp,core/libs/prx/libSceIcu/BreakIterator.hpp,core/libs/prx/libSceIcu/CollatorAvailability.cpp,core/libs/prx/libSceIcu/AvailableLocales.cpp, and targeted portions of the test and build diffs.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T13:01:00Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the checks reported by the author and the source inspected support merging.
What I ran
Reviewed head
d3ea0d7ad27f3f1e2d84ff43d16d319e218863cd. I ran no build or tests; the description reports Windows checks passed and reports earlier Linux and macOS checks, with Linux not rerun on this head. I read the description, commit list, diff, manifest, review README, and the added lines of all 36 changed files (including the zero-addition files); all are marked included. I also read targeted source ranges inCollator.cpp,CollatorHost.cpp,BreakIterator.cpp,BreakIterator.hpp,CollatorHost.hpp,IcuData.cmake,IcuDataFilter.json,icu-host/CMakeLists.txt,Configuration.cpp,Data.cpp,BreakIterator.cpptests, andlibSceIcu/CMakeLists.txt.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not execute the reported checks, inspect every unchanged surrounding caller, or verify runtime behavior on a console. The author reports Windows tests and convention/debt checks passing on this head; Linux and macOS results are from an earlier head.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T09:10:18Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
8a415c8a36b4682acb47af2ecf956c198c9cebd8. No commands were run; the available reader exposes file searches and ranges only. The author reports Windows and other platform checks in the PR description; those were not run by me.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No changed files were available as full-text files in
review/files/; targeted repository ranges were read forcore/libs/prx/libSceIcu/Collator.cpp,core/libs/prx/libSceIcu/Configuration.cpp,core/libs/prx/libSceIcu/BreakIterator.cpp,core/libs/prx/libSceIcu/CollatorHost.cpp,cmake/IcuData.cmake,cmake/Icu.cmake, andcore/libs/prx/libSceIcu/CMakeLists.txt. The diff and description were read. The manifest lists 34 changed files and marks each included; the reader did not expose the separate excluded-file list, so excluded files are not verified. The full contents of other changed files, platform builds and tests, and console behavior were not verified.To get this to a good state
Nothing is required. Optional: run the project build and relevant ICU test selection on this head, including a negative control.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T09:14:28Z.
Review: COMMENTED
Actionable comments posted: 3
e93ce219-9591-4656-a5b2-56b080bb7ce6Reviewing files that changed from the base of the PR and between
0156867329and8a415c8a36..gitignoreCONTRIBUTING.mdcmake/Icu.cmakecmake/IcuData.cmakecmake/IcuDataFilter.jsoncmake/icu-host/CMakeLists.txtcore/libs/prx/libSceIcu/BreakIterator.cppcore/libs/prx/libSceIcu/BreakIterator.hppcore/libs/prx/libSceIcu/CMakeLists.txtcore/libs/prx/libSceIcu/Collator.cppcore/libs/prx/libSceIcu/CollatorHost.cppcore/libs/prx/libSceIcu/CollatorHost.hppcore/libs/prx/libSceIcu/Configuration.cppcore/libs/prx/libSceIcu/Export.cppcore/libs/prx/libSceIcu/RecoveredInventory.cppcore/libs/prx/libSceIcu/RecoveredInventory.hppcore/libs/prx/libSceIcu/RecoveredSignatures.hppcore/libs/prx/libSceIcu/include/InventoryExports.hppcore/libs/prx/libSceIcu/libSceIcu.hppcore/libs/prx/libSceIcu/tests/BreakIterator.cppcore/libs/prx/libSceIcu/tests/Collator.cppcore/libs/prx/libSceIcu/tests/CollatorAvailability.cppcore/libs/prx/libSceIcu/tests/Data.cppcore/libs/prx/libSceIcu/tests/LocaleTableFallback.cppcore/libs/prx/libSceIcu/tests/OpenStandardNames.cppcore/libs/prx/libSceIcu/tests/RightToLeft.cppcore/libs/prx/libSceIcu/tests/SupplementalRegion.cppcore/libs/tests/GuestIcuConverterAliases.cppdocs/dev/BUILD.mddocs/dev/debt/changes/feat-icu-open-available-by-type.mddocs/dev/debt/changes/feat-icu-ucnv-get-canonical-name.mddocs/dev/debt/changes/feat-icu-ucnv-open-all-names.mddocs/dev/debt/changes/feat-libsceicu-availability-exports.mddocs/dev/debt/changes/feat-libsceicu-data-break-iterator.mddocs/dev/debt/changes/feat-libsceicu-data-collator.mddocs/dev/debt/changes/feat-libsceicu-field-position-iterator.mddocs/dev/debt/changes/feat-libsceicu-ucol-available.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T09:47:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The prepared diff and targeted code inspected support the collator and bundled ICU data changes; I did not run checks on this head, so the review is incomplete for a formal approval.
What I ran
No build or tests were run. The author reports Windows checks on a merged preview and earlier Linux and macOS checks; those results were not independently verified here.
Results
Findings
Blocking
None identified in the code read.
Non-blocking
None.
Sources
Reviewed
review/description.md,review/commits.md,review/manifest.json, andreview/diff.patch; changed files read included.gitignore,CONTRIBUTING.md, ICU CMake and wrapper files,Configuration.cpp, and portions of the collator and break iterator tests. The manifest lists all changed files as included. The broader changed-file set and several test and documentation changes were not read in full.Not verified
The build, test suite, negative control, and author-reported Windows/Linux/macOS results were not run or independently confirmed. The review did not inspect every changed file, so the evidence is insufficient for approval.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:09:03Z.
Review: COMMENTED
Built the change and its ICU data through the project on Linux. Both selected CTest cases passed, covering collator availability with the bundled data and its data-only configuration.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.