tools: compare relocated jump-table destinations alongside ctxdiff #676
Reference in New Issue
Block a user
Delete Branch "agent/bittle/audit-jump-relocations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Add an optional, standalone jump_table_diff.py and 20 focused tests. No game source, symbol sizes, splits, report metrics, CI, or existing tool exit codes change.
The SD dispatch corrections in #623 showed why instruction-exact functions still need their jump-table relocations checked. This helper follows corresponding function-relative code relocations to locate the source table, rather than assuming equal data-section offsets. It normalizes section-relative/function-relative destinations and checks entry counts, relocation kinds and destinations. Ambiguous or unsupported input is rejected.
Usage:
python tools/decomp-assist/jump_table_diff.py <unit> <function> [--table <reference-symbol>]Exit 0: all selected tables match, including an explicitly reported zero-table result. Exit 1: destination/count mismatch. Exit 2: invalid or ambiguous input. Only local jumptable_* tables wholly targeting the selected function are automatically selected; callback tables and vtables are outside its scope. This does not establish behavioral equivalence or instruction correctness: run ctxdiff separately. No existing consumers are changed.
Verification
Rebased and built on
fbecedd948. Connector tree exactly matches the locally tested tree 9c3dd215c36b9be1ec9387a171a54bebd01ea4f9.This is a verification-tool PR, not a new decompilation or claim of whole-project completion. No original binaries or extracted assembly are included.
Rebased the same two-file patch onto
d4cdae2177after main advanced during publication. New head 4ce997995d16a366cc5994a79bb1d40da4da1044; remote tree618ab2e060matches the tested local tree. Re-ran all_source/progress/report/ok and 20 tests; DOL SHA1 remains 26116613f624061ba99c8d1a299aaa6efa85670d. Broader inferred-location audit now checks 139 eligible jump tables across 62 table-containing units with no remaining mismatch or inference error among exact-name-100% functions. This audit is selective, not a claim that all data is exact.Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.