feat(libSceIcu): implement the uhash hash table exports #20373

Merged
beardsciences merged 13 commits from upstream-pr/20373 into main 2026-11-26 06:56:32 +00:00
beardsciences commented 2026-11-15 03:09:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by beardsciences on 2026-11-15T03:09:13Z.


What

Thirty-eight libSceIcu uhash_* exports are stubs that throw NotImplemented_nid_no_patch: ICU's internal hash table (common/uhash.cpp, plus uhash_deleteHashtable from uhash_us.cpp), under the ICU 68 names their NIDs already carry in LegacyExports.cpp. The three string hashes they use, ustr_hashUCharsN, ustr_hashCharsN and ustr_hashICharsN, were part of this PR until #23859 implemented them on main (StringHash.cpp); the hash functions here now call those.

This PR implements all thirty-eight in a new core/libs/prx/libSceIcu/HashTable.cpp, with the signatures and layouts of ICU 68.2's uhash.h and the behaviour of its uhash.cpp:
github.com/unicode-org/icu@84e1f26ea7/icu4c/source/common/uhash.cpp
github.com/unicode-org/icu@84e1f26ea7/icu4c/source/common/uhash.h

  • Open addressing with double hashing over ICU's prime table, the three resize policies, the 80-byte UHashtable and 24-byte UHashElement; tables opened by the module or filled in caller storage (uhash_init, uhash_initSize).
  • Hash functions, comparators and deleters are the guest's function pointers, called as they are stored.
  • uhash_puti and uhash_iputi store a zero value as ICU 68 does. ICU 70 changed this to remove the key and added uhash_putiAllowZero; the module exports no ICU 70 uhash_* name, so it follows 68.
  • uhash_deleteHashtable closes and frees an ICU 68 icu::Hashtable (a table pointer followed by the embedded table, no virtual table; delete goes to uprv_free).
  • Blocks come from uprv_malloc and go back through IcuReleaseMemory_nid_no_patch (from #20230), so u_setMemoryFunctions applies.
  • Where ICU dereferences a null pointer (table, status, position, element, a missing hash function or key comparator), indexes past its policy table (an unknown resize policy) or aborts (a full table with no free slot), the export throws.
  • Left as stubs: uhash_hashUnicodeString, uhash_compareUnicodeString, uhash_hashCaselessUnicodeString and uhash_compareCaselessUnicodeString, which read a guest icu::UnicodeString; no layout for it is defined in the module yet.
  • The debt fragment docs/dev/debt/changes/feat-icu-uhash.md adds a libSceIcu entry recording that nothing here is verified on a console.

Matches ICU on purpose. Reviews have raised these three points more than once. Each is how ICU behaves, so the PR keeps it, and guest_icu_hash pins it:

  • A failed growth leaves primeIndex at the new index. ICU's _uhash_allocate sets primeIndex and length before uprv_malloc, and _uhash_rehash puts back only elements and length (L222-L231, L414-L420). The bundled ICU 78.1, with its allocator failed through u_setMemoryFunctions at 64 entries, reports length=127 primeIndex=5 after the failure and grows to 509 on the next put; the PR gives the same numbers (probe).
  • uhash_equals reads the value of the slot the lookup returns without checking it. ICU does the same (L915-L916); the lookup never returns null, since an absent key lands on an empty or deleted slot (L372-L382). Returning false there would change the result for value comparators that accept an empty value (reply).
  • The value deleter runs on whatever the value slot holds, integer values included. UHashTok is a plain union and ICU does not record which member was written, and _uhash_setElement calls the deleter on a nonzero oldValue.pointer that differs from the new value whenever a deleter is set (L144-L159); a side-by-side run against the bundled ICU gave identical traces (comparison).

HashTable.cpp keeps ICU's copyright notice verbatim and the pinned source links at its top, as AGENTS.md allows (#20002).

Tested

Windows 11 26200, WinLibs GCC 15.2.0, Release, Ryzen 5 5600X. Built and run at the head 9f0ed84cda on main ecd019f601. After merging main 0626a8334f (which brought #23859) as bccc109957: ctest -R 'icu|public_header' 144 of 144 pass, including guest_icu_hash and #23859's guest_icu_availability. After merging main again as 52db32b1d5: ctest -R '^public_headers|^guest_icu' 153 of 153 pass. After merging main 7f99fbd60d as 1650f73fe7 (conflicts with neighbouring stubs that main removed, and with a test block in CMakeLists.txt; both sides kept): ctest -R '^public_headers|icu' 161 of 161 pass.

  • ctest -R '^public_headers|^guest_icu': 112 of 112 pass, including the new guest_icu_hash (3 of 3 runs).
  • guest_icu_hash is differential where it can be: a second file in the test drives the bundled ICU 78.1 uhash with the same operations. For string, caseless string and integer keys under each resize policy, 6,000 random puts, removes and gets give the same return values and statuses as ICU, and every slot (position, stored hash, value) and the table length match ICU's at regular checkpoints. The three string hashes and three string comparators match ICU on 400 random strings, with explicit, shorter, zero and negative lengths. Only nonzero values are used there, since ICU 78 removes on zero.
  • It also checks the rest on the module alone, with a tracking allocator installed through u_setMemoryFunctions: pointer values keep all 64 bits, a null value removes, zero integer values are stored, key and value deleters run on replace, remove, removeAll, close and every refused put, find, nextElement, removeElement, growth and shrinking, a fixed table refusing its last slot, caller storage (init overwrites a dirty table; close does not free it), uhash_deleteHashtable, uhash_equals, a failed table or element allocation, a failed growth keeping the old elements, set errors and warnings, the throwing cases, and that every block is released exactly once.
  • Removal checks: 73 one-line mutations of HashTable.cpp (each deleter call, each status write, each probe and rehash step, each water mark, each comparison and hash step), run at the head. 72 make guest_icu_hash fail. The one left removes the break at an empty slot, after which the probe still settles on that slot, so no result can change. The restored build passes.
  • python tools/check_conventions.py --base origin/main with this title and description: passed. python tools/debt_fold.py --check fails on main with and without this PR, on the pending feat-icu-ulist.md fragment (#18203 left two "Older callable exports" entries; #20282 merges them). With that fragment set aside, this PR's fragment applies.

Not run: Linux, macOS, a console, any title. No title is known to import these exports.

Overlap

  • #14144, #14340 and #14443 (the stacked data-free ICU 68 series) also define these exports among several hundred others; all three are labelled needs rebase. No other open PR names or adds a uhash_* export (searched open PRs by name and checked the diff of every open PR that touches libSceIcu). #19951 implements uprv_asciitolower, so HashTable.cpp lowercases ASCII with a private helper instead of exporting it.
  • This PR removes thirty-eight stubs from LegacyExports.cpp and their declarations from include/LegacyExports.hpp, adds one source line and appends a test block to CMakeLists.txt, and changes the debt file only through its fragment; other open libSceIcu PRs touch the same three files at other lines.

Checklist

  • Based on current main; no other open PR implements the same functions (see Overlap for the stacked series)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5318962684 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373). Originally posted by [beardsciences](https://github.com/beardsciences) on 2026-11-15T03:09:13Z. --- ### What Thirty-eight libSceIcu `uhash_*` exports are stubs that throw `NotImplemented_nid_no_patch`: ICU's internal hash table (`common/uhash.cpp`, plus `uhash_deleteHashtable` from `uhash_us.cpp`), under the ICU 68 names their NIDs already carry in `LegacyExports.cpp`. The three string hashes they use, `ustr_hashUCharsN`, `ustr_hashCharsN` and `ustr_hashICharsN`, were part of this PR until #23859 implemented them on `main` (`StringHash.cpp`); the hash functions here now call those. This PR implements all thirty-eight in a new `core/libs/prx/libSceIcu/HashTable.cpp`, with the signatures and layouts of ICU 68.2's `uhash.h` and the behaviour of its `uhash.cpp`: https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.cpp https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.h - Open addressing with double hashing over ICU's prime table, the three resize policies, the 80-byte `UHashtable` and 24-byte `UHashElement`; tables opened by the module or filled in caller storage (`uhash_init`, `uhash_initSize`). - Hash functions, comparators and deleters are the guest's function pointers, called as they are stored. - `uhash_puti` and `uhash_iputi` store a zero value as ICU 68 does. ICU 70 changed this to remove the key and added `uhash_putiAllowZero`; the module exports no ICU 70 `uhash_*` name, so it follows 68. - `uhash_deleteHashtable` closes and frees an ICU 68 `icu::Hashtable` (a table pointer followed by the embedded table, no virtual table; `delete` goes to `uprv_free`). - Blocks come from `uprv_malloc` and go back through `IcuReleaseMemory_nid_no_patch` (from #20230), so `u_setMemoryFunctions` applies. - Where ICU dereferences a null pointer (table, status, position, element, a missing hash function or key comparator), indexes past its policy table (an unknown resize policy) or aborts (a full table with no free slot), the export throws. - Left as stubs: `uhash_hashUnicodeString`, `uhash_compareUnicodeString`, `uhash_hashCaselessUnicodeString` and `uhash_compareCaselessUnicodeString`, which read a guest `icu::UnicodeString`; no layout for it is defined in the module yet. - The debt fragment `docs/dev/debt/changes/feat-icu-uhash.md` adds a libSceIcu entry recording that nothing here is verified on a console. **Matches ICU on purpose.** Reviews have raised these three points more than once. Each is how ICU behaves, so the PR keeps it, and `guest_icu_hash` pins it: - **A failed growth leaves `primeIndex` at the new index.** ICU's `_uhash_allocate` sets `primeIndex` and `length` before `uprv_malloc`, and `_uhash_rehash` puts back only `elements` and `length` ([L222-L231](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.cpp#L222-L231), [L414-L420](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.cpp#L414-L420)). The bundled ICU 78.1, with its allocator failed through `u_setMemoryFunctions` at 64 entries, reports `length=127 primeIndex=5` after the failure and grows to 509 on the next put; the PR gives the same numbers ([probe](https://github.com/boykopovar/AnyPS5/pull/20373#issuecomment-7077731508)). - **`uhash_equals` reads the value of the slot the lookup returns without checking it.** ICU does the same ([L915-L916](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.cpp#L915-L916)); the lookup never returns null, since an absent key lands on an empty or deleted slot ([L372-L382](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.cpp#L372-L382)). Returning false there would change the result for value comparators that accept an empty value ([reply](https://github.com/boykopovar/AnyPS5/pull/20373#issuecomment-7025457001)). - **The value deleter runs on whatever the value slot holds, integer values included.** `UHashTok` is a plain union and ICU does not record which member was written, and `_uhash_setElement` calls the deleter on a nonzero `oldValue.pointer` that differs from the new value whenever a deleter is set ([L144-L159](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/common/uhash.cpp#L144-L159)); a side-by-side run against the bundled ICU gave identical traces ([comparison](https://github.com/boykopovar/AnyPS5/pull/20373#issuecomment-7014465125)). `HashTable.cpp` keeps ICU's copyright notice verbatim and the pinned source links at its top, as AGENTS.md allows (#20002). ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 26200, WinLibs GCC 15.2.0, Release, Ryzen 5 5600X. Built and run at the head `9f0ed84cda` on `main` `ecd019f601`. After merging `main` `0626a8334f` (which brought #23859) as `bccc109957`: `ctest -R 'icu|public_header'` 144 of 144 pass, including `guest_icu_hash` and #23859's `guest_icu_availability`. After merging `main` again as `52db32b1d5`: `ctest -R '^public_headers|^guest_icu'` 153 of 153 pass. After merging `main` `7f99fbd60d` as `1650f73fe7` (conflicts with neighbouring stubs that `main` removed, and with a test block in `CMakeLists.txt`; both sides kept): `ctest -R '^public_headers|icu'` 161 of 161 pass. - `ctest -R '^public_headers|^guest_icu'`: 112 of 112 pass, including the new `guest_icu_hash` (3 of 3 runs). - `guest_icu_hash` is differential where it can be: a second file in the test drives the bundled ICU 78.1 `uhash` with the same operations. For string, caseless string and integer keys under each resize policy, 6,000 random puts, removes and gets give the same return values and statuses as ICU, and every slot (position, stored hash, value) and the table length match ICU's at regular checkpoints. The three string hashes and three string comparators match ICU on 400 random strings, with explicit, shorter, zero and negative lengths. Only nonzero values are used there, since ICU 78 removes on zero. - It also checks the rest on the module alone, with a tracking allocator installed through `u_setMemoryFunctions`: pointer values keep all 64 bits, a null value removes, zero integer values are stored, key and value deleters run on replace, remove, `removeAll`, close and every refused put, `find`, `nextElement`, `removeElement`, growth and shrinking, a fixed table refusing its last slot, caller storage (`init` overwrites a dirty table; close does not free it), `uhash_deleteHashtable`, `uhash_equals`, a failed table or element allocation, a failed growth keeping the old elements, set errors and warnings, the throwing cases, and that every block is released exactly once. - Removal checks: 73 one-line mutations of `HashTable.cpp` (each deleter call, each status write, each probe and rehash step, each water mark, each comparison and hash step), run at the head. 72 make `guest_icu_hash` fail. The one left removes the `break` at an empty slot, after which the probe still settles on that slot, so no result can change. The restored build passes. - `python tools/check_conventions.py --base origin/main` with this title and description: passed. `python tools/debt_fold.py --check` fails on `main` with and without this PR, on the pending `feat-icu-ulist.md` fragment (#18203 left two "Older callable exports" entries; #20282 merges them). With that fragment set aside, this PR's fragment applies. Not run: Linux, macOS, a console, any title. No title is known to import these exports. ### Overlap - #14144, #14340 and #14443 (the stacked data-free ICU 68 series) also define these exports among several hundred others; all three are labelled `needs rebase`. No other open PR names or adds a `uhash_*` export (searched open PRs by name and checked the diff of every open PR that touches libSceIcu). #19951 implements `uprv_asciitolower`, so `HashTable.cpp` lowercases ASCII with a private helper instead of exporting it. - This PR removes thirty-eight stubs from `LegacyExports.cpp` and their declarations from `include/LegacyExports.hpp`, adds one source line and appends a test block to `CMakeLists.txt`, and changes the debt file only through its fragment; other open libSceIcu PRs touch the same three files at other lines. ### 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 (see Overlap for the stacked series) - [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) and the licence notice of code adapted from upstream (see AGENTS.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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-11-15 03:45:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T03:45:28Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the implementation and tests I inspected support merging, with console behavior still unverified.

What I ran

Reviewed head 59c9846008f69ab5b70d9de20dffdbf061f5bef3. No commands or tests were run. The description reports Windows 11 26200, WinLibs GCC 15.2.0, Release tests at a different head; those results were not independently run here.

Read the prepared description, commits, manifest and diff, plus all nine changed files: core/libs/prx/libSceIcu/CMakeLists.txt, HashTable.cpp, HashTable.hpp, LegacyExports.cpp, include/LegacyExports.hpp, libSceIcu.hpp, core/libs/tests/GuestIcuHash.cpp, GuestIcuHashReference.cpp, and docs/dev/debt/changes/feat-icu-uhash.md. No changed files were excluded.

Results

Check Result Note
Source review passed Implementation and integration inspected
Tests not run Only author-reported results were supplied
Console behavior not run No console verification reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not run the tests or build, verify ABI behavior on a console, or check behavior in titles. The description also reports the debt fold check fails on the base due to an unrelated pending fragment; I did not run that check.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5908888190 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5908888190). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T03:45:28Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the implementation and tests I inspected support merging, with console behavior still unverified. ## What I ran Reviewed head `59c9846008f69ab5b70d9de20dffdbf061f5bef3`. No commands or tests were run. The description reports Windows 11 26200, WinLibs GCC 15.2.0, Release tests at a different head; those results were not independently run here. Read the prepared description, commits, manifest and diff, plus all nine changed files: `core/libs/prx/libSceIcu/CMakeLists.txt`, `HashTable.cpp`, `HashTable.hpp`, `LegacyExports.cpp`, `include/LegacyExports.hpp`, `libSceIcu.hpp`, `core/libs/tests/GuestIcuHash.cpp`, `GuestIcuHashReference.cpp`, and `docs/dev/debt/changes/feat-icu-uhash.md`. No changed files were excluded. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Implementation and integration inspected | | Tests | not run | Only author-reported results were supplied | | Console behavior | not run | No console verification reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not run the tests or build, verify ABI behavior on a console, or check behavior in titles. The description also reports the debt fold check fails on the base due to an unrelated pending fragment; I did not run that check. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-15 04:56:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T04:56:22Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 59c9846008:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #3485: guest_icu_hash ...................   Passed    0.07 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified UHashtable (80 bytes), UHashElement (24 bytes), UHashTok (8 bytes), and UHashtableObject (88 bytes) ABI layout and static_asserts against ICU 68 uhash.h specifications on LP64 and LLP64 platforms
    • Audited double hashing probe sequence in Find and PrimeIndexFor across prime table boundary cases and verified string hashing functions ustr_hashUCharsN, ustr_hashCharsN, and ustr_hashICharsN for non-negative and negative lengths
    • Checked lifecycle transitions in uhash_open, uhash_openSize, uhash_init, uhash_initSize, uhash_close, and uhash_deleteHashtable ensuring proper caller storage vs heap allocation deallocation paths via IcuReleaseMemory_nid_no_patch
    • Inspected deletion semantics and deleter callbacks (keyDeleter and valueDeleter) across uhash_put, uhash_puti, uhash_iput, uhash_iputi, uhash_remove, uhash_removeElement, and uhash_removeAll
    • Verified all 41 removed stubs in LegacyExports.cpp match the 41 implemented exports in HashTable.cpp and HashTable.hpp with matching APS5_VABI calling conventions and extern "C" linkage
    • Checked AGENTS.md rules for code comments, technical debt documentation, and conventional commit rules
  • Concerns:
    • core/libs/prx/libSceIcu/HashTable.cpp:457: In uhash_equals_nid_postfix, Lookup(hash2, element->key) is called to find matching entries in hash2, but Lookup returns a pointer to an empty or deleted slot (rather than nullptr) when the key does not exist. The implementation never verifies !EmptyOrDeleted(slot->hashcode) before evaluating hash1->valueComparator(element->value, Lookup(hash2, element->key)->value). Consequently, if hash1 contains a key with value 0 (or nullptr) and hash2 contains a completely different key with value 0 (e.g. hash1 has {"k1": 0} and hash2 has {"k2": 0}), Lookup(hash2, "k1") returns hash2's empty slot whose value field is 0; hash1->valueComparator(0, 0) evaluates to true and uhash_equals falsely reports the two tables with disjoint keys as equal. Furthermore, if a guest value comparator expects non-null pointers, passing the dummy nullptr value of an empty slot triggers an unexpected null pointer dereference.
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5909165660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5909165660). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T04:56:22Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `59c9846008`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #3485: guest_icu_hash ................... Passed 0.07 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified UHashtable (80 bytes), UHashElement (24 bytes), UHashTok (8 bytes), and UHashtableObject (88 bytes) ABI layout and static_asserts against ICU 68 uhash.h specifications on LP64 and LLP64 platforms - Audited double hashing probe sequence in Find and PrimeIndexFor across prime table boundary cases and verified string hashing functions ustr_hashUCharsN, ustr_hashCharsN, and ustr_hashICharsN for non-negative and negative lengths - Checked lifecycle transitions in uhash_open, uhash_openSize, uhash_init, uhash_initSize, uhash_close, and uhash_deleteHashtable ensuring proper caller storage vs heap allocation deallocation paths via IcuReleaseMemory_nid_no_patch - Inspected deletion semantics and deleter callbacks (keyDeleter and valueDeleter) across uhash_put, uhash_puti, uhash_iput, uhash_iputi, uhash_remove, uhash_removeElement, and uhash_removeAll - Verified all 41 removed stubs in LegacyExports.cpp match the 41 implemented exports in HashTable.cpp and HashTable.hpp with matching APS5_VABI calling conventions and extern "C" linkage - Checked AGENTS.md rules for code comments, technical debt documentation, and conventional commit rules - **Concerns**: - core/libs/prx/libSceIcu/HashTable.cpp:457: In uhash_equals_nid_postfix, Lookup(hash2, element->key) is called to find matching entries in hash2, but Lookup returns a pointer to an empty or deleted slot (rather than nullptr) when the key does not exist. The implementation never verifies !EmptyOrDeleted(slot->hashcode) before evaluating hash1->valueComparator(element->value, Lookup(hash2, element->key)->value). Consequently, if hash1 contains a key with value 0 (or nullptr) and hash2 contains a completely different key with value 0 (e.g. hash1 has {"k1": 0} and hash2 has {"k2": 0}), Lookup(hash2, "k1") returns hash2's empty slot whose value field is 0; hash1->valueComparator(0, 0) evaluates to true and uhash_equals falsely reports the two tables with disjoint keys as equal. Furthermore, if a guest value comparator expects non-null pointers, passing the dummy nullptr value of an empty slot triggers an unexpected null pointer dereference. - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 10:01:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T10:01:48Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against c330625a41:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #3502: guest_icu_hash ...................   Passed    0.09 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified that open addressing probing in core/libs/prx/libSceIcu/HashTable.cpp:Find correctly calculates double hashing steps, handles table wrapping, and tracks deleted slots for reuse.
    • Verified that memory management in uhash_open_nid_postfix, uhash_init_nid_postfix, and uhash_close_nid_postfix correctly differentiates allocated versus caller-provided UHashtable storage and invokes key and value deleters before freeing elements.
    • Verified that UHashtableObject structure layout and static assertions in core/libs/prx/libSceIcu/HashTable.hpp (88 bytes) match ICU 68 icu::Hashtable and that uhash_deleteHashtable_nid_postfix releases embedded resources.
    • Verified that SetResizePolicy and uhash_setResizePolicy_nid_postfix enforce policy bounds [0, 2] and throw APS5_INVALID_ARG_EX on out-of-range policies.
    • Verified stub removals in core/libs/prx/libSceIcu/LegacyExports.cpp and confirmed all 41 implemented uhash and ustr exports match their expected NID signatures in core/libs/prx/libSceIcu/HashTable.hpp.
  • Concerns:
    • core/libs/prx/libSceIcu/HashTable.cpp:489: In uhash_equals_nid_postfix, the loop compares values with hash1->valueComparator(element->value, Lookup(hash2, element->key)->value). If element->key does not exist in hash2, Lookup returns an empty or deleted slot whose value is default-initialized to 0. The function does not verify whether the found slot is empty or deleted (IS_EMPTY_OR_DELETED). For tables storing integer value 0 (e.g. via uhash_puti), comparing two tables with disjoint keys such as hash1={"k1": 0} and hash2={"k2": 0} evaluates valueComparator(0, 0), which returns true under uhash_compareLong, causing uhash_equals_nid_postfix to incorrectly return 1 (equal).
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910163701 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5910163701). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T10:01:48Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `c330625a41`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #3502: guest_icu_hash ................... Passed 0.09 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified that open addressing probing in core/libs/prx/libSceIcu/HashTable.cpp:Find correctly calculates double hashing steps, handles table wrapping, and tracks deleted slots for reuse. - Verified that memory management in uhash_open_nid_postfix, uhash_init_nid_postfix, and uhash_close_nid_postfix correctly differentiates allocated versus caller-provided UHashtable storage and invokes key and value deleters before freeing elements. - Verified that UHashtableObject structure layout and static assertions in core/libs/prx/libSceIcu/HashTable.hpp (88 bytes) match ICU 68 icu::Hashtable and that uhash_deleteHashtable_nid_postfix releases embedded resources. - Verified that SetResizePolicy and uhash_setResizePolicy_nid_postfix enforce policy bounds [0, 2] and throw APS5_INVALID_ARG_EX on out-of-range policies. - Verified stub removals in core/libs/prx/libSceIcu/LegacyExports.cpp and confirmed all 41 implemented uhash and ustr exports match their expected NID signatures in core/libs/prx/libSceIcu/HashTable.hpp. - **Concerns**: - core/libs/prx/libSceIcu/HashTable.cpp:489: In uhash_equals_nid_postfix, the loop compares values with `hash1->valueComparator(element->value, Lookup(hash2, element->key)->value)`. If element->key does not exist in hash2, Lookup returns an empty or deleted slot whose value is default-initialized to 0. The function does not verify whether the found slot is empty or deleted (IS_EMPTY_OR_DELETED). For tables storing integer value 0 (e.g. via uhash_puti), comparing two tables with disjoint keys such as hash1={"k1": 0} and hash2={"k2": 0} evaluates valueComparator(0, 0), which returns true under uhash_compareLong, causing uhash_equals_nid_postfix to incorrectly return 1 (equal). - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
MarcZX10 commented 2026-11-15 19:17:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T19:17:34Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: add the guest export registrations for the implemented functions so their NIDs resolve to these implementations.

