feat(libSceIcu): implement 481 data-free ICU 68 exports #14144
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14144"
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 PrivacyOnion on 2026-10-31T20:50:32Z.
What
Implements 481 libSceIcu exports that need no ICU data, as reimplementations of ICU 68.2 (the 3.20 module is ICU 68: its C++ names are in
icu_68). Builds on #14016, which gives these NIDs their ICU 68 names; this PR only replaces those stubs.UnicodeString(construction, copy/alias/reference-counted buffer, mutation, comparison, search, UTF conversion, unescape, hashing),UnicodeStringAppendable,Appendable,Replaceable,UMemory,UObjectCharString,StringPiece,MaybeStackArray<char,40>,ByteSink,CheckedArrayByteSink,PatternProps,ICU_UtilityUVector,UStack,UVector32,EditsBytesTrie,UCharsTrie,CharacterIterator,UCharCharacterIteratoruhash_*,ustr_hash*uprv_*platform helpers (sorting, binary search, invariant/EBCDIC conversion, comparators, UTC time)utext_*core access,ucptrie_*,ucpmap_*,umutablecptrie_*,utrie2_*ulist_*,uenum_*string enumerations,utrace_*,ucln_*,u_terminateUChars/WChars,u_uastrcpy/u_uastrncpy,u_asciiToUpperThe new sources were written from the ICU 68.2 sources function by function to reproduce their behaviour, so each new implementation file carries ICU's notice (
© 2016 and later: Unicode, Inc. and others, http://www.unicode.org/copyright.html).Layouts follow ICU 68.2 for LP64 and are pinned with
static_assert(UHashtable,UText,UCPTrie,UTrie2,UnicodeStringwith its 27-unit stack buffer and the reference count before heap buffers,UVector,Editsand its iterator, the tries, the character iterators). Classes with virtual functions get static tables ofAPS5_VABIfunctions in ICU 68.2's slot order. The 3.20 inventory has no_ZTV/_ZTIexports for ICU classes, so no new exports are added for them. Guest callbacks (hash, comparators, deleters, UText providers, trace, sort) areAPS5_VABIfunction pointers. Path helpers follow the console's POSIX build (/separator).Still throwing
NotImplemented_nid_no_patchand recorded indocs/dev/debt/libSceIcu.md:uprv_malloc/uprv_free,u_setMemoryFunctions), so internal storage uses the host allocator;utext_openUTF8, the swappers,umutablecptrie_buildImmutableandutrie2_enum;The property and case exports of #13578 and #12320 are left untouched.
Tested
Windows 11, MinGW GCC 13.1. No title run.
core/libs/prx/libSceIcu/tests, 25 of them new, built with the library sources on the host ABI. All exit 0. Expected values come from the ICU 68.2 sources.icu4c/source/commonfiles of release-68-2 plusstubdatainto a host static library. Each implemented export was called with the same inputs as its ICU 68.2 counterpart: edge cases plus at least 1000 random inputs per function, and random operation sequences for classes. Every return value, output buffer andUErrorCodewas compared. All 481 match, exceptCharString::getDirSepCharandensureEndsWithFileSeparator, which differ only because the host ICU is a Windows build (\); the console's is/. These harnesses link the ICU sources, so they are not committed; I can attach them.UnicodeString,UVector,UVector32,Edits,Edits::Iterator,BytesTrie,UCharsTrieandUCharCharacterIteratorwith these mirrors. They also compare each virtual slot ofUnicodeStringandUCharCharacterIterator, taken from ICU's pointers-to-member, with the tables here: 0 mismatches.APS5_VABI(sysv_abi) and the CI flags. The guest build and CTest run are left to CI (WinLibs 15.2 absent).python3 tools/check_conventions.py --base upstream/mainandpython3 core/libs/tests/test_public_headers.py --audit-onlypass.tools/pr_overlap.pyreports no shared exports. #14123 (theres_*readers) touches the same include line inlibSceIcu.hpp; this PR goes second and rebases onto it.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)libSceIcu.hpp, and this PR rebases onto it)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T03:25:30Z.
Review: APPROVED
Reviewed — looks good
The exact head has a clean current-main merge preview, registered regression tests, and successful hosted Windows build-and-test coverage; I found no blocking issue.
What I ran
Reviewed head
0d38ce1042cccdbe42d7b26ae298e4acb802c771. The PR's recorded base is9fe758d7520eb0c33f3df8bef539064b40bd523f; currentmainisdac05a44444afbb7bf16ecd9e7d01bee6d934d25, and the PR preview merges cleanly. Environment: Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. I did not build locally.Results
mainCompareIter.cpp,Resource.cpp,Space.cpp, andUnescape.cpp; I checked the PR's CMake file and all four are explicitly included in production/test targetsUnedited local output
Negative control
Findings
Blocking
None found.
Non-blocking
Linux product tests and console behavior were not verified. The exact-head hosted Windows job built and ran the changed guest library tests.
Sources
Not verified
No local C++ build/CTest, Linux product test, console execution, or independent ICU differential run was performed. The author's local differential results are reported in the PR description.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T03:51:36Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
I previously approved this exact head, but that review missed the repository's required author-agreed merge order for the two disclosed open PR overlaps.
What I ran
Rechecked head
0d38ce1042cccdbe42d7b26ae298e4acb802c771against PR base9fe758d7520eb0c33f3df8bef539064b40bd523f. The fresh merge preview against currentmain4a58bc29ad656ad7a54c1733b3b683e68b7ccf85was clean. I did not build or rerun tests; the previously reported checks are for this unchanged head.Results
0d38ce1042cccdbe42d7b26ae298e4acb802c771.4a58bc29ad656ad7a54c1733b3b683e68b7ccf85; the tool found only the declared #14016 dependency.Depends on: none.Findings
Blocking: The repository says authors of overlapping PRs must agree which goes first and declare the order with
Depends on. This PR's overlap section says the shared-header overlap with #14123 exists and that #14050 requires whichever lands second to rebase; both remain open, but this PR records no agreed order and its checklist saysDepends on: none. Please coordinate the order with the affected authors and update the checklist. The clean independent merge previews show the current branches merge separately; they do not record the required order.Non-blocking: I found no new code or test issue in this follow-up. My prior approval was premature because I missed the ordering requirement; this review corrects it.
Sources
Not verified
I did not rerun builds or tests, and Linux product tests remain unverified. The earlier exact-head Windows job and other completed CI results are summarized above; no new test result is claimed.
To get this to a good state
Record the agreed landing order for the still-open overlaps with #14123 and #14050 in the checklist (or document why a reported overlap does not require ordering). I will recheck the same heads and ordering after the update.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:10:44Z.
Review: APPROVED
Reviewed — looks good
The outstanding landing-order point is resolved: the #14123 author explicitly agreed that #14123 lands first and #14144 rebases afterward, and #14144 records that dependency.
What I ran
This follow-up checks the reviewed head
919905beb491a418e946e79f4298cc988fb4d15bagainst PR base3e29acc3805f15e19a0c8f55eedb0c93e92f2f90; its earlier preview on currentmainwas clean at5c9837bfe7c5533f2c77c968dd8193157a8c342a. Environment: Debian GNU/Linux 12; this follow-up used GitHub CLI/API queries only, with no compiler or local build. I did not rerun the code checks because the head is unchanged from the previous review.Results
Raw agreement and check output
Negative control
Findings
Blocking
None. The sole outstanding review condition, confirmation of the overlap order, is resolved.
Non-blocking
The hosted Linux and specialized jobs remain skipped; console behavior and ABI were not independently verified in this follow-up.
Sources
Not verified
No local compilation, CTest, Linux product build, specialized CI job, console run, or GPU behavior was verified in this follow-up. The differential and layout harness results in the PR description are author-reported; I did not rerun them.
To get this to a good state
No further action is needed for the reviewed head. If the PR head changes, I will rerun the same relevant checks against the new head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:35:07Z.
Review: APPROVED
Reviewed — looks good
The landing-order concern is resolved: the #14123 author agreed it lands first, and #14144 now records that order; my later changes-requested review missed that confirmation. I rechecked unchanged head
919905beb491a418e946e79f4298cc988fb4d15bagainst PR base3e29acc3805f15e19a0c8f55eedb0c93e92f2f90; GitHub reports the PR cleanly mergeable. Hosted Windows, conventions, labels, eligibility, library-portability and report checks pass; Linux and specialized jobs are skipped. I did not rerun local tests because the code head is unchanged from the previous detailed review. #14123 author’s order confirmationImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:35:58Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The new head addresses the test, provenance, and harness feedback, but I am withholding approval until the shared-file landing order is confirmed with #14123’s author as required by the repository rules.
What I ran
Reviewed exact head
919905beb491a418e946e79f4298cc988fb4d15bagainst the PR base3e29acc3805f15e19a0c8f55eedb0c93e92f2f90; the merge preview against currentmain5c9837bfe7c5533f2c77c968dd8193157a8c342awas clean. Environment: Debian 12, Python 3.11.2; no compiler was invoked.Results
CMakeLists.txt; this checks registration only, not test execution.5c9837bfe7c5533f2c77c968dd8193157a8c342a; the stack tool confirms the declared #14016 branch dependency.tools/pr_abi_audit.pyandtools/pr_test_quality.pyhelpers. The checker reports conventions and diff checks passed; its overall failure is a workspace-tool availability issue, not a PR failure.Unedited selected command output
python3 core/libs/tests/test_public_headers.py --audit-only:Test registration inspection:
gh pr checks 14144 -R boykopovar/AnyPS5:Precheck command output:
Negative control
Findings
Blocking: The checklist now says #14144 lands after #14123, and the author notified #14123’s author, but I found no acknowledgement or other evidence that the two authors agreed on that order. The repository requires authors of overlapping PRs to agree which lands first and declare it with
Depends on. Please confirm that coordination in either PR before merging; no code change is requested for this point.Non-blocking: The two assertions that treated
NotImplemented_nid_no_patchbehavior as permanent were removed, the ICU copyright notice was added to the new implementation sources and headers, and the differential/layout harnesses and logs are now linked. I found no new issue in this update.Sources
Not verified
I did not compile or run the C++ tests or harnesses locally. Linux product CI was skipped. Console behavior and console ABI were not independently verified. The author-reported differential results are not my local test results.
To get this to a good state
Confirm the landing order with #14123’s author and record the agreement in the discussion. I will recheck the same relevant commands and current heads after that confirmation.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:37:01Z.
Review: APPROVED
Reviewed — looks good
The required landing order is confirmed by #14123’s author and recorded on #14144; my later changes-requested review missed that existing confirmation.
What I ran
Rechecked open PR #14144 at head
919905beb491a418e946e79f4298cc988fb4d15bagainst base3e29acc3805f15e19a0c8f55eedb0c93e92f2f90, checked its latest review and order confirmation, and queried hosted CI. The PR remains mergeable. I did not rerun local tests or builds because the code head is unchanged from the previous detailed review.Results
Sources
Not verified
No local compilation, CTest, Linux product test, specialized job, console run, or GPU behavior was verified in this follow-up.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-11-01T15:08:06Z.
Review: APPROVED
Reviewed
919905beb491a418e946e79f4298cc988fb4d15b, including its increment over #14016. No actionable issue found in the reviewed data-free ICU implementation paths.Windows/MSYS2 GCC 16.2 Release: built the shared library with its submitted test registration and passed all 33 supplied ICU suites in an isolated DLL-linked harness. An independent seeded model check also passes 5,000 UnicodeString replacement/copy-on-write rounds and 10,000 integer-vector insertion/removal rounds. Hosted Windows reports 2,604/2,604 selected tests passing. Whitespace and conventions pass.
The harness substitutes minimal libc support. This does not verify every ICU export against an official binary, all allocation-failure paths, console layouts, or title behavior. Preserve the declared order: #14016 first, and coordinate/rebase after #14123.
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:49:26Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-11-08T20:53:07Z.
Review: APPROVED
Rebuilt this head’s ICU DLL with WinLibs GCC 15.2 on Windows in an isolated harness linked to the existing AnyPS5 libc and libkernel DLLs. All 52 tests passed: 51 registered ICU tests plus the independent seeded check covering 5,000 UnicodeString mutation/copy-on-write rounds and 10,000 UVector rounds. The tokenizer test exercised read-only guest pages. I checked the supplementary-delimiter continuation against ICU 68.2, including its one-code-unit advance. Hosted Windows also passed all 51 ICU tests. The declared ordering behind #14123 still applies. Hosted Windows · ICU 68.2 tokenizer.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T05:24:15Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected portions establishes a concrete defect; this review is incomplete because none of the changed source files could be read at the pinned head.
What I ran
Head:
68df1c37203cef49926950723fce151cf43c867b. I read the prepared description, commit list, diff excerpts and review folder README. No build or tests were run. The README says changed files are available underfiles/, but that directory returned no files; attempts to read repository files through the reader also returned no source lines.Results
Findings
Blocking
None verified from the available excerpts.
Non-blocking
None.
Not verified
The change adds implementations across 58 changed files, including
CodePointTrie.cpp,UnicodeString.cpp,Edits.cpp,Hash.cpp, and 25 test files. Their full changed text could not be read, so correctness, ABI behavior, test coverage and the stated test results are not independently verified. The review folder's README and the manifest file inventory were read; no changed files fromfiles/were available to read.files.jsonwas unavailable through the reader.To get this to a good state
Provide the changed-file text through the pinned reader so the implementation can be reviewed before a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T11:21:14Z.
Review: COMMENTED
Reviewed — comments
The changes implement a broad set of ICU exports, but I reviewed only a small sample of the changed source, so a formal merge decision is not justified.
What I ran
Read the prepared diff and source excerpts at head
ca68afd50f6fe11ce9bc719748af5d943382056fusing the review reader. No build or tests were run.Results
Findings
Blocking
None identified in the excerpts reviewed.
Non-blocking
None.
Not verified
The review bundle lists 75 changed files; only the description, commits, manifest, diff excerpt, README, and the first 100 lines of
UnicodeString.cpp,Edits.cpp,Trie2.cpp,Hash.cpp, andCMakeLists.txtwere read. The other changed lines and remaining files were not reviewed, including test files.files.jsonwas not available through the reader. The author's reported tests were not run or independently verified.To get this to a good state
Complete review of all changed lines and run the relevant checks before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T13:48:18Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fix
utext_getNativeIndexat the native end of a chunk.What I ran
Reviewed prepared diff at head
587b7a654ca612db48c34fa26b1835e50fc69f06; no commands or tests were run. The author reports host tests and differential checks indescription.md, but those were not run as part of this review.Results
Findings
Blocking
core/libs/prx/libSceIcu/Text.cpp:8822:utext_getNativeIndextakes the direct-offset path whenchunkOffset <= nativeIndexingLimit. At equality, it adds the offset tochunkNativeStart; for an index at the chunk’s native end, that can return an index from the previous chunk instead of invokingmapOffsetToNative. Use the direct path only when the offset is strictly below the limit, and cover the end boundary with a provider whose native and UTF-16 indices differ.Non-blocking
None.
Not verified
The manifest marks changed files as included, but only targeted portions of
diff.patchwere inspected; the full text of every changed file was not read.files.jsonwas not available through the reader. Build, CI, guest ABI execution, and console behavior were not verified. Author-reported checks are not independent results.To get this to a good state
Fix the
utext_getNativeIndexchunk-end boundary and rerun the relevant UText tests and build on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T07:44:12Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fix the buffer bounds handling in
uprv_itou_nid_postfix.What I ran
Reviewed head
bf48caf991073f75d836dd495ea7edd20ee2281cusing the pinnedrepo_read.pyreader. No build or tests were run.Results
Findings
Blocking
core/libs/prx/libSceIcu/PlatformUtil.cpp:8189:uprv_itou_nid_postfixwrites a digit before checkingcapacity. For example,capacity == 0still writesbuffer[0]; a positiveminimumWidthcan also make the padding loop write beyond capacity (PlatformUtil.cpp:8192). Bound all writes by the available capacity and define the expected failure/truncation behavior.Non-blocking
None.
Not verified
No build, repository tests, guest ABI compile, or console run was performed. The author reports host tests and differential checks, but those results were not independently run here. All changed files were included in the review folder; the review was targeted rather than a read of every changed line. The excluded-file list was not provided as a separate artifact.
To get this to a good state
Fix the capacity handling in
uprv_itou_nid_postfix, then rerun the relevant formatting tests, including capacity zero andminimumWidthgreater than capacity.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:49:53Z.
Review: COMMENTED
The trial merge onto
c1601e56d5conflicts in the ICU CMake and export inventories andStringPiecesource/tests. Please keep explicit ABI checks for UnicodeString ownership modes and caller-supplied ByteSink/iterator vtables when resolving it. These verify behavior across the guest boundary separately from the low-level algorithms. This is the base of #14340, so it is important to rerun the 481-export layer first on the resolved head before attributing failures to the service and set additions.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.