feat(libSceIcu): implement the string trie builders, data swappers and the ICU service cache #14443

Open
PrivacyOnion wants to merge 10 commits from upstream-pr/14443 into main
PrivacyOnion commented 2026-11-01 13:50:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-01T13:50:17Z.


What

Implements 88 more data-free libSceIcu exports from ICU 68.2, stacked on #14340. This PR's own commits are those after f6303c9 (f376d5d, 47f9f3b, 7d4b66e, c3295f3 and d3cdd80); everything up to f6303c9 is #14016, #14144 and #14340.

String trie builders (43, TrieBuilder.cpp): StringTrieBuilder (constructors, destructors, build, createCompactBuilder/deleteCompactBuilder, node registration, hashing and equality, makeNode, makeBranchSubNode, writeNode, writeBranchSubNode) and UCharsTrieBuilder (add, build, buildUChars, buildUnicodeString, the element accessors and every write* helper). The 16-byte StringTrieBuilder and 112-byte UCharsTrieBuilder LP64 layouts and their virtual slots match ICU, and the serialized tries are byte-identical to ICU's.

Data and trie swappers (11, DataSwapper.cpp): udata_openSwapper, udata_openSwapperForInputData, udata_closeSwapper, udata_swapDataHeader, udata_swapInvStringBlock, udata_readInt16, udata_readInt32, udata_printError (the guest printError receives the guest va_list), utrie_swapAnyVersion, utrie2_swap and ucptrie_swap. The 96-byte UDataSwapper layout matches ICU.

ICU service (32, Service.cpp, ServiceLocale.cpp, LocaleBuilder.cpp, LocaleKeywords.cpp):

  • ICUService factory registration and removal, instance caches, getKey, visible IDs and ID maps, explicit-locale display names, reset, clearCaches, destruction and listener dispatch;
  • SimpleLocaleKeyFactory and ICUResourceBundleFactory construction, destruction and class IDs;
  • LocaleUtility::initNameFromLocale, LocaleBuilder::setLocale, ulocimp_getKnownCanonicalizedLocaleForTest and uloc_openKeywordList.

UVector (2): integer indexOf and sortedInsert. ICU passes uninitialized upper union bytes to the comparator here; the adapter zeroes them.

664 legacy entries stay NotImplemented_nid_no_patch stubs. Among them are the format swappers (break iterator, resource bundle, dictionary, names, converter, collation and normalization), UDataMemory loading, and the locale paths that need data or full ID parsing. The technical debt entries for Trie builders, Data swappers, Format swappers, Vector objects, ICUService, LocaleKey and locale factories, LocaleBuilder, Locale objects and Locale keyword lists are updated, and the files derived from ICU keep ICU's notice and the IBM copyright lines of their sources.

Tested

Windows 11, host build of the library with the Qt MinGW 13.1 toolchain, against ICU 68.2 (84e1f26ea77152936e70d53178a816dbfbf69989) built on the same host:

  • all 56 core/libs/prx/libSceIcu/tests executables pass on this head (TEST EXIT CODE: 0) (TEST EXIT CODE: 0);
  • differential programs that call our export and ICU's on the same inputs and compare every output, status and object field (results below);
  • every changed source compiles with the real APS5_VABI;
  • tools/check_conventions.py passes and core/libs/tests/test_public_headers.py --audit-only passes.
Differential Result
TrieBuilderDiff (layouts, virtual slots, builds) 1580 comparisons, 0 bad
TrieBuilderRandomDiff (1500 random builders: any UTF-16 unit, empty strings, full int32 values, duplicates, add after build, double build, build() and buildUnicodeString()) 1191 tries, 275951 comparisons, 0 bad
TrieSwapDiff (420 tries built by ICU: UTrie v1, UTrie2 16/32-bit, UCPTrie fast/small 8/16/32-bit; preflight, in place, truncated, corrupted headers, round trips; 2000 random buffers) 3580562 comparisons, 0 bad
DataSwapperDiff 3342 comparisons, 0 bad
VectorDiff 541278 comparisons, 0 bad
ServiceCacheDiff (2002 random sequences of 300 operations) 125485864 checks, 0 bad
ServiceLocaleDiff (1001 sequences of 300 key and 300 factory operations) 400985773 comparisons, 0 bad
ServiceResourceFactoryDiff 22424391 checks, 0 bad
ServiceListenerDiff 300300 comparisons per export, 0 bad
LocaleKeywordsDiff 1200 inputs, 2706631 checks, 0 bad
LocaleObjectDiff, LocaleBuilderDiff (existing exports, rerun after the merge) DIFF EXIT CODE: 0

The differentials found and fixed seven bugs in the first version of this code:

  • UTRIE_SHIFT 4 instead of 5, which rejected every UTrie v1;
  • UTRIE2_INDEX_1_OFFSET 0x220 instead of 0x840;
  • UCPTRIE_BMP_INDEX_LENGTH 0x1000 instead of 0x400;
  • the two- and three-unit thresholds of writeValueAndFinal, writeValueAndType and writeDeltaTo;
  • add after build returning 20 instead of U_NO_WRITE_PERMISSION;
  • add of a string longer than 0xffff not counting the element.

The differential sources and the runner are in the gist linked below. The reference ICU is a Windows build, so CharStringDiff still differs on purpose (\ against the POSIX /), as in #14340.

The guest build and CTest run are left to CI (no full CMake configure here: SDL2/ffmpeg submodules missing).

