Improve tiZiString case-conversion allocation with callee-save evidence #1119

Merged
coah80 merged 1 commits from agent/bittle/tizi-case-scalar-pair into main 2026-10-03 16:24:47 +00:00
coah80 commented 2026-10-03 16:24:28 +00:00 (Migrated from github.com)

Scope and result

43U only. In WithZi::update's explicit case-conversion block, separate position/candidate declarations from assignments and reverse their declaration order. position=0 remains before the for-loop candidate=destination initializer. The pointer's POD declaration moves from for-init into the existing immediately enclosing block, which has no statements after the loop. No call, initializer evaluation, read/write, type, array layout or helper changes.

Neutral normalization first preserved all1027 objects/full report. Only the reversed pair is retained.

  • update97.36323% →97.40807%; unit98.2936% →98.308136%
  • 448 source /446 target instructions unchanged; ten r24/r25 operand words change
  • All28 siblings,26/29 exact functions, code3136/5504, data7680/7680 and linking preserved
  • Current-base global fuzzy99.73178% →99.731804%; partial fuzzy progress only

Independent parent verification

Parent rebuilt default43U/ok and rebased/rebuilt on b6786bb798. All1027 current-main objects/reports checked: only owned object/update record changes; no function/exact/code/data/link regression. Every section header, relocation and nontext byte preserved. Candidate equals frozen reviewed object. Tested tree42dc7c8d56af3d039a22ee9679f72d7aaf188930.

Parent reviewed and reran the extended ELF/CFG checker and eight negative self-tests. It proves a32-instruction r24/r25 operand mapping, ordered memory accesses and identical character arguments; actual transitive helper bodies neither consume nor modify mapped registers. Both continuation checks cover64states, including loop reentry. Actual _savegpr_24/_restgpr_24 operands prove restoration from unchanged SP+0x10/SP+0x14 slots. No surviving callee-saved difference is excused at return.

Known WithZi vtable slot0x104 is enumerated across1027 original objects. This is conditional on valid known objects and ordinary PPC calls, not runtime vptr integrity or unknown overrides. It does not prove global string bounds/termination, absence of races or full retail equivalence. Target pointer/position roles now agree; independent increment scheduling remains different.

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

Note

Reorder WithZi::update case-conversion local declarations to match callee-save evidence

Moves the candidate pointer declaration before the position counter in WithZi::update and initializes the counter separately in tiZiString.cpp. Loop body, conversion cases, and candidate processing are unchanged. Adds a decompilation trial record in tizi-case-local-pair.attempts.md covering rejected variants, register-allocation and callee-saved-register checks, and negative tests.

Macroscope summarized 5acac75.

## Scope and result 43U only. In WithZi::update's explicit case-conversion block, separate position/candidate declarations from assignments and reverse their declaration order. position=0 remains before the for-loop candidate=destination initializer. The pointer's POD declaration moves from for-init into the existing immediately enclosing block, which has no statements after the loop. No call, initializer evaluation, read/write, type, array layout or helper changes. Neutral normalization first preserved all1027 objects/full report. Only the reversed pair is retained. - update97.36323% →97.40807%; unit98.2936% →98.308136% - 448 source /446 target instructions unchanged; ten r24/r25 operand words change - All28 siblings,26/29 exact functions, code3136/5504, data7680/7680 and linking preserved - Current-base global fuzzy99.73178% →99.731804%; partial fuzzy progress only ## Independent parent verification Parent rebuilt default43U/ok and rebased/rebuilt on b6786bb798844aefd03af55d39753b2c17fe593d. All1027 current-main objects/reports checked: only owned object/update record changes; no function/exact/code/data/link regression. Every section header, relocation and nontext byte preserved. Candidate equals frozen reviewed object. Tested tree42dc7c8d56af3d039a22ee9679f72d7aaf188930. Parent reviewed and reran the extended ELF/CFG checker and eight negative self-tests. It proves a32-instruction r24/r25 operand mapping, ordered memory accesses and identical character arguments; actual transitive helper bodies neither consume nor modify mapped registers. Both continuation checks cover64states, including loop reentry. Actual _savegpr_24/_restgpr_24 operands prove restoration from unchanged SP+0x10/SP+0x14 slots. No surviving callee-saved difference is excused at return. Known WithZi vtable slot0x104 is enumerated across1027 original objects. This is conditional on valid known objects and ordinary PPC calls, not runtime vptr integrity or unknown overrides. It does not prove global string bounds/termination, absence of races or full retail equivalence. Target pointer/position roles now agree; independent increment scheduling remains different. Pool identical/empty. Literal audit27functions, no errors/candidates; unequal-sized update/clearCandidates explicitly skipped. DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Clean source/diff/worktree gates pass. Evidence and 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] > ### Reorder `WithZi::update` case-conversion local declarations to match callee-save evidence > Moves the candidate pointer declaration before the position counter in `WithZi::update` and initializes the counter separately in [tiZiString.cpp](https://github.com/coah80/wii-ipl/pull/1119/files#diff-345737fc379f4c2ba98a4a663f6008dcc32e2f1fc95928d45e62b211cb84a585). Loop body, conversion cases, and candidate processing are unchanged. Adds a decompilation trial record in [tizi-case-local-pair.attempts.md](https://github.com/coah80/wii-ipl/pull/1119/files#diff-4a3df74e2d6a0baf0b04fe46fcb49625eaf9602d6805f129af7ce3dfdbf28f9f) covering rejected variants, register-allocation and callee-saved-register checks, and negative tests. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 5acac75.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 16:24:45 +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.