feat(icu): implement ten resource bundle accessors #14123
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14123"
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 CobaltMoth482 on 2026-10-31T19:47:33Z.
What
Implements ten existing libSceIcu resource-bundle stubs as one in-memory resource-access topic:
res_read,res_countArrayItems,res_getAlias,res_getArrayItem,res_getBinaryNoTrace,res_getIntVectorNoTrace,res_getResource,res_getStringNoTrace,res_getTableItemByIndex, andres_getTableItemByKey.Names and independently calculated NIDs match the PS5 3.20 inventory. Names/NIDs do not establish prototypes. The source-compatible signatures, structures and behavior follow ICU 78.1 uresdata.h and uresdata.cpp, cross-checked against ICU 65.1's identical structure fields. Implementation independently written; no third-party source or runtime dependency added.
Handles legacy/string-v2 values, binary and integer vectors, all three tables, both arrays, pooled offsets and formats 1–3. Caller-owned data must satisfy upstream accessor preconditions; no loading, allocation or pool ownership is invented. The 64-byte ResourceData/20-byte data-info ABI and firmware compatibility are not console-verified. Existing debt records these limits. For declared input lengths 0–3, res_read deliberately throws after clearing output rather than reading beyond the declared range; upstream malformed-input partial-state equivalence is not claimed.
Prior unchanged progress scan: libSceIcu 28/2475 → 38/2475 (+10 implemented exports, unchanged denominator). The subsequent rebase leaves the ICU source inventory unchanged. No game-unblock or percentage-point claim.
Also cross-checked against pinned ICU 68.2 (
github.com/unicode-org/icu@84e1f26ea7/icu4c/source/common/uresdata.cpp): the ten target functions and res_init preserve the same logic as 78.1, and ResourceData/UDataInfo fields match. On ASCII builds both useNativeStrcmp branches resolve to strcmp; EBCDIC is unsupported. This does not verify the console version or ABI.Tested
Linux x86-64 / GCC 14.2.0. Refreshed candidate
64fcfaa02c139f8fa319319b3e0b9bf5b43237a8on main121b2e37af75278e3d84a2f43869730030b112ed(2026-10-31).-O2 -Wall -Wextra -Werrorbehavioral fixture: passed for all ten exports; covers resource tags/layouts, empty/wrong types, pooling, index boundaries, malformed headers and error/output preservation.049e0d6a420629ac7db77256987d083a563287b5: 261,295 differential assertions passed, including complete parser output-state checks and ignored-field/negative-table-count cases. Candidate+harness sanitizer run passed; oracle DSO uninstrumented. Four fresh mutation controls rejected. The historical 261,143 count differs only because the rebuilt harness splits error/state checks in 152 cases; this is accounting, not additional functions.Repository target
guest_icu_resource_readers_tests; CTestguest_icu_resource_readers.Overlap and merge ordering
The required
tools/pr_overlap.pyscan covered 1,678 open PRs / 19 shared-file peers and exited 2 (failed closed), not a clean result. Fifteen peers already conflict with main. Its scan ran before a final CMake-only source-line relocation; manual controls were then rerun against the exact final candidate for all 19 peers / 59 shared files / 118 base-vs-candidate merge invocations. No duplicate reader names/NIDs or new-path collisions were found. Final CMake controls add no conflicts, including #13274 and #14050 (both clean). The remaining fifteen peers retain their existing base conflicts.Only #14050 (
locale_getKeywordsStart) introduces candidate-caused conflicts: adjacent independent edits inExport.cpp,Identified.hpp, and shared debt counts (one conflict per file). There is no functional dependency, and no peer code is incorporated. Whichever change lands second must rebase, retaining both implementations/registrations and recomputing debt counts (82 total / 62 named after composing these two current patches). No union build was performed. This PR is based on main, not stacked on #14050.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 slopgobblercobbler on 2026-10-31T20:01:53Z.
Review: COMMENTED
Audited the implementation in
core/libs/prx/libSceIcu/ResourceReaders.{hpp,cpp}:Resource Bundle Layout & ABI Alignment:
IcuResourceData(64 bytes) and field offsets (pRoot,p16BitUnits,poolBundleKeys,rootRes,localKeyLimit,poolBundleStrings, etc.) matching standard ICUuresdata.h.IcuDataInfo(20 bytes) format header layout and magic/endianness checks (info->size >= 20, little-endian ASCIIResB, format versions 1 to 3).Error Code & Memory Safety:
res_readcleanly respectsUErrorCode: returns immediately if*error > 0(U_FAILURE), and correctly sets*error = 3(U_INVALID_FORMAT_ERROR) on malformed headers, invalid root resource types, or truncated index tables.Require(data != nullptr), 32-bit alignment of data buffer) protect against undefined memory access.0xffffffff(RES_BOGUS) and set*index = -1.Table & Leaf Accessors:
Test Suite & Technical Debt:
tests/ResourceReaders.cppcovering leaves, strings, arrays, tables, negative table bounds, and format validation.docs/dev/debt/libSceIcu.mdproperly documents the unmeasured console behavior and malformed input handling within convention limits.Clean, high-quality implementation of the resource bundle readers.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T20:10:09Z.
Review: APPROVED
Reviewed — looks good
I found no blocking mismatch in the ten resource readers at head
6bbec72587af482b954e73f7352981691810880cagainst base0ef9ce78a556d6955d181d6b1401b21634227ec5; the hosted Windows build and test job passed.The no-build diff, conventions, dependency checks, and public-header audit passed. I checked the test-registration heuristic against CMake; the CTest is registered. The author reports passing ASan and 261,295 ICU differential assertions, which I did not independently rerun. I did not run a local build or C++ tests; Linux and specialized hosted jobs were skipped. Console ABI/runtime behavior remains unverified and is documented as debt.
Sources: resource readers at the reviewed head, ICU 78.1 reference at pinned commit.
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:49:33Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-06T15:11:37Z.
Review: CHANGES_REQUESTED
The ten readers look good to me. They match ICU
uresdata(68.2/78.1), unmet preconditions throw, the test is registered in ctest, and the debt entries are accurate. The differential runs from @RyanIsAinmDom and your own results support it.One thing blocks the merge: #14050 (
locale_getKeywordsStart) has merged, and this branch now conflicts withmainin:core/libs/prx/libSceIcu/Export.cppcore/libs/prx/libSceIcu/Identified.hppdocs/dev/debt/libSceIcu.md"Allow edits from maintainers" is off, so we can't rebase it for you. Please rebase onto current
main, keep both implementations, and recompute the debt counts (82 total / 62 named, per your overlap notes). Once it is rebased and CI is green it can go to the merge queue.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T08:47:08Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed diff shows no verified blocking defect; this review did not run the reported checks, so a formal approval is not justified.
What I ran
Reviewed head
31d690c126158aab72e8c01e20eeb1d87e8c27bfusing the prepared diff and the pinned repository reader. No build or tests were run in this session.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed changed files at the pinned commit:
core/libs/prx/libSceIcu/CMakeLists.txt,Export.cpp,Identified.hpp,ResourceReaders.cpp,ResourceReaders.hpp,libSceIcu.hpp,tests/ResourceReaders.cpp, anddocs/dev/debt/libSceIcu.md.Not verified
The reported Linux fixtures, sanitizer runs, ICU differential checks, and CMake harness were not run in this session. Full product build, Windows, guest-loader, title/homebrew, and console behavior were not verified. All eight changed files were inspected in the prepared diff; full text was read for six of eight, while
Export.cppandIdentified.hppwere inspected through their diff hunks. No excluded changed files were listed.To get this to a good state
Nothing is required.
Pull request closed