pr_overlap.py: the shared libSceIcu files overlap with the ICU stack this PR builds on (#14016, #14144, #14340) and with other ICU PRs. None of them implements any of these 88 exports; the only open PRs whose diffs name them are #14016, #14144 and #14340, where they are still stubs. #11088 implements uprv_* numeric helpers only.

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: #14340
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5107959807 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-01T13:50:17Z. --- ### What Implements 88 more data-free libSceIcu exports from ICU 68.2, stacked on #14340. This PR's own commits are those after f6303c9 (f376d5d, 47f9f3b, 7d4b66e, c3295f3 and d3cdd80); everything up to f6303c9 is #14016, #14144 and #14340. **String trie builders** (43, `TrieBuilder.cpp`): `StringTrieBuilder` (constructors, destructors, `build`, `createCompactBuilder`/`deleteCompactBuilder`, node registration, hashing and equality, `makeNode`, `makeBranchSubNode`, `writeNode`, `writeBranchSubNode`) and `UCharsTrieBuilder` (`add`, `build`, `buildUChars`, `buildUnicodeString`, the element accessors and every `write*` helper). The 16-byte `StringTrieBuilder` and 112-byte `UCharsTrieBuilder` LP64 layouts and their virtual slots match ICU, and the serialized tries are byte-identical to ICU's. **Data and trie swappers** (11, `DataSwapper.cpp`): `udata_openSwapper`, `udata_openSwapperForInputData`, `udata_closeSwapper`, `udata_swapDataHeader`, `udata_swapInvStringBlock`, `udata_readInt16`, `udata_readInt32`, `udata_printError` (the guest `printError` receives the guest `va_list`), `utrie_swapAnyVersion`, `utrie2_swap` and `ucptrie_swap`. The 96-byte `UDataSwapper` layout matches ICU. **ICU service** (32, `Service.cpp`, `ServiceLocale.cpp`, `LocaleBuilder.cpp`, `LocaleKeywords.cpp`): - `ICUService` factory registration and removal, instance caches, `getKey`, visible IDs and ID maps, explicit-locale display names, `reset`, `clearCaches`, destruction and listener dispatch; - `SimpleLocaleKeyFactory` and `ICUResourceBundleFactory` construction, destruction and class IDs; - `LocaleUtility::initNameFromLocale`, `LocaleBuilder::setLocale`, `ulocimp_getKnownCanonicalizedLocaleForTest` and `uloc_openKeywordList`. **UVector** (2): integer `indexOf` and `sortedInsert`. ICU passes uninitialized upper union bytes to the comparator here; the adapter zeroes them. 664 legacy entries stay `NotImplemented_nid_no_patch` stubs. Among them are the format swappers (break iterator, resource bundle, dictionary, names, converter, collation and normalization), `UDataMemory` loading, and the locale paths that need data or full ID parsing. The [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/debt/libSceIcu.md) entries for Trie builders, Data swappers, Format swappers, Vector objects, ICUService, LocaleKey and locale factories, LocaleBuilder, Locale objects and Locale keyword lists are updated, and the files derived from ICU keep ICU's notice and the IBM copyright lines of their sources. ### Tested Windows 11, host build of the library with the Qt MinGW 13.1 toolchain, against ICU 68.2 (`84e1f26ea77152936e70d53178a816dbfbf69989`) built on the same host: - all 56 `core/libs/prx/libSceIcu/tests` executables pass on this head (`TEST EXIT CODE: 0`) (`TEST EXIT CODE: 0`); - differential programs that call our export and ICU's on the same inputs and compare every output, status and object field (results below); - every changed source compiles with the real `APS5_VABI`; - `tools/check_conventions.py` passes and `core/libs/tests/test_public_headers.py --audit-only` passes. | Differential | Result | | --- | --- | | `TrieBuilderDiff` (layouts, virtual slots, builds) | 1580 comparisons, 0 bad | | `TrieBuilderRandomDiff` (1500 random builders: any UTF-16 unit, empty strings, full int32 values, duplicates, add after build, double build, `build()` and `buildUnicodeString()`) | 1191 tries, 275951 comparisons, 0 bad | | `TrieSwapDiff` (420 tries built by ICU: UTrie v1, UTrie2 16/32-bit, UCPTrie fast/small 8/16/32-bit; preflight, in place, truncated, corrupted headers, round trips; 2000 random buffers) | 3580562 comparisons, 0 bad | | `DataSwapperDiff` | 3342 comparisons, 0 bad | | `VectorDiff` | 541278 comparisons, 0 bad | | `ServiceCacheDiff` (2002 random sequences of 300 operations) | 125485864 checks, 0 bad | | `ServiceLocaleDiff` (1001 sequences of 300 key and 300 factory operations) | 400985773 comparisons, 0 bad | | `ServiceResourceFactoryDiff` | 22424391 checks, 0 bad | | `ServiceListenerDiff` | 300300 comparisons per export, 0 bad | | `LocaleKeywordsDiff` | 1200 inputs, 2706631 checks, 0 bad | | `LocaleObjectDiff`, `LocaleBuilderDiff` (existing exports, rerun after the merge) | `DIFF EXIT CODE: 0` | The differentials found and fixed seven bugs in the first version of this code: - `UTRIE_SHIFT` 4 instead of 5, which rejected every UTrie v1; - `UTRIE2_INDEX_1_OFFSET` 0x220 instead of 0x840; - `UCPTRIE_BMP_INDEX_LENGTH` 0x1000 instead of 0x400; - the two- and three-unit thresholds of `writeValueAndFinal`, `writeValueAndType` and `writeDeltaTo`; - `add` after `build` returning 20 instead of `U_NO_WRITE_PERMISSION`; - `add` of a string longer than 0xffff not counting the element. The differential sources and the runner are in the gist linked below. The reference ICU is a Windows build, so `CharStringDiff` still differs on purpose (`\` against the POSIX `/`), as in #14340. The guest build and CTest run are left to CI (no full CMake configure here: SDL2/ffmpeg submodules missing). `pr_overlap.py`: the shared libSceIcu files overlap with the ICU stack this PR builds on (#14016, #14144, #14340) and with other ICU PRs. None of them implements any of these 88 exports; the only open PRs whose diffs name them are #14016, #14144 and #14340, where they are still stubs. #11088 implements `uprv_*` numeric helpers only. ### 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: #14340 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 14:49:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:49:09Z.

Review: COMMENTED


Reviewed in part — no blocking findings so far

The 1,695 legacy export names that this stack renamed keep their NIDs (each removed NID is produced by a head symbol under the audit's name-to-NID computation), and the head commit that renames internal callbacks is mechanically consistent; the rest of the roughly 25,000-line change is not read, so this is a partial result and not an approval.

What I ran

  • Exact head 7d4b66e3f201590a4fb949f3128094c971c710a4, base f1a7b02028 (the precheck base). The PR is stacked on three open PRs: #14016 (head c516806ab7), #14144 (head 919905beb4) and #14340 (head f6303c9c46). The commits from c516806ab7 to f6303c9c46 belong to those PRs; this PR's own commits are f376d5d149, 47f9f3b842 and 7d4b66e3f2.
  • Environment: Linux, /usr/bin/python3 3.11.2, no build.
  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /dev/shm/reviewer-run/precheck/14443
  • ABI audit by hand (helper absent from the head tree): python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base f1a7b02028 --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --json (exit 0; passed_with_warnings; 1,719 findings: 1,695 export-removed and 24 public-declaration-not-found; 4,233 symbols).
  • NID check: I compared the APS5_EXPORT("<NID>", name) pairs in core/libs/prx/libSceIcu at the base (2,371) and the head (676); 1,695 literal pairs are gone at the head. Each of the 1,695 NIDs equals the computed NID of a head symbol, so the audit's name-to-NID computation carries them to the renamed ICU symbols. No NID was added as a literal pair.
  • Head commit read: 7d4b66e3f2, refactor(libSceIcu): mark the swapper, service and trie builder callbacks as internal. It renames 26 definitions (SwapArray16, CopyArray16 and others in DataSwapper.cpp, the service hash-table callbacks in Service.cpp, and the trie-builder vtable callbacks in TrieBuilder.cpp) to a _nid_no_patch suffix. I checked that none of the 26 old names remains in core/libs/prx/libSceIcu at the head (the one other match, Abstract, is a separate function in CharacterIteratorObjects.cpp).
  • Read in part: the f376d5d149 and 47f9f3b842 commits were not read in full; I read only the file list and the CMakeLists.txt addition for the new LocaleKeywords test.

Results

Precheck report, checks table, unedited (/dev/shm/reviewer-run/precheck/14443/report.md):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check f1a7b02028ae50adaf6c5aaaef892a51841b25bf...7d4b66e3f201590a4fb949f3128094c971c710a4
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --title feat(libSceIcu): implement the string trie builders, data swappers and the ICU service cache --body /dev/shm/reviewer-run/precheck/14443/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14443/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /dev/shm/reviewer-run/precheck/14443/head-7d4b66e3f201-a9d97ffd/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14443/head-7d4b66e3f201-a9d97ffd --json core/libs/prx/libSceIcu/Appendable.cpp core/libs/prx/libSceIcu/Appendable.hpp core/libs/prx/libSceIcu/BasicStringUtilities.cpp core/libs/prx/libSceIcu/BasicStringUtilities.hpp core/libs/prx/libSceIcu/ByteSink.cpp core/libs/prx/libSceIcu/ByteSink.hpp core/libs/prx/libSceIcu/ByteSinkUtil.cpp core/libs/prx/libSceIcu/ByteSinkUtil.hpp core/libs/prx/libSceIcu/BytesTrie.cpp core/libs/prx/libSceIcu/BytesTrie.hpp core/libs/prx/libSceIcu/CMakeLists.txt core/libs/prx/libSceIcu/CharString.cpp core/libs/prx/libSceIcu/CharString.hpp core/libs/prx/libSceIcu/CharacterIterator.cpp core/libs/prx/libSceIcu/CharacterIterator.hpp core/libs/prx/libSceIcu/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/CharacterIteratorObjects.hpp core/libs/prx/libSceIcu/Cleanup.cpp core/libs/prx/libSceIcu/Cleanup.hpp core/libs/prx/libSceIcu/CodePointTrie.cpp core/libs/prx/libSceIcu/CodePointTrie.hpp core/libs/prx/libSceIcu/DataSwapper.cpp core/libs/prx/libSceIcu/DataSwapper.hpp core/libs/prx/libSceIcu/Edits.cpp core/libs/prx/libSceIcu/Edits.hpp core/libs/prx/libSceIcu/ErrorCode.cpp core/libs/prx/libSceIcu/ErrorCode.hpp core/libs/prx/libSceIcu/Export.cpp core/libs/prx/libSceIcu/Hash.cpp core/libs/prx/libSceIcu/Hash.hpp core/libs/prx/libSceIcu/IcuUtility.cpp core/libs/prx/libSceIcu/IcuUtility.hpp core/libs/prx/libSceIcu/LegacyExports.cpp core/libs/prx/libSceIcu/List.cpp core/libs/prx/libSceIcu/List.hpp core/libs/prx/libSceIcu/LocaleBuilder.cpp core/libs/prx/libSceIcu/LocaleBuilder.hpp core/libs/prx/libSceIcu/LocaleId.cpp core/libs/prx/libSceIcu/LocaleId.hpp core/libs/prx/libSceIcu/LocaleKeywords.cpp core/libs/prx/libSceIcu/LocaleKeywords.hpp core/libs/prx/libSceIcu/LocaleObject.cpp core/libs/prx/libSceIcu/LocaleObject.hpp core/libs/prx/libSceIcu/MaybeStackArray.cpp core/libs/prx/libSceIcu/MaybeStackArray.hpp core/libs/prx/libSceIcu/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/MutableCodePointTrie.hpp core/libs/prx/libSceIcu/Object.cpp core/libs/prx/libSceIcu/Object.hpp core/libs/prx/libSceIcu/ParsePosition.cpp core/libs/prx/libSceIcu/ParsePosition.hpp core/libs/prx/libSceIcu/PatternProps.cpp core/libs/prx/libSceIcu/PatternProps.hpp core/libs/prx/libSceIcu/PlatformUtil.cpp core/libs/prx/libSceIcu/PlatformUtil.hpp core/libs/prx/libSceIcu/Service.cpp core/libs/prx/libSceIcu/Service.hpp core/libs/prx/libSceIcu/ServiceFactory.cpp core/libs/prx/libSceIcu/ServiceFactory.hpp core/libs/prx/libSceIcu/ServiceKey.cpp core/libs/prx/libSceIcu/ServiceKey.hpp core/libs/prx/libSceIcu/ServiceLocale.cpp core/libs/prx/libSceIcu/ServiceLocale.hpp core/libs/prx/libSceIcu/ServiceNotifier.cpp core/libs/prx/libSceIcu/ServiceNotifier.hpp core/libs/prx/libSceIcu/ServiceStringPair.cpp core/libs/prx/libSceIcu/ServiceStringPair.hpp core/libs/prx/libSceIcu/StringCharacterIterator.cpp core/libs/prx/libSceIcu/StringCharacterIterator.hpp core/libs/prx/libSceIcu/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/StringEnumerationObjects.hpp core/libs/prx/libSceIcu/StringPiece.cpp core/libs/prx/libSceIcu/StringPiece.hpp core/libs/prx/libSceIcu/StringsEnumeration.cpp core/libs/prx/libSceIcu/StringsEnumeration.hpp core/libs/prx/libSceIcu/Terminate.cpp core/libs/prx/libSceIcu/Terminate.hpp core/libs/prx/libSceIcu/Text.cpp core/libs/prx/libSceIcu/Text.hpp core/libs/prx/libSceIcu/Trace.cpp core/libs/prx/libSceIcu/Trace.hpp core/libs/prx/libSceIcu/Trie2.cpp core/libs/prx/libSceIcu/Trie2.hpp core/libs/prx/libSceIcu/TrieBuilder.cpp core/libs/prx/libSceIcu/TrieBuilder.hpp core/libs/prx/libSceIcu/TrieEnumeration.cpp core/libs/prx/libSceIcu/TrieEnumeration.hpp core/libs/prx/libSceIcu/UCharsTrie.cpp core/libs/prx/libSceIcu/UCharsTrie.hpp core/libs/prx/libSceIcu/UnicodeFilter.cpp core/libs/prx/libSceIcu/UnicodeFilter.hpp core/libs/prx/libSceIcu/UnicodeSet.cpp core/libs/prx/libSceIcu/UnicodeSet.hpp core/libs/prx/libSceIcu/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/UnicodeSetIterator.hpp core/libs/prx/libSceIcu/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/UnicodeSetPattern.hpp core/libs/prx/libSceIcu/UnicodeString.cpp core/libs/prx/libSceIcu/UnicodeString.hpp core/libs/prx/libSceIcu/UnicodeStringHash.cpp core/libs/prx/libSceIcu/UnicodeStringHash.hpp core/libs/prx/libSceIcu/UnicodeStringSink.cpp core/libs/prx/libSceIcu/UnicodeStringSink.hpp core/libs/prx/libSceIcu/Vector.cpp core/libs/prx/libSceIcu/Vector.hpp core/libs/prx/libSceIcu/Vector32.cpp core/libs/prx/libSceIcu/Vector32.hpp core/libs/prx/libSceIcu/VectorObjects.cpp core/libs/prx/libSceIcu/VectorObjects.hpp core/libs/prx/libSceIcu/include/InventoryDispatch.hpp core/libs/prx/libSceIcu/include/LegacyExports.hpp core/libs/prx/libSceIcu/libSceIcu.hpp core/libs/prx/libSceIcu/tests/Appendable.cpp core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp core/libs/prx/libSceIcu/tests/ByteSink.cpp core/libs/prx/libSceIcu/tests/ByteSinkUtil.cpp core/libs/prx/libSceIcu/tests/BytesTrie.cpp core/libs/prx/libSceIcu/tests/CharString.cpp core/libs/prx/libSceIcu/tests/CharacterIterator.cpp core/libs/prx/libSceIcu/tests/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/tests/Cleanup.cpp core/libs/prx/libSceIcu/tests/CodePointTrie.cpp core/libs/prx/libSceIcu/tests/DataSwapper.cpp core/libs/prx/libSceIcu/tests/Edits.cpp core/libs/prx/libSceIcu/tests/ErrorCode.cpp core/libs/prx/libSceIcu/tests/Hash.cpp core/libs/prx/libSceIcu/tests/IcuUtility.cpp core/libs/prx/libSceIcu/tests/List.cpp core/libs/prx/libSceIcu/tests/LocaleBuilder.cpp core/libs/prx/libSceIcu/tests/LocaleId.cpp core/libs/prx/libSceIcu/tests/LocaleKeywords.cpp core/libs/prx/libSceIcu/tests/LocaleObject.cpp core/libs/prx/libSceIcu/tests/MaybeStackArray.cpp core/libs/prx/libSceIcu/tests/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/tests/ParsePosition.cpp core/libs/prx/libSceIcu/tests/PatternProps.cpp core/libs/prx/libSceIcu/tests/PlatformUtil.cpp core/libs/prx/libSceIcu/tests/Service.cpp core/libs/prx/libSceIcu/tests/ServiceFactory.cpp core/libs/prx/libSceIcu/tests/ServiceKey.cpp core/libs/prx/libSceIcu/tests/ServiceLocale.cpp core/libs/prx/libSceIcu/tests/ServiceNotifier.cpp core/libs/prx/libSceIcu/tests/ServiceStringPair.cpp core/libs/prx/libSceIcu/tests/StringCharacterIterator.cpp core/libs/prx/libSceIcu/tests/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/tests/StringPiece.cpp core/libs/prx/libSceIcu/tests/StringsEnumeration.cpp core/libs/prx/libSceIcu/tests/Terminate.cpp core/libs/prx/libSceIcu/tests/Text.cpp core/libs/prx/libSceIcu/tests/Trace.cpp core/libs/prx/libSceIcu/tests/Trie2.cpp core/libs/prx/libSceIcu/tests/TrieBuilder.cpp core/libs/prx/libSceIcu/tests/TrieEnumeration.cpp core/libs/prx/libSceIcu/tests/UCharsTrie.cpp core/libs/prx/libSceIcu/tests/UnicodeFilter.cpp core/libs/prx/libSceIcu/tests/UnicodeSet.cpp core/libs/prx/libSceIcu/tests/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/tests/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/tests/UnicodeString.cpp core/libs/prx/libSceIcu/tests/UnicodeStringHash.cpp core/libs/prx/libSceIcu/tests/UnicodeStringSink.cpp core/libs/prx/libSceIcu/tests/Vector.cpp core/libs/prx/libSceIcu/tests/Vector32.cpp core/libs/prx/libSceIcu/tests/VectorObjects.cpp docs/dev/debt/libSceIcu.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run here. The tests need a built libSceIcu.

Findings

Blocking: none found in the parts I read.

Non-blocking:

  • The head commit's stated purpose is to stop tools/progress.py from counting these callbacks as exports. That is the same workaround I flagged on #14421: the rename is harmless, but the counting tool should skip internal symbols instead of the source being renamed to satisfy it.
  • The PR depends on three open PRs (#14016, #14144, #14340). A review of this PR's own commits is only meaningful with those three in place; the author should keep the stack order explicit.

Sources

Not verified

  • Not read: most of the new implementation in TrieBuilder.cpp (1,159 lines), DataSwapper.cpp (696 lines), Service.cpp (544 added lines), the f376d5d149 and 47f9f3b842 commits, the 1,695 renamed legacy exports beyond the NID check, and most of the 25 test files.
  • The ICU 68 behaviour and the byte-identical trie claim in the PR body were not checked.
  • No build and no test run.
  • Hosted: at this head conventions (one cancelled, one queued), eligibility, library-portability and report were queued at review time.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5728687520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5728687520). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T14:49:09Z. **Review:** COMMENTED --- # Reviewed in part — no blocking findings so far The 1,695 legacy export names that this stack renamed keep their NIDs (each removed NID is produced by a head symbol under the audit's name-to-NID computation), and the head commit that renames internal callbacks is mechanically consistent; the rest of the roughly 25,000-line change is not read, so this is a partial result and not an approval. ## What I ran - Exact head `7d4b66e3f201590a4fb949f3128094c971c710a4`, base `f1a7b02028` (the precheck base). The PR is stacked on three open PRs: #14016 (head `c516806ab7`), #14144 (head `919905beb4`) and #14340 (head `f6303c9c46`). The commits from `c516806ab7` to `f6303c9c46` belong to those PRs; this PR's own commits are `f376d5d149`, `47f9f3b842` and `7d4b66e3f2`. - Environment: Linux, `/usr/bin/python3` 3.11.2, no build. - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /dev/shm/reviewer-run/precheck/14443` - ABI audit by hand (helper absent from the head tree): `python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base f1a7b02028 --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --json` (exit 0; `passed_with_warnings`; 1,719 findings: 1,695 `export-removed` and 24 `public-declaration-not-found`; 4,233 symbols). - NID check: I compared the `APS5_EXPORT("<NID>", name)` pairs in `core/libs/prx/libSceIcu` at the base (2,371) and the head (676); 1,695 literal pairs are gone at the head. Each of the 1,695 NIDs equals the computed NID of a head symbol, so the audit's name-to-NID computation carries them to the renamed ICU symbols. No NID was added as a literal pair. - Head commit read: `7d4b66e3f2`, `refactor(libSceIcu): mark the swapper, service and trie builder callbacks as internal`. It renames 26 definitions (`SwapArray16`, `CopyArray16` and others in `DataSwapper.cpp`, the service hash-table callbacks in `Service.cpp`, and the trie-builder vtable callbacks in `TrieBuilder.cpp`) to a `_nid_no_patch` suffix. I checked that none of the 26 old names remains in `core/libs/prx/libSceIcu` at the head (the one other match, `Abstract`, is a separate function in `CharacterIteratorObjects.cpp`). - Read in part: the `f376d5d149` and `47f9f3b842` commits were not read in full; I read only the file list and the `CMakeLists.txt` addition for the new `LocaleKeywords` test. ## Results Precheck report, checks table, unedited (`/dev/shm/reviewer-run/precheck/14443/report.md`): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f1a7b02028ae50adaf6c5aaaef892a51841b25bf...7d4b66e3f201590a4fb949f3128094c971c710a4` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --title feat(libSceIcu): implement the string trie builders, data swappers and the ICU service cache --body /dev/shm/reviewer-run/precheck/14443/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14443/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /dev/shm/reviewer-run/precheck/14443/head-7d4b66e3f201-a9d97ffd/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14443/head-7d4b66e3f201-a9d97ffd --json core/libs/prx/libSceIcu/Appendable.cpp core/libs/prx/libSceIcu/Appendable.hpp core/libs/prx/libSceIcu/BasicStringUtilities.cpp core/libs/prx/libSceIcu/BasicStringUtilities.hpp core/libs/prx/libSceIcu/ByteSink.cpp core/libs/prx/libSceIcu/ByteSink.hpp core/libs/prx/libSceIcu/ByteSinkUtil.cpp core/libs/prx/libSceIcu/ByteSinkUtil.hpp core/libs/prx/libSceIcu/BytesTrie.cpp core/libs/prx/libSceIcu/BytesTrie.hpp core/libs/prx/libSceIcu/CMakeLists.txt core/libs/prx/libSceIcu/CharString.cpp core/libs/prx/libSceIcu/CharString.hpp core/libs/prx/libSceIcu/CharacterIterator.cpp core/libs/prx/libSceIcu/CharacterIterator.hpp core/libs/prx/libSceIcu/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/CharacterIteratorObjects.hpp core/libs/prx/libSceIcu/Cleanup.cpp core/libs/prx/libSceIcu/Cleanup.hpp core/libs/prx/libSceIcu/CodePointTrie.cpp core/libs/prx/libSceIcu/CodePointTrie.hpp core/libs/prx/libSceIcu/DataSwapper.cpp core/libs/prx/libSceIcu/DataSwapper.hpp core/libs/prx/libSceIcu/Edits.cpp core/libs/prx/libSceIcu/Edits.hpp core/libs/prx/libSceIcu/ErrorCode.cpp core/libs/prx/libSceIcu/ErrorCode.hpp core/libs/prx/libSceIcu/Export.cpp core/libs/prx/libSceIcu/Hash.cpp core/libs/prx/libSceIcu/Hash.hpp core/libs/prx/libSceIcu/IcuUtility.cpp core/libs/prx/libSceIcu/IcuUtility.hpp core/libs/prx/libSceIcu/LegacyExports.cpp core/libs/prx/libSceIcu/List.cpp core/libs/prx/libSceIcu/List.hpp core/libs/prx/libSceIcu/LocaleBuilder.cpp core/libs/prx/libSceIcu/LocaleBuilder.hpp core/libs/prx/libSceIcu/LocaleId.cpp core/libs/prx/libSceIcu/LocaleId.hpp core/libs/prx/libSceIcu/LocaleKeywords.cpp core/libs/prx/libSceIcu/LocaleKeywords.hpp core/libs/prx/libSceIcu/LocaleObject.cpp core/libs/prx/libSceIcu/LocaleObject.hpp core/libs/prx/libSceIcu/MaybeStackArray.cpp core/libs/prx/libSceIcu/MaybeStackArray.hpp core/libs/prx/libSceIcu/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/MutableCodePointTrie.hpp core/libs/prx/libSceIcu/Object.cpp core/libs/prx/libSceIcu/Object.hpp core/libs/prx/libSceIcu/ParsePosition.cpp core/libs/prx/libSceIcu/ParsePosition.hpp core/libs/prx/libSceIcu/PatternProps.cpp core/libs/prx/libSceIcu/PatternProps.hpp core/libs/prx/libSceIcu/PlatformUtil.cpp core/libs/prx/libSceIcu/PlatformUtil.hpp core/libs/prx/libSceIcu/Service.cpp core/libs/prx/libSceIcu/Service.hpp core/libs/prx/libSceIcu/ServiceFactory.cpp core/libs/prx/libSceIcu/ServiceFactory.hpp core/libs/prx/libSceIcu/ServiceKey.cpp core/libs/prx/libSceIcu/ServiceKey.hpp core/libs/prx/libSceIcu/ServiceLocale.cpp core/libs/prx/libSceIcu/ServiceLocale.hpp core/libs/prx/libSceIcu/ServiceNotifier.cpp core/libs/prx/libSceIcu/ServiceNotifier.hpp core/libs/prx/libSceIcu/ServiceStringPair.cpp core/libs/prx/libSceIcu/ServiceStringPair.hpp core/libs/prx/libSceIcu/StringCharacterIterator.cpp core/libs/prx/libSceIcu/StringCharacterIterator.hpp core/libs/prx/libSceIcu/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/StringEnumerationObjects.hpp core/libs/prx/libSceIcu/StringPiece.cpp core/libs/prx/libSceIcu/StringPiece.hpp core/libs/prx/libSceIcu/StringsEnumeration.cpp core/libs/prx/libSceIcu/StringsEnumeration.hpp core/libs/prx/libSceIcu/Terminate.cpp core/libs/prx/libSceIcu/Terminate.hpp core/libs/prx/libSceIcu/Text.cpp core/libs/prx/libSceIcu/Text.hpp core/libs/prx/libSceIcu/Trace.cpp core/libs/prx/libSceIcu/Trace.hpp core/libs/prx/libSceIcu/Trie2.cpp core/libs/prx/libSceIcu/Trie2.hpp core/libs/prx/libSceIcu/TrieBuilder.cpp core/libs/prx/libSceIcu/TrieBuilder.hpp core/libs/prx/libSceIcu/TrieEnumeration.cpp core/libs/prx/libSceIcu/TrieEnumeration.hpp core/libs/prx/libSceIcu/UCharsTrie.cpp core/libs/prx/libSceIcu/UCharsTrie.hpp core/libs/prx/libSceIcu/UnicodeFilter.cpp core/libs/prx/libSceIcu/UnicodeFilter.hpp core/libs/prx/libSceIcu/UnicodeSet.cpp core/libs/prx/libSceIcu/UnicodeSet.hpp core/libs/prx/libSceIcu/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/UnicodeSetIterator.hpp core/libs/prx/libSceIcu/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/UnicodeSetPattern.hpp core/libs/prx/libSceIcu/UnicodeString.cpp core/libs/prx/libSceIcu/UnicodeString.hpp core/libs/prx/libSceIcu/UnicodeStringHash.cpp core/libs/prx/libSceIcu/UnicodeStringHash.hpp core/libs/prx/libSceIcu/UnicodeStringSink.cpp core/libs/prx/libSceIcu/UnicodeStringSink.hpp core/libs/prx/libSceIcu/Vector.cpp core/libs/prx/libSceIcu/Vector.hpp core/libs/prx/libSceIcu/Vector32.cpp core/libs/prx/libSceIcu/Vector32.hpp core/libs/prx/libSceIcu/VectorObjects.cpp core/libs/prx/libSceIcu/VectorObjects.hpp core/libs/prx/libSceIcu/include/InventoryDispatch.hpp core/libs/prx/libSceIcu/include/LegacyExports.hpp core/libs/prx/libSceIcu/libSceIcu.hpp core/libs/prx/libSceIcu/tests/Appendable.cpp core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp core/libs/prx/libSceIcu/tests/ByteSink.cpp core/libs/prx/libSceIcu/tests/ByteSinkUtil.cpp core/libs/prx/libSceIcu/tests/BytesTrie.cpp core/libs/prx/libSceIcu/tests/CharString.cpp core/libs/prx/libSceIcu/tests/CharacterIterator.cpp core/libs/prx/libSceIcu/tests/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/tests/Cleanup.cpp core/libs/prx/libSceIcu/tests/CodePointTrie.cpp core/libs/prx/libSceIcu/tests/DataSwapper.cpp core/libs/prx/libSceIcu/tests/Edits.cpp core/libs/prx/libSceIcu/tests/ErrorCode.cpp core/libs/prx/libSceIcu/tests/Hash.cpp core/libs/prx/libSceIcu/tests/IcuUtility.cpp core/libs/prx/libSceIcu/tests/List.cpp core/libs/prx/libSceIcu/tests/LocaleBuilder.cpp core/libs/prx/libSceIcu/tests/LocaleId.cpp core/libs/prx/libSceIcu/tests/LocaleKeywords.cpp core/libs/prx/libSceIcu/tests/LocaleObject.cpp core/libs/prx/libSceIcu/tests/MaybeStackArray.cpp core/libs/prx/libSceIcu/tests/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/tests/ParsePosition.cpp core/libs/prx/libSceIcu/tests/PatternProps.cpp core/libs/prx/libSceIcu/tests/PlatformUtil.cpp core/libs/prx/libSceIcu/tests/Service.cpp core/libs/prx/libSceIcu/tests/ServiceFactory.cpp core/libs/prx/libSceIcu/tests/ServiceKey.cpp core/libs/prx/libSceIcu/tests/ServiceLocale.cpp core/libs/prx/libSceIcu/tests/ServiceNotifier.cpp core/libs/prx/libSceIcu/tests/ServiceStringPair.cpp core/libs/prx/libSceIcu/tests/StringCharacterIterator.cpp core/libs/prx/libSceIcu/tests/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/tests/StringPiece.cpp core/libs/prx/libSceIcu/tests/StringsEnumeration.cpp core/libs/prx/libSceIcu/tests/Terminate.cpp core/libs/prx/libSceIcu/tests/Text.cpp core/libs/prx/libSceIcu/tests/Trace.cpp core/libs/prx/libSceIcu/tests/Trie2.cpp core/libs/prx/libSceIcu/tests/TrieBuilder.cpp core/libs/prx/libSceIcu/tests/TrieEnumeration.cpp core/libs/prx/libSceIcu/tests/UCharsTrie.cpp core/libs/prx/libSceIcu/tests/UnicodeFilter.cpp core/libs/prx/libSceIcu/tests/UnicodeSet.cpp core/libs/prx/libSceIcu/tests/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/tests/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/tests/UnicodeString.cpp core/libs/prx/libSceIcu/tests/UnicodeStringHash.cpp core/libs/prx/libSceIcu/tests/UnicodeStringSink.cpp core/libs/prx/libSceIcu/tests/Vector.cpp core/libs/prx/libSceIcu/tests/Vector32.cpp core/libs/prx/libSceIcu/tests/VectorObjects.cpp docs/dev/debt/libSceIcu.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ## Negative control Not run here. The tests need a built libSceIcu. ## Findings **Blocking:** none found in the parts I read. **Non-blocking:** - The head commit's stated purpose is to stop `tools/progress.py` from counting these callbacks as exports. That is the same workaround I flagged on #14421: the rename is harmless, but the counting tool should skip internal symbols instead of the source being renamed to satisfy it. - The PR depends on three open PRs (#14016, #14144, #14340). A review of this PR's own commits is only meaningful with those three in place; the author should keep the stack order explicit. ## Sources - Head commit's renamed definitions: https://github.com/boykopovar/AnyPS5/blob/7d4b66e3f201590a4fb949f3128094c971c710a4/core/libs/prx/libSceIcu/DataSwapper.cpp - The `LocaleKeywords` test registration at head: https://github.com/boykopovar/AnyPS5/blob/7d4b66e3f201590a4fb949f3128094c971c710a4/core/libs/prx/libSceIcu/CMakeLists.txt ## Not verified - Not read: most of the new implementation in `TrieBuilder.cpp` (1,159 lines), `DataSwapper.cpp` (696 lines), `Service.cpp` (544 added lines), the `f376d5d149` and `47f9f3b842` commits, the 1,695 renamed legacy exports beyond the NID check, and most of the 25 test files. - The ICU 68 behaviour and the byte-identical trie claim in the PR body were not checked. - No build and no test run. - Hosted: at this head `conventions` (one cancelled, one queued), `eligibility`, `library-portability` and `report` were queued at review time.
THEMANnt commented 2026-11-01 15:07:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-11-01T15:07:42Z.

Review: CHANGES_REQUESTED


Reviewed 7d4b66e3f201590a4fb949f3128094c971c710a4.

[P1] Give the factory deleter the guest calling convention — Service.cpp:159 / DeleteObject at line 60. CreateFactoryVector casts the plain host-ABI DeleteObject into Icu::ObjectDeleter, which is an APS5_VABI function pointer. On Windows, UVector calls it using System V registers while the function expects Microsoft x64 registers. Unregistering a factory or destroying/resetting a service with factories can therefore delete the wrong object and corrupt the heap. The submitted guest_icu_service reproduces heap-corruption exit 0xc0000374. In a separate control build, changing only the helper declaration to void APS5_VABI DeleteObject(Object*) makes that same test pass. Please use a correctly typed guest-ABI deleter/trampoline and retain a Windows cleanup regression.

Windows/MSYS2 GCC 16.2 Release, real guest ABI: 59/60 submitted ICU suites pass in an isolated DLL-linked harness; the service suite fails. The helper for the DataSwapper test supports only its exercised formatting patterns. Whitespace and conventions pass. No author files were modified. Depends on #14340.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5728749417 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5728749417). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-11-01T15:07:42Z. **Review:** CHANGES_REQUESTED --- Reviewed `7d4b66e3f201590a4fb949f3128094c971c710a4`. **[P1] Give the factory deleter the guest calling convention — `Service.cpp:159` / `DeleteObject` at line 60.** `CreateFactoryVector` casts the plain host-ABI `DeleteObject` into `Icu::ObjectDeleter`, which is an `APS5_VABI` function pointer. On Windows, UVector calls it using System V registers while the function expects Microsoft x64 registers. Unregistering a factory or destroying/resetting a service with factories can therefore delete the wrong object and corrupt the heap. The submitted `guest_icu_service` reproduces heap-corruption exit `0xc0000374`. In a separate control build, changing only the helper declaration to `void APS5_VABI DeleteObject(Object*)` makes that same test pass. Please use a correctly typed guest-ABI deleter/trampoline and retain a Windows cleanup regression. Windows/MSYS2 GCC 16.2 Release, real guest ABI: 59/60 submitted ICU suites pass in an isolated DLL-linked harness; the service suite fails. The helper for the DataSwapper test supports only its exercised formatting patterns. Whitespace and conventions pass. No author files were modified. Depends on #14340.
MarcZX10 commented 2026-11-01 19:00:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:00:04Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Four blocking items at this head: a size overflow that lets the trie swapper write past its buffer, a use after free on a repeated unregister, an out-of-bounds read in setLocale, and a debt-file entry that contradicts the code. This complete result supersedes the partial review 5728687520 at 7d4b66e3f2.

What I ran

  • Head c3295f3c312c8d063f40b17b43c66a4424ecdb0b; PR base f1a7b02028; own-commit base f6303c9c46 (top of #14340). 165 files in the PR; 28 are this PR's own commits (f376d5d149, 47f9f3b842, 7d4b66e3f2, c3295f3c31). The other 137 belong to the stacked PRs #14016, #14144 and #14340 and are not reviewed here.
  • Read: all 28 own files, split across six read-only subagents (TrieBuilder; DataSwapper with its test; Service and ServiceLocale with their tests; LegacyExports removals, libSceIcu.hpp and Vector; the Locale files; CMake, the debt file and the trie test). I re-read the four blocking sites myself and checked the arithmetic of the first.
  • Precheck report at this exact head (head and base unchanged at completion). Two precheck rows (ABI audit, test quality) failed because their helpers are not in the head tree; I reran both by hand. Details below.

Results

Check Result Note
Diff check passed
Conventions and PR template passed
Mergeability and stack passed stack check passed; #14016, #14144 and #14340 are still open
Export ABI audit (own scope, by hand) passed 1603 symbols, 0 alias mismatches; one warning, a test helper
Test quality (by hand) passed 8 flags are false positives; all eight tests are registered in CMake
Trie swapper size arithmetic failed int32 overflow lets swaps run past the buffer (finding 1)
Unregister of an unknown key failed call through freed memory after a repeat (finding 2)
setLocale variant offset failed read past the name for a large offset (finding 3)
Debt file accuracy failed says implemented wrappers are stubs (finding 4)
Trie builder and other code passed non-blocking items only
Build and runtime tests not run no build
Negative controls not run needs a build
Hosted CI passed completed jobs succeeded; relinker jobs skipped by the workflow
Commands and unedited precheck output

Commands:

  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /dev/shm/reviewer-run/precheck/14443c (report: report.md in that directory).
  • ABI audit, by hand, own scope: python3 tools/pr_abi_audit.py --base f6303c9c46 --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --json. Result: passed_with_warnings; 1603 symbols; 0 alias mismatches; one warning, CapturePrintError, which is a test helper in tests/DataSwapper.cpp (line 106).
  • ABI audit, by hand, full PR base: ... --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf .... Result: 4234 symbols; 1695 export-removed entries, which come from the stacked #14016 rename of the legacy names (not checked here); 24 declaration warnings.
  • Test quality, by hand, on an archive of the head: python3 tools/pr_test_quality.py --root <archive> --json on the eight test files. The eight flags are possible-unregistered-cpp-test. All eight are registered in CMakeLists.txt at lines 284, 541, 556, 676, 691, 878, 889 and 905 (add_test_executable).
  • Hosted checks: gh api repos/boykopovar/AnyPS5/commits/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/check-runs.

Precheck table (unedited):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check f1a7b02028ae50adaf6c5aaaef892a51841b25bf...c3295f3c312c8d063f40b17b43c66a4424ecdb0b
conventions_and_pr_template passed /marc/Conlyse-VIEJO/.venv/bin/python3 tools/check_conventions.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --title feat(libSceIcu): implement the string trie builders, data swappers and the ICU service cache --body /dev/shm/reviewer-run/precheck/14443c/pr-body.md
changed_export_abi_audit failed /marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /marc/Conlyse-VIEJO/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14443c/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /marc/Conlyse-VIEJO/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14443c/head-c3295f3c312c-2bbdfd49/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14443c/head-c3295f3c312c-2bbdfd49 --json core/libs/prx/libSceIcu/Appendable.cpp core/libs/prx/libSceIcu/Appendable.hpp core/libs/prx/libSceIcu/BasicStringUtilities.cpp core/libs/prx/libSceIcu/BasicStringUtilities.hpp core/libs/prx/libSceIcu/ByteSink.cpp core/libs/prx/libSceIcu/ByteSink.hpp core/libs/prx/libSceIcu/ByteSinkUtil.cpp core/libs/prx/libSceIcu/ByteSinkUtil.hpp core/libs/prx/libSceIcu/BytesTrie.cpp core/libs/prx/libSceIcu/BytesTrie.hpp core/libs/prx/libSceIcu/CMakeLists.txt core/libs/prx/libSceIcu/CharString.cpp core/libs/prx/libSceIcu/CharString.hpp core/libs/prx/libSceIcu/CharacterIterator.cpp core/libs/prx/libSceIcu/CharacterIterator.hpp core/libs/prx/libSceIcu/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/CharacterIteratorObjects.hpp core/libs/prx/libSceIcu/Cleanup.cpp core/libs/prx/libSceIcu/Cleanup.hpp core/libs/prx/libSceIcu/CodePointTrie.cpp core/libs/prx/libSceIcu/CodePointTrie.hpp core/libs/prx/libSceIcu/DataSwapper.cpp core/libs/prx/libSceIcu/DataSwapper.hpp core/libs/prx/libSceIcu/Edits.cpp core/libs/prx/libSceIcu/Edits.hpp core/libs/prx/libSceIcu/ErrorCode.cpp core/libs/prx/libSceIcu/ErrorCode.hpp core/libs/prx/libSceIcu/Export.cpp core/libs/prx/libSceIcu/Hash.cpp core/libs/prx/libSceIcu/Hash.hpp core/libs/prx/libSceIcu/IcuUtility.cpp core/libs/prx/libSceIcu/IcuUtility.hpp core/libs/prx/libSceIcu/LegacyExports.cpp core/libs/prx/libSceIcu/List.cpp core/libs/prx/libSceIcu/List.hpp core/libs/prx/libSceIcu/LocaleBuilder.cpp core/libs/prx/libSceIcu/LocaleBuilder.hpp core/libs/prx/libSceIcu/LocaleId.cpp core/libs/prx/libSceIcu/LocaleId.hpp core/libs/prx/libSceIcu/LocaleKeywords.cpp core/libs/prx/libSceIcu/LocaleKeywords.hpp core/libs/prx/libSceIcu/LocaleObject.cpp core/libs/prx/libSceIcu/LocaleObject.hpp core/libs/prx/libSceIcu/MaybeStackArray.cpp core/libs/prx/libSceIcu/MaybeStackArray.hpp core/libs/prx/libSceIcu/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/MutableCodePointTrie.hpp core/libs/prx/libSceIcu/Object.cpp core/libs/prx/libSceIcu/Object.hpp core/libs/prx/libSceIcu/ParsePosition.cpp core/libs/prx/libSceIcu/ParsePosition.hpp core/libs/prx/libSceIcu/PatternProps.cpp core/libs/prx/libSceIcu/PatternProps.hpp core/libs/prx/libSceIcu/PlatformUtil.cpp core/libs/prx/libSceIcu/PlatformUtil.hpp core/libs/prx/libSceIcu/Service.cpp core/libs/prx/libSceIcu/Service.hpp core/libs/prx/libSceIcu/ServiceFactory.cpp core/libs/prx/libSceIcu/ServiceFactory.hpp core/libs/prx/libSceIcu/ServiceKey.cpp core/libs/prx/libSceIcu/ServiceKey.hpp core/libs/prx/libSceIcu/ServiceLocale.cpp core/libs/prx/libSceIcu/ServiceLocale.hpp core/libs/prx/libSceIcu/ServiceNotifier.cpp core/libs/prx/libSceIcu/ServiceNotifier.hpp core/libs/prx/libSceIcu/ServiceStringPair.cpp core/libs/prx/libSceIcu/ServiceStringPair.hpp core/libs/prx/libSceIcu/StringCharacterIterator.cpp core/libs/prx/libSceIcu/StringCharacterIterator.hpp core/libs/prx/libSceIcu/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/StringEnumerationObjects.hpp core/libs/prx/libSceIcu/StringPiece.cpp core/libs/prx/libSceIcu/StringPiece.hpp core/libs/prx/libSceIcu/StringsEnumeration.cpp core/libs/prx/libSceIcu/StringsEnumeration.hpp core/libs/prx/libSceIcu/Terminate.cpp core/libs/prx/libSceIcu/Terminate.hpp core/libs/prx/libSceIcu/Text.cpp core/libs/prx/libSceIcu/Text.hpp core/libs/prx/libSceIcu/Trace.cpp core/libs/prx/libSceIcu/Trace.hpp core/libs/prx/libSceIcu/Trie2.cpp core/libs/prx/libSceIcu/Trie2.hpp core/libs/prx/libSceIcu/TrieBuilder.cpp core/libs/prx/libSceIcu/TrieBuilder.hpp core/libs/prx/libSceIcu/TrieEnumeration.cpp core/libs/prx/libSceIcu/TrieEnumeration.hpp core/libs/prx/libSceIcu/UCharsTrie.cpp core/libs/prx/libSceIcu/UCharsTrie.hpp core/libs/prx/libSceIcu/UnicodeFilter.cpp core/libs/prx/libSceIcu/UnicodeFilter.hpp core/libs/prx/libSceIcu/UnicodeSet.cpp core/libs/prx/libSceIcu/UnicodeSet.hpp core/libs/prx/libSceIcu/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/UnicodeSetIterator.hpp core/libs/prx/libSceIcu/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/UnicodeSetPattern.hpp core/libs/prx/libSceIcu/UnicodeString.cpp core/libs/prx/libSceIcu/UnicodeString.hpp core/libs/prx/libSceIcu/UnicodeStringHash.cpp core/libs/prx/libSceIcu/UnicodeStringHash.hpp core/libs/prx/libSceIcu/UnicodeStringSink.cpp core/libs/prx/libSceIcu/UnicodeStringSink.hpp core/libs/prx/libSceIcu/Vector.cpp core/libs/prx/libSceIcu/Vector.hpp core/libs/prx/libSceIcu/Vector32.cpp core/libs/prx/libSceIcu/Vector32.hpp core/libs/prx/libSceIcu/VectorObjects.cpp core/libs/prx/libSceIcu/VectorObjects.hpp core/libs/prx/libSceIcu/include/InventoryDispatch.hpp core/libs/prx/libSceIcu/include/LegacyExports.hpp core/libs/prx/libSceIcu/libSceIcu.hpp core/libs/prx/libSceIcu/tests/Appendable.cpp core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp core/libs/prx/libSceIcu/tests/ByteSink.cpp core/libs/prx/libSceIcu/tests/ByteSinkUtil.cpp core/libs/prx/libSceIcu/tests/BytesTrie.cpp core/libs/prx/libSceIcu/tests/CharString.cpp core/libs/prx/libSceIcu/tests/CharacterIterator.cpp core/libs/prx/libSceIcu/tests/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/tests/Cleanup.cpp core/libs/prx/libSceIcu/tests/CodePointTrie.cpp core/libs/prx/libSceIcu/tests/DataSwapper.cpp core/libs/prx/libSceIcu/tests/Edits.cpp core/libs/prx/libSceIcu/tests/ErrorCode.cpp core/libs/prx/libSceIcu/tests/Hash.cpp core/libs/prx/libSceIcu/tests/IcuUtility.cpp core/libs/prx/libSceIcu/tests/List.cpp core/libs/prx/libSceIcu/tests/LocaleBuilder.cpp core/libs/prx/libSceIcu/tests/LocaleId.cpp core/libs/prx/libSceIcu/tests/LocaleKeywords.cpp core/libs/prx/libSceIcu/tests/LocaleObject.cpp core/libs/prx/libSceIcu/tests/MaybeStackArray.cpp core/libs/prx/libSceIcu/tests/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/tests/ParsePosition.cpp core/libs/prx/libSceIcu/tests/PatternProps.cpp core/libs/prx/libSceIcu/tests/PlatformUtil.cpp core/libs/prx/libSceIcu/tests/Service.cpp core/libs/prx/libSceIcu/tests/ServiceFactory.cpp core/libs/prx/libSceIcu/tests/ServiceKey.cpp core/libs/prx/libSceIcu/tests/ServiceLocale.cpp core/libs/prx/libSceIcu/tests/ServiceNotifier.cpp core/libs/prx/libSceIcu/tests/ServiceStringPair.cpp core/libs/prx/libSceIcu/tests/StringCharacterIterator.cpp core/libs/prx/libSceIcu/tests/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/tests/StringPiece.cpp core/libs/prx/libSceIcu/tests/StringsEnumeration.cpp core/libs/prx/libSceIcu/tests/Terminate.cpp core/libs/prx/libSceIcu/tests/Text.cpp core/libs/prx/libSceIcu/tests/Trace.cpp core/libs/prx/libSceIcu/tests/Trie2.cpp core/libs/prx/libSceIcu/tests/TrieBuilder.cpp core/libs/prx/libSceIcu/tests/TrieEnumeration.cpp core/libs/prx/libSceIcu/tests/UCharsTrie.cpp core/libs/prx/libSceIcu/tests/UnicodeFilter.cpp core/libs/prx/libSceIcu/tests/UnicodeSet.cpp core/libs/prx/libSceIcu/tests/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/tests/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/tests/UnicodeString.cpp core/libs/prx/libSceIcu/tests/UnicodeStringHash.cpp core/libs/prx/libSceIcu/tests/UnicodeStringSink.cpp core/libs/prx/libSceIcu/tests/Vector.cpp core/libs/prx/libSceIcu/tests/Vector32.cpp core/libs/prx/libSceIcu/tests/VectorObjects.cpp docs/dev/debt/libSceIcu.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run. The new tests are C++ and need a build.

Findings

Blocking

  1. The trie swapper can run its swaps past the caller's buffer. DataSwapper.cpp line 379 computes size in int32, from indexLength and dataLength, which are int32 in UTrieHeader (lines 323-328). Only lower bounds are checked (lines 370-372). A header with options 0x125, indexLength 0x3fffffe0 and dataLength 0x20 gives size = -2147483568 after wrapping (16 + 2147483584 + 128, then wrapped). The check at line 381 (length < size) then passes for a length of 16, and the swaps at line 388 run over 2147483584 bytes from a 16-byte buffer. utrie_swapAnyVersion (lines 683-685) reaches this path, so a call with a crafted trie reads and writes far outside the buffer. Smallest fix: bound indexLength and dataLength against the real trie size, or compute size in 64 bits and require size <= length before any swap; check each swap's end against length. Add a test with that header. I checked the arithmetic by hand; it has not been run.

  2. Unregistering an unknown key calls through a pointer the service does not own, and a repeat call reaches freed memory. Service.cpp lines 336-346: when removeElement misses, the else branch sets *status and calls vtable slot 1 (the deleting destructor) on the caller's key (line 345). The service does not own that object. The success path already frees it: removeElement calls Remove (Vector.cpp lines 72-75), which runs the vector's deleter, DeleteFactory, set at Service.cpp line 162. factories is not cleared, so a second unregister with the same key takes the else branch and calls a vtable on freed memory. Smallest fix: on a miss, set *status and return 0 without touching the object. Add a test that unregisters twice; tests/Service.cpp line 36 covers only the successful call.

  3. setLocale reads past the name when the variant offset is larger than the name. LocaleBuilder.cpp line 170 rejects only a negative offset and a null base name. Line 171 then calls strlen(baseName + variantBegin). A locale whose variantBegin is greater than strlen(baseName) makes strlen read outside the string, inside an inline buffer or past a heap allocation. The clamp that exists on the @ path belongs to #14340 (LocaleObject.cpp line 250); the plain path has none. Smallest fix: throw std::invalid_argument when variantBegin > strlen(baseName), as line 170 does for the other offset. Add a test with an offset past the name.

  4. The debt file says integer indexOf and integer sortedInsert are stubs, but this PR implements both. docs/dev/debt/libSceIcu.md line 146 says the integer wrappers "remain stubs". Vector.cpp lines 251-255 and 392-396 implement them, and the debt entry at line 84 says so. The debt file is the record of what is still a stub, so the clause must come out in this PR. Smallest fix: delete the clause.

Non-blocking

  • Trie builder, TrieBuilder.cpp lines 957-963: after a failed reallocation in ensureCapacity, uchars is null and capacity is 0, while ucharsLength keeps counting the units already written. The next write allocates a new buffer and skips the copy. buildUChars (lines 912-914) checks only for a null uchars, so it can return success with uninitialized units. This needs an allocation failure. Fix: make a failed write sticky and return error 7 from buildUChars.
  • Trie builder, TrieBuilder.cpp lines 839-843: for a string longer than 0xffff units, elementsLength is incremented before code 8 is set, and no element is written. The sticky error stops this in normal use; a caller that clears the status and adds again reaches the sort with an uninitialized element.
  • Trie builder tests: tests/TrieBuilder.cpp line 54 checks only that the output length is above zero; the serialized content is not tested. The out-of-range index throws (lines 1085, 1091, 1097) and are not tested.
  • DataSwapper: tests/DataSwapper.cpp lines 88-97 never read outBuf, so byte order is not checked. No test calls SwapUTrie or utrie2_swap, which is why finding 1 is not caught. The Write* helpers (lines 168-178) are unused.
  • DataSwapper, lines 612 and 672: an odd indexLength gives misaligned 32-bit accesses (undefined behaviour). Parity is not checked at lines 594 and 647.
  • DataSwapper, lines 323-348: there are no size or offset static_asserts for UTrieHeader, UTrie2Header or UCPTrieHeader, unlike Trie2.cpp and CodePointTrie.cpp. Line 609 relies on sizeof(UTrie2Header) - 4.
  • DataSwapper: the null-pointer and error-code handling differs between exports. The swapper functions throw on a null error code in some places (lines 575, 625, 681) and return silently in others (SwapUTrie, udata_openSwapper). udata_readInt16 and udata_readInt32 dereference ds without a check (as reported; not re-checked).
  • DataSwapper, lines 399 and 691: GetTrieVersion returns 0 for length -1, so utrie_swapAnyVersion(-1) fails with error 3, while ucptrie_swap and utrie2_swap accept -1 as a size query. ICU 68.2 behaviour was not checked.
  • Service, lines 311-331 (registerFactory): if *status is above 0 on entry, the factory is returned as registered but never inserted or deleted. If creating the vector fails (lines 314-316), the factory leaks.
  • Service, lines 601-602 (getDisplayNames): Require(dn) throws std::invalid_argument when the status is already failing and no display-name cache exists. The debt file says throws happen only for null pointers.
  • Service, lines 209-210 (FindListener, used by IsServiceListener at line 243): search.direct is set without the accessibility test that the target branch applies. Needs a guest class with a private ServiceListener base (reported by a subagent; not run).
  • Service, lines 179-188 (LocalVector::Add): on the early return and on an addElement failure, str is not freed; the caller is at lines 484-485.
  • Service tests: tests/Service.cpp has no case for a second unregister, a failing status, or the registerFactory error paths.
  • Locale, LocaleBuilder.cpp lines 165-170: clear() runs before the offset check, so a throw leaves the builder half-updated with status 0.
  • Locale tests: tests/LocaleBuilder.cpp covers only the happy path (lines 43-46). tests/LocaleKeywords.cpp does not test a null status, a bad size, a missing trailing NUL or an allocation failure. tests/LocaleObject.cpp line 119 checks the count and the first and last entries of the array only.
  • Vector: the integer indexOf and sortedInsert (Vector.cpp lines 251-255 and 392-396) have no test; tests/Vector.cpp covers the other overloads.
  • Debt file, line 44 (Trie builders): it says serialized tries "are compared byte for byte" with ICU 68.2, but no test in the tree does that. It also does not say that unset function-table slots fall back to Abstract_nid_no_patch, which throws (TrieBuilder.cpp lines 25, 400, 411); slot 2 of UCharsTrieBuilder is never set.
  • Debt file, line 20: the counts (1691, 2347, 939, 656, 652) are unchanged although 88 stubs moved. They are probably stale; not recomputed.
  • Debt file, lines 144 and 146 (not from this PR's diff): they say the UVector32, UVector and UStack constructors and destructors remain stubs. VectorObjects.cpp implements them, and line 84 says so. Fix while the file is open.
  • PR body: "Only the last three commits are new here; everything before them is #14016, #14144 and #14340." Four commits are own commits on top of f6303c9c46, including f376d5d149. The body should list them.
  • Maintainer question: the new files carry ICU license headers (DataSwapper.cpp and .hpp lines 1-3, TrieBuilder.cpp and .hpp, LocaleKeywords.cpp and .hpp lines 1-3, tests/LocaleKeywords.cpp lines 1-2). docs/dev/CONVENTIONS.md permits comments only for technical debt, and AGENTS.md line 8 and CONTRIBUTING.md line 17 cover third-party code as submodules. The debt file says these files port ICU 68.2 sources. Whether ICU-derived code is accepted in the tree is a maintainer decision.

Sources

Not verified

  • No build or test run. The swapper overflow and the repeated unregister are shown by reading the code and by integer arithmetic.
  • ICU 68.2 fidelity: the repository has no ICU source, so the debt file's ICU claims are not checked.
  • Console behaviour is not claimed.
  • The 137 stacked-only files and the 1695-entry legacy rename in #14016 were not reviewed here.
  • The relinker jobs were skipped by the workflow at review time.

To get this to a good state

  • Fix the four blocking items, each with a test: bound the swapper's sizes and add a malformed-trie test; return from a missed unregister without touching the object and add a second-unregister test; validate the variant offset and add a test; delete the stale clause in the debt file.
  • Correct the PR body's commit statement.
  • Decide the ICU license-header question with the maintainers.
  • Rerun the precheck and the DataSwapper, Service, LocaleBuilder and TrieBuilder test executables on the new head.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729757088 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5729757088). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T19:00:04Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Four blocking items at this head: a size overflow that lets the trie swapper write past its buffer, a use after free on a repeated unregister, an out-of-bounds read in setLocale, and a debt-file entry that contradicts the code. This complete result supersedes the partial review 5728687520 at 7d4b66e3f2. ## What I ran - Head `c3295f3c312c8d063f40b17b43c66a4424ecdb0b`; PR base `f1a7b02028`; own-commit base `f6303c9c46` (top of #14340). 165 files in the PR; 28 are this PR's own commits (f376d5d149, 47f9f3b842, 7d4b66e3f2, c3295f3c31). The other 137 belong to the stacked PRs #14016, #14144 and #14340 and are not reviewed here. - Read: all 28 own files, split across six read-only subagents (TrieBuilder; DataSwapper with its test; Service and ServiceLocale with their tests; LegacyExports removals, libSceIcu.hpp and Vector; the Locale files; CMake, the debt file and the trie test). I re-read the four blocking sites myself and checked the arithmetic of the first. - Precheck report at this exact head (head and base unchanged at completion). Two precheck rows (ABI audit, test quality) failed because their helpers are not in the head tree; I reran both by hand. Details below. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | | | Mergeability and stack | passed | stack check passed; #14016, #14144 and #14340 are still open | | Export ABI audit (own scope, by hand) | passed | 1603 symbols, 0 alias mismatches; one warning, a test helper | | Test quality (by hand) | passed | 8 flags are false positives; all eight tests are registered in CMake | | Trie swapper size arithmetic | failed | int32 overflow lets swaps run past the buffer (finding 1) | | Unregister of an unknown key | failed | call through freed memory after a repeat (finding 2) | | setLocale variant offset | failed | read past the name for a large offset (finding 3) | | Debt file accuracy | failed | says implemented wrappers are stubs (finding 4) | | Trie builder and other code | passed | non-blocking items only | | Build and runtime tests | not run | no build | | Negative controls | not run | needs a build | | Hosted CI | passed | completed jobs succeeded; relinker jobs skipped by the workflow | <details><summary>Commands and unedited precheck output</summary> Commands: - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /dev/shm/reviewer-run/precheck/14443c` (report: report.md in that directory). - ABI audit, by hand, own scope: `python3 tools/pr_abi_audit.py --base f6303c9c46 --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --json`. Result: passed_with_warnings; 1603 symbols; 0 alias mismatches; one warning, CapturePrintError, which is a test helper in tests/DataSwapper.cpp (line 106). - ABI audit, by hand, full PR base: `... --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf ...`. Result: 4234 symbols; 1695 export-removed entries, which come from the stacked #14016 rename of the legacy names (not checked here); 24 declaration warnings. - Test quality, by hand, on an archive of the head: `python3 tools/pr_test_quality.py --root <archive> --json` on the eight test files. The eight flags are possible-unregistered-cpp-test. All eight are registered in CMakeLists.txt at lines 284, 541, 556, 676, 691, 878, 889 and 905 (add_test_executable). - Hosted checks: `gh api repos/boykopovar/AnyPS5/commits/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/check-runs`. Precheck table (unedited): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f1a7b02028ae50adaf6c5aaaef892a51841b25bf...c3295f3c312c8d063f40b17b43c66a4424ecdb0b` | | conventions_and_pr_template | passed | `/marc/Conlyse-VIEJO/.venv/bin/python3 tools/check_conventions.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --title feat(libSceIcu): implement the string trie builders, data swappers and the ICU service cache --body /dev/shm/reviewer-run/precheck/14443c/pr-body.md` | | changed_export_abi_audit | failed | `/marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/marc/Conlyse-VIEJO/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14443c/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/marc/Conlyse-VIEJO/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14443c/head-c3295f3c312c-2bbdfd49/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14443c/head-c3295f3c312c-2bbdfd49 --json core/libs/prx/libSceIcu/Appendable.cpp core/libs/prx/libSceIcu/Appendable.hpp core/libs/prx/libSceIcu/BasicStringUtilities.cpp core/libs/prx/libSceIcu/BasicStringUtilities.hpp core/libs/prx/libSceIcu/ByteSink.cpp core/libs/prx/libSceIcu/ByteSink.hpp core/libs/prx/libSceIcu/ByteSinkUtil.cpp core/libs/prx/libSceIcu/ByteSinkUtil.hpp core/libs/prx/libSceIcu/BytesTrie.cpp core/libs/prx/libSceIcu/BytesTrie.hpp core/libs/prx/libSceIcu/CMakeLists.txt core/libs/prx/libSceIcu/CharString.cpp core/libs/prx/libSceIcu/CharString.hpp core/libs/prx/libSceIcu/CharacterIterator.cpp core/libs/prx/libSceIcu/CharacterIterator.hpp core/libs/prx/libSceIcu/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/CharacterIteratorObjects.hpp core/libs/prx/libSceIcu/Cleanup.cpp core/libs/prx/libSceIcu/Cleanup.hpp core/libs/prx/libSceIcu/CodePointTrie.cpp core/libs/prx/libSceIcu/CodePointTrie.hpp core/libs/prx/libSceIcu/DataSwapper.cpp core/libs/prx/libSceIcu/DataSwapper.hpp core/libs/prx/libSceIcu/Edits.cpp core/libs/prx/libSceIcu/Edits.hpp core/libs/prx/libSceIcu/ErrorCode.cpp core/libs/prx/libSceIcu/ErrorCode.hpp core/libs/prx/libSceIcu/Export.cpp core/libs/prx/libSceIcu/Hash.cpp core/libs/prx/libSceIcu/Hash.hpp core/libs/prx/libSceIcu/IcuUtility.cpp core/libs/prx/libSceIcu/IcuUtility.hpp core/libs/prx/libSceIcu/LegacyExports.cpp core/libs/prx/libSceIcu/List.cpp core/libs/prx/libSceIcu/List.hpp core/libs/prx/libSceIcu/LocaleBuilder.cpp core/libs/prx/libSceIcu/LocaleBuilder.hpp core/libs/prx/libSceIcu/LocaleId.cpp core/libs/prx/libSceIcu/LocaleId.hpp core/libs/prx/libSceIcu/LocaleKeywords.cpp core/libs/prx/libSceIcu/LocaleKeywords.hpp core/libs/prx/libSceIcu/LocaleObject.cpp core/libs/prx/libSceIcu/LocaleObject.hpp core/libs/prx/libSceIcu/MaybeStackArray.cpp core/libs/prx/libSceIcu/MaybeStackArray.hpp core/libs/prx/libSceIcu/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/MutableCodePointTrie.hpp core/libs/prx/libSceIcu/Object.cpp core/libs/prx/libSceIcu/Object.hpp core/libs/prx/libSceIcu/ParsePosition.cpp core/libs/prx/libSceIcu/ParsePosition.hpp core/libs/prx/libSceIcu/PatternProps.cpp core/libs/prx/libSceIcu/PatternProps.hpp core/libs/prx/libSceIcu/PlatformUtil.cpp core/libs/prx/libSceIcu/PlatformUtil.hpp core/libs/prx/libSceIcu/Service.cpp core/libs/prx/libSceIcu/Service.hpp core/libs/prx/libSceIcu/ServiceFactory.cpp core/libs/prx/libSceIcu/ServiceFactory.hpp core/libs/prx/libSceIcu/ServiceKey.cpp core/libs/prx/libSceIcu/ServiceKey.hpp core/libs/prx/libSceIcu/ServiceLocale.cpp core/libs/prx/libSceIcu/ServiceLocale.hpp core/libs/prx/libSceIcu/ServiceNotifier.cpp core/libs/prx/libSceIcu/ServiceNotifier.hpp core/libs/prx/libSceIcu/ServiceStringPair.cpp core/libs/prx/libSceIcu/ServiceStringPair.hpp core/libs/prx/libSceIcu/StringCharacterIterator.cpp core/libs/prx/libSceIcu/StringCharacterIterator.hpp core/libs/prx/libSceIcu/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/StringEnumerationObjects.hpp core/libs/prx/libSceIcu/StringPiece.cpp core/libs/prx/libSceIcu/StringPiece.hpp core/libs/prx/libSceIcu/StringsEnumeration.cpp core/libs/prx/libSceIcu/StringsEnumeration.hpp core/libs/prx/libSceIcu/Terminate.cpp core/libs/prx/libSceIcu/Terminate.hpp core/libs/prx/libSceIcu/Text.cpp core/libs/prx/libSceIcu/Text.hpp core/libs/prx/libSceIcu/Trace.cpp core/libs/prx/libSceIcu/Trace.hpp core/libs/prx/libSceIcu/Trie2.cpp core/libs/prx/libSceIcu/Trie2.hpp core/libs/prx/libSceIcu/TrieBuilder.cpp core/libs/prx/libSceIcu/TrieBuilder.hpp core/libs/prx/libSceIcu/TrieEnumeration.cpp core/libs/prx/libSceIcu/TrieEnumeration.hpp core/libs/prx/libSceIcu/UCharsTrie.cpp core/libs/prx/libSceIcu/UCharsTrie.hpp core/libs/prx/libSceIcu/UnicodeFilter.cpp core/libs/prx/libSceIcu/UnicodeFilter.hpp core/libs/prx/libSceIcu/UnicodeSet.cpp core/libs/prx/libSceIcu/UnicodeSet.hpp core/libs/prx/libSceIcu/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/UnicodeSetIterator.hpp core/libs/prx/libSceIcu/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/UnicodeSetPattern.hpp core/libs/prx/libSceIcu/UnicodeString.cpp core/libs/prx/libSceIcu/UnicodeString.hpp core/libs/prx/libSceIcu/UnicodeStringHash.cpp core/libs/prx/libSceIcu/UnicodeStringHash.hpp core/libs/prx/libSceIcu/UnicodeStringSink.cpp core/libs/prx/libSceIcu/UnicodeStringSink.hpp core/libs/prx/libSceIcu/Vector.cpp core/libs/prx/libSceIcu/Vector.hpp core/libs/prx/libSceIcu/Vector32.cpp core/libs/prx/libSceIcu/Vector32.hpp core/libs/prx/libSceIcu/VectorObjects.cpp core/libs/prx/libSceIcu/VectorObjects.hpp core/libs/prx/libSceIcu/include/InventoryDispatch.hpp core/libs/prx/libSceIcu/include/LegacyExports.hpp core/libs/prx/libSceIcu/libSceIcu.hpp core/libs/prx/libSceIcu/tests/Appendable.cpp core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp core/libs/prx/libSceIcu/tests/ByteSink.cpp core/libs/prx/libSceIcu/tests/ByteSinkUtil.cpp core/libs/prx/libSceIcu/tests/BytesTrie.cpp core/libs/prx/libSceIcu/tests/CharString.cpp core/libs/prx/libSceIcu/tests/CharacterIterator.cpp core/libs/prx/libSceIcu/tests/CharacterIteratorObjects.cpp core/libs/prx/libSceIcu/tests/Cleanup.cpp core/libs/prx/libSceIcu/tests/CodePointTrie.cpp core/libs/prx/libSceIcu/tests/DataSwapper.cpp core/libs/prx/libSceIcu/tests/Edits.cpp core/libs/prx/libSceIcu/tests/ErrorCode.cpp core/libs/prx/libSceIcu/tests/Hash.cpp core/libs/prx/libSceIcu/tests/IcuUtility.cpp core/libs/prx/libSceIcu/tests/List.cpp core/libs/prx/libSceIcu/tests/LocaleBuilder.cpp core/libs/prx/libSceIcu/tests/LocaleId.cpp core/libs/prx/libSceIcu/tests/LocaleKeywords.cpp core/libs/prx/libSceIcu/tests/LocaleObject.cpp core/libs/prx/libSceIcu/tests/MaybeStackArray.cpp core/libs/prx/libSceIcu/tests/MutableCodePointTrie.cpp core/libs/prx/libSceIcu/tests/ParsePosition.cpp core/libs/prx/libSceIcu/tests/PatternProps.cpp core/libs/prx/libSceIcu/tests/PlatformUtil.cpp core/libs/prx/libSceIcu/tests/Service.cpp core/libs/prx/libSceIcu/tests/ServiceFactory.cpp core/libs/prx/libSceIcu/tests/ServiceKey.cpp core/libs/prx/libSceIcu/tests/ServiceLocale.cpp core/libs/prx/libSceIcu/tests/ServiceNotifier.cpp core/libs/prx/libSceIcu/tests/ServiceStringPair.cpp core/libs/prx/libSceIcu/tests/StringCharacterIterator.cpp core/libs/prx/libSceIcu/tests/StringEnumerationObjects.cpp core/libs/prx/libSceIcu/tests/StringPiece.cpp core/libs/prx/libSceIcu/tests/StringsEnumeration.cpp core/libs/prx/libSceIcu/tests/Terminate.cpp core/libs/prx/libSceIcu/tests/Text.cpp core/libs/prx/libSceIcu/tests/Trace.cpp core/libs/prx/libSceIcu/tests/Trie2.cpp core/libs/prx/libSceIcu/tests/TrieBuilder.cpp core/libs/prx/libSceIcu/tests/TrieEnumeration.cpp core/libs/prx/libSceIcu/tests/UCharsTrie.cpp core/libs/prx/libSceIcu/tests/UnicodeFilter.cpp core/libs/prx/libSceIcu/tests/UnicodeSet.cpp core/libs/prx/libSceIcu/tests/UnicodeSetIterator.cpp core/libs/prx/libSceIcu/tests/UnicodeSetPattern.cpp core/libs/prx/libSceIcu/tests/UnicodeString.cpp core/libs/prx/libSceIcu/tests/UnicodeStringHash.cpp core/libs/prx/libSceIcu/tests/UnicodeStringSink.cpp core/libs/prx/libSceIcu/tests/Vector.cpp core/libs/prx/libSceIcu/tests/Vector32.cpp core/libs/prx/libSceIcu/tests/VectorObjects.cpp docs/dev/debt/libSceIcu.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | </details> ## Negative control Not run. The new tests are C++ and need a build. ## Findings **Blocking** 1. **The trie swapper can run its swaps past the caller's buffer.** `DataSwapper.cpp` line 379 computes `size` in `int32`, from `indexLength` and `dataLength`, which are `int32` in `UTrieHeader` (lines 323-328). Only lower bounds are checked (lines 370-372). A header with options `0x125`, indexLength `0x3fffffe0` and dataLength `0x20` gives `size` = -2147483568 after wrapping (16 + 2147483584 + 128, then wrapped). The check at line 381 (`length < size`) then passes for a length of 16, and the swaps at line 388 run over 2147483584 bytes from a 16-byte buffer. `utrie_swapAnyVersion` (lines 683-685) reaches this path, so a call with a crafted trie reads and writes far outside the buffer. Smallest fix: bound `indexLength` and `dataLength` against the real trie size, or compute `size` in 64 bits and require `size <= length` before any swap; check each swap's end against `length`. Add a test with that header. I checked the arithmetic by hand; it has not been run. 2. **Unregistering an unknown key calls through a pointer the service does not own, and a repeat call reaches freed memory.** `Service.cpp` lines 336-346: when `removeElement` misses, the else branch sets `*status` and calls vtable slot 1 (the deleting destructor) on the caller's `key` (line 345). The service does not own that object. The success path already frees it: `removeElement` calls `Remove` (`Vector.cpp` lines 72-75), which runs the vector's deleter, `DeleteFactory`, set at `Service.cpp` line 162. `factories` is not cleared, so a second `unregister` with the same key takes the else branch and calls a vtable on freed memory. Smallest fix: on a miss, set `*status` and return 0 without touching the object. Add a test that unregisters twice; `tests/Service.cpp` line 36 covers only the successful call. 3. **setLocale reads past the name when the variant offset is larger than the name.** `LocaleBuilder.cpp` line 170 rejects only a negative offset and a null base name. Line 171 then calls `strlen(baseName + variantBegin)`. A locale whose `variantBegin` is greater than `strlen(baseName)` makes `strlen` read outside the string, inside an inline buffer or past a heap allocation. The clamp that exists on the `@` path belongs to #14340 (`LocaleObject.cpp` line 250); the plain path has none. Smallest fix: throw `std::invalid_argument` when `variantBegin > strlen(baseName)`, as line 170 does for the other offset. Add a test with an offset past the name. 4. **The debt file says integer `indexOf` and integer `sortedInsert` are stubs, but this PR implements both.** `docs/dev/debt/libSceIcu.md` line 146 says the integer wrappers "remain stubs". `Vector.cpp` lines 251-255 and 392-396 implement them, and the debt entry at line 84 says so. The debt file is the record of what is still a stub, so the clause must come out in this PR. Smallest fix: delete the clause. **Non-blocking** - Trie builder, `TrieBuilder.cpp` lines 957-963: after a failed reallocation in `ensureCapacity`, `uchars` is null and `capacity` is 0, while `ucharsLength` keeps counting the units already written. The next write allocates a new buffer and skips the copy. `buildUChars` (lines 912-914) checks only for a null `uchars`, so it can return success with uninitialized units. This needs an allocation failure. Fix: make a failed write sticky and return error 7 from `buildUChars`. - Trie builder, `TrieBuilder.cpp` lines 839-843: for a string longer than 0xffff units, `elementsLength` is incremented before code 8 is set, and no element is written. The sticky error stops this in normal use; a caller that clears the status and adds again reaches the sort with an uninitialized element. - Trie builder tests: `tests/TrieBuilder.cpp` line 54 checks only that the output length is above zero; the serialized content is not tested. The out-of-range index throws (lines 1085, 1091, 1097) and are not tested. - DataSwapper: `tests/DataSwapper.cpp` lines 88-97 never read `outBuf`, so byte order is not checked. No test calls `SwapUTrie` or `utrie2_swap`, which is why finding 1 is not caught. The `Write*` helpers (lines 168-178) are unused. - DataSwapper, lines 612 and 672: an odd `indexLength` gives misaligned 32-bit accesses (undefined behaviour). Parity is not checked at lines 594 and 647. - DataSwapper, lines 323-348: there are no size or offset `static_assert`s for `UTrieHeader`, `UTrie2Header` or `UCPTrieHeader`, unlike `Trie2.cpp` and `CodePointTrie.cpp`. Line 609 relies on `sizeof(UTrie2Header) - 4`. - DataSwapper: the null-pointer and error-code handling differs between exports. The swapper functions throw on a null error code in some places (lines 575, 625, 681) and return silently in others (`SwapUTrie`, `udata_openSwapper`). `udata_readInt16` and `udata_readInt32` dereference `ds` without a check (as reported; not re-checked). - DataSwapper, lines 399 and 691: `GetTrieVersion` returns 0 for length -1, so `utrie_swapAnyVersion(-1)` fails with error 3, while `ucptrie_swap` and `utrie2_swap` accept -1 as a size query. ICU 68.2 behaviour was not checked. - Service, lines 311-331 (`registerFactory`): if `*status` is above 0 on entry, the factory is returned as registered but never inserted or deleted. If creating the vector fails (lines 314-316), the factory leaks. - Service, lines 601-602 (`getDisplayNames`): `Require(dn)` throws `std::invalid_argument` when the status is already failing and no display-name cache exists. The debt file says throws happen only for null pointers. - Service, lines 209-210 (`FindListener`, used by `IsServiceListener` at line 243): `search.direct` is set without the accessibility test that the target branch applies. Needs a guest class with a private ServiceListener base (reported by a subagent; not run). - Service, lines 179-188 (`LocalVector::Add`): on the early return and on an `addElement` failure, `str` is not freed; the caller is at lines 484-485. - Service tests: `tests/Service.cpp` has no case for a second unregister, a failing status, or the `registerFactory` error paths. - Locale, `LocaleBuilder.cpp` lines 165-170: `clear()` runs before the offset check, so a throw leaves the builder half-updated with status 0. - Locale tests: `tests/LocaleBuilder.cpp` covers only the happy path (lines 43-46). `tests/LocaleKeywords.cpp` does not test a null status, a bad size, a missing trailing NUL or an allocation failure. `tests/LocaleObject.cpp` line 119 checks the count and the first and last entries of the array only. - Vector: the integer `indexOf` and `sortedInsert` (`Vector.cpp` lines 251-255 and 392-396) have no test; `tests/Vector.cpp` covers the other overloads. - Debt file, line 44 (Trie builders): it says serialized tries "are compared byte for byte" with ICU 68.2, but no test in the tree does that. It also does not say that unset function-table slots fall back to `Abstract_nid_no_patch`, which throws (`TrieBuilder.cpp` lines 25, 400, 411); slot 2 of `UCharsTrieBuilder` is never set. - Debt file, line 20: the counts (1691, 2347, 939, 656, 652) are unchanged although 88 stubs moved. They are probably stale; not recomputed. - Debt file, lines 144 and 146 (not from this PR's diff): they say the UVector32, UVector and UStack constructors and destructors remain stubs. `VectorObjects.cpp` implements them, and line 84 says so. Fix while the file is open. - PR body: "Only the last three commits are new here; everything before them is #14016, #14144 and #14340." Four commits are own commits on top of `f6303c9c46`, including f376d5d149. The body should list them. - Maintainer question: the new files carry ICU license headers (DataSwapper.cpp and .hpp lines 1-3, TrieBuilder.cpp and .hpp, LocaleKeywords.cpp and .hpp lines 1-3, tests/LocaleKeywords.cpp lines 1-2). `docs/dev/CONVENTIONS.md` permits comments only for technical debt, and `AGENTS.md` line 8 and `CONTRIBUTING.md` line 17 cover third-party code as submodules. The debt file says these files port ICU 68.2 sources. Whether ICU-derived code is accepted in the tree is a maintainer decision. ## Sources - SwapUTrie size: https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/core/libs/prx/libSceIcu/DataSwapper.cpp#L323-L328 and #L370-L388 - Unregister: https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/core/libs/prx/libSceIcu/Service.cpp#L336-L346, the removal path at https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/core/libs/prx/libSceIcu/Vector.cpp#L72-L75, and the test at https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/core/libs/prx/libSceIcu/tests/Service.cpp#L36 - setLocale: https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/core/libs/prx/libSceIcu/LocaleBuilder.cpp#L170-L171 - Debt file: https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/docs/dev/debt/libSceIcu.md#L146 and the implementation at https://github.com/boykopovar/AnyPS5/blob/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/core/libs/prx/libSceIcu/Vector.cpp#L251-L255 and #L392-L396 ## Not verified - No build or test run. The swapper overflow and the repeated unregister are shown by reading the code and by integer arithmetic. - ICU 68.2 fidelity: the repository has no ICU source, so the debt file's ICU claims are not checked. - Console behaviour is not claimed. - The 137 stacked-only files and the 1695-entry legacy rename in #14016 were not reviewed here. - The relinker jobs were skipped by the workflow at review time. ## To get this to a good state - Fix the four blocking items, each with a test: bound the swapper's sizes and add a malformed-trie test; return from a missed unregister without touching the object and add a second-unregister test; validate the variant offset and add a test; delete the stale clause in the debt file. - Correct the PR body's commit statement. - Decide the ICU license-header question with the maintainers. - Rerun the precheck and the DataSwapper, Service, LocaleBuilder and TrieBuilder test executables on the new head.
MarcZX10 commented 2026-11-01 21:15:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T21:15:04Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Four blocking defects at this head: three verified by reading the exact lines, and the earlier unregister blocker is still present.

What I ran

  • Exact head d3cdd80fd470edcd2be460c4886bbbbb678a071a, PR base f1a7b02028ae50adaf6c5aaaef892a51841b25bf, own-commit base f6303c9c46.
  • Read-only: git -C /marc/AnyPS5 show d3cdd80fd470edcd2be460c4886bbbbb678a071a:<path> for the 28 own-commit files, split across read-only file-range reads. I re-read the lines cited below myself.
  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir <scratch>.
  • Not built, not run.

Results

Check Result Note
Diff check passed
Conventions passed license // headers pass only because the PR touches a debt file
ABI audit failed helper absent from the head tree
Test quality failed helper absent from the head tree
Build and ctest not run needs a build
Earlier blocker: unregister of an unknown key still present see Blocking 1
Precheck report (unedited header and failing rows)
# PR precheck report — checks failed
changed_export_abi_audit | failed | pr_abi_audit.py (helper absent from the head tree)
test_quality_heuristics | failed | pr_test_quality.py (helper absent from the head tree)

Findings

Blocking

  1. core/libs/prx/libSceIcu/Service.cpp 350-352: when the key is missing, unregister sets the status and calls DeleteFactory_nid_no_patch(factory) on the caller's pointer. The service does not own that object. Fix: return false with status 1 and leave ownership with the caller. Update tests/Service.cpp to expect that result instead of a throw.
  2. core/libs/prx/libSceIcu/DataSwapper.cpp 74: if (!errorCode || *errorCode > 0) return 0; returns silently on a null errorCode. Line 580 in the same file throws std::invalid_argument("null UErrorCode"). CONTRIBUTING.md line 7 requires every function to do what it should or throw. Fix: throw on null in each helper, as line 580 does.
  3. core/libs/prx/libSceIcu/TrieBuilder.cpp 950-963: after a failed reallocation, uchars is null and capacity is 0 while ucharsLength keeps counting. The next successful growth skips the copy at 963, so build() returns code 0 with units missing. Fix: make the failure sticky, for example by a negative capacity.
  4. core/libs/prx/libSceIcu/TrieBuilder.cpp 990-993: newLength = b.ucharsLength + length is computed in int32. A length near INT32_MAX wraps negative, the growth check at 951 passes, and memcpy writes out of bounds. Fix: reject a length above INT32_MAX - ucharsLength before the addition.
  5. core/libs/prx/libSceIcu/TrieBuilder.cpp 1103-1105: getLimitOfLinearMatch indexes b.elements[] with no range check. The debt file says out-of-range indices throw. Other element-index exports in the file have the same gap (reported, not checked line by line). Fix: add the guard already used at 1085-1097.

Non-blocking

  • Every new file starts with license // comments. CONVENTIONS.md line 13 allows comments only for debt. The checker drops those findings because the PR touches a debt file. This needs a maintainer decision.
  • The debt file says several implemented functions are stubs, and its counts do not match the code. Reported, not yet confirmed line by line.
  • ICU 68.2 behaviour is not verified: UStack::pop (Vector.cpp 441-447) and Vector::operator== (257-266). These need the ICU source to decide.

Sources

Not verified

  • Build, ctest and every new test: not run.
  • ICU 68.2 behaviour: no ICU source in this checkout.
  • Debt file counts and stub claims beyond the lines cited above.

To get this to a good state

Fix blocking 1-5, then rebuild and run the ICU tests on the new head (ctest -R icu). Confirm the ICU items above against the ICU 68.2 source.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5730307342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5730307342). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T21:15:04Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Four blocking defects at this head: three verified by reading the exact lines, and the earlier unregister blocker is still present. ## What I ran - Exact head `d3cdd80fd470edcd2be460c4886bbbbb678a071a`, PR base `f1a7b02028ae50adaf6c5aaaef892a51841b25bf`, own-commit base `f6303c9c46`. - Read-only: `git -C /marc/AnyPS5 show d3cdd80fd470edcd2be460c4886bbbbb678a071a:<path>` for the 28 own-commit files, split across read-only file-range reads. I re-read the lines cited below myself. - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir <scratch>`. - Not built, not run. ## Results | Check | Result | Note | | - | - | - | | Diff check | passed | | | Conventions | passed | license `//` headers pass only because the PR touches a debt file | | ABI audit | failed | helper absent from the head tree | | Test quality | failed | helper absent from the head tree | | Build and ctest | not run | needs a build | | Earlier blocker: unregister of an unknown key | still present | see Blocking 1 | <details> <summary>Precheck report (unedited header and failing rows)</summary> ```text # PR precheck report — checks failed changed_export_abi_audit | failed | pr_abi_audit.py (helper absent from the head tree) test_quality_heuristics | failed | pr_test_quality.py (helper absent from the head tree) ``` </details> ## Findings **Blocking** 1. `core/libs/prx/libSceIcu/Service.cpp` 350-352: when the key is missing, unregister sets the status and calls `DeleteFactory_nid_no_patch(factory)` on the caller's pointer. The service does not own that object. Fix: return false with status 1 and leave ownership with the caller. Update `tests/Service.cpp` to expect that result instead of a throw. 2. `core/libs/prx/libSceIcu/DataSwapper.cpp` 74: `if (!errorCode || *errorCode > 0) return 0;` returns silently on a null `errorCode`. Line 580 in the same file throws `std::invalid_argument("null UErrorCode")`. CONTRIBUTING.md line 7 requires every function to do what it should or throw. Fix: throw on null in each helper, as line 580 does. 3. `core/libs/prx/libSceIcu/TrieBuilder.cpp` 950-963: after a failed reallocation, `uchars` is null and capacity is 0 while `ucharsLength` keeps counting. The next successful growth skips the copy at 963, so `build()` returns code 0 with units missing. Fix: make the failure sticky, for example by a negative capacity. 4. `core/libs/prx/libSceIcu/TrieBuilder.cpp` 990-993: `newLength = b.ucharsLength + length` is computed in int32. A length near INT32_MAX wraps negative, the growth check at 951 passes, and `memcpy` writes out of bounds. Fix: reject a length above `INT32_MAX - ucharsLength` before the addition. 5. `core/libs/prx/libSceIcu/TrieBuilder.cpp` 1103-1105: `getLimitOfLinearMatch` indexes `b.elements[]` with no range check. The debt file says out-of-range indices throw. Other element-index exports in the file have the same gap (reported, not checked line by line). Fix: add the guard already used at 1085-1097. **Non-blocking** - Every new file starts with license `//` comments. CONVENTIONS.md line 13 allows comments only for debt. The checker drops those findings because the PR touches a debt file. This needs a maintainer decision. - The debt file says several implemented functions are stubs, and its counts do not match the code. Reported, not yet confirmed line by line. - ICU 68.2 behaviour is not verified: `UStack::pop` (`Vector.cpp` 441-447) and `Vector::operator==` (257-266). These need the ICU source to decide. ## Sources - Service: https://github.com/boykopovar/AnyPS5/blob/d3cdd80fd470edcd2be460c4886bbbbb678a071a/core/libs/prx/libSceIcu/Service.cpp#L345-L353 - DataSwapper: https://github.com/boykopovar/AnyPS5/blob/d3cdd80fd470edcd2be460c4886bbbbb678a071a/core/libs/prx/libSceIcu/DataSwapper.cpp#L74 and #L580 - TrieBuilder: https://github.com/boykopovar/AnyPS5/blob/d3cdd80fd470edcd2be460c4886bbbbb678a071a/core/libs/prx/libSceIcu/TrieBuilder.cpp#L950-L963, #L990-L993, #L1103-L1105 ## Not verified - Build, ctest and every new test: not run. - ICU 68.2 behaviour: no ICU source in this checkout. - Debt file counts and stub claims beyond the lines cited above. ## To get this to a good state Fix blocking 1-5, then rebuild and run the ICU tests on the new head (`ctest -R icu`). Confirm the ICU items above against the ICU 68.2 source.
MarcZX10 commented 2026-11-03 02:23:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T02:23:29Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

At head fa9639acd1458302b151339b1a152ed0e508b558, I found one blocking out-of-bounds read in StringPiece::find and one non-blocking enumeration-buffer leak.

What I ran

  • Reviewed all 165 changed files against base b28bb772177768f99874ca38f6252cd0139acf2a; current target main was 7feb37ee3e30e10139b483fb4df689d5b5b69ab8.
  • Environment: Debian 12 x86_64, Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0.
  • Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /tmp/anyps5-pr-precheck/14443-20261103
git diff --check b28bb772177768f99874ca38f6252cd0139acf2a...fa9639acd1458302b151339b1a152ed0e508b558
python3 tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/14443-20261103/stack
  • Also read the complete diff, PR discussion and CI; manually checked the test registrations flagged by the heuristic.

Results

Check Result Note
Diff and conventions passed Exact head and base remained unchanged
Hosted CI passed / skipped Windows and required no-build jobs passed; specialized/Linux jobs skipped
Dependency preview clean, with order caveat Individual merge previews clean; #14016's current head is not included by #14144
ABI audit warnings only Heuristic output; no ABI conclusion from its warnings
Test quality false-positive warning Heuristic labels tests unregistered; CMake registration was manually confirmed
Build and CTest not run Would require building; this review did not build
Raw check output excerpts
# PR precheck report — checks failed
Head: fa9639acd1458302b151339b1a152ed0e508b558
Base: b28bb772177768f99874ca38f6252cd0139acf2a
Head unchanged at completion: True
Base unchanged at completion: True
diff_check | passed
conventions_and_pr_template | passed
changed_export_abi_audit | failed
live_dependency_and_mergeability_check | passed
build_dependent_cpp_tests | not_applicable
test_quality_heuristics | failed
Target branch tip: 7feb37ee3e30e10139b483fb4df689d5b5b69ab8
Dependency order: #14016 → #14144 → #14340 → #14443
#14016 → #14144: current_dependency_head_not_included
#14144 → #14340: head_included
#14340 → #14443: head_included

The ABI/test-quality helper failures are tool-availability/heuristic signals, not demonstrated code failures. The test-quality warning was checked against the test registration in CMake. Hosted check runs were attached to the exact reviewed head; their raw statuses are linked under CI checks.

Negative control

Not run. Exercising a negative control requires an exact-head test binary or a safe code-mutation harness; neither was run here.

Findings

Blocking

  • BasicStringUtilities.cpp, StringPiece::find: the inner loop checks index < 0 but not index < object.length. With a one-character length-delimited haystack "a" and needle "ab", it compares the first character, increments index to the haystack length, then reads object.pointer[1] on the next iteration. This is an out-of-bounds read. Stop the candidate comparison when index reaches object.length, then return no match for that candidate.

Non-blocking

  • StringsEnumeration.cpp: Buffer() stores an allocated buffer in enumeration->baseContext; Close_nid_no_patch() frees only enumeration. The owned baseContext allocation therefore appears to leak when the enumeration is closed. Free the buffer before freeing the enumeration, and add or update a close-path test.

Sources

Not verified

  • No local build, CTest, Linux build, sanitizer run, console run, or negative-control mutation was performed.
  • Hosted Linux, relinker, relinker-ASan, register-context, edge-watch and write-watch jobs were skipped.
  • The ABI audit is heuristic and does not establish ABI correctness.

To get this to a good state

Bound the StringPiece::find inner loop by the haystack length and add a regression test for a needle longer than the remaining haystack; also release the enumeration buffer on close. I will recheck the exact new head and rerun the applicable no-build checks after the update.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5746440740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5746440740). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T02:23:29Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested At head `fa9639acd1458302b151339b1a152ed0e508b558`, I found one blocking out-of-bounds read in `StringPiece::find` and one non-blocking enumeration-buffer leak. ## What I ran - Reviewed all 165 changed files against base `b28bb772177768f99874ca38f6252cd0139acf2a`; current target `main` was `7feb37ee3e30e10139b483fb4df689d5b5b69ab8`. - Environment: Debian 12 x86_64, Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. - Commands: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /tmp/anyps5-pr-precheck/14443-20261103 git diff --check b28bb772177768f99874ca38f6252cd0139acf2a...fa9639acd1458302b151339b1a152ed0e508b558 python3 tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/14443-20261103/stack ``` - Also read the complete diff, PR discussion and CI; manually checked the test registrations flagged by the heuristic. ## Results | Check | Result | Note | | - | - | - | | Diff and conventions | passed | Exact head and base remained unchanged | | Hosted CI | passed / skipped | Windows and required no-build jobs passed; specialized/Linux jobs skipped | | Dependency preview | clean, with order caveat | Individual merge previews clean; #14016's current head is not included by #14144 | | ABI audit | warnings only | Heuristic output; no ABI conclusion from its warnings | | Test quality | false-positive warning | Heuristic labels tests unregistered; CMake registration was manually confirmed | | Build and CTest | not run | Would require building; this review did not build | <details> <summary>Raw check output excerpts</summary> ```text # PR precheck report — checks failed Head: fa9639acd1458302b151339b1a152ed0e508b558 Base: b28bb772177768f99874ca38f6252cd0139acf2a Head unchanged at completion: True Base unchanged at completion: True diff_check | passed conventions_and_pr_template | passed changed_export_abi_audit | failed live_dependency_and_mergeability_check | passed build_dependent_cpp_tests | not_applicable test_quality_heuristics | failed ``` ```text Target branch tip: 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 Dependency order: #14016 → #14144 → #14340 → #14443 #14016 → #14144: current_dependency_head_not_included #14144 → #14340: head_included #14340 → #14443: head_included ``` The ABI/test-quality helper failures are tool-availability/heuristic signals, not demonstrated code failures. The test-quality warning was checked against the test registration in CMake. Hosted check runs were attached to the exact reviewed head; their raw statuses are linked under [CI checks](https://github.com/boykopovar/AnyPS5/pull/14443/checks). </details> ## Negative control Not run. Exercising a negative control requires an exact-head test binary or a safe code-mutation harness; neither was run here. ## Findings ### Blocking - `BasicStringUtilities.cpp`, `StringPiece::find`: the inner loop checks `index < 0` but not `index < object.length`. With a one-character length-delimited haystack `"a"` and needle `"ab"`, it compares the first character, increments `index` to the haystack length, then reads `object.pointer[1]` on the next iteration. This is an out-of-bounds read. Stop the candidate comparison when `index` reaches `object.length`, then return no match for that candidate. ### Non-blocking - `StringsEnumeration.cpp`: `Buffer()` stores an allocated buffer in `enumeration->baseContext`; `Close_nid_no_patch()` frees only `enumeration`. The owned `baseContext` allocation therefore appears to leak when the enumeration is closed. Free the buffer before freeing the enumeration, and add or update a close-path test. ## Sources - [StringPiece::find at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/fa9639acd1458302b151339b1a152ed0e508b558/core/libs/prx/libSceIcu/BasicStringUtilities.cpp#L130-L144) - [Enumeration buffer allocation and close at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/fa9639acd1458302b151339b1a152ed0e508b558/core/libs/prx/libSceIcu/StringsEnumeration.cpp#L44-L60) ## Not verified - No local build, CTest, Linux build, sanitizer run, console run, or negative-control mutation was performed. - Hosted Linux, relinker, relinker-ASan, register-context, edge-watch and write-watch jobs were skipped. - The ABI audit is heuristic and does not establish ABI correctness. ## To get this to a good state Bound the `StringPiece::find` inner loop by the haystack length and add a regression test for a needle longer than the remaining haystack; also release the enumeration buffer on close. I will recheck the exact new head and rerun the applicable no-build checks after the update.
MarcZX10 commented 2026-11-03 06:39:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T06:39:27Z.

Review: COMMENTED


Re-checked — new head, no blocking findings

The bounds check and regression cases address the prior StringPiece::find out-of-bounds finding; the hosted Windows job is still pending.

What I ran

  • Re-checked head d61bf05d163d624b9cc7d0b7d76692824defdd37 against base d1ae628bc2f62459cce1e9872ba5632c938c71f2; compared all changes since my previous review at fa9639acd1458302b151339b1a152ed0e508b558. The current-main merge preview is clean; the declared stack is #14016 → #14144 → #14340 → #14443.
  • Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0. No build or compiler invocation was run.
  • Commands and inspections:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443
git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...d61bf05d163d624b9cc7d0b7d76692824defdd37
git diff fa9639acd1458302b151339b1a152ed0e508b558..d61bf05d163d624b9cc7d0b7d76692824defdd37 -- core/libs/prx/libSceIcu/BasicStringUtilities.cpp core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp docs/dev/debt/libSceIcu.md
git show d61bf05d163d624b9cc7d0b7d76692824defdd37:core/libs/prx/libSceIcu/CMakeLists.txt
gh pr checks 14443 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and conventions passed No whitespace or convention errors.
Merge preview passed Clean against current main.
Regression registration passed The existing ICU test executable remains registered.
Hosted checks not run Windows is pending; other required checks passed.
Build and runtime tests not run No local build was performed.
Commands and unedited outputs

Precheck command output:

/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14443-d61bf05d163d/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14443-d61bf05d163d/report.json
Conclusion: checks failed

The precheck report says diff_check and conventions_and_pr_template passed, and its live merge preview passed. Its ABI and test-quality helper invocations failed because those scripts are absent from the isolated PR snapshot; the delta changes no exports or declarations. The C++ test-quality helper could not be rerun from that snapshot.

The raw git diff --check output was empty (exit status 0).

Hosted check output at the final refresh:

[{"conclusion":"skipped","name":"write-watch","status":"completed"},{"conclusion":"skipped","name":"register-context","status":"completed"},{"conclusion":"skipped","name":"linux","status":"completed"},{"conclusion":"skipped","name":"relinker-asan","status":"completed"},{"conclusion":"skipped","name":"relinker","status":"completed"},{"conclusion":"skipped","name":"edge-watch","status":"completed"},{"conclusion":null,"name":"windows","status":"in_progress"},{"conclusion":"success","name":"report","status":"completed"},{"conclusion":"success","name":"library-portability","status":"completed"},{"conclusion":"success","name":"eligibility","status":"completed"},{"conclusion":"success","name":"conventions","status":"completed"},{"conclusion":"success","name":"labels","status":"completed"}]

Negative control

Not run: the updated C++ regression needs an exact-head test binary, and no safe no-build mutation path was available.

Findings

Blocking

  • None in the three-file update. The new index >= object.length guard prevents the inner scan from reading beyond the logical haystack, and the added tests cover a needle that crosses the end and a match that would start too near the end.

Non-blocking

  • The previously noted StringsEnumeration::Buffer() allocation is still stored in baseContext, while Close_nid_no_patch() frees only the enumeration object. Closing an enumeration after using its string buffer therefore leaks that buffer. Consider freeing baseContext on close and adding a close-path regression.

Sources

Not verified

  • No local build, CTest, sanitizer, Linux runtime, GPU, or console run was performed. The exact-head hosted Windows job was pending at the final refresh.
  • The prior Windows/author-reported test evidence applies to earlier heads and does not independently verify this updated head.

To get this to a good state

No blocking code change is needed for this update. Let the Windows check finish; consider fixing the enumeration buffer leak separately. If the head changes, I will rerun the same no-build checks and review the new delta.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748112127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5748112127). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T06:39:27Z. **Review:** COMMENTED --- # Re-checked — new head, no blocking findings The bounds check and regression cases address the prior `StringPiece::find` out-of-bounds finding; the hosted Windows job is still pending. ## What I ran - Re-checked head `d61bf05d163d624b9cc7d0b7d76692824defdd37` against base `d1ae628bc2f62459cce1e9872ba5632c938c71f2`; compared all changes since my previous review at `fa9639acd1458302b151339b1a152ed0e508b558`. The current-main merge preview is clean; the declared stack is `#14016 → #14144 → #14340 → #14443`. - Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0. No build or compiler invocation was run. - Commands and inspections: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...d61bf05d163d624b9cc7d0b7d76692824defdd37 git diff fa9639acd1458302b151339b1a152ed0e508b558..d61bf05d163d624b9cc7d0b7d76692824defdd37 -- core/libs/prx/libSceIcu/BasicStringUtilities.cpp core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp docs/dev/debt/libSceIcu.md git show d61bf05d163d624b9cc7d0b7d76692824defdd37:core/libs/prx/libSceIcu/CMakeLists.txt gh pr checks 14443 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace or convention errors. | | Merge preview | passed | Clean against current `main`. | | Regression registration | passed | The existing ICU test executable remains registered. | | Hosted checks | not run | Windows is pending; other required checks passed. | | Build and runtime tests | not run | No local build was performed. | <details><summary>Commands and unedited outputs</summary> Precheck command output: ```text /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14443-d61bf05d163d/report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14443-d61bf05d163d/report.json Conclusion: checks failed ``` The precheck report says `diff_check` and `conventions_and_pr_template` passed, and its live merge preview passed. Its ABI and test-quality helper invocations failed because those scripts are absent from the isolated PR snapshot; the delta changes no exports or declarations. The C++ test-quality helper could not be rerun from that snapshot. The raw `git diff --check` output was empty (exit status 0). Hosted check output at the final refresh: ```text [{"conclusion":"skipped","name":"write-watch","status":"completed"},{"conclusion":"skipped","name":"register-context","status":"completed"},{"conclusion":"skipped","name":"linux","status":"completed"},{"conclusion":"skipped","name":"relinker-asan","status":"completed"},{"conclusion":"skipped","name":"relinker","status":"completed"},{"conclusion":"skipped","name":"edge-watch","status":"completed"},{"conclusion":null,"name":"windows","status":"in_progress"},{"conclusion":"success","name":"report","status":"completed"},{"conclusion":"success","name":"library-portability","status":"completed"},{"conclusion":"success","name":"eligibility","status":"completed"},{"conclusion":"success","name":"conventions","status":"completed"},{"conclusion":"success","name":"labels","status":"completed"}] ``` </details> ## Negative control Not run: the updated C++ regression needs an exact-head test binary, and no safe no-build mutation path was available. ## Findings ### Blocking - None in the three-file update. The new `index >= object.length` guard prevents the inner scan from reading beyond the logical haystack, and the added tests cover a needle that crosses the end and a match that would start too near the end. ### Non-blocking - The previously noted `StringsEnumeration::Buffer()` allocation is still stored in `baseContext`, while `Close_nid_no_patch()` frees only the enumeration object. Closing an enumeration after using its string buffer therefore leaks that buffer. Consider freeing `baseContext` on close and adding a close-path regression. ## Sources - [Updated `StringPiece::find` bounds guard](https://github.com/boykopovar/AnyPS5/blob/d61bf05d163d624b9cc7d0b7d76692824defdd37/core/libs/prx/libSceIcu/BasicStringUtilities.cpp#L130-L147) - [New end-of-piece regression cases](https://github.com/boykopovar/AnyPS5/blob/d61bf05d163d624b9cc7d0b7d76692824defdd37/core/libs/prx/libSceIcu/tests/BasicStringUtilities.cpp#L24-L28) - [ICU test registration](https://github.com/boykopovar/AnyPS5/blob/d61bf05d163d624b9cc7d0b7d76692824defdd37/core/libs/prx/libSceIcu/CMakeLists.txt#L810-L813) - [Enumeration buffer allocation and close path](https://github.com/boykopovar/AnyPS5/blob/d61bf05d163d624b9cc7d0b7d76692824defdd37/core/libs/prx/libSceIcu/StringsEnumeration.cpp#L44-L60) ## Not verified - No local build, CTest, sanitizer, Linux runtime, GPU, or console run was performed. The exact-head hosted Windows job was pending at the final refresh. - The prior Windows/author-reported test evidence applies to earlier heads and does not independently verify this updated head. ## To get this to a good state No blocking code change is needed for this update. Let the Windows check finish; consider fixing the enumeration buffer leak separately. If the head changes, I will rerun the same no-build checks and review the new delta.
THEMANnt commented 2026-11-08 20:35:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-11-08T20:35:34Z.

