feat(libSceIcu): give five collator exports their ICU 68.2 signatures and early returns #23850
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23850"
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 ToRaNek on 2026-11-19T19:17:04Z.
What
Five collator exports of libSceIcu were parameterless
intplaceholders inRecoveredInventory.cppthat threw on every call. They now have their ICU 68.2 prototypes and the early returns of the ICU sources at commit84e1f26ea771, inCollator.cpp, the way #17265 did it for 70 other recovered exports. OnmainnoUCollatorcan exist (ucol_openthrows on a valid call), so every path that reads one, or collation data, still throwsNotImplemented_nid_no_patch.ucol_getKeywordValuescollation: null andU_ILLEGAL_ARGUMENT_ERROR.collationneeds the collation data and throwsucol_getKeywordValuesForLocaleures_open, the sink andures_getAllItemsWithFallbackall return early)ucol_getContractionsAndExpansionsU_ILLEGAL_ARGUMENT_ERRORucol_strcollIterUCOL_EQUAL(0), status untouched; null collator or null iterator:UCOL_EQUALandU_ILLEGAL_ARGUMENT_ERRORucol_getRulesRuleBasedCollator(the source says "OK to crash if coll==NULL"), so it only gets its prototype and throws for every inputTwo details follow the source rather than the usual pattern:
ucol_strcollIteris the only one that accepts a nullUErrorCode(if(!status || U_FAILURE(*status))); the four others dereference it, so they throw on a null one.ucol_getKeywordValuescompares the keyword withstrcmp. The guest string is read one byte at a time throughGuestCopyIn_nid_no_patch, up to the first byte that differs fromcollationand its terminator, which is as far asstrcmpreads.The guest
UErrorCodegoes through the file'sGuestCopyIn_nid_no_patchhelper and a newWriteStatus(GuestCopyOut_nid_no_patch), which keeperrno.ucol_countAvailableanducol_getAvailablestay placeholders: they have no early return, and the first one's real prototype is alreadyint().Debt: one entry is added next to the existing collator one. The
recovered inventory exportsentry goes from 18 to 13 placeholders left, edited in the pendingfeat-libsceicu-field-position-iterator.mdfragment becausetools/debt_fold.py --checkrefuses two fragments that change the same entry.Stacked on #23848, itself on #23844, #23839 and #23819. The five PRs change that same count line, so they cannot be independent. This branch is one commit,
516dece96f, on top of the previous one; until the others merge, the diff shows five commits and only the last belongs to this PR. The functions of the five PRs are different.Related open PR. #23196 implements the collator over ICU 78.1 (
ucol_open,ucol_strcoll, strength) and conflicts withmainalready. It does not touch these five exports. Once it merges, their object paths can call the real collator; that is a follow-up, not part of this PR.Tested
Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, on830ba03e6d(#23848). Not run on a console; the console behaviour of these exports is unverified, as the debt entry says.guest_icu_recovered_signaturespasses.tests/Collator.cppgains aUcolQueriesgroup:static_asserts on the five prototypes; seven failing status values (result returned, status unchanged, with null and non-null arguments); four non-failing status values against each illegal argument (six wrong keywords and a null one, a null collator, each null iterator) and against valid calls (a throw, status unchanged); a null status (a throw, or 0 forucol_strcollIter); an unreadable keyword pointer;ucol_getRulesthrowing for a null and a non-null collator with the length untouched; the fake object's bytes unchanged.mainthe placeholders areint(), 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: the keyword compared without its terminator (socollationspasses); a null keyword reaching the data;ucol_strcollIterthrowing on a null status;ucol_strcollIteraccepting a null second iterator;ucol_getContractionsAndExpansionsaccepting a null collator;ucol_getKeywordValuesForLocaleignoring a failing status;ucol_getRulesreturning null for a null collator.ctest -R icu: 76 of 76 pass.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.python tools/pr_overlap.py --namesover the five names: each is a stub onmainand no open PR adds or edits it.--branchcould not compare six open PRs that conflict withmainon the recovered inventory files (#18210, #19635, #19645, #19670, #19720, #23196); compared by hand, none of them touches one of the five exports.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 PrivacyOnion on 2026-11-19T19:34:20Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
516dece96f:tools/check_conventions.pypassed.guest_icu_recovered_signatures_testsbuilt cleanly.guest_icu_recovered_signatures):core/libs/prx/libSceIcu/Calendar.cpp,core/libs/prx/libSceIcu/Collator.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/NumberFormat.cpp,core/libs/prx/libSceIcu/NumberFormatter.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.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T12:13:01Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed code and tests were read at head
516dece96f9c3bc5e338e0fea6bb142ff1486957; no concrete blocking defect was found, but the reported checks could not be run in this interface.What I ran
Read the prepared diff and all seven changed files at the pinned head using
repo_read.py. No command-line checks were run because this interface provides no shell command runner.Results
830ba03e6dFindings
Blocking
None.
Non-blocking
830ba03e6d, the prior stacked PR head, rather than this reviewed head. Run the reported suite and checks on this head before relying on them as validation for this change.Sources
Not verified
No tests or convention/debt checks were executed. The PR description reports those results from the prior head. Console ABI and behavior remain unverified as described by the author. All changed files in
manifest.jsonunderreviewedwere read; none were excluded.To get this to a good state
Nothing is required. Optional: run the reported checks on this head and share the results.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:37:15Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
b88c50ddc22aa8fbdbff34d9522de603ce9b87cffrom the prepared diff and reader-pinned source. No commands or checks were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read
Collator.cpp,RecoveredSignatures.hpp,Status.hpp, andtests/Collator.cpp, plus the prepared description, commits, manifest, and diff. The manifest marks all six changed files as included; I did not read the complete contents ofRecoveredInventory.cpp,RecoveredInventory.hpp, or either changed debt fragment. I did not run build/tests or verify console behavior. The description's test and convention-check results were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:04:33Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code supports merging, with the noted console behavior remaining unverified.
What I ran
Reviewed head
b276f2477fd12c795e43ca21767c308dbbdfb378. Read the prepared description, commits, manifest, diff, review folder README, and all seven changed files. Usedrepo_read.pyto inspect the changed code and relevant ICU status, guest-memory, and enumeration declarations. No commands or tests were run; test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests, build, CI, and console behavior were not run or confirmed in this review. The description reports Windows tests and checks on a related revision, not the reviewed head.
files.jsonwas not available as a review-folder document; the folder README and manifest list all seven changed files as included, and all seven were read.To get this to a good state
Nothing is required.