Align tiZiString case-loop increment order with original #1121

Merged
coah80 merged 1 commits from agent/bittle/tizi-case-increment into main 2026-10-03 16:48:11 +00:00
coah80 commented 2026-10-03 16:47:35 +00:00 (Migrated from github.com)

Scope and result

43U only. Move the case loop's ++position from its body to the for-increment expression, after ++candidate. All declarations, initializers, switch/helper calls, scopes and other source remain fixed. Built-in comma sequences the two independent scalar updates in target order; there is no continue or body exit bypassing either update.

  • update97.40807% →97.4574%; unit98.308136% →98.32413%
  • 448 source /446 target instructions unchanged; exactly two addi words at0x1144/0x1148 swap and now equal the target pair
  • All28 siblings,26/29 exact functions, code3136/5504, data7680/7680 and linking preserved
  • Global fuzzy99.73189% →99.73191%; partial improvement, not an exact match

Independent parent verification

Fresh full default43U/ok on57c17ebe2a7b3788cbbbf54f7dc9a9fb35abaec8. All1027 current-main objects/reports compared, only owned unit/update changes, no function/exact/code/data/link regressions. Fresh object equals frozen candidate. Tested tree028db32424288149313259fa8d1d000c62bfee87.

Parent reviewed and reran actual ELF/instruction commutation checker and eight negative self-tests. The two addi instructions have disjoint register effects, no memory/call/branch/CR/XER effects, and identical complete state at0x114C. No alternate edge enters the second increment. Remaining instruction/CFG/memory/call order is identical; actual save/restore slots remain unchanged. Source equivalence is for defined executions; malformed global bounds/termination are not fixed or claimed safe.

One precise nonallocated compiler metadata change is explicitly audited: .strtab byte210 renumbers @1391→@1393 on the same STB_LOCAL/STT_OBJECT symbol index11, section3 offset12 size48. Full symbol entry, allocated data and both relocation references at .rela.text0x141A/0x1422 are byte-identical. Every section header and all other nontext bytes are unchanged. This is not a blanket symbol/string-table exception.

Pool identical/empty. Literal audit27functions, no candidates/errors; unequal-sized update/clearCandidates explicitly skipped. DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Clean worktree/diff gates pass. One candidate only, no adaptive variants. Evidence/checker hash committed; original executable artifacts stay local. No merge performed or requested.

Note

Align WithZi::update case-loop increment order with original

Moves the candidate pointer increment into the loop increment expression, before the position counter, and removes the separate position increment from the loop body in tiZiString.cpp. Loop body, switch cases, and helper calls are unchanged. Adds an engineering record of the trial in tizi-case-increment-order.attempts.md. Risk: if any branch relies on the position counter advancing before the candidate pointer, the changed evaluation order in WithZi::update could shift candidate indexing; verify the case branches in tiZiString.cpp.

Macroscope summarized 1c27ca5.

## Scope and result 43U only. Move the case loop's ++position from its body to the for-increment expression, after ++candidate. All declarations, initializers, switch/helper calls, scopes and other source remain fixed. Built-in comma sequences the two independent scalar updates in target order; there is no continue or body exit bypassing either update. - update97.40807% →97.4574%; unit98.308136% →98.32413% - 448 source /446 target instructions unchanged; exactly two addi words at0x1144/0x1148 swap and now equal the target pair - All28 siblings,26/29 exact functions, code3136/5504, data7680/7680 and linking preserved - Global fuzzy99.73189% →99.73191%; partial improvement, not an exact match ## Independent parent verification Fresh full default43U/ok on57c17ebe2a7b3788cbbbf54f7dc9a9fb35abaec8. All1027 current-main objects/reports compared, only owned unit/update changes, no function/exact/code/data/link regressions. Fresh object equals frozen candidate. Tested tree028db32424288149313259fa8d1d000c62bfee87. Parent reviewed and reran actual ELF/instruction commutation checker and eight negative self-tests. The two addi instructions have disjoint register effects, no memory/call/branch/CR/XER effects, and identical complete state at0x114C. No alternate edge enters the second increment. Remaining instruction/CFG/memory/call order is identical; actual save/restore slots remain unchanged. Source equivalence is for defined executions; malformed global bounds/termination are not fixed or claimed safe. One precise nonallocated compiler metadata change is explicitly audited: .strtab byte210 renumbers @1391→@1393 on the same STB_LOCAL/STT_OBJECT symbol index11, section3 offset12 size48. Full symbol entry, allocated data and both relocation references at .rela.text0x141A/0x1422 are byte-identical. Every section header and all other nontext bytes are unchanged. This is not a blanket symbol/string-table exception. Pool identical/empty. Literal audit27functions, no candidates/errors; unequal-sized update/clearCandidates explicitly skipped. DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Clean worktree/diff gates pass. One candidate only, no adaptive variants. Evidence/checker hash 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] > ### Align `WithZi::update` case-loop increment order with original > Moves the candidate pointer increment into the loop increment expression, before the position counter, and removes the separate position increment from the loop body in [tiZiString.cpp](https://github.com/coah80/wii-ipl/pull/1121/files#diff-345737fc379f4c2ba98a4a663f6008dcc32e2f1fc95928d45e62b211cb84a585). Loop body, switch cases, and helper calls are unchanged. Adds an engineering record of the trial in [tizi-case-increment-order.attempts.md](https://github.com/coah80/wii-ipl/pull/1121/files#diff-73223d8d52372465834a958ad9bafba736df6be134073688fe799fe8c6d764e0). Risk: if any branch relies on the position counter advancing before the candidate pointer, the changed evaluation order in `WithZi::update` could shift candidate indexing; verify the case branches in `tiZiString.cpp`. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 1c27ca5.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 16:48:09 +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.