Review: COMMENTED


The current factory cleanup uses a guest-ABI adapter before calling the host DeleteObject, addressing the calling-convention mismatch from my previous review in the source. The current Windows job instead fails in guest_icu_string_enumeration_objects with 0xc0000409, the same test and exit code as #14340. Please verify the shared enumeration test on #14340 first, then rerun this branch. Windows job

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819558043 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5819558043). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-11-08T20:35:34Z. **Review:** COMMENTED --- The current factory cleanup uses a guest-ABI adapter before calling the host `DeleteObject`, addressing the calling-convention mismatch from my previous review in the source. The current Windows job instead fails in `guest_icu_string_enumeration_objects` with `0xc0000409`, the same test and exit code as #14340. Please verify the shared enumeration test on #14340 first, then rerun this branch. [Windows job](https://github.com/boykopovar/AnyPS5/actions/runs/42473221466/job/128711350806)
MarcZX10 commented 2026-11-14 04:56:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T04:56:24Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected excerpts show no verified blocking defect, but the change is too broad for a complete approval review and the reported checks were not run here.

What I ran

  • Reviewed head a326184ecba7f02e5a6a33abea12f22caa11c4c3.
  • Read the prepared description, commits, manifest and selected ranges of diff.patch; no commands or tests were run.
  • Read diff excerpts for core/libs/prx/libSceIcu/Appendable.cpp, TrieBuilder.cpp, DataSwapper.cpp and Service.cpp.

