decomp: reconstruct BS2 partition and banner paths #987

Merged
coah80 merged 1 commits from agent/bittle/bs2-partition-flow into main 2026-10-02 23:12:23 +00:00
coah80 commented 2026-10-02 23:09:41 +00:00 (Migrated from github.com)

Tick-only follow-up preserving the already-merged Run implementation/fixed-stack correction. Restores sparse D/R/S/T family dispatch, the partition-member snapshot before cache/disc selection, and the missing BannerBuffer variadic report argument. Expresses the same strictly-next-cache-line arithmetic explicitly. The positive GamePartition branch already on main is preserved, not claimed as a new gain.

  • BS2Tick: 98.354126% → 98.639175%, 1935 → 1937 instructions versus target 1940.
  • Unit decompiled/fuzzy: 98.96632% → 99.09658%; exact 25/29, code 5112/16980 and data 155504/158528 unchanged.
  • Parent checked original object offsets 0x39B4..0x39D8: aligned banner value is computed in r4, stored and passed to BS2Report. The prior reconstructed call supplied no value for %08X.
  • Parent checked all 256 family prefixes and 196,608 wrapping next-line address cases. Pool 91/91 identical.
  • Only BS2Mach text (16960 → 16968) and layout-dependent jump-table addends change; raw data bytes/extent remain unchanged. Existing unmatched table/data attribution is not claimed exact. Run stays 43/43 exact and unchanged.
  • Literal audit: 28 functions / 97 arguments, no candidates/errors; changed Tick explicitly skipped due unequal size. No other unit regressions.
  • Earlier attempt log records its historical 24/29 baseline; the current independent baseline is 25/29 after #973. Remote tree 83aeaa37eb equals tested tree.

Fresh independent verification on 5a222cde: full 43U all_source/progress/report/DOL passes SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; every unit/function report and all 1027 allocated objects audited with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree checks and base-relative diff checks pass. No linking flags, fabricated padding, forced registers/volatile or new assembly. Partial decompilation progress, not full exact completion. Left for review; no merge performed.

Note

Reconstruct BS2 partition and banner paths in BS2Tick state machine

  • Reworks the state-0x24/0x25 control flow in BS2Mach.BS2Tick: the game partition offset is now captured before the cache or disc path is chosen, and the disc path uses the captured value
  • Replaces the title-prefix conditional with an explicit D/R/S/T dispatch set covering the same cases
  • Fixes the banner-buffer alignment expression to compute the next 32-byte boundary, and passes BannerBuffer as the missing argument to the allocation-path BS2Report call
  • Adds a reconstruction report in allhands-bs2-tick.attempts.md documenting the retained changes, fuzzy-match measurements, and build verification
  • Behavioral Change: in state 0x25, the game partition member is evaluated before either the cache or disc path runs; the disc open now uses the pre-captured offset

Macroscope summarized 523b8b3.

Tick-only follow-up preserving the already-merged Run implementation/fixed-stack correction. Restores sparse D/R/S/T family dispatch, the partition-member snapshot before cache/disc selection, and the missing BannerBuffer variadic report argument. Expresses the same strictly-next-cache-line arithmetic explicitly. The positive GamePartition branch already on main is preserved, not claimed as a new gain. - BS2Tick: 98.354126% → 98.639175%, 1935 → 1937 instructions versus target 1940. - Unit decompiled/fuzzy: 98.96632% → 99.09658%; exact 25/29, code 5112/16980 and data 155504/158528 unchanged. - Parent checked original object offsets 0x39B4..0x39D8: aligned banner value is computed in r4, stored and passed to BS2Report. The prior reconstructed call supplied no value for %08X. - Parent checked all 256 family prefixes and 196,608 wrapping next-line address cases. Pool 91/91 identical. - Only BS2Mach text (16960 → 16968) and layout-dependent jump-table addends change; raw data bytes/extent remain unchanged. Existing unmatched table/data attribution is not claimed exact. Run stays 43/43 exact and unchanged. - Literal audit: 28 functions / 97 arguments, no candidates/errors; changed Tick explicitly skipped due unequal size. No other unit regressions. - Earlier attempt log records its historical 24/29 baseline; the current independent baseline is 25/29 after #973. Remote tree 83aeaa37eb3d3f742979156a31f11fb79d6e6ac7 equals tested tree. Fresh independent verification on 5a222cde: full 43U all_source/progress/report/DOL passes SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; every unit/function report and all 1027 allocated objects audited with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree checks and base-relative diff checks pass. No linking flags, fabricated padding, forced registers/volatile or new assembly. Partial decompilation progress, not full exact completion. 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] > ### Reconstruct BS2 partition and banner paths in `BS2Tick` state machine > - Reworks the state-0x24/0x25 control flow in `BS2Mach.BS2Tick`: the game partition offset is now captured before the cache or disc path is chosen, and the disc path uses the captured value > - Replaces the title-prefix conditional with an explicit D/R/S/T dispatch set covering the same cases > - Fixes the banner-buffer alignment expression to compute the next 32-byte boundary, and passes `BannerBuffer` as the missing argument to the allocation-path `BS2Report` call > - Adds a reconstruction report in [allhands-bs2-tick.attempts.md](https://github.com/coah80/wii-ipl/pull/987/files#diff-893a364fbef6fd2af113d9f5327b1f92cccd00670b3b9df2b358f6d4c0b0158f) documenting the retained changes, fuzzy-match measurements, and build verification > - Behavioral Change: in state 0x25, the game partition member is evaluated before either the cache or disc path runs; the disc open now uses the pre-captured offset > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 523b8b3.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 23:12:21 +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.