feat(libSceIcu): give 70 recovered exports their ICU 68.2 signatures and early returns #17265

Merged
MarrasFederico merged 4 commits from upstream-pr/17265 into main 2026-11-12 17:06:27 +00:00
MarrasFederico commented 2026-11-08 16:31:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-11-08T16:31:45Z.


What

This replaces the single-function series #17160 to #17215, as asked in this comment, with one change. It also folds in 20 functions from the same series that were never opened separately. The series PRs will be closed in favour of this one.

70 exports that were parameterless placeholders get their ICU 68.2 signatures: 68 from RecoveredInventory.cpp, plus ures_close and utext_close from Export.cpp. Each implements only the paths that the pinned ICU 68.2 source decides before it touches an object:

  • close functions return for a null handle;
  • other functions return early on a failing UErrorCode (above zero) with the status untouched, while warnings still reach the argument checks that come before any object use.

Everything else still throws NotImplemented_nid_no_patch: non-null handles, a null UErrorCode, and anything that needs a real object, locale data or an allocation. No title behaves differently yet.

Layout, so later work only appends:

  • one source file per ICU C header and one RecoveredSignatures.hpp, included once from libSceIcu.hpp;
  • one test executable guest_icu_recovered_signatures, with one test file per header and shared checks in tests/RecoveredSignatureChecks.hpp;
  • one CMake block, whose source and test lists are the variables ICU_RECOVERED_SOURCES and ICU_RECOVERED_TESTS;
  • one technical-debt entry per header, linking the pinned line ranges. The recovered inventory count drops from 117 (main) to 49, and additional callable exports from 56 (main) to 54.
File Functions
Calendar.cpp ucal_clone, ucal_close, ucal_get, ucal_getCanonicalTimeZoneID, ucal_getDefaultTimeZone, ucal_getKeywordValuesForLocale, ucal_getTimeZoneDisplayName, ucal_open, ucal_setGregorianChange, ucal_setMillis
Collator.cpp ucol_close, ucol_getAttribute, ucol_getReorderCodes, ucol_getTailoredSet, ucol_open, ucol_setAttribute
DateFormat.cpp udat_close, udat_format, udat_formatForFields, udat_getSymbols, udat_open, udat_toPattern
DateTimePatternGenerator.cpp udatpg_close, udatpg_getBestPattern, udatpg_getBestPatternWithOptions, udatpg_getFieldDisplayName, udatpg_getSkeleton, udatpg_open
DateIntervalFormat.cpp udtitvfmt_close, udtitvfmt_closeResult, udtitvfmt_formatCalendarToResult, udtitvfmt_formatToResult, udtitvfmt_open, udtitvfmt_openResult
FieldPositionIterator.cpp ufieldpositer_close, ufieldpositer_open
FormattedValue.cpp ufmtval_getString, ufmtval_nextPosition
Idna.cpp uidna_close, uidna_nameToASCII, uidna_nameToUnicode, uidna_openUTS46
LocaleDisplayNames.cpp uldn_close, uldn_openForContext
ListFormatter.cpp ulistfmt_close, ulistfmt_closeResult, ulistfmt_format, ulistfmt_formatStringsToResult, ulistfmt_openForType, ulistfmt_openResult
NumberFormat.cpp unum_clone, unum_close, unum_formatDecimal, unum_formatDouble, unum_getSymbol, unum_open
NumberFormatter.cpp unumf_close, unumf_closeResult, unumf_openResult
NumberingSystem.cpp unumsys_close, unumsys_open, unumsys_openByName
PluralRules.cpp uplrules_close, uplrules_openForType
RelativeDateTimeFormatter.cpp ureldatefmt_close, ureldatefmt_format, ureldatefmt_open
ResourceBundle.cpp ures_close
StringSearch.cpp usearch_open
UText.cpp utext_close