Results

Check Result Note
Prepared diff review not run Selected excerpts only
Build and tests not run Reported results are author supplied
Full change review not run Many changed files and hunks were not inspected

Findings

Blocking

None identified in the inspected excerpts.

Non-blocking

The change spans a large ICU implementation; a broader source review and the guest build/CI results are still needed before a formal approval is justified.

Not verified

The full contents of most changed files were not reviewed. files.json lists numerous omitted test files as too large for the review folder, along with docs/dev/debt/libSceIcu.md; their contents were not inspected. No checks were run. The description's test and differential results were not independently verified.

To get this to a good state

Nothing is required. Optional: complete the remaining source review and confirm the guest build and CI checks on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5901763174 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5901763174). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T04:56:24Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected excerpts show no verified blocking defect, but the change is too broad for a complete approval review and the reported checks were not run here. ## What I ran - Reviewed head `a326184ecba7f02e5a6a33abea12f22caa11c4c3`. - Read the prepared description, commits, manifest and selected ranges of `diff.patch`; no commands or tests were run. - Read diff excerpts for `core/libs/prx/libSceIcu/Appendable.cpp`, `TrieBuilder.cpp`, `DataSwapper.cpp` and `Service.cpp`. ## Results | Check | Result | Note | | --- | --- | --- | | Prepared diff review | not run | Selected excerpts only | | Build and tests | not run | Reported results are author supplied | | Full change review | not run | Many changed files and hunks were not inspected | ## Findings ### Blocking None identified in the inspected excerpts. ### Non-blocking The change spans a large ICU implementation; a broader source review and the guest build/CI results are still needed before a formal approval is justified. ## Not verified The full contents of most changed files were not reviewed. `files.json` lists numerous omitted test files as too large for the review folder, along with `docs/dev/debt/libSceIcu.md`; their contents were not inspected. No checks were run. The description's test and differential results were not independently verified. ## To get this to a good state Nothing is required. Optional: complete the remaining source review and confirm the guest build and CI checks on this head.
MarcZX10 commented 2026-11-15 11:15:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T11:15:16Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete, so a formal merge decision is not justified; the changed byte conversion code also appears to read past the input for a trailing high surrogate.