What I ran

Reviewed head a41de98b086daeb0bdd8b07e09e3d095816aec41 from the prepared diff and pinned repository reader. No commands or tests were run.

Results

Check Result Note
Source and diff review passed Implementations and declarations inspected
Runtime tests not run Author-reported results only

Findings

Blocking

  • HashTable.cpp defines the new uhash_* and ustr_hash*N functions, but none of them are registered with APS5_EXPORT. The existing export mechanism uses those registrations to map guest NIDs to functions; the corresponding stubs and declarations were removed from the legacy files, and the new declarations in HashTable.hpp alone do not register exports. As a result, guest imports cannot resolve these implementations. Add registrations for the implemented exports. Evidence: core/libs/prx/libSceIcu/HashTable.cpp:289 and core/libs/prx/libSceIcu/HashTable.cpp:527; the changed lines in core/libs/prx/libSceIcu/LegacyExports.cpp remove the prior implementations.

Non-blocking

None.

Not verified

The author reports Windows tests and mutation checks, but I did not run them. Linux, macOS, console behavior, and title imports were not verified. Reviewed changed files: core/libs/prx/libSceIcu/CMakeLists.txt, core/libs/prx/libSceIcu/HashTable.cpp, core/libs/prx/libSceIcu/HashTable.hpp, core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/tests/GuestIcuHash.cpp, core/libs/tests/GuestIcuHashReference.cpp, and docs/dev/debt/changes/feat-icu-uhash.md. No changed files were excluded from review.