Reviewer points addressed (oneandonlydean):

  1. Merge main and drop exports main already has:
    • Merged upstream/main onto the published head a888ff804c with two normal merge commits, both titled chore: merge upstream main: 691294ad38 (main 919e4ee48a) and d475e2338c (main e894ec3383, current at the time of writing). No rebase, no force push.
    • Verified whether upstream/main had implemented any of the 70 exports: scanned all 70 functions with grep across the whole libSceIcu codebase. Main implements none of these 70 functions (68 remained stubs in RecoveredInventory.cpp, and 2 in Export.cpp).
    • Cleanly preserved all additions from main (Bidi.cpp, CharsetDetection.cpp, Normalization.cpp, CodePoints.cpp, LocaleCore.cpp, LocaleMap.cpp, LanguageTag.cpp, Properties.cpp, CaseMapping.cpp, etc.).
    • Verified that every single one of the 70 functions has exactly 1 definition in libSceIcu, exactly 1 declaration, and 0 duplicate symbols.
  2. Technical debt counts recalculated from resultant code:
    • core/libs/prx/libSceIcu/RecoveredInventory.cpp: 117 stubs on main -> 49 stubs (grep -c "NotImplemented_nid_no_patch" core/libs/prx/libSceIcu/RecoveredInventory.cpp = 49).
    • core/libs/prx/libSceIcu/Export.cpp: 56 remaining throwing functions in Additional callable exports on main -> 54 (ures_close and utext_close removed). Total NotImplemented_nid_no_patch in Export.cpp: 82 on main -> 80 in branch (grep -c "NotImplemented_nid_no_patch" core/libs/prx/libSceIcu/Export.cpp = 80).
    • 18 new technical debt entries integrated into docs/dev/debt/libSceIcu.md, all strictly within the 1000-character limit.
  3. Tests cited by review:
    • guest_icu_recovered_signatures, guest_json_string_search, and nkwebkit_wtftext_allocation are present in the codebase, registered in CMake, built here and run: all three pass, together with every other guest_icu_* test (39 executables, --repeat until-fail:3, 100% passed).

Tested

Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic, GCC 15.2.0, Release, BUILD_TESTING=ON, CMake 4.4.4 with Ninja 1.13 from a virtualenv. Merged upstream/main into the published head a888ff804c with normal merge commits 691294ad38 (main 919e4ee48a) and then d475e2338c (main e894ec3383); the published history was not rebased, squashed or force-pushed. Final head: d475e2338c (full d475e2338ca169c5f660fadf24a1afb2a30ec015). Windows and macOS were not compiled here; no game title was run.

  • All 70 functions verified: exactly 1 definition and 1 declaration each in libSceIcu, with 0 symbol collisions.
  • Test names cited by reviewer verified present: guest_icu_recovered_signatures, guest_json_string_search, and nkwebkit_wtftext_allocation.
  • On head a888ff804c, JJenkx verified that guest_icu_recovered_signatures, guest_json_string_search, and nkwebkit_wtftext_allocation passed in 3 of 3 runs on Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. Windows and macOS were not re-run in this local Linux merge pass.
  • Negative control (from PR series): making ucal_close throw for a null handle makes guest_icu_recovered_signatures abort.
  • ctest -R '^guest_icu|guest_json_string_search|nkwebkit_wtftext_allocation' --output-on-failure --repeat until-fail:3: 100% tests passed out of 39, 3 runs each, Not Run = 0 (exit 0).
  • The licence/ICU submodule 3rdparty/icu did not move between the two merged mains; cmake/Icu.cmake gained ICU sources, so ICU was rebuilt incrementally.
  • Conventions check: python3 tools/check_conventions.py --base upstream/main passed cleanly (exit code 0).
  • Git diff check: git diff --check upstream/main...HEAD passed cleanly (exit code 0).
  • python3 core/libs/tests/test_public_headers.py --audit-only: 411 libraries, 34457 exports: unique declarations and umbrella coverage verified.