What I ran

Reviewed prepared diff at head 7dafe4c74f43391d70da637d016b52653f5a7a3d; no build or tests were run.

Results

Check Result Note
Diff inspection passed Prepared diff reviewed
Build and tests not run Author-reported results only

Findings

Blocking

None verified.

Non-blocking

  • core/libs/prx/libSceIcu/ByteSinkUtil.cpp:744: When the last UTF-16 unit is a high surrogate, this branch reads source[i] after incrementing i to sourceLength. This can read beyond the caller-provided buffer. Handle an unmatched trailing surrogate without accessing past the input.

Not verified

Read description.md, commits.md, manifest.json, and portions of diff.patch. Inspected changed code in BasicStringUtilities.cpp and ByteSinkUtil.cpp; the trailing-surrogate observation is based on the diff. The change spans many additional source and test files; their full text was not reviewed. The prepared bundle reports that some tests and documentation files were excluded because they were too large. The claimed Windows build, CTest, differential runs, and convention checks were not independently run or verified.

To get this to a good state

Nothing is required. The trailing-surrogate handling is an optional point to address; the broader implementation and reported test results remain unverified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910396886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5910396886). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T11:15:16Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete, so a formal merge decision is not justified; the changed byte conversion code also appears to read past the input for a trailing high surrogate. ## What I ran Reviewed prepared diff at head `7dafe4c74f43391d70da637d016b52653f5a7a3d`; no build or tests were run. ## Results | Check | Result | Note | | --- | --- | --- | | Diff inspection | passed | Prepared diff reviewed | | Build and tests | not run | Author-reported results only | ## Findings ### Blocking None verified. ### Non-blocking - `core/libs/prx/libSceIcu/ByteSinkUtil.cpp:744`: When the last UTF-16 unit is a high surrogate, this branch reads `source[i]` after incrementing `i` to `sourceLength`. This can read beyond the caller-provided buffer. Handle an unmatched trailing surrogate without accessing past the input. ## Not verified Read `description.md`, `commits.md`, `manifest.json`, and portions of `diff.patch`. Inspected changed code in `BasicStringUtilities.cpp` and `ByteSinkUtil.cpp`; the trailing-surrogate observation is based on the diff. The change spans many additional source and test files; their full text was not reviewed. The prepared bundle reports that some tests and documentation files were excluded because they were too large. The claimed Windows build, CTest, differential runs, and convention checks were not independently run or verified. ## To get this to a good state Nothing is required. The trailing-surrogate handling is an optional point to address; the broader implementation and reported test results remain unverified.
MarcZX10 commented 2026-11-15 12:48:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T12:48:55Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: fix the trie builder’s out-of-bounds branch construction and propagate allocation failures.

