fix(keyboard): use bounded OEM dictionary accessor #1005

Merged
coah80 merged 1 commits from agent/bittle/keyboard-oem-bounds into main 2026-10-03 00:42:46 +00:00
coah80 commented 2026-10-03 00:42:21 +00:00 (Migrated from github.com)

Correctness fix

Two OEM dictionary lookups pass indices 10–19 to getZiDicData(int), whose implementation indexes the 10-element system array. Use the existing OEM accessor with indices 0–9 instead. Physical target addresses and fallback selection remain unchanged; the C++ accesses now respect the declared subarray bounds.

Independent verification

  • All allocated bytes and normalized relocations across 1027 source objects unchanged; complete report unchanged
  • Keyboard create remains 94.00944%, 318/318 instructions; 31/32 exact functions and data 1184/1184 preserved
  • Parent reran the actual extracted dictionary loops over all 1,048,576 system/OEM availability combinations with bounds/UBSan checks, fallback assertions and table sentinels
  • Tests use fixed-size accessor stubs, not Wii resource/UI execution
  • Pool 28/28 and literal audit clean; worktree/diff checks and full 43U all_source/report/progress/DOL pass

Type/access correctness only, with no percentage gain claimed. No header, data, metadata or linking change.

Parent baseline: e4a9449256
Tested tree: 0cd4e59b41
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Fix OEM dictionary lookups in ipl::keyboard::Manager::create to use OEM-relative indices

Both OEM dictionary lookups in the Zi dictionary initialization loops now call System::getZiOemDicData with OEM-relative indices (0–9) instead of passing absolute indices (10–19) to System::getZiDicData. Covers the fallback lookup and the per-language lookups in iplKeyboard.cpp. System dictionary lookups, fallback selection, language-table assignments, and sentinel entries are unchanged. Also adds a reconstruction log in allhands-keyboard-dictionary-contract.attempts.md.

Macroscope summarized 00a642e.

## Correctness fix Two OEM dictionary lookups pass indices 10–19 to getZiDicData(int), whose implementation indexes the 10-element system array. Use the existing OEM accessor with indices 0–9 instead. Physical target addresses and fallback selection remain unchanged; the C++ accesses now respect the declared subarray bounds. ## Independent verification - All allocated bytes and normalized relocations across 1027 source objects unchanged; complete report unchanged - Keyboard create remains 94.00944%, 318/318 instructions; 31/32 exact functions and data 1184/1184 preserved - Parent reran the actual extracted dictionary loops over all 1,048,576 system/OEM availability combinations with bounds/UBSan checks, fallback assertions and table sentinels - Tests use fixed-size accessor stubs, not Wii resource/UI execution - Pool 28/28 and literal audit clean; worktree/diff checks and full 43U all_source/report/progress/DOL pass Type/access correctness only, with no percentage gain claimed. No header, data, metadata or linking change. Parent baseline: e4a9449256b34b8a7047fe45c204116ed26e3b5b Tested tree: 0cd4e59b41f4cd067782b8cabc23707a1ce96cf0 DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d No merge performed or requested by this author. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Fix OEM dictionary lookups in `ipl::keyboard::Manager::create` to use OEM-relative indices > Both OEM dictionary lookups in the Zi dictionary initialization loops now call `System::getZiOemDicData` with OEM-relative indices (0–9) instead of passing absolute indices (10–19) to `System::getZiDicData`. Covers the fallback lookup and the per-language lookups in [iplKeyboard.cpp](https://github.com/coah80/wii-ipl/pull/1005/files#diff-07d2aa986e4a46da25655a66f0d340ebd0a9d8c04f7b634bc95ae727555369fc). System dictionary lookups, fallback selection, language-table assignments, and sentinel entries are unchanged. Also adds a reconstruction log in [allhands-keyboard-dictionary-contract.attempts.md](https://github.com/coah80/wii-ipl/pull/1005/files#diff-361d50953e31a49469c2cb4039c4ef8efae56b34bfad97e4bbcf330e176e2188). > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 00a642e.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 00:42:44 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.