Publication checks: head d475e2338ca169c5f660fadf24a1afb2a30ec015 passed an independent conventions/diff check and a clean merge-tree check against upstream main fa289273974bb03ffcf6c6432f0b15a2cb65f46d. Linux execution results above come from the recorded verification runs, reviewed rather than rerun during publication.

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:5213040446 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17265). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-11-08T16:31:45Z. --- ### What This replaces the single-function series #17160 to #17215, as asked in [this comment](https://github.com/boykopovar/AnyPS5/pull/17160#issuecomment-6722696732), with one change. It also folds in 20 functions from the same series that were never opened separately. The series PRs will be closed in favour of this one. 70 exports that were parameterless placeholders get their ICU 68.2 signatures: 68 from `RecoveredInventory.cpp`, plus `ures_close` and `utext_close` from `Export.cpp`. Each implements only the paths that the pinned [ICU 68.2 source](https://github.com/unicode-org/icu/tree/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source) decides before it touches an object: - close functions return for a null handle; - other functions return early on a failing `UErrorCode` (above zero) with the status untouched, while warnings still reach the argument checks that come before any object use. Everything else still throws `NotImplemented_nid_no_patch`: non-null handles, a null `UErrorCode`, and anything that needs a real object, locale data or an allocation. No title behaves differently yet. Layout, so later work only appends: - one source file per ICU C header and one `RecoveredSignatures.hpp`, included once from `libSceIcu.hpp`; - one test executable `guest_icu_recovered_signatures`, with one test file per header and shared checks in `tests/RecoveredSignatureChecks.hpp`; - one CMake block, whose source and test lists are the variables `ICU_RECOVERED_SOURCES` and `ICU_RECOVERED_TESTS`; - one technical-debt entry per header, linking the pinned line ranges. The recovered inventory count drops from 117 (main) to 49, and additional callable exports from 56 (main) to 54. | File | Functions | | --- | --- | | `Calendar.cpp` | `ucal_clone`, `ucal_close`, `ucal_get`, `ucal_getCanonicalTimeZoneID`, `ucal_getDefaultTimeZone`, `ucal_getKeywordValuesForLocale`, `ucal_getTimeZoneDisplayName`, `ucal_open`, `ucal_setGregorianChange`, `ucal_setMillis` | | `Collator.cpp` | `ucol_close`, `ucol_getAttribute`, `ucol_getReorderCodes`, `ucol_getTailoredSet`, `ucol_open`, `ucol_setAttribute` | | `DateFormat.cpp` | `udat_close`, `udat_format`, `udat_formatForFields`, `udat_getSymbols`, `udat_open`, `udat_toPattern` | | `DateTimePatternGenerator.cpp` | `udatpg_close`, `udatpg_getBestPattern`, `udatpg_getBestPatternWithOptions`, `udatpg_getFieldDisplayName`, `udatpg_getSkeleton`, `udatpg_open` | | `DateIntervalFormat.cpp` | `udtitvfmt_close`, `udtitvfmt_closeResult`, `udtitvfmt_formatCalendarToResult`, `udtitvfmt_formatToResult`, `udtitvfmt_open`, `udtitvfmt_openResult` | | `FieldPositionIterator.cpp` | `ufieldpositer_close`, `ufieldpositer_open` | | `FormattedValue.cpp` | `ufmtval_getString`, `ufmtval_nextPosition` | | `Idna.cpp` | `uidna_close`, `uidna_nameToASCII`, `uidna_nameToUnicode`, `uidna_openUTS46` | | `LocaleDisplayNames.cpp` | `uldn_close`, `uldn_openForContext` | | `ListFormatter.cpp` | `ulistfmt_close`, `ulistfmt_closeResult`, `ulistfmt_format`, `ulistfmt_formatStringsToResult`, `ulistfmt_openForType`, `ulistfmt_openResult` | | `NumberFormat.cpp` | `unum_clone`, `unum_close`, `unum_formatDecimal`, `unum_formatDouble`, `unum_getSymbol`, `unum_open` | | `NumberFormatter.cpp` | `unumf_close`, `unumf_closeResult`, `unumf_openResult` | | `NumberingSystem.cpp` | `unumsys_close`, `unumsys_open`, `unumsys_openByName` | | `PluralRules.cpp` | `uplrules_close`, `uplrules_openForType` | | `RelativeDateTimeFormatter.cpp` | `ureldatefmt_close`, `ureldatefmt_format`, `ureldatefmt_open` | | `ResourceBundle.cpp` | `ures_close` | | `StringSearch.cpp` | `usearch_open` | | `UText.cpp` | `utext_close` | Reviewer points addressed (oneandonlydean): 1. **Merge main and drop exports main already has:** - Merged `upstream/main` onto the published head `a888ff804c` with two normal merge commits, both titled `chore: merge upstream main`: `691294ad38` (main `919e4ee48a`) and `d475e2338c` (main `e894ec3383`, current at the time of writing). No rebase, no force push. - Verified whether `upstream/main` had implemented any of the 70 exports: scanned all 70 functions with grep across the whole `libSceIcu` codebase. Main implements none of these 70 functions (68 remained stubs in `RecoveredInventory.cpp`, and 2 in `Export.cpp`). - Cleanly preserved all additions from `main` (`Bidi.cpp`, `CharsetDetection.cpp`, `Normalization.cpp`, `CodePoints.cpp`, `LocaleCore.cpp`, `LocaleMap.cpp`, `LanguageTag.cpp`, `Properties.cpp`, `CaseMapping.cpp`, etc.). - Verified that every single one of the 70 functions has exactly 1 definition in `libSceIcu`, exactly 1 declaration, and 0 duplicate symbols. 2. **Technical debt counts recalculated from resultant code:** - `core/libs/prx/libSceIcu/RecoveredInventory.cpp`: 117 stubs on main -> 49 stubs (`grep -c "NotImplemented_nid_no_patch" core/libs/prx/libSceIcu/RecoveredInventory.cpp` = 49). - `core/libs/prx/libSceIcu/Export.cpp`: 56 remaining throwing functions in `Additional callable exports` on main -> 54 (`ures_close` and `utext_close` removed). Total `NotImplemented_nid_no_patch` in `Export.cpp`: 82 on main -> 80 in branch (`grep -c "NotImplemented_nid_no_patch" core/libs/prx/libSceIcu/Export.cpp` = 80). - 18 new technical debt entries integrated into `docs/dev/debt/libSceIcu.md`, all strictly within the 1000-character limit. 3. **Tests cited by review:** - `guest_icu_recovered_signatures`, `guest_json_string_search`, and `nkwebkit_wtftext_allocation` are present in the codebase, registered in CMake, built here and run: all three pass, together with every other `guest_icu_*` test (39 executables, `--repeat until-fail:3`, 100% passed). ### 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. --> Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic, GCC 15.2.0, Release, `BUILD_TESTING=ON`, CMake 4.4.4 with Ninja 1.13 from a virtualenv. Merged `upstream/main` into the published head `a888ff804c` with normal merge commits `691294ad38` (main `919e4ee48a`) and then `d475e2338c` (main `e894ec3383`); the published history was not rebased, squashed or force-pushed. Final head: `d475e2338c` (full `d475e2338ca169c5f660fadf24a1afb2a30ec015`). Windows and macOS were not compiled here; no game title was run. - All 70 functions verified: exactly 1 definition and 1 declaration each in `libSceIcu`, with 0 symbol collisions. - Test names cited by reviewer verified present: `guest_icu_recovered_signatures`, `guest_json_string_search`, and `nkwebkit_wtftext_allocation`. - On head `a888ff804c`, JJenkx verified that `guest_icu_recovered_signatures`, `guest_json_string_search`, and `nkwebkit_wtftext_allocation` passed in 3 of 3 runs on Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. Windows and macOS were not re-run in this local Linux merge pass. - Negative control (from PR series): making `ucal_close` throw for a null handle makes `guest_icu_recovered_signatures` abort. - `ctest -R '^guest_icu|guest_json_string_search|nkwebkit_wtftext_allocation' --output-on-failure --repeat until-fail:3`: **100% tests passed out of 39**, 3 runs each, `Not Run` = 0 (exit 0). - The licence/ICU submodule `3rdparty/icu` did not move between the two merged mains; `cmake/Icu.cmake` gained ICU sources, so ICU was rebuilt incrementally. - Conventions check: `python3 tools/check_conventions.py --base upstream/main` passed cleanly (exit code 0). - Git diff check: `git diff --check upstream/main...HEAD` passed cleanly (exit code 0). - `python3 core/libs/tests/test_public_headers.py --audit-only`: 411 libraries, 34457 exports: unique declarations and umbrella coverage verified. Publication checks: head `d475e2338ca169c5f660fadf24a1afb2a30ec015` passed an independent conventions/diff check and a clean merge-tree check against upstream main `fa289273974bb03ffcf6c6432f0b15a2cb65f46d`. Linux execution results above come from the recorded verification runs, reviewed rather than rerun during publication. ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
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!17265
No description provided.