feat(libSceIcu): implement u_getVersion and u_errorName #11115
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11115"
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 mantavisual on 2026-10-25T18:31:59Z.
What
Implements
u_getVersionandu_errorName, twolibSceIcuexports that firmware 13.42's module still has. Per BunnyFl's export list, both are among its 299 exports and in the 3.20 table.u_getVersionwrites{78, 1, 0, 0}, as ICU 78.1's putil.cpp does by parsingU_ICU_VERSION("78.1") withu_versionFromString. That matches the 78.1.0.0 BunnyFl measured on 13.42. A null array does nothing, as inu_versionFromString. It reuses #11013'su_versionFromString.u_errorNamereturns the names in ICU 78.1's utypes.cpp: eight tables starting at -128, 0, 0x10000, 0x10100, 0x10200, 0x10300, 0x10400 and 0x10500, 156 codes in all. Every other code gets[BOGUS UErrorCode]. The tables were generated from that file, and I checked every name against theUErrorCodevalue in 78.1'sutypes.h. All tables are full, so there are no null entries. ICU'sU_BRK_VARIABLE_REDFINITIONspelling is kept. The strings are static, so repeated calls return the same pointer.Both report ICU 78.1 whatever firmware is emulated. The 3.20 module was ICU 65–68 and has no names for codes added since (the
U_MF_*codes, for example). The newdocs/dev/debt/libSceIcu.mdentry records that, and that only the version was measured on the console.Depends on #11088, which is stacked on #11013, because all three add to the new
CMakeLists.txt,libSceIcu.hppand debt file. Until those merge, this diff also shows their commits. This PR's own change is the last commit,eb607ba588. The agreed ICU order is #11013 → #10961 → … → #10967 → #11088, and this PR comes right after #11088.Tested
Windows 11 Pro 23H2, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, on #11088 (a43b228a4a).guest_icu_error_name:U_BRK_VARIABLE_REDFINITIONat 0x10206.INT32_MINandINT32_MAX.U_-prefixed names, none null, each a stable pointer.guest_icu_versionnow also checks thatu_getVersiongives 78.1.0.0 ("78.1"throughu_versionToString), and that a null array is accepted.ctest -R "guest_icu_|patched_libraries": all 4 pass. The NID-patchedlibSceIcu.prxhas 31 NID exports, includingiRm8tkU1ir4(u_getVersion) andcY8dSl6Rqr4(u_errorName).tools/progress.py --module libSceIcu: 31 implemented, 0 stubs.tools/check_test_registration.py build: 1343 test executables, none built and not run.python3 tools/check_conventions.py --base origin/mainpasses. Overlap: no open PR implements either function (checked 2026-10-25). #10961, #10963 and #10966 citeu_getVersion's measurement in their debt text only.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T18:40:08Z.
Review: APPROVED
Reviewed exact head
eb607ba588. I compared all eightu_errorNamename tables against the pinned ICU 78.1utypes.cpp; every entry and range matches, including the standard, transliterator, format, break, regex, IDNA, plugin, and warning ranges. I independently built and ranGuestIcuErrorNamewith GCC 12.2; it passed the boundary and complete-range checks. The ICU source also confirmsu_getVersiondelegates tou_versionFromStringwithU_ICU_VERSION, and the submitted version helper follows the same parsing/formatting algorithm. The PR reports all four focused ICU tests passing and hosted conventions/intake checks are green; the full hosted product jobs are skipped. Its declared dependency on #11088 is appropriate for the shared ICU helpers.Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T18:47:28Z.
Review: APPROVED
Reviewed exact last-commit delta
eb607ba588901b81824e28011a213137757c7637overa43b228a4ac1ce6316037802a613b8e40851c35c(#11088). Approve; no actionable findings in the two new exports, their declarations/registration/tests or their new debt entry.The eight ranges and all156 names match ICU78.1, including the historical
U_BRK_VARIABLE_REDFINITIONspelling and all holes returning[BOGUS UErrorCode]. The subtraction is widened to64 bits before indexing, so the signed32-bit endpoints do not overflow.u_getVersiondelegates to the existing parser with the fixed78.1 string, matching upstream putil.cpp. The documented choice to report78.1 on older firmware remains explicit.Independent Windows11 build26200 / GCC16.2.0-6 UCRT / CMake4.3.1 / Ninja1.13.2:
utypes.cppwith its pinned public headers as a separate native reference. Source/header manifest:13 files from tag commit049e0d6a420629ac7db77256987d083a563287b5. Only the reference symbol name/static-build macros are changed; no reference table or function body is reconstructed from the PR.-fno-strict-enumspermits the intended invalid-code ABI probes.ErrorName.cpp: every integer in[-0x400,0x10800),100,000 deterministic arbitrary signed32-bit values, and INT32_MIN/MAX. Zero name mismatches, nulls or unstable pointers; exactly156 named codes and156 distinct names in the continuous range. Each production result is called twice to check pointer stability:337,220 production calls and168,610 reference calls in this additional probe.GuestIcuErrorName.cppfixture unchanged. It passes, including table boundaries, unknown gaps/extremes and its own continuous sweep.Version.cpp/Invariant.cpp: 61 guarded buffer offsets plus a null-pointer call, all pass. Each populated buffer contains exactly78.1.0.0 in the four destination bytes and preserves every guard byte. This version harness supplies a host-strtoulladapter for the existing guest-strtoulboundary; it validates the new fixed-literal call and writes, not general guest-libc integer parsing or the complete parent version fixture.a7a2eece499ef8925c93765dbbcc9f4d9461a2f0and whitespace checks pass; author checkout is clean.The new commit is directly on the current #11088 head, and the authors have recorded #11088 after #10967, followed by this PR. This approval covers the new commit's delta; it does not certify a future rebase/composition of every ICU topic or independently repeat the parent's numeric tests, full patched shared-library/NID checks, Linux/macOS or hosted product jobs. The linked firmware78.1 version observation was obtained from the firmware module in an emulator; I did not perform a retail-console measurement or compare error names on a console.
AI-assisted review and native comparison; all local runs stated above actually executed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:45:04Z.
Review: APPROVED
Re-reviewed exact head
795a7c4ac79be762952d7bf4ca0c838c700a8337after the main merge. The current-main merge preview is clean and its effective change is the previously reviewed ICU implementation/tests plus the resolved CMake/debt conflicts; the author reports no other code changes. The exact-head Windows workflow, conventions and report checks pass; Linux/product jobs are skipped. I did not rerun the ICU CTest targets locally, so this update relies on the earlier source review and the author’s merge-only description.