What I ran

Reviewed head 1054efe9855211fc5b4318337bfa5e6817293189 using repo_read.py against the prepared diff and pinned source. No build or tests were run; the description reports author-run tests.

Results

Check Result Note
Diff and targeted source review failed Two concrete trie builder defects
Build and tests not run Author reports Windows host tests; not independently verified

Findings

Blocking

  • core/libs/prx/libSceIcu/TrieBuilder.cpp:614: makeBranchSubNode stores split points in middleUnits[14] and lessThan[14], but length can grow with the number of distinct UTF-16 units and the loop at lines 617–624 has no bound check. A trie with enough distinct first-unit branches recurses to a depth greater than 14 and writes past both arrays. Grow these arrays dynamically or otherwise bound the algorithm safely.
  • core/libs/prx/libSceIcu/TrieBuilder.cpp:825: the element capacity grows by 4 * b.elementsCapacity using signed 32-bit arithmetic, without checking overflow. Once capacity exceeds INT32_MAX / 4, this overflows and can produce an invalid allocation size followed by an out-of-bounds write in add. Check the growth calculation and report an allocation/size error before allocating.

Non-blocking

None.

Not verified

Read the prepared description, commits, manifest, diff, and targeted head source for TrieBuilder.cpp, TrieBuilder.hpp, DataSwapper.cpp, Service.cpp, LocaleBuilder.cpp, and LocaleKeywords.cpp. The review folder’s files.json was not available; the manifest identifies excluded changed files, including large test files. Other changed files and full test coverage were not read. The author-reported tests and differential results were not run or independently verified.