To get this to a good state

Register each newly implemented export with the project’s NID export mechanism, then rerun the build and guest ICU hash tests on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912396035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5912396035). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T19:17:34Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: add the guest export registrations for the implemented functions so their NIDs resolve to these implementations. ## What I ran Reviewed head `a41de98b086daeb0bdd8b07e09e3d095816aec41` from the prepared diff and pinned repository reader. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Source and diff review | passed | Implementations and declarations inspected | | Runtime tests | not run | Author-reported results only | ## Findings ### Blocking - `HashTable.cpp` defines the new `uhash_*` and `ustr_hash*N` functions, but none of them are registered with `APS5_EXPORT`. The existing export mechanism uses those registrations to map guest NIDs to functions; the corresponding stubs and declarations were removed from the legacy files, and the new declarations in `HashTable.hpp` alone do not register exports. As a result, guest imports cannot resolve these implementations. Add registrations for the implemented exports. Evidence: `core/libs/prx/libSceIcu/HashTable.cpp:289` and `core/libs/prx/libSceIcu/HashTable.cpp:527`; the changed lines in `core/libs/prx/libSceIcu/LegacyExports.cpp` remove the prior implementations. ### Non-blocking None. ## Not verified The author reports Windows tests and mutation checks, but I did not run them. Linux, macOS, console behavior, and title imports were not verified. Reviewed changed files: `core/libs/prx/libSceIcu/CMakeLists.txt`, `core/libs/prx/libSceIcu/HashTable.cpp`, `core/libs/prx/libSceIcu/HashTable.hpp`, `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp`, `core/libs/tests/GuestIcuHash.cpp`, `core/libs/tests/GuestIcuHashReference.cpp`, and `docs/dev/debt/changes/feat-icu-uhash.md`. No changed files were excluded from review. ## To get this to a good state Register each newly implemented export with the project’s NID export mechanism, then rerun the build and guest ICU hash tests on the updated head.
PrivacyOnion commented 2026-11-15 21:00:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:00:49Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against a41de98b08:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #3609: guest_icu_hash ...................   Passed    0.08 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified ICU 68.2 UHashtable layout (80 bytes) and UHashElement layout (24 bytes) in core/libs/prx/libSceIcu/HashTable.hpp against upstream ICU 68.2 uhash.h
    • Checked double-hashing probe loop, prime table sizing, water-mark calculations, and resize policy ratios in core/libs/prx/libSceIcu/HashTable.cpp
    • Verified memory allocation via uprv_malloc_nid_postfix and deallocation via IcuReleaseMemory_nid_no_patch on failure paths in Allocate, Create, and uhash_deleteHashtable_nid_postfix
    • Confirmed SetElement, RemoveElement, key/value deleter invocation, and pointer/integer token handling match ICU 68 semantics (including zero-value storage in uhash_puti/uhash_iputi)
    • Verified string hashing and comparison functions (uhash_hashUChars, uhash_hashChars, uhash_hashIChars, ustr_hashUCharsN, ustr_hashCharsN, ustr_hashICharsN, and comparators) for null handling and unsigned character widening
    • Checked AGENTS.md compliance, upstream ICU copyright headers, and mechanical gate results (check_conventions.py and guest_icu_hash CTest passing)

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912912657 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5912912657). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:00:49Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `a41de98b08`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #3609: guest_icu_hash ................... Passed 0.08 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified ICU 68.2 UHashtable layout (80 bytes) and UHashElement layout (24 bytes) in core/libs/prx/libSceIcu/HashTable.hpp against upstream ICU 68.2 uhash.h - Checked double-hashing probe loop, prime table sizing, water-mark calculations, and resize policy ratios in core/libs/prx/libSceIcu/HashTable.cpp - Verified memory allocation via uprv_malloc_nid_postfix and deallocation via IcuReleaseMemory_nid_no_patch on failure paths in Allocate, Create, and uhash_deleteHashtable_nid_postfix - Confirmed SetElement, RemoveElement, key/value deleter invocation, and pointer/integer token handling match ICU 68 semantics (including zero-value storage in uhash_puti/uhash_iputi) - Verified string hashing and comparison functions (uhash_hashUChars, uhash_hashChars, uhash_hashIChars, ustr_hashUCharsN, ustr_hashCharsN, ustr_hashICharsN, and comparators) for null handling and unsigned character widening - Checked AGENTS.md compliance, upstream ICU copyright headers, and mechanical gate results (check_conventions.py and guest_icu_hash CTest passing) Looks Good To Me
PrivacyOnion commented 2026-11-18 12:39:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T12:39:32Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against c74f8dc9a4:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #3870: guest_icu_hash ...................   Passed    0.05 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/prx/libSceIcu/HashTable.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Checked HashTable.cpp Find() probe loop and jump calculation against ICU 68 uhash.cpp implementation for double hashing and termination
    • Verified memory allocation via uprv_malloc_nid_postfix and deallocation via IcuReleaseMemory_nid_no_patch across Allocate, Create, and uhash_deleteHashtable_nid_postfix
    • Checked null checking, pointer token conventions, and required argument validation macros (APS5_INVALID_ARG_EX) on all exported uhash functions
    • Verified string hashing functions (ustr_hashUCharsN, ustr_hashCharsN, ustr_hashICharsN) and character comparators for unsigned widening and null handling
    • Confirmed AGENTS.md rules adherence regarding comments, technical debt fragments in docs/dev/debt/changes/, and conventional commit structure

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5956689734 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5956689734). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T12:39:32Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `c74f8dc9a4`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #3870: guest_icu_hash ................... Passed 0.05 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp`, `core/libs/prx/libSceIcu/HashTable.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Checked HashTable.cpp Find() probe loop and jump calculation against ICU 68 uhash.cpp implementation for double hashing and termination - Verified memory allocation via uprv_malloc_nid_postfix and deallocation via IcuReleaseMemory_nid_no_patch across Allocate, Create, and uhash_deleteHashtable_nid_postfix - Checked null checking, pointer token conventions, and required argument validation macros (APS5_INVALID_ARG_EX) on all exported uhash functions - Verified string hashing functions (ustr_hashUCharsN, ustr_hashCharsN, ustr_hashICharsN) and character comparators for unsigned widening and null handling - Confirmed AGENTS.md rules adherence regarding comments, technical debt fragments in docs/dev/debt/changes/, and conventional commit structure Looks Good To Me
MarcZX10 commented 2026-11-18 12:54:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T12:54:36Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: fix the failed-growth rehash path so the table retains its original metadata and count.

