Match tiPcKeyboard Base::setTranslateMode via uninit keyMode #1270

Merged
devin-ai-integration[bot] merged 1 commits from tiskb-clean into main 2026-10-08 22:06:00 +00:00
devin-ai-integration[bot] commented 2026-10-08 22:04:35 +00:00 (Migrated from github.com)

Summary

Base::setTranslateMode (tiPcKeyboard) is now byte-identical: 105/105 insns, fuzzy 99.0 → 100.0.

The change is one declaration: u32 keyMode = mode; → u32 keyMode;. For mode outside {TM_Direct, TM_Roman, TM_Kana} the switch leaves keyMode unset, and retail provably reads the uninitialized register — at orig 0xd48 (bge → 0xd64) and 0xd40 (b → 0xd64) control reaches the merge with no li r31 store on the path, then cmplw r31, r0 at 0xd6c consumes it. Initializing keyMode lets MWCC collapse the default into an extra b and changes the whole cmpwi dispatch tree (106 insns vs 105). Same accepted uninitialized-read pattern as set_err_msg/keyMode in earlier units.

Verification: full ninja build, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, zero drops elsewhere (all other diffs are the pre-existing tiPcKeyboard weak-emit asymmetry that the tikey link lane owns).

Also appends two probe write-ups to tools/decomp-assist/ attempts files (iplSetting scanAP inlined-bool materialization wall; tiString inputChar indexed-store/dead-compare fossil) — documentation only, no source changes.

Link to Devin session: https://app.devin.ai/sessions/222dce3cd2364f14bc9a8d5ef82cda00
Open in Devin Desktop: https://app.devin.ai/desktop/session/222dce3cd2364f14bc9a8d5ef82cda00?variant=devin
Requested by: @coah80

## Summary `Base::setTranslateMode` (tiPcKeyboard) is now byte-identical: 105/105 insns, fuzzy 99.0 → 100.0. The change is one declaration: `u32 keyMode = mode;` → `u32 keyMode;`. For `mode` outside `{TM_Direct, TM_Roman, TM_Kana}` the switch leaves `keyMode` unset, and retail provably reads the uninitialized register — at orig `0xd48` (`bge → 0xd64`) and `0xd40` (`b → 0xd64`) control reaches the merge with no `li r31` store on the path, then `cmplw r31, r0` at `0xd6c` consumes it. Initializing `keyMode` lets MWCC collapse the default into an extra `b` and changes the whole cmpwi dispatch tree (106 insns vs 105). Same accepted uninitialized-read pattern as `set_err_msg`/`keyMode` in earlier units. Verification: full ninja build, DOL sha1 `26116613f624061ba99c8d1a299aaa6efa85670d`, zero drops elsewhere (all other diffs are the pre-existing tiPcKeyboard weak-emit asymmetry that the tikey link lane owns). Also appends two probe write-ups to `tools/decomp-assist/` attempts files (iplSetting `scanAP` inlined-bool materialization wall; tiString `inputChar` indexed-store/dead-compare fossil) — documentation only, no source changes. Link to Devin session: https://app.devin.ai/sessions/222dce3cd2364f14bc9a8d5ef82cda00 Open in Devin Desktop: https://app.devin.ai/desktop/session/222dce3cd2364f14bc9a8d5ef82cda00?variant=devin Requested by: @coah80
devin-ai-integration[bot] commented 2026-10-08 22:04:39 +00:00 (Migrated from github.com)

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring
<!-- devin-pr-monitoring-controls --> I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)". - [ ] Disable automatic comment, CI, and merge conflict monitoring
coah80 commented 2026-10-08 22:05:58 +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.