feat(libSceIcu): give nine display name, plural and formatted value exports their ICU 68.2 signatures and early returns #23844

Merged
ToRaNek merged 3 commits from upstream-pr/23844 into main 2026-11-19 21:08:59 +00:00
ToRaNek commented 2026-11-19 19:05:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ToRaNek on 2026-11-19T19:05:20Z.


What

Nine exports of libSceIcu were parameterless int placeholders in RecoveredInventory.cpp that threw on every call. They now have their ICU 68.2 prototypes and the early returns of the ICU sources at commit 84e1f26ea771, in the files that already hold their families, the way #17265 did it for 70 other recovered exports. None of the objects can exist yet (every open export throws on a valid call), so every path that reads one still throws NotImplemented_nid_no_patch.

Export Returns without the object Source lines
uldn_localeDisplayName, uldn_scriptDisplayName, uldn_regionDisplayName failing status: 0, status untouched; null handle, null code, null result with a positive size, or negative size: 0 and U_ILLEGAL_ARGUMENT_ERROR common/locdspnm.cpp 969-989, 1009-1025, 1036-1052
uldn_keyValueDisplayName the same, with a null key or a null value common/locdspnm.cpp 1090-1108
uplrules_getKeywords failing status: null, status untouched; null rules: null and U_ILLEGAL_ARGUMENT_ERROR i18n/upluralrules.cpp 159-180
uplrules_selectWithFormat failing status: 0, status untouched; null rules, null number format, or a keyword buffer and capacity that disagree (null with a capacity other than 0, or a negative capacity): 0 and U_ILLEGAL_ARGUMENT_ERROR i18n/upluralrules.cpp 138-157
ureldatefmt_formatNumeric failing status: 0, status untouched; a result buffer and capacity that disagree: 0 and U_ILLEGAL_ARGUMENT_ERROR, checked before the formatter is read (the same as ureldatefmt_format) i18n/reldatefmt.cpp 1301-1327
udtitvfmt_resultAsValue, ulistfmt_resultAsValue failing status: null, status untouched; null result: null and U_ILLEGAL_ARGUMENT_ERROR. A non-null result has its magic number read next, so it throws i18n/formattedval_impl.h 266-270, IcuCApiHelper::validate in common/capi_helper.h 52-66

Each file keeps its own way of reaching the guest UErrorCode: LocaleDisplayNames.cpp, PluralRules.cpp and RelativeDateTimeFormatter.cpp go through GuestCopyIn_nid_no_patch / GuestCopyOut_nid_no_patch (the first one gains the WriteStatus helper its two neighbours already have), DateIntervalFormat.cpp and ListFormatter.cpp use Icu::Failure and a direct store like the exports around them. A null UErrorCode throws: the console dereferences it.

Debt: five entries are added next to the existing ones of each family. The recovered inventory exports entry goes from 33 to 24 placeholders left, edited in the pending feat-libsceicu-field-position-iterator.md fragment because tools/debt_fold.py --check refuses two fragments that change the same entry.

Stacked on #23839, itself on #23819. The three PRs change that same count line, so they cannot be independent. This branch is one commit, 81dc9c3045, on top of #23839's e045338414; until the two merge, the diff shows three commits and only the last belongs to this PR. The functions of the three PRs are different.