What I ran

Reviewed head c74f8dc9a4a16733cecd42c4fb717b86d46c80d8 using the prepared diff and the pinned reader. No commands or tests were run by me; the Windows test and mutation results below are author-reported.

Read the changed files listed as included in the manifest: core/libs/prx/libSceIcu/CMakeLists.txt, HashTable.cpp, HashTable.hpp, LegacyExports.cpp, include/LegacyExports.hpp, libSceIcu.hpp, core/libs/tests/GuestIcuHash.cpp, GuestIcuHashReference.cpp, and docs/dev/debt/changes/feat-icu-uhash.md. Also read focused context from Configuration.cpp. No changed file was excluded by the manifest.

Results

Check Result Note
Source review failed Failed rehash allocation corrupts metadata
Author-reported Windows tests not run 112/112 reported passing
Linux, macOS, console not run Not verified on these targets

Findings

Blocking

  • core/libs/prx/libSceIcu/HashTable.cpp:111: When rehash allocation fails, Allocate has already overwritten primeIndex, count, and water marks before returning. Rehash restores only elements and length (HashTable.cpp:199-203), leaving the existing table with count zero and metadata for the failed target size. The current put then sees the error and returns, while all entries remain physically present but become invisible to count/iteration and later resizing. Preserve and restore all mutated metadata on allocation failure.

