Fix Korean jump-table ownership and link zikorean #483

Merged
coah80 merged 2 commits from agent/bittle/korean-table-ownership into main 2026-10-01 21:50:23 +00:00
coah80 commented 2026-10-01 21:32:09 +00:00 (Migrated from github.com)

Evidence

zikorean.c already has 3/3 byte-exact functions, but its original .data split incorrectly includes a foreign 40-byte jump table at 0x8166B3A8–0x8166B3D0.

All 10 relocations in that table target Zi8_81483118, which belongs to zkokeyp.c (.text 0x8148302C–0x8148447C), not zikorean. The independently compiled zkokeyp object naturally emits exactly the same 40-byte table with matching destinations/addends: 0x140, 0x120, 0x10C, 0xEC, 0xD8, 0xB8, 0xA4, 0x84, 0x70, 0x50 relative to Zi8_81483118.

Move only this .data ownership to zkokeyp. Zikorean retains its two natural 31-entry tables (248 bytes), and can then be marked Matching and linked. No bytes are removed from total accounting, no source tables are invented, and this is not weak-vtable deduplication.

Fresh verification

Rebased/reference main: 3946983f. Freshly rebuilt the owned object and full 43U target, plus a separate current-main report for regression comparison.

  • Zikorean: 3/3 functions, 5,188/5,188 code bytes, 308/308 data bytes, all four sections and code/data links 100%.
  • ctxdiff.py: 49/49, 619/619, 629/629 instructions; zero differences.
  • Zkokeyp gains the correct 40/40 exact .data bytes; its other unmatched code/extabindex remain unchanged and unlinked.
  • Global matched data 1,670,308 → 1,670,596; total data remains 1,832,684.
  • Linked code 61.64127% → 61.81448% (+5,188 bytes); one additional complete unit.
  • No previously exact function or matched-data regression across the full report.
  • Pool comparison passes (empty string pools), workflow guards 7/7, pool tests 8/8, diff/worktree checks pass.
  • Full build and build/43U/ok pass; DOL SHA-1 26116613f624061ba99c8d1a299aaa6efa85670d.

Two adjacent data owners necessarily appear in this one ownership correction. No C/C++ source, function extent, padding objects, assembly or original binaries changed. Left for Cole's review and merge.

Note

Mark clib/zikorean.c as matching and fix jump-table ownership in 43U splits

  • Shifts the .data range 0x8166B3A8–0x8166B3D0 in splits.txt from zikorean.c to zkokeyp.c, correcting the jump-table ownership split.
  • Changes clib/zikorean.c from NonMatching to Matching in the system library config in configure.py.
  • Behavioral Change: the 43U linker split now attributes the range 0x8166B3A8–0x8166B3D0 to zkokeyp.c, and the build treats zikorean.c as matching.

Macroscope summarized f2d58e3.

## Evidence `zikorean.c` already has 3/3 byte-exact functions, but its original `.data` split incorrectly includes a foreign 40-byte jump table at **0x8166B3A8–0x8166B3D0**. All **10 relocations** in that table target `Zi8_81483118`, which belongs to `zkokeyp.c` (`.text` **0x8148302C–0x8148447C**), not zikorean. The independently compiled zkokeyp object naturally emits exactly the same 40-byte table with matching destinations/addends: **0x140, 0x120, 0x10C, 0xEC, 0xD8, 0xB8, 0xA4, 0x84, 0x70, 0x50** relative to `Zi8_81483118`. Move only this `.data` ownership to zkokeyp. Zikorean retains its two natural 31-entry tables (**248 bytes**), and can then be marked Matching and linked. No bytes are removed from total accounting, no source tables are invented, and this is not weak-vtable deduplication. ## Fresh verification Rebased/reference main: **3946983f**. Freshly rebuilt the owned object and full 43U target, plus a separate current-main report for regression comparison. - Zikorean: **3/3 functions**, **5,188/5,188 code bytes**, **308/308 data bytes**, all four sections and code/data links **100%**. - `ctxdiff.py`: **49/49, 619/619, 629/629 instructions; zero differences**. - Zkokeyp gains the correct **40/40 exact `.data` bytes**; its other unmatched code/extabindex remain unchanged and unlinked. - Global matched data **1,670,308 → 1,670,596**; total data remains **1,832,684**. - Linked code **61.64127% → 61.81448%** (+5,188 bytes); one additional complete unit. - No previously exact function or matched-data regression across the full report. - Pool comparison passes (empty string pools), workflow guards **7/7**, pool tests **8/8**, diff/worktree checks pass. - Full build and `build/43U/ok` pass; DOL SHA-1 **26116613f624061ba99c8d1a299aaa6efa85670d**. Two adjacent data owners necessarily appear in this one ownership correction. No C/C++ source, function extent, padding objects, assembly or original binaries changed. Left for Cole's review and merge. <!-- 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] > ### Mark `clib/zikorean.c` as matching and fix jump-table ownership in 43U splits > - Shifts the `.data` range `0x8166B3A8`–`0x8166B3D0` in [splits.txt](https://github.com/coah80/wii-ipl/pull/483/files#diff-d5132efbf4d83cc6fc61c89e9d57150d270f1361827760236aeab4e594f19366) from `zikorean.c` to `zkokeyp.c`, correcting the jump-table ownership split. > - Changes `clib/zikorean.c` from `NonMatching` to `Matching` in the system library config in [configure.py](https://github.com/coah80/wii-ipl/pull/483/files#diff-4d5f3192809ec1b9add6b33007e0c50031ad9a0a2f3f55a481b506468824db2c). > - Behavioral Change: the 43U linker split now attributes the range `0x8166B3A8`–`0x8166B3D0` to `zkokeyp.c`, and the build treats `zikorean.c` as matching. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized f2d58e3.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-01 21:50:20 +00:00 (Migrated from github.com)

Reviewed and merged. Clean rebuild on the orchestrator gate: DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, zikorean 3/3 exact with code 5188/5188 and data 308/308 now linked, zkokeyp picks up the table's 40 bytes, 0 regressions, 0 forbidden patterns. The relocation evidence (all 10 entries target zkokeyp's .text) is exactly what a split ownership change needs. Nice one: this kind of mis-owned table is worth hunting for elsewhere; any .data block whose relocations all point into another unit's .text is a candidate.

Reviewed and merged. Clean rebuild on the orchestrator gate: DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, zikorean 3/3 exact with code 5188/5188 and data 308/308 now linked, zkokeyp picks up the table's 40 bytes, 0 regressions, 0 forbidden patterns. The relocation evidence (all 10 entries target zkokeyp's .text) is exactly what a split ownership change needs. Nice one: this kind of mis-owned table is worth hunting for elsewhere; any .data block whose relocations all point into another unit's .text is a candidate.
Sign in to join this conversation.