feat(libSceIcu): implement the character name exports over ICU data #18208
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18208"
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 rocklouis055 on 2026-11-10T21:05:09Z.
What
Implements the five libSceIcu character-name exports by forwarding them to ICU 78.1. It adds
"unames": "include"tocmake/IcuDataFilter.jsonso thatunames.icu(334 KiB) is built into the ICU data. This PR is stacked on #16971; the branch merges #16971's current head (ec69fdad70), and the PR's own changes areb043cabaf5ande621f727dc. #13578 lists these exports as blocked onunames.icu; the slice was claimed in discussion #11150.u_charName<control-0000>) and alias names, including the algorithmic CJK and Hangul names; preflighting and the usual termination resultsu_charFromName0xFFFFandU_ILLEGAL_CHAR_FOUNDu_enumCharNamesUEnumCharNamesFnthrough a host trampoline and stops when it returns falseuprv_getMaxCharNameLengthuprv_getCharNameCharactersUSetAdder'saddthrough a trampoline, with the guest's ownsetpointernameChoice >= U_CHAR_NAME_CHOICE_COUNT, which lets a negative choice through when the enum is signed. The wrapper maps negative choices toU_ILLEGAL_ARGUMENT_ERRORon every compiler. The mutation check shows the clamp matters on Linux too: without it,-1aborts the test.U_ILLEGAL_ARGUMENT_ERRORfor bad buffers, null names and a null callback, so these are forwarded rather than thrown. A nullUErrorCodeand a null adder throwstd::invalid_argument.Export.cpp/Identified.hppandLegacyExports.cpp/.hpp. One debt entry is added next to the ISO comment entry.Tested
Linux (GCC, Release):
guest_icu_character_namestest passes. Its expected values come from UnicodeData and NameAliases:LATIN CAPITAL LETTER A, U+1F600, U+4E00 and U+AC01 (algorithmic),<control-0000>and<private use area-E000>, the U+01A2 alias, and the empty Unicode 1.0 name. It also covers overflow, exact-fit and preflight results, bad choices, null buffers, reverse lookup of each kind, enumeration with early stop and an empty range, the 83-character U+FBF9 name againstuprv_getMaxCharNameLength, and the name character set.guest_icu_*tests pass.-fsyntax-onlywith zigx86_64-windows-gnufor both new files.CharacterNames.cppall make the test fail: no negative clamp, ignoring the visitor's stop result, the wrong choice passed to the visitor, a null visitor forwarded, the wrong set pointer passed toadd, no null-adder check, and a fixed maximum length.Merge notes: the stub removals are next to stubs that #16605 (
Identified.hpp) and #14340/#14443 (LegacyExports) also touch, so each needs a one-line resolution. Nothing else conflicts with an open PR, including #18203.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-10T21:16:35Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The
guest_icu_break_allocatorassertion can miss a large caller-text copy made through the test allocator'srealloccallback.What I ran
PR #18208 head
b043cabaf5f97b88ebbdcbc1033a9a59f67ce6c9; based66e6aac01bdf52b7a0a97b255a4110e2efe03a3. The dependency/merge preview is not clean: #16971 and #18208 conflict with currentmain; the declared stack is #13578 → #16971 → #18208.Environment: Linux x86_64, Debian glibc 2.36; Python 3.11.2; GCC 12.2.0; Git 2.39.5.
I read all 33 changed files at this head, split across build integration, exports/implementation, and tests/debt. I ran the exact-head no-build precheck and read the live GitHub checks:
Results
Precheck output and mergeability evidence
The stack report records:
#13578 → #16971 → #18208; #13578 merges cleanly, while #16971 and #18208 conflict against based66e6aac01bdf52b7a0a97b255a4110e2efe03a3. The declared #16971 head is included in #18208; the current #13578 head is not included in #16971.The precheck also reported
All conventions checks passed.andgit diff --checkproduced no output.Negative control
I did not run local tests or mutation controls. The PR description reports seven character-name mutants detected by
guest_icu_character_names; I did not independently reproduce that result, and it does not exercise the allocator assertion below.Findings
Blocking
In
Data.cpp,Reallocateupdateslargestonly when it delegates toAllocatefor a null pointer. A non-null pointer can be grown to at least the 200,000-byte caller-text size without updatinglargest, so the assertion at line 84 can pass even if ICU copies the input throughrealloc. Track the requested size on every reallocation so this test detects the behavior it claims to rule out.Non-blocking
UnicodeData.cpprecords a badstartvalue but then uses it as a vector index. Ifu_enumCharTypessupplies a negative start, the test can invoke undefined behavior instead of reporting the mismatch. Validate the range and return before indexing.The merge conflict is in the declared stack: #16971 currently conflicts with
main, and #18208 includes that dependency head. Defer stack updates until #16971 is resolved; the current mergeability result does not establish a separate conflict in this PR's final change.Sources
Data.cppallocator callback and large-buffer assertionUnicodeData.cpprange callbackNot verified
guest_icu_break_allocatororguest_icu_unicode_data; the ICU submodule is not populated in this checkout. The author-reported Linux test results were not independently reproduced.To get this to a good state
Update the allocator's size accounting and guard invalid enumeration ranges. Then run
guest_icu_break_allocatorandguest_icu_unicode_dataon the new head. Resolve the declared stack after #16971 is updated; I will re-check the same source checks and current mergeability on the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T03:03:22Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the remaining verification limits are listed below.
What I ran
Reviewed head
b3753a44eb71c84c94f368336e04195360585ce3against the prepared diff. I read the PR description, commit list, diff, manifest, and the full text ofCharacterNames.cpp,Configuration.cpp,Data.cpp,BreakIterator.cpp, and the libSceIcu CMake file, plus targeted export and macro context. I did not run commands or tests;repo_read.pywas available only through reader tools.Results
Negative control
Not run; no local test runner was available.
Findings
Blocking
None found in the inspected implementation.
Non-blocking
None.
Sources
Behavior claims are based on the prepared diff and the pinned-head source read through
repo_read.py.Not verified
I did not read every changed file or run the reported Linux, Windows, or mutation checks. The manifest marks all changed files as included; the directly inspected changed files were
core/libs/prx/libSceIcu/CharacterNames.cpp,core/libs/prx/libSceIcu/Configuration.cpp,core/libs/prx/libSceIcu/Data.cpp,core/libs/prx/libSceIcu/BreakIterator.cpp, andcore/libs/prx/libSceIcu/CMakeLists.txt. Remaining changed-file contents were not read. Console ABI and data parity remain author-documented as unverified.To get this to a good state
Nothing is required. Optional: independently run the reported test suite and verify behavior on console hardware.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T07:22:13Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected code blocks merge; native data build integration and character name forwarding appear consistent with the stated goal.
What I ran
Reviewed head
52ca84cc4ffd486343bac8d25076458ed4fef246using the prepared diff and pinned repository readerrepo_read.py. No build or tests were run by this review.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Not verified
I read the review description, commits, manifest, the full prepared diff, and the changed source
CharacterNames.cppandCharacterNames.hpp, plus its character names test content in the diff. The manifest lists 23 changed files, all included in the prepared bundle; I did not read every changed file's full text or all touched functions. Build integration, break iterator and data registration behavior, platform builds, and console ABI/behavior remain unverified. Linux tests and Windows syntax-only checks in the description are author reported, not run in this review.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T13:25:02Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the implementation and tests support merging based on the source reviewed.
What I ran
Read the prepared diff and changed-line manifest for head
15291e5df43f1584438738e39d8b9bf62dc530ausingrepo_read.py. No tests were run. I read the description, commits, README, manifest, and diff; targeted source reading was incomplete.Results
Findings
Blocking
None identified in the portions reviewed.
Non-blocking
None.
Not verified
The review bundle lists 24 changed files. I did not read every changed line or verify all behavior claims, build configuration, or author-reported test results. In particular, source context beyond the prepared diff was not inspected, so this is not a complete review.
To get this to a good state
Complete the changed-line review and run the relevant checks before treating this as a full approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T09:43:58Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: preserve ICU’s status handling in
udata_setFileAccess.What I ran
Reviewed head
7d20a40afb53a9d541b87c592f9789c148e710ec. I read the prepared description, commit list, manifest, diff, and targeted source files throughrepo_read.py. I did not run build or test commands.Results
Findings
Blocking
core/libs/prx/libSceIcu/Data.cpp:19-20discards the caller’sUErrorCode*and always callsudata_setFileAccess_78with a null status. This bypasses ICU’s failed-input behavior and prevents the wrapper from returning ICU’s status for invalid access values. Forward the guest status through a localUErrorCode, then copy it back, following theudata_setCommonDatawrapper.Non-blocking
None.
Not verified
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,core/libs/prx/libSceIcu/CharacterNames.cpp,core/libs/prx/libSceIcu/CharacterNames.hpp,core/libs/prx/libSceIcu/tests/CharacterNames.cpp,core/libs/prx/libSceIcu/Configuration.cpp,core/libs/prx/libSceIcu/Configuration.hpp,core/libs/prx/libSceIcu/Data.cpp,core/libs/prx/libSceIcu/Data.hpp,core/libs/prx/libSceIcu/libSceIcu.hpp,core/libs/prx/libSceIcu/tests/Data.cpp, andcmake/IcuData.cmake.To get this to a good state
Forward and preserve the status value in
udata_setFileAccess, add coverage for an incoming failure and an invalid access value, then rerun the affected tests on the updated head.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:26:27Z.
Review: COMMENTED
I compiled and ran the branch's standalone
CharacterNamesfixture on Linux with the pinned ICU 78.1 library and itsunames.icudata. The name lookup, enumeration, early stop and set callback cases passed. The existing ICU package neededunames.icuadded for this standalone run, matching the branch's filter. Could the refreshed integrated test also verify the package built by CMake provides that data without a separate registration step?Source review at
7d20a40afb. The trial merge conflicts in the ICU CMake and export files.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.