Non-blocking

None.

Not verified

I did not run tests or independently verify the author-reported test, build, or mutation results. Linux, macOS, console ABI/behavior, and title imports were not verified.

To get this to a good state

Restore the original table metadata when growth allocation fails, then rerun the allocation-failure and failed-growth checks in guest_icu_hash on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5956925828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5956925828). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T12:54:36Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: fix the failed-growth rehash path so the table retains its original metadata and count. ## What I ran Reviewed head `c74f8dc9a4a16733cecd42c4fb717b86d46c80d8` using the prepared diff and the pinned reader. No commands or tests were run by me; the Windows test and mutation results below are author-reported. Read the changed files listed as included in the manifest: `core/libs/prx/libSceIcu/CMakeLists.txt`, `HashTable.cpp`, `HashTable.hpp`, `LegacyExports.cpp`, `include/LegacyExports.hpp`, `libSceIcu.hpp`, `core/libs/tests/GuestIcuHash.cpp`, `GuestIcuHashReference.cpp`, and `docs/dev/debt/changes/feat-icu-uhash.md`. Also read focused context from `Configuration.cpp`. No changed file was excluded by the manifest. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | Failed rehash allocation corrupts metadata | | Author-reported Windows tests | not run | 112/112 reported passing | | Linux, macOS, console | not run | Not verified on these targets | ## Findings ### Blocking - `core/libs/prx/libSceIcu/HashTable.cpp:111`: When rehash allocation fails, `Allocate` has already overwritten `primeIndex`, `count`, and water marks before returning. `Rehash` restores only `elements` and `length` (`HashTable.cpp:199-203`), leaving the existing table with count zero and metadata for the failed target size. The current put then sees the error and returns, while all entries remain physically present but become invisible to count/iteration and later resizing. Preserve and restore all mutated metadata on allocation failure. ### Non-blocking None. ## Not verified I did not run tests or independently verify the author-reported test, build, or mutation results. Linux, macOS, console ABI/behavior, and title imports were not verified. ## To get this to a good state Restore the original table metadata when growth allocation fails, then rerun the allocation-failure and failed-growth checks in `guest_icu_hash` on the updated head.
MarcZX10 commented 2026-11-19 06:27:44 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — comments

Changes are not required before merge; one optional verification point is listed below.

What I ran

Reviewed head 9539a70b965347f379a5c4513cbe2faea2f232a6 using the prepared diff and repository reader repo_read.py; no commands or tests were run.

Results

Check Result Note
Implementation and API review passed Core paths and layouts read
Tests and build not run Author-reported results only
Console behavior not run No console or title tested

Findings

Blocking

None.

Non-blocking

  • The reported differential tests ran on Windows with ICU 78.1 and exclude zero integer values because ICU 78 changes their semantics. Console and title behavior remain unconfirmed.

Not verified

No tests, build, Linux/macOS run, console run, or title run was performed in this review. The description reports Windows 11/GCC 15.2 test and mutation results; these were not independently run. Read: CMakeLists.txt, HashTable.cpp, HashTable.hpp, LegacyExports.cpp, GuestIcuHash.cpp, GuestIcuHashReference.cpp, and the ICU debt fragment. All seven changed files listed in the manifest were read. No exclusions were listed in the manifest.

To get this to a good state

Nothing is required. The author may add console or title verification when available.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5970340176 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5970340176). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T06:27:44Z. **Review:** COMMENTED --- # Reviewed — comments Changes are not required before merge; one optional verification point is listed below. ## What I ran Reviewed head `9539a70b965347f379a5c4513cbe2faea2f232a6` using the prepared diff and repository reader `repo_read.py`; no commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Implementation and API review | passed | Core paths and layouts read | | Tests and build | not run | Author-reported results only | | Console behavior | not run | No console or title tested | ## Findings ### Blocking None. ### Non-blocking - The reported differential tests ran on Windows with ICU 78.1 and exclude zero integer values because ICU 78 changes their semantics. Console and title behavior remain unconfirmed. ## Not verified No tests, build, Linux/macOS run, console run, or title run was performed in this review. The description reports Windows 11/GCC 15.2 test and mutation results; these were not independently run. Read: `CMakeLists.txt`, `HashTable.cpp`, `HashTable.hpp`, `LegacyExports.cpp`, `GuestIcuHash.cpp`, `GuestIcuHashReference.cpp`, and the ICU debt fragment. All seven changed files listed in the manifest were read. No exclusions were listed in the manifest. ## To get this to a good state Nothing is required. The author may add console or title verification when available.
PrivacyOnion commented 2026-11-19 14:55:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T14:55:35Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 548f31cce2:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #3985: guest_icu_hash ...................   Passed    0.04 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/prx/libSceIcu/HashTable.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified open addressing with double hashing and collision resolution in Find() matching ICU uhash.cpp: startIndex calculation and step sizing.
    • Verified memory allocation and cleanup paths in uhash_open, uhash_openSize, uhash_init, uhash_close, and uhash_deleteHashtable against uprv_malloc and IcuReleaseMemory.
    • Verified that key/value comparator and deleter callbacks honor guest calling conventions via APS5_VABI and handle null tokens properly.
    • Verified that uhash_puti/iputi follow ICU 68 semantics where 0 is preserved as a value, matching upstream ICU 68.2 behavior.
    • Verified LP64 vs LLP64 portability and sizing static_asserts (sizeof(UHashTok)==8, sizeof(UHashElement)==24, sizeof(UHashtable)==80, sizeof(UHashtableObject)==88).
    • Verified compliance with AGENTS.md conventions, license notices, and debt documentation fragment feat-icu-uhash.md.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5977355433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5977355433). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T14:55:35Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `548f31cce2`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #3985: guest_icu_hash ................... Passed 0.04 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp`, `core/libs/prx/libSceIcu/HashTable.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified open addressing with double hashing and collision resolution in Find() matching ICU uhash.cpp: startIndex calculation and step sizing. - Verified memory allocation and cleanup paths in uhash_open, uhash_openSize, uhash_init, uhash_close, and uhash_deleteHashtable against uprv_malloc and IcuReleaseMemory. - Verified that key/value comparator and deleter callbacks honor guest calling conventions via APS5_VABI and handle null tokens properly. - Verified that uhash_puti/iputi follow ICU 68 semantics where 0 is preserved as a value, matching upstream ICU 68.2 behavior. - Verified LP64 vs LLP64 portability and sizing static_asserts (sizeof(UHashTok)==8, sizeof(UHashElement)==24, sizeof(UHashtable)==80, sizeof(UHashtableObject)==88). - Verified compliance with AGENTS.md conventions, license notices, and debt documentation fragment feat-icu-uhash.md. Looks Good To Me
MarcZX10 commented 2026-11-19 15:08:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T15:08:14Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: fix integer-value deleter handling and full-cycle probing so these exports preserve table semantics.

What I ran

Reviewed head 548f31cce238dada2ee3dc36447317d54d72bd34 using repo_read.py-backed review tools. No tests or build commands were run in this session; the description reports Windows 11 test results at a different head.

Read review/description.md, review/commits.md, review/manifest.json, and review/diff.patch. Read the changed HashTable.cpp ranges 1–69, 70–140, 138–290, 320–405 and the relevant changed test hunks in diff.patch. The reader did not expose review/files/ or review/files.json; other changed-file contents were inspected only where shown in the patch.

Results

