feat(icu): compare counted StringPiece byte strings #23063
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23063"
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 MrSourceee on 2026-11-18T17:16:54Z.
What
Implement the existing ICU 68
operator==(const StringPiece&, const StringPiece&)export. It compares counted bytes rather than NUL-terminated text and returns the one-byteUBoolresult. Unequal lengths do not inspect the backing bytes; two empty views compare equal. Nonempty comparisons check the last byte, then compare the prefix in fixed-size chunks using the existing guest-copy API. No ICU object ownership, shared state or game-specific path changes.Reference: ICU 68.2 implementation and class layout. The console ABI has not been independently measured. The documentation fragment distinguishes invalid input handling from the upstream contract.
Tested
Linux x86-64, GCC 14.2, focused source-linked builds on
6286d36449. The original export threwnot implemented; the new regression passed with the actual project guest-copy code. Covered empty views, unequal lengths, embedded NULs, byte and chunk-boundary differences, unreadable input, equal negative lengths and errno on valid comparisons. The adjacent ICU Compare and Resource tests also passed.Separately linked the exact ICU 68.2 Linux release, constructed real
icu_68::StringPieceobjects, and compared the two implementations on 12,000 deterministic generated pairs: no mismatches.git diff --check,tools/check_conventions.py --base origin/main,tools/debt_fold.py --checkandtest_public_headers.py --audit-onlypassed. Overlap checked via GitHub API, including the head sources of #14144 and #14340; no implementation found. The full-project CMake suite, Windows, PS5 hardware and titles were not tested. No game-unblock or speed claim.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T17:18:33Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
2a336d5058:tools/check_conventions.pypassed.guest_icu_string_piece_testsbuilt cleanly.guest_icu_string_piece):core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/libSceIcu.hpp,core/libs/prx/libSceIcu/StringPiece.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T07:05:43Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the review found no verified defect, but the declared console layout has not been independently measured.
What I ran
Reviewed head
ca9825d4734ee1137a99aff0e13562bda80b89a5using the prepared diff and pinned reader. No build or tests were run; test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed
core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/StringPiece.cpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/include/StringPiece.hpp,core/libs/prx/libSceIcu/libSceIcu.hpp,core/libs/prx/libSceIcu/tests/StringPiece.cpp, anddocs/dev/debt/changes/feat-icu-string-piece-equality.md. The only declared file exclusions were none (manifest.jsonmarks all changed files included). Targeted context read:core/libs/prx/libc/src/General.cpp.Not verified
No commands or checks were run. Linux tests, generated-pair comparison, convention checks, and debt checks are claims from the PR description, not results from this review. Windows, PS5 hardware, game behavior, and independent verification of the console ABI remain unverified.