To get this to a good state

Fix both trie builder defects, then rerun the reported trie builder tests and relevant differential checks on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910799997 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5910799997). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T12:48:55Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: fix the trie builder’s out-of-bounds branch construction and propagate allocation failures. ## What I ran Reviewed head `1054efe9855211fc5b4318337bfa5e6817293189` using `repo_read.py` against the prepared diff and pinned source. No build or tests were run; the description reports author-run tests. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | failed | Two concrete trie builder defects | | Build and tests | not run | Author reports Windows host tests; not independently verified | ## Findings ### Blocking - `core/libs/prx/libSceIcu/TrieBuilder.cpp:614`: `makeBranchSubNode` stores split points in `middleUnits[14]` and `lessThan[14]`, but `length` can grow with the number of distinct UTF-16 units and the loop at lines 617–624 has no bound check. A trie with enough distinct first-unit branches recurses to a depth greater than 14 and writes past both arrays. Grow these arrays dynamically or otherwise bound the algorithm safely. - `core/libs/prx/libSceIcu/TrieBuilder.cpp:825`: the element capacity grows by `4 * b.elementsCapacity` using signed 32-bit arithmetic, without checking overflow. Once capacity exceeds `INT32_MAX / 4`, this overflows and can produce an invalid allocation size followed by an out-of-bounds write in `add`. Check the growth calculation and report an allocation/size error before allocating. ### Non-blocking None. ## Not verified Read the prepared description, commits, manifest, diff, and targeted head source for `TrieBuilder.cpp`, `TrieBuilder.hpp`, `DataSwapper.cpp`, `Service.cpp`, `LocaleBuilder.cpp`, and `LocaleKeywords.cpp`. The review folder’s `files.json` was not available; the manifest identifies excluded changed files, including large test files. Other changed files and full test coverage were not read. The author-reported tests and differential results were not run or independently verified. ## To get this to a good state Fix both trie builder defects, then rerun the reported trie builder tests and relevant differential checks on the updated head.
MarcZX10 commented 2026-11-15 13:25:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T13:25:05Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this review; the inspected implementation showed no verified blocking defect.