Check Result Note
Source review failed Two concrete defects found
Tests in this session not run Author-reported tests used another head
Console behavior not run No console verification reported

Findings

Blocking

  • core/libs/prx/libSceIcu/HashTable.cpp:85: SetElement calls the value deleter through oldValue.pointer regardless of whether the old value was stored as an integer. uhash_puti and uhash_iputi create integer tokens, so replacing an integer value or removing/closing an entry with a value deleter installed can invoke that deleter with an integer reinterpreted as a pointer. Preserve the token kind and only call the value deleter for pointer-valued entries.
  • core/libs/prx/libSceIcu/HashTable.cpp:182: When probing completes a full cycle, tableHash still refers to the final slot visited, rather than the starting slot. If that final slot is deleted, firstDeleted is set and the function returns a reusable slot even though the table has no empty slot. This bypasses the full-table failure path and can permit insertion into a table state the implementation explicitly intends to reject. Track whether an empty slot was actually encountered, and handle full-cycle exhaustion directly.

Non-blocking

None.

Not verified

  • The new test executable was not built or run here. The PR description reports tests at 9f0ed84cda, not the reviewed head.
  • Linux, macOS, console, and title behavior were not verified; the description also reports these as not run.
  • Full text for other changed files was not available through the reader; their patch hunks were inspected where included.

To get this to a good state

Fix both blocking issues and rerun the reported ICU hash test suite on the updated head, including cases with integer values and a value deleter, and a full-cycle probe with a deleted slot.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5977590581 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5977590581). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T15:08:14Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: fix integer-value deleter handling and full-cycle probing so these exports preserve table semantics. ## What I ran Reviewed head `548f31cce238dada2ee3dc36447317d54d72bd34` using `repo_read.py`-backed review tools. No tests or build commands were run in this session; the description reports Windows 11 test results at a different head. Read `review/description.md`, `review/commits.md`, `review/manifest.json`, and `review/diff.patch`. Read the changed `HashTable.cpp` ranges 1–69, 70–140, 138–290, 320–405 and the relevant changed test hunks in `diff.patch`. The reader did not expose `review/files/` or `review/files.json`; other changed-file contents were inspected only where shown in the patch. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | Two concrete defects found | | Tests in this session | not run | Author-reported tests used another head | | Console behavior | not run | No console verification reported | ## Findings ### Blocking - `core/libs/prx/libSceIcu/HashTable.cpp:85`: `SetElement` calls the value deleter through `oldValue.pointer` regardless of whether the old value was stored as an integer. `uhash_puti` and `uhash_iputi` create integer tokens, so replacing an integer value or removing/closing an entry with a value deleter installed can invoke that deleter with an integer reinterpreted as a pointer. Preserve the token kind and only call the value deleter for pointer-valued entries. - `core/libs/prx/libSceIcu/HashTable.cpp:182`: When probing completes a full cycle, `tableHash` still refers to the final slot visited, rather than the starting slot. If that final slot is deleted, `firstDeleted` is set and the function returns a reusable slot even though the table has no empty slot. This bypasses the full-table failure path and can permit insertion into a table state the implementation explicitly intends to reject. Track whether an empty slot was actually encountered, and handle full-cycle exhaustion directly. ### Non-blocking None. ## Not verified - The new test executable was not built or run here. The PR description reports tests at `9f0ed84cda`, not the reviewed head. - Linux, macOS, console, and title behavior were not verified; the description also reports these as not run. - Full text for other changed files was not available through the reader; their patch hunks were inspected where included. ## To get this to a good state Fix both blocking issues and rerun the reported ICU hash test suite on the updated head, including cases with integer values and a value deleter, and a full-cycle probe with a deleted slot.
PrivacyOnion commented 2026-11-19 23:40:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T23:40:56Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against bccc109957:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #4013: guest_icu_hash ...................   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/prx/libSceIcu/HashTable.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified uhash_open, uhash_openSize, uhash_init, uhash_initSize allocation, null handling, and UHashtable / UHashElement memory layouts against ICU 68.2 uhash.h/uhash.cpp.
    • Verified open addressing probing logic in Find() and table expansion in Rehash() including full cycle probing, empty/deleted slot reuse, and water mark calculations.
    • Verified uhash_puti/uhash_iputi zero-value semantics and checked memory cleanup in uhash_close, uhash_deleteHashtable, and SetElement/RemoveElement.
    • Verified string hashing and comparators in uhash_hashUChars, uhash_hashChars, uhash_hashIChars, uhash_compareUChars, uhash_compareChars, and uhash_compareIChars.
    • Verified AGENTS.md compliance, including conventional commits, comments policy, debt changes fragment in docs/dev/debt/changes/feat-icu-uhash.md, and test build/execution gates.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5985181886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5985181886). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T23:40:56Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `bccc109957`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #4013: guest_icu_hash ................... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp`, `core/libs/prx/libSceIcu/HashTable.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified uhash_open, uhash_openSize, uhash_init, uhash_initSize allocation, null handling, and UHashtable / UHashElement memory layouts against ICU 68.2 uhash.h/uhash.cpp. - Verified open addressing probing logic in Find() and table expansion in Rehash() including full cycle probing, empty/deleted slot reuse, and water mark calculations. - Verified uhash_puti/uhash_iputi zero-value semantics and checked memory cleanup in uhash_close, uhash_deleteHashtable, and SetElement/RemoveElement. - Verified string hashing and comparators in uhash_hashUChars, uhash_hashChars, uhash_hashIChars, uhash_compareUChars, uhash_compareChars, and uhash_compareIChars. - Verified AGENTS.md compliance, including conventional commits, comments policy, debt changes fragment in docs/dev/debt/changes/feat-icu-uhash.md, and test build/execution gates. Looks Good To Me
MarcZX10 commented 2026-11-19 23:42:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T23:42:50Z.

Review: COMMENTED


Reviewed — comments

The implementation is substantial and has focused differential tests, but a remaining edge case in uhash_equals can dereference a null element when the tables do not share the same key semantics.

What I ran

Reviewed head bccc109957440e1e648eed8df0493939c65e9fd8 using the prepared diff and repo_read.py at the pinned head. No build or tests were run; the test results in the description are author-reported.

Results

Check Result Note
Diff and implementation review passed Changed files and relevant implementation paths read
Automated checks not run No commands or tests run in this review

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceIcu/HashTable.cpp:517: uhash_equals compares each key from hash1 by looking it up in hash2, then immediately reads the returned element’s value. If the tables have the same count and comparator pointers but different key hashers, or otherwise contain different keys, Lookup can return an empty slot and this dereference is invalid. Check the lookup result’s hash code before reading its value and return false when the key is absent; add a test with equal counts and shared value/key comparator pointers but different keys or hashers.

Not verified

No build, tests, sanitizer run, console ABI check, or title behavior was verified here. The change’s stated Windows test results are author-reported. All changed files were included in the prepared review folder and read: core/libs/prx/libSceIcu/CMakeLists.txt, HashTable.cpp, HashTable.hpp, LegacyExports.cpp, include/LegacyExports.hpp, libSceIcu.hpp, core/libs/tests/GuestIcuHash.cpp, GuestIcuHashReference.cpp, and docs/dev/debt/changes/feat-icu-uhash.md. No files were excluded per the manifest.

To get this to a good state

