Improve WADBackupEx zero initialization (97.370995 → 97.38042%) #1139

Merged
coah80 merged 1 commits from agent/bittle/wad-backup-zero-order into main 2026-10-03 20:38:30 +00:00
coah80 commented 2026-10-03 20:37:42 +00:00 (Migrated from github.com)

Change

Move only the existing outputBuffer = 0 assignment ahead of files = 0. These are distinct nonvolatile automatic locals; no call, branch, escape, cleanup flag, declaration, type or other statement changes.

Measurement

  • WADBackupEx97.370995 →97.38042%; unit98.94155 →98.943184%
  • Source/target remain1057/1062instructions; frame unchanged,64-byte-aligned0x8C0 allocation
  • Exact35/40, matched code13180/24500, data528/528, link status unchanged
  • Fixed146-order experiment, every order actually compiled and individually officially scored; unique best117 reproduced by separate final compile. No adaptive search/proxy filter/object dedup
  • Historical97.37571 source order was not recovered. This is a new bounded hypothesis; reproducing an old numeric score does not identify its source

Independent parent verification

Rebased on56f64ea4; tested tree97cad91cb0c6ea7fa66541a28d19de8641902628. Fresh full default43U build and explicit ok pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. All1027 whole source objects compared: only WAD differs; all1026 other complete unit records unchanged. No function/exact/data/link regressions. All35 exact functions independently instruction-identical; pool18/18 and literal advisory clean with existing size skips disclosed in log.

Only5 bytes in the entire ELF differ, within three li instructions. All metadata, nontext bytes, symbols, relocation records and39 sibling bodies are byte-identical. Actual instructions18–21 reorder zeroing r21/r24/r25 around an unchanged stw r0,0x68(r1). Independent symbolic execution proves identical registers and identical memory store at the join for arbitrary incoming state, with no pointer-disjointness assumption. No branch enters the window; all instructions outside it and all99 call sites are identical. Target DOL words/direct-call destinations separately checked.

Committed log includes exact scope, every measured order and evidence limitations. Original binaries/raw evidence stay local. This is a fuzzy gain, not exact completion or hardware execution. Draft for review; no merge or auto-merge requested.

Note

Reorder zero initialization of outputBuffer and files in WADBackupEx

Swaps the order of two zero assignments in the local initialization block of WADBackupEx in wad.c, improving the official fuzzy match from 97.370995% to 97.38042%. Adds a report in wad-backup-zero-orders-20261003.md covering the equivalence checks and per-order match measurements.

Macroscope summarized 74e9e49.

## Change Move only the existing outputBuffer = 0 assignment ahead of files = 0. These are distinct nonvolatile automatic locals; no call, branch, escape, cleanup flag, declaration, type or other statement changes. ## Measurement - WADBackupEx97.370995 →97.38042%; unit98.94155 →98.943184% - Source/target remain1057/1062instructions; frame unchanged,64-byte-aligned0x8C0 allocation - Exact35/40, matched code13180/24500, data528/528, link status unchanged - Fixed146-order experiment, every order actually compiled and individually officially scored; unique best117 reproduced by separate final compile. No adaptive search/proxy filter/object dedup - Historical97.37571 source order was not recovered. This is a new bounded hypothesis; reproducing an old numeric score does not identify its source ## Independent parent verification Rebased on56f64ea4; tested tree97cad91cb0c6ea7fa66541a28d19de8641902628. Fresh full default43U build and explicit ok pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. All1027 whole source objects compared: only WAD differs; all1026 other complete unit records unchanged. No function/exact/data/link regressions. All35 exact functions independently instruction-identical; pool18/18 and literal advisory clean with existing size skips disclosed in log. Only5 bytes in the entire ELF differ, within three li instructions. All metadata, nontext bytes, symbols, relocation records and39 sibling bodies are byte-identical. Actual instructions18–21 reorder zeroing r21/r24/r25 around an unchanged stw r0,0x68(r1). Independent symbolic execution proves identical registers and identical memory store at the join for arbitrary incoming state, with no pointer-disjointness assumption. No branch enters the window; all instructions outside it and all99 call sites are identical. Target DOL words/direct-call destinations separately checked. Committed log includes exact scope, every measured order and evidence limitations. Original binaries/raw evidence stay local. This is a fuzzy gain, not exact completion or hardware execution. Draft for review; no merge or auto-merge requested. <!-- 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] > ### Reorder zero initialization of `outputBuffer` and `files` in `WADBackupEx` > Swaps the order of two zero assignments in the local initialization block of `WADBackupEx` in [wad.c](https://github.com/coah80/wii-ipl/pull/1139/files#diff-f89534c3829239a13862901683d3f73929c8719516dc47b0db0ad2e7c79d071e), improving the official fuzzy match from 97.370995% to 97.38042%. Adds a report in [wad-backup-zero-orders-20261003.md](https://github.com/coah80/wii-ipl/pull/1139/files#diff-83e602ec15228c038c6e4119276124f966701b2603c86cfadd7c762f34d0c964) covering the equivalence checks and per-order match measurements. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 74e9e49.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 20:38:28 +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.