decomp: reconstruct alpha output and bounded dictionary scan #976

Merged
coah80 merged 1 commits from agent/bittle/alpha-output-flow into main 2026-10-02 22:31:15 +00:00
coah80 commented 2026-10-02 22:29:16 +00:00 (Migrated from github.com)

Follow-up to #966. Restores wide-output-first sentinel handling, its shared zero assignments, an explicit bounded dictionary scan with mismatch break, and once-evaluated punctuation cursor consumption. No ABI, header or linking changes.

  • AlphaGetCandidates: 94.47314% → 95.02813%; 3946/3946 instructions unchanged.
  • Unit decompiled/fuzzy: 95.97323% → 96.37759%; exact 11/12, code 5880/21664 and data 516/564 preserved.
  • Only alpha text and its existing unmatched 48-byte switch-table relocations change. Raw data bytes/extent unchanged; all 12 destination addends shift. Parent independently checked each entry maps to the original normalized case-entry block, with matching handler routing; this is not an exact-data or full behavior proof. Existing table remains unmatched.
  • Pool 0/0 identical. All 11 exact functions remain ctxdiff zero. Advisory alignment checks 701 branches and 73/73 calls; all 12 table entries fall in equal normalized instruction blocks.
  • Metadata-regressing/ABI experiments excluded. Remote tree 99d20d6be0 equals tested tree.

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

Restructure alpha candidate output and dictionary scan in Zi8AlphaGetCandidates

Refactors the alpha-candidate logic in zi8alpha.c. The dictionary comparison now runs as a bounded loop with an explicit mismatch break instead of a compound loop condition, and the punctuation-candidate output branches are reorganized so the wide-character and encoded paths are selected through the inverse condition. Output initialization and cursor advancement are preserved. Also adds an engineering record in allhands-ezitext-alpha-followup.attempts.md covering the reconstructions and validation measurements.

Macroscope summarized 0dfb3a5.

Follow-up to #966. Restores wide-output-first sentinel handling, its shared zero assignments, an explicit bounded dictionary scan with mismatch break, and once-evaluated punctuation cursor consumption. No ABI, header or linking changes. - AlphaGetCandidates: 94.47314% → 95.02813%; 3946/3946 instructions unchanged. - Unit decompiled/fuzzy: 95.97323% → 96.37759%; exact 11/12, code 5880/21664 and data 516/564 preserved. - Only alpha text and its existing unmatched 48-byte switch-table relocations change. Raw data bytes/extent unchanged; all 12 destination addends shift. Parent independently checked each entry maps to the original normalized case-entry block, with matching handler routing; this is not an exact-data or full behavior proof. Existing table remains unmatched. - Pool 0/0 identical. All 11 exact functions remain ctxdiff zero. Advisory alignment checks 701 branches and 73/73 calls; all 12 table entries fall in equal normalized instruction blocks. - Metadata-regressing/ABI experiments excluded. Remote tree 99d20d6be0b7596b16e40178770a7cfd2785d1c8 equals tested tree. 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] > ### Restructure alpha candidate output and dictionary scan in `Zi8AlphaGetCandidates` > Refactors the alpha-candidate logic in [zi8alpha.c](https://github.com/coah80/wii-ipl/pull/976/files#diff-d9d8f6044ba4883939783bcce6da08c5875ea20b0dd0f305b1d77e8601ec0654). The dictionary comparison now runs as a bounded loop with an explicit mismatch break instead of a compound loop condition, and the punctuation-candidate output branches are reorganized so the wide-character and encoded paths are selected through the inverse condition. Output initialization and cursor advancement are preserved. Also adds an engineering record in [allhands-ezitext-alpha-followup.attempts.md](https://github.com/coah80/wii-ipl/pull/976/files#diff-a8dfde249f32f8910f9a1c01b83f2a7275e17801473d8a30abb016b957f94ce6) covering the reconstructions and validation measurements. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 0dfb3a5.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 22:31:12 +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.