decomp(jpeg): improve RGBA420 output/stride allocation #1108

Merged
coah80 merged 1 commits from agent/bittle/rgba420-output-stride-order into main 2026-10-03 14:34:52 +00:00
coah80 commented 2026-10-03 14:34:23 +00:00 (Migrated from github.com)

Minimal declaration-only gain

Swap only existing uninitialized lumaSkip/output declarations in normal RGBA420. All other source bytes, types, scopes, initializers, arithmetic and memory accesses stay fixed.

  • Function: 90.35294% → 90.745094%, 153/153 instructions
  • Positional differences:84 → 79
  • Unit:90.62644% → 90.66283%
  • Twelve siblings, two exact functions, code660/6596, data and linking preserved

One fixed-center audit compiled baseline plus all782 unique neighbors,783 real builds and official scores. Parent independently reproduced every official report/hash and the complete set. Unique best0083 is the minimal swap; only5/782 winner neighbors were observed. Historical overlap is disclosed; no new-winner fixed-point claim.

Independent parent gates

Fresh build on ccffee8af5. Tested tree06fc90d5454a3c6365099dd8a3982cefcbd4899d.

  • All1,027 reports/functions and source objects checked: no regressions, only target changes
  • Sibling instruction/relocation streams and allocated non-code sections preserved
  • Sequential pixel reference:11,138 vectors/33,414 executions, including2,946 contained overlaps; full153-instruction coverage in candidate/original/baseline
  • Reference preserves pair read/store order and row-parity chroma reuse; out-of-plane full-height odd-origin cases excluded
  • JPEG differential suite:9,456 paired cases passes with ABI checks
  • Pool identical; literal audit12 functions, no errors, existing unequal-size setter skip preserved
  • Full default build/progress,43U/ok, main/leaf/diff checks pass
  • DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d

Bounded reference/interpreter diagnostics are not formal proof or hardware execution. Evidence: tools/decomp-assist/allhands-jpeg-rgba420-next-neighbors.attempts.md. No original binaries/disassembly uploaded. Draft for human review; no merge or auto-merge requested.

Note

Reorder declarations in TMCJPEGDEC_converterYUV420toRGBA8 to match decompilation

Swaps two local declarations in TMCJPEGDEC_converterYUV420toRGBA8 so the output pointer is declared before the luma-skip integer. No executable code changes. Also adds a report in allhands-jpeg-rgba420-next-neighbors.attempts.md documenting the selected snapshot and validation evidence. Risk: none — declaration order only; behavior and generated layout goals are unchanged.

Macroscope summarized b02d75f.

## Minimal declaration-only gain Swap only existing uninitialized lumaSkip/output declarations in normal RGBA420. All other source bytes, types, scopes, initializers, arithmetic and memory accesses stay fixed. - Function: 90.35294% → 90.745094%, 153/153 instructions - Positional differences:84 → 79 - Unit:90.62644% → 90.66283% - Twelve siblings, two exact functions, code660/6596, data and linking preserved One fixed-center audit compiled baseline plus all782 unique neighbors,783 real builds and official scores. Parent independently reproduced every official report/hash and the complete set. Unique best0083 is the minimal swap; only5/782 winner neighbors were observed. Historical overlap is disclosed; no new-winner fixed-point claim. ## Independent parent gates Fresh build on ccffee8af5cd76fe326187d93418d3d62ee3c177. Tested tree06fc90d5454a3c6365099dd8a3982cefcbd4899d. - All1,027 reports/functions and source objects checked: no regressions, only target changes - Sibling instruction/relocation streams and allocated non-code sections preserved - Sequential pixel reference:11,138 vectors/33,414 executions, including2,946 contained overlaps; full153-instruction coverage in candidate/original/baseline - Reference preserves pair read/store order and row-parity chroma reuse; out-of-plane full-height odd-origin cases excluded - JPEG differential suite:9,456 paired cases passes with ABI checks - Pool identical; literal audit12 functions, no errors, existing unequal-size setter skip preserved - Full default build/progress,43U/ok, main/leaf/diff checks pass - DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d Bounded reference/interpreter diagnostics are not formal proof or hardware execution. Evidence: tools/decomp-assist/allhands-jpeg-rgba420-next-neighbors.attempts.md. No original binaries/disassembly uploaded. Draft for human 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 declarations in `TMCJPEGDEC_converterYUV420toRGBA8` to match decompilation > Swaps two local declarations in `TMCJPEGDEC_converterYUV420toRGBA8` so the output pointer is declared before the luma-skip integer. No executable code changes. Also adds a report in [allhands-jpeg-rgba420-next-neighbors.attempts.md](https://github.com/coah80/wii-ipl/pull/1108/files#diff-d745fc310a1bf12ced62551b83fa3f59316a56f256fe9878cf8e391b22c49fa7) documenting the selected snapshot and validation evidence. Risk: none — declaration order only; behavior and generated layout goals are unchanged. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized b02d75f.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 14:34:49 +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.