decomp: recover ESMisc ticket scratch lifetime and cleanup flow #975

Merged
coah80 merged 1 commits from agent/bittle/esmisc-helper-flow into main 2026-10-02 22:30:27 +00:00
coah80 commented 2026-10-02 22:29:11 +00:00 (Migrated from github.com)

Follow-up to #964. Gives the real aligned ticket buffer an explicit pointer lifetime scoped to successful enumeration, and expresses the ticket helper's early-return/cleanup paths using its already-computed ES status. The private fully inlined helper return contract is inferred, not an independently recovered public ABI; caller intentionally discards it. Public ABI and behavior are unchanged.

  • DeleteUnauthorizedData: 95.830734% → 99.14254%, 446 → 449/449 instructions. Remaining 74 positional differences are register substitutions, not an exact match.
  • Unit decompiled/fuzzy: 99.33143% → 99.8625%; exact 30/31 and data 4416/4416 preserved.
  • Only ESMisc text changes, 11408 → 11420 bytes; all data and other objects unchanged.
  • Pool 114/114 identical. Literal audit now covers all 31 functions / 245 arguments with no candidates/errors/skips.
  • Parent regenerated and passed the same 12 extracted-source ASan/UBSan cases. Leak checking disabled for the documented environment limitation; no Wii runtime claim.
  • Remote tree 0e0a1b4199 equals tested tree. No header, metadata, ATERM or assembly change.

Independent verification on dc48b109: full 43U all_source/progress/report/DOL passed SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; all 1027 allocated objects and every unit/function report compared with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree and diff checks passed. No linking flags or new exact-function attribution. Left for review; no merge performed.

Note

Recover ESMisc ticket scratch lifetime and cleanup flow

  • Changes utility.DeleteTicketsForce from void to returning s32, returning the ES status from ticket-view enumeration or deletion while still freeing the allocated ticket-view list before returning
  • Adds a scoped ticket-scratch pointer in utility.InitSavedata, initialized after successful title enumeration and passed to each DeleteTicketsForce call
  • The current caller discards the new return value; outer savedata status handling is unchanged
  • Logs the reconstruction attempts, validation results, and the rejected ATERM ownership experiment in allhands-system-decompile.attempts.md

Macroscope summarized 79f512d.

Follow-up to #964. Gives the real aligned ticket buffer an explicit pointer lifetime scoped to successful enumeration, and expresses the ticket helper's early-return/cleanup paths using its already-computed ES status. The private fully inlined helper return contract is inferred, not an independently recovered public ABI; caller intentionally discards it. Public ABI and behavior are unchanged. - DeleteUnauthorizedData: 95.830734% → 99.14254%, 446 → 449/449 instructions. Remaining 74 positional differences are register substitutions, not an exact match. - Unit decompiled/fuzzy: 99.33143% → 99.8625%; exact 30/31 and data 4416/4416 preserved. - Only ESMisc text changes, 11408 → 11420 bytes; all data and other objects unchanged. - Pool 114/114 identical. Literal audit now covers all 31 functions / 245 arguments with no candidates/errors/skips. - Parent regenerated and passed the same 12 extracted-source ASan/UBSan cases. Leak checking disabled for the documented environment limitation; no Wii runtime claim. - Remote tree 0e0a1b4199ae0a4836546ba6c6f4ac40ca0e40e4 equals tested tree. No header, metadata, ATERM or assembly change. Independent verification on dc48b109: full 43U all_source/progress/report/DOL passed SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; all 1027 allocated objects and every unit/function report compared with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree and diff checks passed. No linking flags or new exact-function attribution. Left for review; no merge performed. <!-- 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] > ### Recover ESMisc ticket scratch lifetime and cleanup flow > - Changes `utility.DeleteTicketsForce` from void to returning `s32`, returning the ES status from ticket-view enumeration or deletion while still freeing the allocated ticket-view list before returning > - Adds a scoped ticket-scratch pointer in `utility.InitSavedata`, initialized after successful title enumeration and passed to each `DeleteTicketsForce` call > - The current caller discards the new return value; outer savedata status handling is unchanged > - Logs the reconstruction attempts, validation results, and the rejected ATERM ownership experiment in [allhands-system-decompile.attempts.md](https://github.com/coah80/wii-ipl/pull/975/files#diff-318410918fd7f38155cddb3b47be22a339efca49a90090892d80e530c20de88c) > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 79f512d.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 22:30:24 +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.