decomp: refine JPEG butterfly and color source structure #978

Merged
coah80 merged 1 commits from agent/bittle/jpeg-source-shape into main 2026-10-02 22:32:08 +00:00
coah80 commented 2026-10-02 22:29:26 +00:00 (Migrated from github.com)

Three small sibling-grounded source-shape changes: explicit luminance IDCT odd-coefficient differences, RGB444 red/luminance consumption and packing association, and RGBA420-edge luminance consumption. No semantic bug or new exact match is claimed.

  • IDCT unit: 88.80309% → 89.06892%; exact 0/2 unchanged.
  • RGB565 unit: 96.40103% → 96.44502%; exact 6/13 unchanged.
  • RGBA8 unit: 90.318985% → 90.32323%; exact 2/13 unchanged.
  • All eight existing exact functions remain ctxdiff zero. Only the three native text sections change; no allocated data in these units, no other object changes.
  • Parent reran 9,456 paired compiled-PPC calls with the included read-only integer interpreter. Non-stack memory, GPR14–31, SP and LR checks pass. Includes scale/edge/clipping/IDCT cases, but is bounded test evidence, not formal equivalence or Wii runtime validation. Interpreter limitations are explicit in the log; unsupported instructions fail closed. No original executable bytes are committed.
  • Pools all 0/0 identical. Literal audit has no strings; two pre-existing setter size mismatches are explicitly skipped.
  • Fixed only a trailing blank line in the attempt log during parent review. Remote tree 75388b56a1 equals tested tree. No headers, symbols, assembly, configuration or link changes.

Independent verification on dc48b109: full 43U all_source/progress/report/DOL passed SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; all 1027 allocated objects and every unit/function report compared with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree and diff checks passed. No linking flags or new exact-function attribution. Left for review; no merge performed.

Note

Refine JPEG decomp butterflies and add PPC differential audit tool

  • Reworks TMCJPEGDEC_IdctBlock_Lumi to use explicit sum/difference temporaries for the odd-frequency butterfly instead of destructive coefficient updates in idct_block_var.c
  • Reuses the red local to hold luminance in the YUV444-to-RGB565 and YUV420-to-RGBA8 edge converters, matching the original compiled register usage
  • Adds jpeg_differential_audit.py, a PPC interpreter that loads source and reference ELF objects, executes a seeded differential matrix over the converters, setters, and IDCT functions, and asserts on memory, return-value, register-restoration, and coverage mismatches
  • Includes the audit report and per-function differential results in jpeg-remainder-attempts.md and jpeg-remainder-differential-results.txt
  • Behavioral Change: none — butterfly arithmetic, RGB565 masks/shifts, and clipping/packing expressions are preserved; the differential audit confirms output equivalence

Macroscope summarized d1c3642.

Three small sibling-grounded source-shape changes: explicit luminance IDCT odd-coefficient differences, RGB444 red/luminance consumption and packing association, and RGBA420-edge luminance consumption. No semantic bug or new exact match is claimed. - IDCT unit: 88.80309% → 89.06892%; exact 0/2 unchanged. - RGB565 unit: 96.40103% → 96.44502%; exact 6/13 unchanged. - RGBA8 unit: 90.318985% → 90.32323%; exact 2/13 unchanged. - All eight existing exact functions remain ctxdiff zero. Only the three native text sections change; no allocated data in these units, no other object changes. - Parent reran 9,456 paired compiled-PPC calls with the included read-only integer interpreter. Non-stack memory, GPR14–31, SP and LR checks pass. Includes scale/edge/clipping/IDCT cases, but is bounded test evidence, not formal equivalence or Wii runtime validation. Interpreter limitations are explicit in the log; unsupported instructions fail closed. No original executable bytes are committed. - Pools all 0/0 identical. Literal audit has no strings; two pre-existing setter size mismatches are explicitly skipped. - Fixed only a trailing blank line in the attempt log during parent review. Remote tree 75388b56a13ab913fd5b5150aec515d5097026ab equals tested tree. No headers, symbols, assembly, configuration or link changes. Independent verification on dc48b109: full 43U all_source/progress/report/DOL passed SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; all 1027 allocated objects and every unit/function report compared with no score regressions. Workflow/literal/jump-table/pool tests 8/36/27/8, worktree and diff checks passed. No linking flags or new exact-function attribution. Left for review; no merge performed. <!-- 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] > ### Refine JPEG decomp butterflies and add PPC differential audit tool > - Reworks `TMCJPEGDEC_IdctBlock_Lumi` to use explicit sum/difference temporaries for the odd-frequency butterfly instead of destructive coefficient updates in [idct_block_var.c](https://github.com/coah80/wii-ipl/pull/978/files#diff-a274164d13198c046348fb647cba8dc885eaf013132027c97c324a7004d5242a) > - Reuses the red local to hold luminance in the YUV444-to-RGB565 and YUV420-to-RGBA8 edge converters, matching the original compiled register usage > - Adds [jpeg_differential_audit.py](https://github.com/coah80/wii-ipl/pull/978/files#diff-8603e0a8b87d20aee9db790278bc6ef0673f537c104a29ceda27806b2ca9fa3b), a PPC interpreter that loads source and reference ELF objects, executes a seeded differential matrix over the converters, setters, and IDCT functions, and asserts on memory, return-value, register-restoration, and coverage mismatches > - Includes the audit report and per-function differential results in [jpeg-remainder-attempts.md](https://github.com/coah80/wii-ipl/pull/978/files#diff-7885f1ad149fcfea43cc0045583ae29a125e8f3c94d6d139ccb0d2bcd5baf2e2) and [jpeg-remainder-differential-results.txt](https://github.com/coah80/wii-ipl/pull/978/files#diff-1d09f307e3ee99aa027476aa276be6c78696a1fac1476b664458f8ce2ff9de13) > - Behavioral Change: none — butterfly arithmetic, RGB565 masks/shifts, and clipping/packing expressions are preserved; the differential audit confirms output equivalence > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized d1c3642.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 22:32:05 +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.