Restore keyboard unit identity and getter order, then link #572

Merged
coah80 merged 1 commits from agent/bittle/keyboard-unit-filename into main 2026-10-01 23:02:26 +00:00
coah80 commented 2026-10-01 22:43:37 +00:00 (Migrated from github.com)

Changes and evidence

The original initializer is __sinit_\\tiKeyboard_cpp at 0x814395C0, while this unit had been reconstructed in tiManager.cpp and naturally emitted __sinit_\\tiManager_cpp. Rename the source to tiKeyboard.cpp and update its build/split path only. Preserve the original symbol name, address and size; no assembler aliases or filename pragma.

A linking trial then exposed four correctly matched getters emitted too late as inline bodies. Restore ordinary out-of-line definitions in original order, immediately before setDefaultPredictionJP:

  • getPredictLanguageSelectDialog, non-const/const: 0x814392C0 / 0x814392C8
  • getSignKeyboard, non-const/const: 0x814392D0 / 0x814392D8

Shared header touched: include/keyboard/tiManager.h. Declaration-only branches are restricted to the existing TIMANAGER_IMPLEMENTATION guard; other units retain their inline definitions. No class layout, vtable shape or behavior changes. These four ordinary return statements restore the linked placement; the earlier trial with filename correction alone failed the DOL gate and was not accepted.

Fresh verification

Rebased on e062e1c6. Performed a clean rebuild of all source objects for shared-header isolation, then full source/report/DOL gates again after rebase.

  • 62/62 exact functions, 8,368/8,368 code bytes. All 62 functions have identical instruction counts and zero ctxdiff differences. Initializer 4/4 instructions.
  • All 2,696 owned .data bytes and 578 owned relocations agree exactly; .ctors 4 bytes and .sbss 8 bytes also match.
  • Important reporting caveat: the compiler additionally emits 48 bytes of pre-existing deduplicated weak vtables, with four GUI-method relocations outside the original owned extent. These are retained untouched. Objdiff therefore still scores .data 99.117645% and counts matched data 12/2,708. This PR does not claim that object-level data metric is 100%, trim weak tables, or add padding to game it. The full linked binary is the authority, consistent with the review on #484.
  • The unit's code/data are now 100% linked. Linked code 1,858,432 → 1,866,800 (62.047256% → 62.32664%); linked data 1,266,636 → 1,269,344; complete units 918 → 919.
  • Matched code gains 16 bytes / one initializer through correct unit identity; total code/data/functions/units unchanged. Global matched-data total unchanged. Full-report regression comparison, mapping the renamed unit, finds zero exact-function or matched-data regressions.
  • Pool 8/8 identical, workflow guards 7/7, pool tests 8/8, diff/worktree checks pass.
  • Full all_source, report and build/43U/ok pass. The linked DOL is byte-for-byte identical: SHA-1 26116613f624061ba99c8d1a299aaa6efa85670d.

One logical translation unit; Git recognizes the source-file rename. No symbol metadata edits, new assembly, forced data or original binaries. Left for Cole's review and merge.

## Changes and evidence The original initializer is **`__sinit_\\tiKeyboard_cpp` at 0x814395C0**, while this unit had been reconstructed in tiManager.cpp and naturally emitted `__sinit_\\tiManager_cpp`. Rename the source to **tiKeyboard.cpp** and update its build/split **path only**. Preserve the original symbol name, address and size; no assembler aliases or filename pragma. A linking trial then exposed four correctly matched getters emitted too late as inline bodies. Restore ordinary out-of-line definitions in original order, immediately before setDefaultPredictionJP: - getPredictLanguageSelectDialog, non-const/const: **0x814392C0 / 0x814392C8** - getSignKeyboard, non-const/const: **0x814392D0 / 0x814392D8** **Shared header touched:** include/keyboard/tiManager.h. Declaration-only branches are restricted to the existing TIMANAGER_IMPLEMENTATION guard; other units retain their inline definitions. No class layout, vtable shape or behavior changes. These four ordinary return statements restore the linked placement; the earlier trial with filename correction alone failed the DOL gate and was not accepted. ## Fresh verification Rebased on **e062e1c6**. Performed a clean rebuild of **all source objects** for shared-header isolation, then full source/report/DOL gates again after rebase. - **62/62 exact functions**, **8,368/8,368 code bytes**. All 62 functions have identical instruction counts and **zero ctxdiff differences**. Initializer **4/4 instructions**. - All **2,696 owned `.data` bytes and 578 owned relocations** agree exactly; `.ctors` 4 bytes and `.sbss` 8 bytes also match. - **Important reporting caveat:** the compiler additionally emits 48 bytes of pre-existing deduplicated weak vtables, with four GUI-method relocations outside the original owned extent. These are retained untouched. Objdiff therefore still scores `.data` **99.117645%** and counts matched data **12/2,708**. This PR does not claim that object-level data metric is 100%, trim weak tables, or add padding to game it. The full linked binary is the authority, consistent with the review on #484. - The unit's code/data are now **100% linked**. Linked code **1,858,432 → 1,866,800** (**62.047256% → 62.32664%**); linked data **1,266,636 → 1,269,344**; complete units **918 → 919**. - Matched code gains **16 bytes / one initializer** through correct unit identity; total code/data/functions/units unchanged. Global matched-data total unchanged. Full-report regression comparison, mapping the renamed unit, finds **zero exact-function or matched-data regressions**. - Pool **8/8 identical**, workflow guards **7/7**, pool tests **8/8**, diff/worktree checks pass. - Full `all_source`, report and `build/43U/ok` pass. The linked DOL is **byte-for-byte identical**: SHA-1 **26116613f624061ba99c8d1a299aaa6efa85670d**. One logical translation unit; Git recognizes the source-file rename. No symbol metadata edits, new assembly, forced data or original binaries. Left for Cole's review and merge.
coah80 commented 2026-10-01 23:02:24 +00:00 (Migrated from github.com)

Reviewed and merged: unit rename is proven by __sinit_\\tiKeyboard_cpp. tiKeyboard 62/62 exact, now linked, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 forbidden. The only gate 'regression' is the old tiManager unit name disappearing. Good evidence write-up. The header getter guard is acceptable; a later cleanup could move those definitions into tiKeyboard.cpp outright.

Reviewed and merged: unit rename is proven by `__sinit_\\tiKeyboard_cpp`. tiKeyboard 62/62 exact, now linked, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 forbidden. The only gate 'regression' is the old tiManager unit name disappearing. Good evidence write-up. The header getter guard is acceptable; a later cleanup could move those definitions into tiKeyboard.cpp outright.
Sign in to join this conversation.