Tested

Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, on e045338414 (#23839). Not run on a console; the console behaviour of these exports is unverified, as the debt entries say.

  • guest_icu_recovered_signatures passes. tests/LocaleDisplayNames.cpp, PluralRules.cpp, RelativeDateTimeFormatter.cpp, DateIntervalFormat.cpp and ListFormatter.cpp gain one group each: static_asserts on the nine prototypes; seven failing status values (result returned, status unchanged, with null and non-null handles); four non-failing status values against each illegal argument (U_ILLEGAL_ARGUMENT_ERROR) and against valid calls (a throw, status unchanged); a null status; the output buffer and the fake object's bytes unchanged.
  • Red: on main the placeholders are int(), so the new checks cannot compile against them (by construction, not built). Seven one-line mutations of the new code each fail the test, then it passes again with the code restored: uldn accepting a null result with a positive size; uldn_keyValueDisplayName accepting a null value; uplrules_selectWithFormat accepting a null number format; uplrules_getKeywords not flagging null rules; ureldatefmt_formatNumeric accepting capacity -1; udtitvfmt_resultAsValue leaving the status for a null result; ulistfmt_resultAsValue ignoring a failing status.
  • ctest -R icu: 76 of 76 pass.
  • python tools/check_conventions.py --base origin/main and python tools/debt_fold.py --check pass.
  • python tools/pr_overlap.py --names over the nine names: each is a stub on main and no open PR adds or edits it. --branch could not compare six open PRs that conflict with main on the recovered inventory files (#18210, #19635, #19645, #19670, #19720, #23196); compared by hand, none of them touches one of the nine exports.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: #23839
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5401187662 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23844). Originally posted by [ToRaNek](https://github.com/ToRaNek) on 2026-11-19T19:05:20Z. --- ### What Nine exports of libSceIcu were parameterless `int` placeholders in `RecoveredInventory.cpp` that threw on every call. They now have their ICU 68.2 prototypes and the early returns of the ICU sources at commit [`84e1f26ea771`](https://github.com/unicode-org/icu/tree/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source), in the files that already hold their families, the way #17265 did it for 70 other recovered exports. None of the objects can exist yet (every `open` export throws on a valid call), so every path that reads one still throws `NotImplemented_nid_no_patch`. | Export | Returns without the object | Source lines | |---|---|---| | `uldn_localeDisplayName`, `uldn_scriptDisplayName`, `uldn_regionDisplayName` | failing status: 0, status untouched; null handle, null code, null result with a positive size, or negative size: 0 and `U_ILLEGAL_ARGUMENT_ERROR` | `common/locdspnm.cpp` 969-989, 1009-1025, 1036-1052 | | `uldn_keyValueDisplayName` | the same, with a null key or a null value | `common/locdspnm.cpp` 1090-1108 | | `uplrules_getKeywords` | failing status: null, status untouched; null rules: null and `U_ILLEGAL_ARGUMENT_ERROR` | `i18n/upluralrules.cpp` 159-180 | | `uplrules_selectWithFormat` | failing status: 0, status untouched; null rules, null number format, or a keyword buffer and capacity that disagree (null with a capacity other than 0, or a negative capacity): 0 and `U_ILLEGAL_ARGUMENT_ERROR` | `i18n/upluralrules.cpp` 138-157 | | `ureldatefmt_formatNumeric` | failing status: 0, status untouched; a result buffer and capacity that disagree: 0 and `U_ILLEGAL_ARGUMENT_ERROR`, checked before the formatter is read (the same as `ureldatefmt_format`) | `i18n/reldatefmt.cpp` 1301-1327 | | `udtitvfmt_resultAsValue`, `ulistfmt_resultAsValue` | failing status: null, status untouched; null result: null and `U_ILLEGAL_ARGUMENT_ERROR`. A non-null result has its magic number read next, so it throws | `i18n/formattedval_impl.h` 266-270, `IcuCApiHelper::validate` in `common/capi_helper.h` 52-66 | Each file keeps its own way of reaching the guest `UErrorCode`: `LocaleDisplayNames.cpp`, `PluralRules.cpp` and `RelativeDateTimeFormatter.cpp` go through `GuestCopyIn_nid_no_patch` / `GuestCopyOut_nid_no_patch` (the first one gains the `WriteStatus` helper its two neighbours already have), `DateIntervalFormat.cpp` and `ListFormatter.cpp` use `Icu::Failure` and a direct store like the exports around them. A null `UErrorCode` throws: the console dereferences it. Debt: five entries are added next to the existing ones of each family. The `recovered inventory exports` entry goes from 33 to 24 placeholders left, edited in the pending `feat-libsceicu-field-position-iterator.md` fragment because `tools/debt_fold.py --check` refuses two fragments that change the same entry. **Stacked on #23839, itself on #23819.** The three PRs change that same count line, so they cannot be independent. This branch is one commit, `81dc9c3045`, on top of #23839's `e045338414`; until the two merge, the diff shows three commits and only the last belongs to this PR. The functions of the three PRs are different. ### Tested Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, on `e045338414` (#23839). Not run on a console; the console behaviour of these exports is unverified, as the debt entries say. - `guest_icu_recovered_signatures` passes. `tests/LocaleDisplayNames.cpp`, `PluralRules.cpp`, `RelativeDateTimeFormatter.cpp`, `DateIntervalFormat.cpp` and `ListFormatter.cpp` gain one group each: `static_assert`s on the nine prototypes; seven failing status values (result returned, status unchanged, with null and non-null handles); four non-failing status values against each illegal argument (`U_ILLEGAL_ARGUMENT_ERROR`) and against valid calls (a throw, status unchanged); a null status; the output buffer and the fake object's bytes unchanged. - Red: on `main` the placeholders are `int()`, so the new checks cannot compile against them (by construction, not built). Seven one-line mutations of the new code each fail the test, then it passes again with the code restored: `uldn` accepting a null result with a positive size; `uldn_keyValueDisplayName` accepting a null value; `uplrules_selectWithFormat` accepting a null number format; `uplrules_getKeywords` not flagging null rules; `ureldatefmt_formatNumeric` accepting capacity -1; `udtitvfmt_resultAsValue` leaving the status for a null result; `ulistfmt_resultAsValue` ignoring a failing status. - `ctest -R icu`: 76 of 76 pass. - `python tools/check_conventions.py --base origin/main` and `python tools/debt_fold.py --check` pass. - `python tools/pr_overlap.py --names` over the nine names: each is a stub on `main` and no open PR adds or edits it. `--branch` could not compare six open PRs that conflict with `main` on the recovered inventory files (#18210, #19635, #19645, #19670, #19720, #23196); compared by hand, none of them touches one of the nine exports. ### Checklist - [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) and the licence notice of code adapted from upstream (see AGENTS.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: #23839 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-19 19:20:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T19:20:08Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 81dc9c3045:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_icu_recovered_signatures_tests built cleanly.
  • CTest (guest_icu_recovered_signatures):
    1/1 Test #3995: guest_icu_recovered_signatures ...   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/Calendar.cpp, core/libs/prx/libSceIcu/DateFormat.cpp, core/libs/prx/libSceIcu/DateIntervalFormat.cpp, core/libs/prx/libSceIcu/ListFormatter.cpp, core/libs/prx/libSceIcu/LocaleDisplayNames.cpp, core/libs/prx/libSceIcu/PluralRules.cpp, core/libs/prx/libSceIcu/RecoveredInventory.cpp, core/libs/prx/libSceIcu/RecoveredInventory.hpp, core/libs/prx/libSceIcu/RecoveredSignatures.hpp, core/libs/prx/libSceIcu/RelativeDateTimeFormatter.cpp, core/libs/prx/libSceIcu/StringSearch.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified uldn_keyValueDisplayName, uldn_localeDisplayName, uldn_regionDisplayName, uldn_scriptDisplayName correctly check guest pointer safety, status failure check, and argument validation (null codes/result/negative capacity) setting U_ILLEGAL_ARGUMENT_ERROR (1) via WriteStatus.
    • Verified uplrules_getKeywords and uplrules_selectWithFormat early returns and argument validations match ICU 68.2 behavior for failing status and null/invalid arguments.
    • Verified udtitvfmt_resultAsValue and ulistfmt_resultAsValue validate input pointers and set U_ILLEGAL_ARGUMENT_ERROR when the formatted result object is nullptr.
    • Verified ureldatefmt_formatNumeric checks status failure and validates result pointer vs resultCapacity consistency before throwing NotImplemented_nid_no_patch.
    • Verified technical debt markdown fragments in docs/dev/debt/changes/ accurately document the unimplemented paths and gaps according to AGENTS.md.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5981722657 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23844#pullrequestreview-5981722657). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T19:20:08Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `81dc9c3045`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_icu_recovered_signatures_tests` built cleanly. - **CTest** (`guest_icu_recovered_signatures`): ``` 1/1 Test #3995: guest_icu_recovered_signatures ... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/Calendar.cpp`, `core/libs/prx/libSceIcu/DateFormat.cpp`, `core/libs/prx/libSceIcu/DateIntervalFormat.cpp`, `core/libs/prx/libSceIcu/ListFormatter.cpp`, `core/libs/prx/libSceIcu/LocaleDisplayNames.cpp`, `core/libs/prx/libSceIcu/PluralRules.cpp`, `core/libs/prx/libSceIcu/RecoveredInventory.cpp`, `core/libs/prx/libSceIcu/RecoveredInventory.hpp`, `core/libs/prx/libSceIcu/RecoveredSignatures.hpp`, `core/libs/prx/libSceIcu/RelativeDateTimeFormatter.cpp`, `core/libs/prx/libSceIcu/StringSearch.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified uldn_keyValueDisplayName, uldn_localeDisplayName, uldn_regionDisplayName, uldn_scriptDisplayName correctly check guest pointer safety, status failure check, and argument validation (null codes/result/negative capacity) setting U_ILLEGAL_ARGUMENT_ERROR (1) via WriteStatus. - Verified uplrules_getKeywords and uplrules_selectWithFormat early returns and argument validations match ICU 68.2 behavior for failing status and null/invalid arguments. - Verified udtitvfmt_resultAsValue and ulistfmt_resultAsValue validate input pointers and set U_ILLEGAL_ARGUMENT_ERROR when the formatted result object is nullptr. - Verified ureldatefmt_formatNumeric checks status failure and validates result pointer vs resultCapacity consistency before throwing NotImplemented_nid_no_patch. - Verified technical debt markdown fragments in docs/dev/debt/changes/ accurately document the unimplemented paths and gaps according to AGENTS.md. Looks Good To Me
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!23844
No description provided.