Discover compiler-named and custom jump tables #710

Merged
coah80 merged 1 commits from agent/bittle/jump-table-discovery into main 2026-10-02 01:29:37 +00:00
coah80 commented 2026-10-02 01:28:58 +00:00 (Migrated from github.com)

Extend jump_table_diff's automatic discovery beyond the jumptable_ prefix. Multi-entry initialized-data objects qualify when every ADDR32 entry targets the selected function and at least one destination is inside its body. This finds compiler @ names and custom names such as scHwKeyboardConvertWCCodeJumpTable. Ordinary function-entry callback arrays, single pointers, nonobjects and nondata sections are excluded unless explicitly named. Existing named-table behavior and exit codes remain unchanged.

Stop scanning an object after the first nonmatching entry, avoiding full scans of ordinary string/constant arrays for every function.

Evidence on 10e3f47e:

  • Expanded audit: 255 eligible tables across 107 units, including 116 non-jumptable_ names; zero remaining differences/inference errors among the exact-name-100% functions examined
  • HW character conversion now automatically compares its 63/63-entry table, where the old default reported zero tables
  • Historical pre-fix SD calcNormal object remains a negative integration fixture: 0/30 entries and exit 1
  • Seven added discovery/negative-selection tests: 27/27 pass; workflow 7/7, pool 8/8, py_compile and diff/worktree checks pass
  • Full all_source/progress/report/ok passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Tested local/remote tree fef5701046

Only the optional tool and its tests change; no runtime sources, data, metadata, report scoring or CI policy changes. This is selective table verification, not a claim that all data or instruction behavior is correct. Left for Cole's review and merge.

Note

Discover compiler-named and custom jump tables in jump_table_diff

  • Expands automatic reference-table discovery in reference_tables beyond symbols with the jumptable prefix: candidates are now sufficiently large object symbols in supported data sections
  • Auto-selected tables must have valid relocations for every entry, and non-prefixed tables need at least one interior function destination. This excludes incomplete, externally targeting, single-entry, and all-function-entry callback arrays
  • Explicitly named tables keep prior behavior: small tables and all-function-entry tables can still be fetched by name
  • Adds tests in test_jump_table_diff.py covering compiler-generated and custom names, callback exclusion, single pointers, and swapped-entry detection
  • Behavioral Change: automatic discovery may now pick up compiler-named and custom-named data objects that were previously ignored; callback tables and vtables remain excluded

Macroscope summarized 05ec8bc.

Extend jump_table_diff's automatic discovery beyond the jumptable_ prefix. Multi-entry initialized-data objects qualify when every ADDR32 entry targets the selected function and at least one destination is inside its body. This finds compiler @ names and custom names such as scHwKeyboardConvertWCCodeJumpTable. Ordinary function-entry callback arrays, single pointers, nonobjects and nondata sections are excluded unless explicitly named. Existing named-table behavior and exit codes remain unchanged. Stop scanning an object after the first nonmatching entry, avoiding full scans of ordinary string/constant arrays for every function. Evidence on 10e3f47e: - Expanded audit: 255 eligible tables across 107 units, including 116 non-jumptable_ names; zero remaining differences/inference errors among the exact-name-100% functions examined - HW character conversion now automatically compares its 63/63-entry table, where the old default reported zero tables - Historical pre-fix SD calcNormal object remains a negative integration fixture: 0/30 entries and exit 1 - Seven added discovery/negative-selection tests: 27/27 pass; workflow 7/7, pool 8/8, py_compile and diff/worktree checks pass - Full all_source/progress/report/ok passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Tested local/remote tree fef5701046de96d957a447a7fd445bb9ce1d53f5 Only the optional tool and its tests change; no runtime sources, data, metadata, report scoring or CI policy changes. This is selective table verification, not a claim that all data or instruction behavior is correct. 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] > ### Discover compiler-named and custom jump tables in `jump_table_diff` > - Expands automatic reference-table discovery in `reference_tables` beyond symbols with the jumptable prefix: candidates are now sufficiently large object symbols in supported data sections > - Auto-selected tables must have valid relocations for every entry, and non-prefixed tables need at least one interior function destination. This excludes incomplete, externally targeting, single-entry, and all-function-entry callback arrays > - Explicitly named tables keep prior behavior: small tables and all-function-entry tables can still be fetched by name > - Adds tests in [test_jump_table_diff.py](https://github.com/coah80/wii-ipl/pull/710/files#diff-58b4189fe59bdf46f2408e06fb743321e7caf69b28ecb166d2b777ff2e5000fb) covering compiler-generated and custom names, callback exclusion, single pointers, and swapped-entry detection > - Behavioral Change: automatic discovery may now pick up compiler-named and custom-named data objects that were previously ignored; callback tables and vtables remain excluded > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 05ec8bc.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 01:29:34 +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.