Nothing is required. Consider adding a regression test for equality when a key in one table is absent from the other.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5985199889 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-5985199889). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T23:42:50Z. **Review:** COMMENTED --- # Reviewed — comments The implementation is substantial and has focused differential tests, but a remaining edge case in `uhash_equals` can dereference a null element when the tables do not share the same key semantics. ## What I ran Reviewed head `bccc109957440e1e648eed8df0493939c65e9fd8` using the prepared diff and `repo_read.py` at the pinned head. No build or tests were run; the test results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and implementation review | passed | Changed files and relevant implementation paths read | | Automated checks | not run | No commands or tests run in this review | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceIcu/HashTable.cpp:517`: `uhash_equals` compares each key from `hash1` by looking it up in `hash2`, then immediately reads the returned element’s value. If the tables have the same count and comparator pointers but different key hashers, or otherwise contain different keys, `Lookup` can return an empty slot and this dereference is invalid. Check the lookup result’s hash code before reading its value and return false when the key is absent; add a test with equal counts and shared value/key comparator pointers but different keys or hashers. ## Not verified No build, tests, sanitizer run, console ABI check, or title behavior was verified here. The change’s stated Windows test results are author-reported. All changed files were included in the prepared review folder and read: `core/libs/prx/libSceIcu/CMakeLists.txt`, `HashTable.cpp`, `HashTable.hpp`, `LegacyExports.cpp`, `include/LegacyExports.hpp`, `libSceIcu.hpp`, `core/libs/tests/GuestIcuHash.cpp`, `GuestIcuHashReference.cpp`, and `docs/dev/debt/changes/feat-icu-uhash.md`. No files were excluded per the manifest. ## To get this to a good state Nothing is required. Consider adding a regression test for equality when a key in one table is absent from the other.
PrivacyOnion commented 2026-11-21 16:45:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T16:45:40Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against b4a84c3136:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #4105: guest_icu_hash ...................   Passed    0.13 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/prx/libSceIcu/HashTable.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified libSceIcu uhash table struct layout and sizing (UHashTok 8 bytes, UHashElement 24 bytes, UHashtable 80 bytes, UHashtableObject 88 bytes) matches ICU 68.2 uhash.h and uhash_us.cpp
    • Verified double-hashing open addressing probe logic in Find(), resize policy transitions, and prime selection against ICU 68.2 uhash.cpp
    • Verified SetElement and DeleteKeyValue key/value deleter invoking semantics match upstream ICU 68.2 behavior exactly (confirming PR author's analysis in PR discussion)
    • Verified uhash_equals lookup and comparison handling when keys differ or are absent matches upstream ICU 68.2 behavior
    • Verified all 38 exported uhash_* symbols in LegacyExports.cpp / LegacyExports.hpp are properly replaced and linked without missing stub implementations or unhandled exports
    • Checked AGENTS.md conventions compliance: debt tracking fragment added in docs/dev/debt/changes/feat-icu-uhash.md, no forbidden comments, and mechanical checks passed

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6006654646 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-6006654646). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-21T16:45:40Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `b4a84c3136`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #4105: guest_icu_hash ................... Passed 0.13 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp`, `core/libs/prx/libSceIcu/HashTable.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified libSceIcu uhash table struct layout and sizing (UHashTok 8 bytes, UHashElement 24 bytes, UHashtable 80 bytes, UHashtableObject 88 bytes) matches ICU 68.2 uhash.h and uhash_us.cpp - Verified double-hashing open addressing probe logic in Find(), resize policy transitions, and prime selection against ICU 68.2 uhash.cpp - Verified SetElement and DeleteKeyValue key/value deleter invoking semantics match upstream ICU 68.2 behavior exactly (confirming PR author's analysis in PR discussion) - Verified uhash_equals lookup and comparison handling when keys differ or are absent matches upstream ICU 68.2 behavior - Verified all 38 exported uhash_* symbols in LegacyExports.cpp / LegacyExports.hpp are properly replaced and linked without missing stub implementations or unhandled exports - Checked AGENTS.md conventions compliance: debt tracking fragment added in docs/dev/debt/changes/feat-icu-uhash.md, no forbidden comments, and mechanical checks passed Looks Good To Me
MarcZX10 commented 2026-11-22 04:18:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:18:34Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head b4a84c3136cb3dc64e5cb7abcc0ddf16c742a099 using the prepared diff and repo_read.py at the pinned head. No commands or tests were run; the test results below are author-reported.

Results

Check Result Note
Code review passed No verified blocking defect found
Tests not run Author reports 144 of 144 passed on a merged preview
Console verification not run Author reports no console or title testing

Findings

Blocking

None.

Non-blocking

  • Console ABI and behavior remain unverified, as recorded in the added debt entry. Consider console validation when a suitable environment is available.

Not verified

No checks were run in this review, and console behavior, Linux/macOS builds, and title compatibility were not verified. Read the prepared description, commits, manifest and diff, plus HashTable.cpp, HashTable.hpp, libSceIcu.hpp, GuestIcuHash.cpp, GuestIcuHashReference.cpp, and the debt fragment through repo_read.py. CMakeLists.txt, LegacyExports.cpp, and include/LegacyExports.hpp were inspected only in the prepared diff; their full contents were not read. No excluded files were identified in the manifest entries inspected.

To get this to a good state

Nothing is required. Optional: verify ABI and behavior on a console when available.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6010284238 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-6010284238). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T04:18:34Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed head `b4a84c3136cb3dc64e5cb7abcc0ddf16c742a099` using the prepared diff and `repo_read.py` at the pinned head. No commands or tests were run; the test results below are author-reported. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | No verified blocking defect found | | Tests | not run | Author reports 144 of 144 passed on a merged preview | | Console verification | not run | Author reports no console or title testing | ## Findings ### Blocking None. ### Non-blocking - Console ABI and behavior remain unverified, as recorded in the added debt entry. Consider console validation when a suitable environment is available. ## Not verified No checks were run in this review, and console behavior, Linux/macOS builds, and title compatibility were not verified. Read the prepared description, commits, manifest and diff, plus `HashTable.cpp`, `HashTable.hpp`, `libSceIcu.hpp`, `GuestIcuHash.cpp`, `GuestIcuHashReference.cpp`, and the debt fragment through `repo_read.py`. `CMakeLists.txt`, `LegacyExports.cpp`, and `include/LegacyExports.hpp` were inspected only in the prepared diff; their full contents were not read. No excluded files were identified in the manifest entries inspected. ## To get this to a good state Nothing is required. Optional: verify ABI and behavior on a console when available.
PrivacyOnion commented 2026-11-22 07:56:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T07:56:32Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 52db32b1d5:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_icu_hash_tests built cleanly.
  • CTest (guest_icu_hash):
    1/1 Test #4144: guest_icu_hash ...................   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/prx/libSceIcu/HashTable.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Audited HashTable.cpp against upstream ICU 68.2 uhash.cpp and verified double hashing, collision probing, and prime-index selection.
    • Checked pointer safety and null checks across all 38 uhash_* exports, verifying Required() usage and error handling.
    • Verified deleter semantics in SetElement and DeleteKeyValue, ensuring adherence to upstream ICU 68.2 behavior for both pointers and integers.
    • Validated that all 38 symbols in LegacyExports.cpp / LegacyExports.hpp are properly replaced and exported without missing stubs.
    • Confirmed AGENTS.md conventions compliance, including debt tracking fragment docs/dev/debt/changes/feat-icu-uhash.md and lack of illegal comments.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011131672 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-6011131672). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-22T07:56:32Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `52db32b1d5`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_icu_hash_tests` built cleanly. - **CTest** (`guest_icu_hash`): ``` 1/1 Test #4144: guest_icu_hash ................... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceIcu/LegacyExports.cpp`, `core/libs/prx/libSceIcu/include/LegacyExports.hpp`, `core/libs/prx/libSceIcu/libSceIcu.hpp`, `core/libs/prx/libSceIcu/HashTable.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Audited HashTable.cpp against upstream ICU 68.2 uhash.cpp and verified double hashing, collision probing, and prime-index selection. - Checked pointer safety and null checks across all 38 uhash_* exports, verifying Required() usage and error handling. - Verified deleter semantics in SetElement and DeleteKeyValue, ensuring adherence to upstream ICU 68.2 behavior for both pointers and integers. - Validated that all 38 symbols in LegacyExports.cpp / LegacyExports.hpp are properly replaced and exported without missing stubs. - Confirmed AGENTS.md conventions compliance, including debt tracking fragment docs/dev/debt/changes/feat-icu-uhash.md and lack of illegal comments. Looks Good To Me
MarcZX10 commented 2026-11-22 08:16:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T08:16:20Z.

Review: DISMISSED


Reviewed — changes requested

Changes are required before merge: restore resize metadata after a failed rehash and correct the test that currently expects the inconsistent state.

What I ran

  • Reviewed head 52db32b1d5ad2b184394e21f8a68105bb2e2705e using the prepared diff and repo_read.py.
  • No commands or tests were run. The description reports Windows tests and mutation checks; those results were not independently verified.

Results

Check Result Note
Diff and targeted source review passed Resize failure path reviewed
Tests not run No test execution environment was available

Findings

Blocking

  • core/libs/prx/libSceIcu/HashTable.cpp:199: Allocate updates hash->primeIndex before allocating. On allocation failure, Rehash restores elements and length but leaves the new index in place (HashTable.cpp:200-203). The table then reports an index for a capacity it does not have; a later growth attempt advances from that index and skips a prime size. Restore the previous primeIndex on failure. The test currently asserts the inconsistent index after failed growth (core/libs/tests/GuestIcuHash.cpp:451) and should instead check that it remains consistent with the retained capacity. Pinned source

