decomp(sd-select): align traversal title declaration lifetime #1066

Merged
coah80 merged 1 commits from agent/bittle/channel-title-review into main 2026-10-03 06:16:21 +00:00
coah80 commented 2026-10-03 06:15:34 +00:00 (Migrated from github.com)

Small declaration/lifetime gain

Move the existing uninitialized ESTitleId titleId before the outer traversal loop. Every assignment, read and side effect stays in place. ESTitleId is a trivial u64; both loaded/unloaded arms assign it fully before use and its address never escapes. No additional state, initializer or cast.

  • collectTitlesByChannelOrder: 97.29365% → 98.007935%, 126/126 instructions
  • Positional differences 22 → 7; unit 99.76244% → 99.77309%
  • Exact 123/129, matched code 30,344 and data 2,960/2,960 preserved

Independent verification

Base b7a06e9d82e35cda3de92a6135db491000722791; tested tree 4efe030d5a.

  • Full 43U build/progress/report/DOL passed; all 1,027 units compared, only this function's fuzzy changes
  • Removing the moved declaration leaves identical executable source; definite assignment and no escape verified
  • All text outside this function, allocated nontext payloads and all 1,561 relocation records byte-identical
  • Original words and call destinations independently checked against the DOL
  • Pool 101/101 identical; literal audit 128 functions/73 arguments, no candidates/errors; pre-existing create unequal extent skipped
  • DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; worktree/diff checks pass

Partial fuzzy gain using the repository-supported declaration-order workflow, not an exact or linking claim. Details: tools/decomp-assist/sd-channel-title-declaration-20261003.md.

Note

Move ESTitleId declaration before page loop in ipl.scene.collectTitlesByChannelOrder

Moves the uninitialized ESTitleId declaration from inside the per-channel order loop to just before the outer page loop, matching the original code's declaration lifetime. All uses stay at their existing positions. Adds a decomp-assist record in sd-channel-title-declaration-20261003.md with the rationale and validation results.

Macroscope summarized 290240a.

## Small declaration/lifetime gain Move the existing uninitialized ESTitleId titleId before the outer traversal loop. Every assignment, read and side effect stays in place. ESTitleId is a trivial u64; both loaded/unloaded arms assign it fully before use and its address never escapes. No additional state, initializer or cast. - collectTitlesByChannelOrder: 97.29365% → 98.007935%, 126/126 instructions - Positional differences 22 → 7; unit 99.76244% → 99.77309% - Exact 123/129, matched code 30,344 and data 2,960/2,960 preserved ## Independent verification Base b7a06e9d82e35cda3de92a6135db491000722791; tested tree 4efe030d5a40d7c9d09d123d5dc013f357d8d25b. - Full 43U build/progress/report/DOL passed; all 1,027 units compared, only this function's fuzzy changes - Removing the moved declaration leaves identical executable source; definite assignment and no escape verified - All text outside this function, allocated nontext payloads and all 1,561 relocation records byte-identical - Original words and call destinations independently checked against the DOL - Pool 101/101 identical; literal audit 128 functions/73 arguments, no candidates/errors; pre-existing create unequal extent skipped - DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; worktree/diff checks pass Partial fuzzy gain using the repository-supported declaration-order workflow, not an exact or linking claim. Details: tools/decomp-assist/sd-channel-title-declaration-20261003.md. <!-- 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] > ### Move `ESTitleId` declaration before page loop in `ipl.scene.collectTitlesByChannelOrder` > Moves the uninitialized `ESTitleId` declaration from inside the per-channel order loop to just before the outer page loop, matching the original code's declaration lifetime. All uses stay at their existing positions. Adds a decomp-assist record in [sd-channel-title-declaration-20261003.md](https://github.com/coah80/wii-ipl/pull/1066/files#diff-3462eff912d9e0deeb21a955583736a74b8810661c8b70eaf89c45c6ffd7a683) with the rationale and validation results. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 290240a.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 06:16:19 +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.