Improve card icon-loader scalar allocation with ABI evidence #1117

Merged
coah80 merged 1 commits from agent/bittle/card-loader-scalar-allocation into main 2026-10-03 16:13:27 +00:00
coah80 commented 2026-10-03 16:12:20 +00:00 (Migrated from github.com)

Scope and result

43U only. Reorder three existing uninitialized scalar declarations in loadCardFileIcons to iconAddressOffset, iconAddressBase, result. Types, assignments, scope, stack records, helper calls and all other source bytes stay fixed.

  • Function90.34375% →90.37305%; unit97.219246% →97.225334%
  • 508 source /512 target instructions unchanged; seven instruction words change
  • All29 sibling bodies/relocations and27 exact functions preserved; code4168/9852 and data1496/1496 unchanged
  • Global fuzzy remains99.73176% at current report precision. Partial local improvement; no new exact/link claim.

Independent verification

Parent independently rebuilt full default43U/ok, rebased and rebuilt on246c3f8056430e98f8c10e3edc3b0b717721e917. All1027 current-main objects/reports checked: only owned object/unit changes; no function/exact/code/data/link regression. Current candidate equals immutable snapshot002. Tested treec0f57bae453fc6d806521441aba2d0c51de2d474.

Independently verified allsix source/object hashes and exact permutations, and regenerated allsix full official reports. Three orders improve, three are baseline-identical; first lexicographic winner retained. Historical overlap is unknown, no novelty claim.

Actual seven-word r22/r23 role mapping accounts for every read/definition, CARDRead/memcpy arguments, range comparisons and comment-phase redefinition. Parent reran508-node CFG/dominator checks and21,400 bounded instruction-slice executions. Actual original-DOL save/restore helpers preserve both registers at unchanged SP+0x38/SP+0x3C slots; all13 calls and branch destinations unchanged. Other ELF sections/headers/relocations are byte-identical. This is local transformation/ABI evidence and bounded slices, not full CARD or Wii execution; existing negative-shift/reserved-format limitations are unchanged.

Pool43/43 identical. Literal audit45arguments across29functions, no candidates/errors; unequal-sized loader explicitly skipped. All27 exact functions independently retain zero ctxdiff. DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Clean worktree/diff gates pass. Detailed evidence and limits committed; original executable artifacts stay local. No merge performed or requested.

Note

Reorder scalar declarations in loadCardFileIcons per ABI evidence

Reorders the declarations of three scalar locals (icon address base, icon address offset, and file-open result) in loadCardFileIcons in iplCardSequence.cpp. Types, scopes, assignments, and surrounding stack record are unchanged. Adds a validation report at card-loader-scalar-orders-20261003.md with compilation trials, register-allocation evidence, and hashes supporting the chosen order.

Macroscope summarized 64dbbdb.

## Scope and result 43U only. Reorder three existing uninitialized scalar declarations in loadCardFileIcons to iconAddressOffset, iconAddressBase, result. Types, assignments, scope, stack records, helper calls and all other source bytes stay fixed. - Function90.34375% →90.37305%; unit97.219246% →97.225334% - 508 source /512 target instructions unchanged; seven instruction words change - All29 sibling bodies/relocations and27 exact functions preserved; code4168/9852 and data1496/1496 unchanged - Global fuzzy remains99.73176% at current report precision. Partial local improvement; no new exact/link claim. ## Independent verification Parent independently rebuilt full default43U/ok, rebased and rebuilt on246c3f8056430e98f8c10e3edc3b0b717721e917. All1027 current-main objects/reports checked: only owned object/unit changes; no function/exact/code/data/link regression. Current candidate equals immutable snapshot002. Tested treec0f57bae453fc6d806521441aba2d0c51de2d474. Independently verified allsix source/object hashes and exact permutations, and regenerated allsix full official reports. Three orders improve, three are baseline-identical; first lexicographic winner retained. Historical overlap is unknown, no novelty claim. Actual seven-word r22/r23 role mapping accounts for every read/definition, CARDRead/memcpy arguments, range comparisons and comment-phase redefinition. Parent reran508-node CFG/dominator checks and21,400 bounded instruction-slice executions. Actual original-DOL save/restore helpers preserve both registers at unchanged SP+0x38/SP+0x3C slots; all13 calls and branch destinations unchanged. Other ELF sections/headers/relocations are byte-identical. This is local transformation/ABI evidence and bounded slices, not full CARD or Wii execution; existing negative-shift/reserved-format limitations are unchanged. Pool43/43 identical. Literal audit45arguments across29functions, no candidates/errors; unequal-sized loader explicitly skipped. All27 exact functions independently retain zero ctxdiff. DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Clean worktree/diff gates pass. Detailed evidence and limits committed; original executable artifacts stay local. No merge performed or 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 scalar declarations in `loadCardFileIcons` per ABI evidence > Reorders the declarations of three scalar locals (icon address base, icon address offset, and file-open result) in `loadCardFileIcons` in [iplCardSequence.cpp](https://github.com/coah80/wii-ipl/pull/1117/files#diff-f522f916c990017f7c52bea35b7777db45f5b54897d68286050669924b44e3f2). Types, scopes, assignments, and surrounding stack record are unchanged. Adds a validation report at [card-loader-scalar-orders-20261003.md](https://github.com/coah80/wii-ipl/pull/1117/files#diff-ae9229cfa1a9e275ffc47ed784394a5e52de90bb0085f8dc37d815ca41144113) with compilation trials, register-allocation evidence, and hashes supporting the chosen order. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 64dbbdb.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 16:13: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.