feat(libSceIcu): implement the string trie builders, data swappers and the ICU service cache #14443
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14443"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by 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,
c3295f3and 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) andUCharsTrieBuilder(add,build,buildUChars,buildUnicodeString, the element accessors and everywrite*helper). The 16-byteStringTrieBuilderand 112-byteUCharsTrieBuilderLP64 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 guestprintErrorreceives the guestva_list),utrie_swapAnyVersion,utrie2_swapanducptrie_swap. The 96-byteUDataSwapperlayout matches ICU.ICU service (32,
Service.cpp,ServiceLocale.cpp,LocaleBuilder.cpp,LocaleKeywords.cpp):ICUServicefactory registration and removal, instance caches,getKey, visible IDs and ID maps, explicit-locale display names,reset,clearCaches, destruction and listener dispatch;SimpleLocaleKeyFactoryandICUResourceBundleFactoryconstruction, destruction and class IDs;LocaleUtility::initNameFromLocale,LocaleBuilder::setLocale,ulocimp_getKnownCanonicalizedLocaleForTestanduloc_openKeywordList.UVector (2): integer
indexOfandsortedInsert. ICU passes uninitialized upper union bytes to the comparator here; the adapter zeroes them.664 legacy entries stay
NotImplemented_nid_no_patchstubs. Among them are the format swappers (break iterator, resource bundle, dictionary, names, converter, collation and normalization),UDataMemoryloading, 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:core/libs/prx/libSceIcu/testsexecutables pass on this head (TEST EXIT CODE: 0) (TEST EXIT CODE: 0);APS5_VABI;tools/check_conventions.pypasses andcore/libs/tests/test_public_headers.py --audit-onlypasses.TrieBuilderDiff(layouts, virtual slots, builds)TrieBuilderRandomDiff(1500 random builders: any UTF-16 unit, empty strings, full int32 values, duplicates, add after build, double build,build()andbuildUnicodeString())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)DataSwapperDiffVectorDiffServiceCacheDiff(2002 random sequences of 300 operations)ServiceLocaleDiff(1001 sequences of 300 key and 300 factory operations)ServiceResourceFactoryDiffServiceListenerDiffLocaleKeywordsDiffLocaleObjectDiff,LocaleBuilderDiff(existing exports, rerun after the merge)DIFF EXIT CODE: 0The differentials found and fixed seven bugs in the first version of this code:
UTRIE_SHIFT4 instead of 5, which rejected every UTrie v1;UTRIE2_INDEX_1_OFFSET0x220 instead of 0x840;UCPTRIE_BMP_INDEX_LENGTH0x1000 instead of 0x400;writeValueAndFinal,writeValueAndTypeandwriteDeltaTo;addafterbuildreturning 20 instead ofU_NO_WRITE_PERMISSION;addof 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
CharStringDiffstill 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 implementsuprv_*numeric helpers only.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by 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
7d4b66e3f201590a4fb949f3128094c971c710a4, basef1a7b02028(the precheck base). The PR is stacked on three open PRs: #14016 (headc516806ab7), #14144 (head919905beb4) and #14340 (headf6303c9c46). The commits fromc516806ab7tof6303c9c46belong to those PRs; this PR's own commits aref376d5d149,47f9f3b842and7d4b66e3f2./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /dev/shm/reviewer-run/precheck/14443python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base f1a7b02028 --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --json(exit 0;passed_with_warnings; 1,719 findings: 1,695export-removedand 24public-declaration-not-found; 4,233 symbols).APS5_EXPORT("<NID>", name)pairs incore/libs/prx/libSceIcuat 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.7d4b66e3f2,refactor(libSceIcu): mark the swapper, service and trie builder callbacks as internal. It renames 26 definitions (SwapArray16,CopyArray16and others inDataSwapper.cpp, the service hash-table callbacks inService.cpp, and the trie-builder vtable callbacks inTrieBuilder.cpp) to a_nid_no_patchsuffix. I checked that none of the 26 old names remains incore/libs/prx/libSceIcuat the head (the one other match,Abstract, is a separate function inCharacterIteratorObjects.cpp).f376d5d149and47f9f3b842commits were not read in full; I read only the file list and theCMakeLists.txtaddition for the newLocaleKeywordstest.Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14443/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check f1a7b02028ae50adaf6c5aaaef892a51841b25bf...7d4b66e3f201590a4fb949f3128094c971c710a4/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/usr/bin/python3 tools/pr_abi_audit.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head 7d4b66e3f201590a4fb949f3128094c971c710a4 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14443 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14443/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./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.mdNo 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:
tools/progress.pyfrom 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.Sources
github.com/boykopovar/AnyPS5@7d4b66e3f2/core/libs/prx/libSceIcu/DataSwapper.cppLocaleKeywordstest registration at head:github.com/boykopovar/AnyPS5@7d4b66e3f2/core/libs/prx/libSceIcu/CMakeLists.txtNot verified
TrieBuilder.cpp(1,159 lines),DataSwapper.cpp(696 lines),Service.cpp(544 added lines), thef376d5d149and47f9f3b842commits, the 1,695 renamed legacy exports beyond the NID check, and most of the 25 test files.conventions(one cancelled, one queued),eligibility,library-portabilityandreportwere queued at review time.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/DeleteObjectat line 60.CreateFactoryVectorcasts the plain host-ABIDeleteObjectintoIcu::ObjectDeleter, which is anAPS5_VABIfunction 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 submittedguest_icu_servicereproduces heap-corruption exit0xc0000374. In a separate control build, changing only the helper declaration tovoid 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.
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
c3295f3c312c8d063f40b17b43c66a4424ecdb0b; PR basef1a7b02028; own-commit basef6303c9c46(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.Results
Commands and unedited precheck output
Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir /dev/shm/reviewer-run/precheck/14443c(report: report.md in that directory).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).... --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.python3 tools/pr_test_quality.py --root <archive> --jsonon 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).gh api repos/boykopovar/AnyPS5/commits/c3295f3c312c8d063f40b17b43c66a4424ecdb0b/check-runs.Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check f1a7b02028ae50adaf6c5aaaef892a51841b25bf...c3295f3c312c8d063f40b17b43c66a4424ecdb0b/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/marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base f1a7b02028ae50adaf6c5aaaef892a51841b25bf --head c3295f3c312c8d063f40b17b43c66a4424ecdb0b --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./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/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./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.mdNo 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
The trie swapper can run its swaps past the caller's buffer.
DataSwapper.cppline 379 computessizeinint32, fromindexLengthanddataLength, which areint32inUTrieHeader(lines 323-328). Only lower bounds are checked (lines 370-372). A header with options0x125, indexLength0x3fffffe0and dataLength0x20givessize= -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: boundindexLengthanddataLengthagainst the real trie size, or computesizein 64 bits and requiresize <= lengthbefore any swap; check each swap's end againstlength. Add a test with that header. I checked the arithmetic by hand; it has not been run.Unregistering an unknown key calls through a pointer the service does not own, and a repeat call reaches freed memory.
Service.cpplines 336-346: whenremoveElementmisses, the else branch sets*statusand calls vtable slot 1 (the deleting destructor) on the caller'skey(line 345). The service does not own that object. The success path already frees it:removeElementcallsRemove(Vector.cpplines 72-75), which runs the vector's deleter,DeleteFactory, set atService.cppline 162.factoriesis not cleared, so a secondunregisterwith the same key takes the else branch and calls a vtable on freed memory. Smallest fix: on a miss, set*statusand return 0 without touching the object. Add a test that unregisters twice;tests/Service.cppline 36 covers only the successful call.setLocale reads past the name when the variant offset is larger than the name.
LocaleBuilder.cppline 170 rejects only a negative offset and a null base name. Line 171 then callsstrlen(baseName + variantBegin). A locale whosevariantBeginis greater thanstrlen(baseName)makesstrlenread outside the string, inside an inline buffer or past a heap allocation. The clamp that exists on the@path belongs to #14340 (LocaleObject.cppline 250); the plain path has none. Smallest fix: throwstd::invalid_argumentwhenvariantBegin > strlen(baseName), as line 170 does for the other offset. Add a test with an offset past the name.The debt file says integer
indexOfand integersortedInsertare stubs, but this PR implements both.docs/dev/debt/libSceIcu.mdline 146 says the integer wrappers "remain stubs".Vector.cpplines 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
TrieBuilder.cpplines 957-963: after a failed reallocation inensureCapacity,ucharsis null andcapacityis 0, whileucharsLengthkeeps counting the units already written. The next write allocates a new buffer and skips the copy.buildUChars(lines 912-914) checks only for a nulluchars, so it can return success with uninitialized units. This needs an allocation failure. Fix: make a failed write sticky and return error 7 frombuildUChars.TrieBuilder.cpplines 839-843: for a string longer than 0xffff units,elementsLengthis 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.tests/TrieBuilder.cppline 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.tests/DataSwapper.cpplines 88-97 never readoutBuf, so byte order is not checked. No test callsSwapUTrieorutrie2_swap, which is why finding 1 is not caught. TheWrite*helpers (lines 168-178) are unused.indexLengthgives misaligned 32-bit accesses (undefined behaviour). Parity is not checked at lines 594 and 647.static_asserts forUTrieHeader,UTrie2HeaderorUCPTrieHeader, unlikeTrie2.cppandCodePointTrie.cpp. Line 609 relies onsizeof(UTrie2Header) - 4.SwapUTrie,udata_openSwapper).udata_readInt16andudata_readInt32dereferencedswithout a check (as reported; not re-checked).GetTrieVersionreturns 0 for length -1, soutrie_swapAnyVersion(-1)fails with error 3, whileucptrie_swapandutrie2_swapaccept -1 as a size query. ICU 68.2 behaviour was not checked.registerFactory): if*statusis 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.getDisplayNames):Require(dn)throwsstd::invalid_argumentwhen the status is already failing and no display-name cache exists. The debt file says throws happen only for null pointers.FindListener, used byIsServiceListenerat line 243):search.directis 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).LocalVector::Add): on the early return and on anaddElementfailure,stris not freed; the caller is at lines 484-485.tests/Service.cpphas no case for a second unregister, a failing status, or theregisterFactoryerror paths.LocaleBuilder.cpplines 165-170:clear()runs before the offset check, so a throw leaves the builder half-updated with status 0.tests/LocaleBuilder.cppcovers only the happy path (lines 43-46).tests/LocaleKeywords.cppdoes not test a null status, a bad size, a missing trailing NUL or an allocation failure.tests/LocaleObject.cppline 119 checks the count and the first and last entries of the array only.indexOfandsortedInsert(Vector.cpplines 251-255 and 392-396) have no test;tests/Vector.cppcovers the other overloads.Abstract_nid_no_patch, which throws (TrieBuilder.cpplines 25, 400, 411); slot 2 ofUCharsTrieBuilderis never set.VectorObjects.cppimplements them, and line 84 says so. Fix while the file is open.f6303c9c46, including f376d5d149. The body should list them.docs/dev/CONVENTIONS.mdpermits comments only for technical debt, andAGENTS.mdline 8 andCONTRIBUTING.mdline 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
github.com/boykopovar/AnyPS5@c3295f3c31/core/libs/prx/libSceIcu/DataSwapper.cpp (L323-L328)and #L370-L388github.com/boykopovar/AnyPS5@c3295f3c31/core/libs/prx/libSceIcu/Service.cpp (L336-L346), the removal path atgithub.com/boykopovar/AnyPS5@c3295f3c31/core/libs/prx/libSceIcu/Vector.cpp (L72-L75), and the test atgithub.com/boykopovar/AnyPS5@c3295f3c31/core/libs/prx/libSceIcu/tests/Service.cpp (L36)github.com/boykopovar/AnyPS5@c3295f3c31/core/libs/prx/libSceIcu/LocaleBuilder.cpp (L170-L171)github.com/boykopovar/AnyPS5@c3295f3c31/docs/dev/debt/libSceIcu.md (L146)and the implementation atgithub.com/boykopovar/AnyPS5@c3295f3c31/core/libs/prx/libSceIcu/Vector.cpp (L251-L255)and #L392-L396Not verified
To get this to a good state
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
d3cdd80fd470edcd2be460c4886bbbbb678a071a, PR basef1a7b02028ae50adaf6c5aaaef892a51841b25bf, own-commit basef6303c9c46.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.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14443 --output-dir <scratch>.Results
//headers pass only because the PR touches a debt filePrecheck report (unedited header and failing rows)
Findings
Blocking
core/libs/prx/libSceIcu/Service.cpp350-352: when the key is missing, unregister sets the status and callsDeleteFactory_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. Updatetests/Service.cppto expect that result instead of a throw.core/libs/prx/libSceIcu/DataSwapper.cpp74:if (!errorCode || *errorCode > 0) return 0;returns silently on a nullerrorCode. Line 580 in the same file throwsstd::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.core/libs/prx/libSceIcu/TrieBuilder.cpp950-963: after a failed reallocation,ucharsis null and capacity is 0 whileucharsLengthkeeps counting. The next successful growth skips the copy at 963, sobuild()returns code 0 with units missing. Fix: make the failure sticky, for example by a negative capacity.core/libs/prx/libSceIcu/TrieBuilder.cpp990-993:newLength = b.ucharsLength + lengthis computed in int32. A length near INT32_MAX wraps negative, the growth check at 951 passes, andmemcpywrites out of bounds. Fix: reject a length aboveINT32_MAX - ucharsLengthbefore the addition.core/libs/prx/libSceIcu/TrieBuilder.cpp1103-1105:getLimitOfLinearMatchindexesb.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
//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.UStack::pop(Vector.cpp441-447) andVector::operator==(257-266). These need the ICU source to decide.Sources
github.com/boykopovar/AnyPS5@d3cdd80fd4/core/libs/prx/libSceIcu/Service.cpp (L345-L353)github.com/boykopovar/AnyPS5@d3cdd80fd4/core/libs/prx/libSceIcu/DataSwapper.cpp (L74)and #L580github.com/boykopovar/AnyPS5@d3cdd80fd4/core/libs/prx/libSceIcu/TrieBuilder.cpp (L950-L963), #L990-L993, #L1103-L1105Not verified
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.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 inStringPiece::findand one non-blocking enumeration-buffer leak.What I ran
b28bb772177768f99874ca38f6252cd0139acf2a; current targetmainwas7feb37ee3e30e10139b483fb4df689d5b5b69ab8.Results
Raw check output excerpts
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 checksindex < 0but notindex < object.length. With a one-character length-delimited haystack"a"and needle"ab", it compares the first character, incrementsindexto the haystack length, then readsobject.pointer[1]on the next iteration. This is an out-of-bounds read. Stop the candidate comparison whenindexreachesobject.length, then return no match for that candidate.Non-blocking
StringsEnumeration.cpp:Buffer()stores an allocated buffer inenumeration->baseContext;Close_nid_no_patch()frees onlyenumeration. The ownedbaseContextallocation 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
To get this to a good state
Bound the
StringPiece::findinner 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.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::findout-of-bounds finding; the hosted Windows job is still pending.What I ran
d61bf05d163d624b9cc7d0b7d76692824defdd37against based1ae628bc2f62459cce1e9872ba5632c938c71f2; compared all changes since my previous review atfa9639acd1458302b151339b1a152ed0e508b558. The current-main merge preview is clean; the declared stack is#14016 → #14144 → #14340 → #14443.Results
main.Commands and unedited outputs
Precheck command output:
The precheck report says
diff_checkandconventions_and_pr_templatepassed, 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 --checkoutput was empty (exit status 0).Hosted check output at the final refresh:
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
index >= object.lengthguard 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
StringsEnumeration::Buffer()allocation is still stored inbaseContext, whileClose_nid_no_patch()frees only the enumeration object. Closing an enumeration after using its string buffer therefore leaks that buffer. Consider freeingbaseContexton close and adding a close-path regression.Sources
StringPiece::findbounds guardNot verified
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.
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 inguest_icu_string_enumeration_objectswith0xc0000409, the same test and exit code as #14340. Please verify the shared enumeration test on #14340 first, then rerun this branch. Windows jobImported 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
a326184ecba7f02e5a6a33abea12f22caa11c4c3.diff.patch; no commands or tests were run.core/libs/prx/libSceIcu/Appendable.cpp,TrieBuilder.cpp,DataSwapper.cppandService.cpp.Results
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.jsonlists numerous omitted test files as too large for the review folder, along withdocs/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.
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
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 readssource[i]after incrementingitosourceLength. 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 ofdiff.patch. Inspected changed code inBasicStringUtilities.cppandByteSinkUtil.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.
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
1054efe9855211fc5b4318337bfa5e6817293189usingrepo_read.pyagainst the prepared diff and pinned source. No build or tests were run; the description reports author-run tests.Results
Findings
Blocking
core/libs/prx/libSceIcu/TrieBuilder.cpp:614:makeBranchSubNodestores split points inmiddleUnits[14]andlessThan[14], butlengthcan 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 by4 * b.elementsCapacityusing signed 32-bit arithmetic, without checking overflow. Once capacity exceedsINT32_MAX / 4, this overflows and can produce an invalid allocation size followed by an out-of-bounds write inadd. 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, andLocaleKeywords.cpp. The review folder’sfiles.jsonwas 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.
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
5093a7bf7ea6e101ce6d16d4f879750454df5381from 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
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.cppand.hpp,DataSwapper.cpp,Service.cppand.hpp,ServiceLocale.cpp, andLocaleKeywords.cpp. Other changed files were not read, including many implementation files, tests anddocs/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.
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
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: falsein 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 ofdiff.patch, and the changed trie-builder hunk atcore/libs/prx/libSceIcu/TrieBuilder.cpp:makeBranchSubNode. Excluded by the prepared review bundle: 40 changed files listed withincluded: falsein 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.
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 throughrepo_read.py.Results
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 theTrieBuilder.cpp,DataSwapper.cpp, andService.cpptests. Also read the corresponding diff context and the completeAppendable.cppdiff.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.
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 touhash_putbefore 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.