Non-blocking

  • None.

Not verified

  • No tests were run; the reported Windows results were not independently checked. Linux, macOS, console behavior, and title behavior were not verified.
  • Read the prepared description, commits, manifest, diff, and README; all of HashTable.cpp, HashTable.hpp, GuestIcuHash.cpp, GuestIcuHashReference.cpp, and the debt fragment; the changed include/source excerpts of CMakeLists.txt and libSceIcu.hpp; and the opening excerpts of LegacyExports.cpp and include/LegacyExports.hpp. The changed legacy-export deletions were inspected in the diff, but not verified against their full head files. The manifest lists nine changed files; full changed-file text was reviewed for seven.

To get this to a good state

  • Restore the resize index when allocation fails and update the regression test to assert the retained capacity and matching index. Then rerun the relevant guest_icu_hash tests on the new head.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011189374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-6011189374). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T08:16:20Z. **Review:** DISMISSED --- # Reviewed — changes requested Changes are required before merge: restore resize metadata after a failed rehash and correct the test that currently expects the inconsistent state. ## What I ran - Reviewed head `52db32b1d5ad2b184394e21f8a68105bb2e2705e` using the prepared diff and `repo_read.py`. - No commands or tests were run. The description reports Windows tests and mutation checks; those results were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Resize failure path reviewed | | Tests | not run | No test execution environment was available | ## Findings ### Blocking - `core/libs/prx/libSceIcu/HashTable.cpp:199`: `Allocate` updates `hash->primeIndex` before allocating. On allocation failure, `Rehash` restores `elements` and `length` but leaves the new index in place (`HashTable.cpp:200-203`). The table then reports an index for a capacity it does not have; a later growth attempt advances from that index and skips a prime size. Restore the previous `primeIndex` on failure. The test currently asserts the inconsistent index after failed growth (`core/libs/tests/GuestIcuHash.cpp:451`) and should instead check that it remains consistent with the retained capacity. [Pinned source](https://github.com/boykopovar/AnyPS5/blob/52db32b1d5ad2b184394e21f8a68105bb2e2705e/core/libs/prx/libSceIcu/HashTable.cpp#L188-L203) ### Non-blocking - None. ## Not verified - No tests were run; the reported Windows results were not independently checked. Linux, macOS, console behavior, and title behavior were not verified. - Read the prepared description, commits, manifest, diff, and README; all of `HashTable.cpp`, `HashTable.hpp`, `GuestIcuHash.cpp`, `GuestIcuHashReference.cpp`, and the debt fragment; the changed include/source excerpts of `CMakeLists.txt` and `libSceIcu.hpp`; and the opening excerpts of `LegacyExports.cpp` and `include/LegacyExports.hpp`. The changed legacy-export deletions were inspected in the diff, but not verified against their full head files. The manifest lists nine changed files; full changed-file text was reviewed for seven. ## To get this to a good state - Restore the resize index when allocation fails and update the regression test to assert the retained capacity and matching index. Then rerun the relevant `guest_icu_hash` tests on the new head.
MarcZX10 commented 2026-11-24 23:31:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-24T23:31:34Z.

Review: COMMENTED


Reviewed — comments

This review covers the implementation diff at head 1650f73fe70a14456c45e7240b72e50a76ff2df4; I did not run checks and did not inspect every changed file, so a formal approval is not justified.

What I ran

  • Read the prepared description, commits, manifest and diff. No build or tests were run.
  • Reviewed HashTable.cpp and HashTable.hpp changes in the diff. Other changed files were not read.

Results

Check Result Note
Prepared diff review passed Implementation and export declarations inspected
Build and tests not run Results in the PR description are author reported

Findings

Blocking

None identified in the inspected code.

Non-blocking

No specific code change requested from the inspected portion.

Not verified

The changed CMakeLists.txt, LegacyExports.cpp, include/LegacyExports.hpp, libSceIcu.hpp, GuestIcuHash.cpp, GuestIcuHashReference.cpp and debt fragment were not read. No tests or build were run. The PR description reports Windows test results, but those results were not independently verified. No files were excluded by the prepared manifest.

To get this to a good state

Nothing is required. Optional: inspect the remaining changed files and run the reported checks before making a formal decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6049091987 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-6049091987). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-24T23:31:34Z. **Review:** COMMENTED --- # Reviewed — comments This review covers the implementation diff at head `1650f73fe70a14456c45e7240b72e50a76ff2df4`; I did not run checks and did not inspect every changed file, so a formal approval is not justified. ## What I ran - Read the prepared description, commits, manifest and diff. No build or tests were run. - Reviewed `HashTable.cpp` and `HashTable.hpp` changes in the diff. Other changed files were not read. ## Results | Check | Result | Note | |---|---|---| | Prepared diff review | passed | Implementation and export declarations inspected | | Build and tests | not run | Results in the PR description are author reported | ## Findings ### Blocking None identified in the inspected code. ### Non-blocking No specific code change requested from the inspected portion. ## Not verified The changed `CMakeLists.txt`, `LegacyExports.cpp`, `include/LegacyExports.hpp`, `libSceIcu.hpp`, `GuestIcuHash.cpp`, `GuestIcuHashReference.cpp` and debt fragment were not read. No tests or build were run. The PR description reports Windows test results, but those results were not independently verified. No files were excluded by the prepared manifest. ## To get this to a good state Nothing is required. Optional: inspect the remaining changed files and run the reported checks before making a formal decision.
MarcZX10 commented 2026-11-25 22:21:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T22:21:58Z.

Review: COMMENTED


Reviewed — no blocking findings

The implementation and its focused test setup were inspected, but the review is incomplete, so a formal approval is not justified.

What I ran

Inspected the prepared diff and repository files at head 3597d9c56bc6d3e39c0cbc7d65dec83870c184a4 using the review reader. No commands or tests were run.

Results

Check Result Note
Diff and implementation inspection passed Core table logic and interfaces inspected
Tests not run Author-reported results only
Full changed-file review not run Some changed files and test lines were not read

Negative control

Not run.

Findings

Blocking

None verified in the inspected code.

Non-blocking

None.

Sources

Inspected the prepared diff and pinned-head repository files through repo_read.py.

Not verified

The full test body in GuestIcuHash.cpp, the complete changed deletions in LegacyExports.cpp and include/LegacyExports.hpp, and the referenced repository exclusions were not fully inspected. Tests, builds, and console behavior were not verified. Read: CMakeLists.txt, HashTable.cpp, HashTable.hpp, libSceIcu.hpp, GuestIcuHash.cpp (lines 1–150), GuestIcuHashReference.cpp, and the debt fragment; also inspected the prepared diff, description, commits, and manifest. The changed export files were reviewed through diff excerpts only.

To get this to a good state

Nothing is required. Optional: complete inspection of the unread changed lines and run the focused test suite before requesting approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6065804752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20373#pullrequestreview-6065804752). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T22:21:58Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The implementation and its focused test setup were inspected, but the review is incomplete, so a formal approval is not justified. ## What I ran Inspected the prepared diff and repository files at head `3597d9c56bc6d3e39c0cbc7d65dec83870c184a4` using the review reader. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and implementation inspection | passed | Core table logic and interfaces inspected | | Tests | not run | Author-reported results only | | Full changed-file review | not run | Some changed files and test lines were not read | ## Negative control Not run. ## Findings ### Blocking None verified in the inspected code. ### Non-blocking None. ## Sources Inspected the prepared diff and pinned-head repository files through `repo_read.py`. ## Not verified The full test body in `GuestIcuHash.cpp`, the complete changed deletions in `LegacyExports.cpp` and `include/LegacyExports.hpp`, and the referenced repository exclusions were not fully inspected. Tests, builds, and console behavior were not verified. Read: `CMakeLists.txt`, `HashTable.cpp`, `HashTable.hpp`, `libSceIcu.hpp`, `GuestIcuHash.cpp` (lines 1–150), `GuestIcuHashReference.cpp`, and the debt fragment; also inspected the prepared diff, description, commits, and manifest. The changed export files were reviewed through diff excerpts only. ## To get this to a good state Nothing is required. Optional: complete inspection of the unread changed lines and run the focused test suite before requesting approval.
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!20373
No description provided.