What I ran

Reviewed head 5093a7bf7ea6e101ce6d16d4f879750454df5381 from the prepared diff and pinned reader context. No commands or tests were run; the author-reported test and differential results were not independently verified.

Results

Check Result Note
Prepared diff and targeted source review passed Inspected trie builders, data swappers, service and locale code
Programmatic checks not run No local build or tests run

Findings

Blocking

None verified in the code inspected.

Non-blocking

None.

Not verified

The PR changes 149 files; this review read the description, commits, review README, TrieBuilder.cpp and .hpp, DataSwapper.cpp, Service.cpp and .hpp, ServiceLocale.cpp, and LocaleKeywords.cpp. Other changed files were not read, including many implementation files, tests and docs/dev/debt/libSceIcu.md; excluded files are identified as too large in the review bundle. Therefore this is an incomplete review and does not establish that the full change is sound. The reported Windows host tests and differentials were not run here; guest build and CTest are left to CI per the description.

To get this to a good state

Nothing is required for the inspected code; complete review of the unread changed files and run the project checks before treating the whole PR as reviewed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910935740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5910935740). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T13:25:05Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this review; the inspected implementation showed no verified blocking defect. ## What I ran Reviewed head `5093a7bf7ea6e101ce6d16d4f879750454df5381` from the prepared diff and pinned reader context. No commands or tests were run; the author-reported test and differential results were not independently verified. ## Results | Check | Result | Note | | --- | --- | --- | | Prepared diff and targeted source review | passed | Inspected trie builders, data swappers, service and locale code | | Programmatic checks | not run | No local build or tests run | ## Findings ### Blocking None verified in the code inspected. ### Non-blocking None. ## Not verified The PR changes 149 files; this review read the description, commits, review README, `TrieBuilder.cpp` and `.hpp`, `DataSwapper.cpp`, `Service.cpp` and `.hpp`, `ServiceLocale.cpp`, and `LocaleKeywords.cpp`. Other changed files were not read, including many implementation files, tests and `docs/dev/debt/libSceIcu.md`; excluded files are identified as too large in the review bundle. Therefore this is an incomplete review and does not establish that the full change is sound. The reported Windows host tests and differentials were not run here; guest build and CTest are left to CI per the description. ## To get this to a good state Nothing is required for the inspected code; complete review of the unread changed files and run the project checks before treating the whole PR as reviewed.
MarcZX10 commented 2026-11-15 13:42:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T13:42:25Z.

Review: COMMENTED


Reviewed — no blocking findings

The reviewed change has no verified blocking defects, but the review is incomplete because many changed files were excluded for size and checks were not run here.

What I ran

Reviewed head d7415c563792798ab86da8930f201039026d6e93. Read the prepared description, commit list, manifest, and targeted diff hunks. No build or tests were run; author-reported test results were not independently verified.

Results

Check Result Note
Targeted diff review passed No verified blocking defect found
Build and tests not run Author reports passing host checks
Full source coverage not run Numerous files excluded for size

Findings

Blocking

None verified in the portions reviewed.

Non-blocking

None.

Not verified

The diff and source files were too large to review completely. In particular, the 40 files marked included: false in the manifest were excluded because they were too large for the review folder; their full text was not read. Other changed source files were not read in full. The claims about differential tests, compilation, and conventions are author-reported and were not run for this review.

Read: description.md, commits.md, manifest.json, targeted portions of diff.patch, and the changed trie-builder hunk at core/libs/prx/libSceIcu/TrieBuilder.cpp:makeBranchSubNode. Excluded by the prepared review bundle: 40 changed files listed with included: false in the manifest; the full contents of these files were not read.

To get this to a good state

Nothing is required. Optional: provide a review bundle that includes the excluded source files and run the reported checks on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5911003412 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5911003412). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T13:42:25Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The reviewed change has no verified blocking defects, but the review is incomplete because many changed files were excluded for size and checks were not run here. ## What I ran Reviewed head `d7415c563792798ab86da8930f201039026d6e93`. Read the prepared description, commit list, manifest, and targeted diff hunks. No build or tests were run; author-reported test results were not independently verified. ## Results | Check | Result | Note | | --- | --- | --- | | Targeted diff review | passed | No verified blocking defect found | | Build and tests | not run | Author reports passing host checks | | Full source coverage | not run | Numerous files excluded for size | ## Findings ### Blocking None verified in the portions reviewed. ### Non-blocking None. ## Not verified The diff and source files were too large to review completely. In particular, the 40 files marked `included: false` in the manifest were excluded because they were too large for the review folder; their full text was not read. Other changed source files were not read in full. The claims about differential tests, compilation, and conventions are author-reported and were not run for this review. Read: `description.md`, `commits.md`, `manifest.json`, targeted portions of `diff.patch`, and the changed trie-builder hunk at `core/libs/prx/libSceIcu/TrieBuilder.cpp:makeBranchSubNode`. Excluded by the prepared review bundle: 40 changed files listed with `included: false` in the manifest; the full contents of these files were not read. ## To get this to a good state Nothing is required. Optional: provide a review bundle that includes the excluded source files and run the reported checks on this head.
MarcZX10 commented 2026-11-16 19:24:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T19:24:54Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete because only a small subset of the changed source and test files was read; merge approval is not justified.

What I ran

Reviewed head 98b7164b4637d8e8d7172891a4a6f5a28c51e420. No commands or tests were run. Read the prepared description, commits, manifest, diff, review-folder README, and selected source and test files through repo_read.py.

Results

Check Result Note
Change inspection not run Diff reviewed selectively
Tests not run Author-reported results only
Full changed-file review not run Many changed files unread

Negative control

Not run; no tests were run in this review.

Findings

Blocking

None verified in the portions inspected.

Non-blocking

None.

Sources

Inspected selected ranges from TrieBuilder.cpp, DataSwapper.cpp, Service.cpp, Appendable.cpp, LocaleBuilder.cpp, and the TrieBuilder.cpp, DataSwapper.cpp, and Service.cpp tests. Also read the corresponding diff context and the complete Appendable.cpp diff.

Not verified

The review folder lists over 100 changed files. Most changed implementation files and tests were not read, including the full trie builder, data swapper, service implementations, and the excluded large test files and debt document. The Windows host tests and differential results in the description are author-reported and were not independently run. No guest build or console behavior was verified.

To get this to a good state

Nothing is required to address a verified defect. Complete review of the changed files and run the relevant checks before requesting a formal approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5926092955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-5926092955). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T19:24:54Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete because only a small subset of the changed source and test files was read; merge approval is not justified. ## What I ran Reviewed head `98b7164b4637d8e8d7172891a4a6f5a28c51e420`. No commands or tests were run. Read the prepared description, commits, manifest, diff, review-folder README, and selected source and test files through `repo_read.py`. ## Results | Check | Result | Note | | --- | --- | --- | | Change inspection | not run | Diff reviewed selectively | | Tests | not run | Author-reported results only | | Full changed-file review | not run | Many changed files unread | ## Negative control Not run; no tests were run in this review. ## Findings ### Blocking None verified in the portions inspected. ### Non-blocking None. ## Sources Inspected selected ranges from `TrieBuilder.cpp`, `DataSwapper.cpp`, `Service.cpp`, `Appendable.cpp`, `LocaleBuilder.cpp`, and the `TrieBuilder.cpp`, `DataSwapper.cpp`, and `Service.cpp` tests. Also read the corresponding diff context and the complete `Appendable.cpp` diff. ## Not verified The review folder lists over 100 changed files. Most changed implementation files and tests were not read, including the full trie builder, data swapper, service implementations, and the excluded large test files and debt document. The Windows host tests and differential results in the description are author-reported and were not independently run. No guest build or console behavior was verified. ## To get this to a good state Nothing is required to address a verified defect. Complete review of the changed files and run the relevant checks before requesting a formal approval.
ligmaSec commented 2026-12-03 15:57:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:57:21Z.

Review: COMMENTED


In the fallback cache loop in Service.cpp, the result is passed to uhash_put before its reference count is incremented. The hash consumes that reference even when insertion fails, by calling its value deleter. If the first cache key already owns the only reference, failure on a later alias can destroy the entry while the first key still points to it. Please acquire the reference for each new alias before passing it to the hash. I reviewed this path in the commits on top of #14340.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6173367663 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14443#pullrequestreview-6173367663). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T15:57:21Z. **Review:** COMMENTED --- In the fallback cache loop in `Service.cpp`, the result is passed to `uhash_put` before its reference count is incremented. The hash consumes that reference even when insertion fails, by calling its value deleter. If the first cache key already owns the only reference, failure on a later alias can destroy the entry while the first key still points to it. Please acquire the reference for each new alias before passing it to the hash. I reviewed this path in the commits on top of #14340. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/14443:upstream-pr/14443'
git switch 'upstream-pr/14443'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/14443'
git switch 'upstream-pr/14443'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/14443'
git switch 'upstream-pr/14443'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/14443'
git switch 'main'
git merge --squash 'upstream-pr/14443'
git switch 'main'
git merge --ff-only 'upstream-pr/14443'
git switch 'main'
git merge 'upstream-pr/14443'
git push origin 'main'
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!14443
No description provided.