fix(odh): represent Huffman trees as halfword nodes #1025

Merged
coah80 merged 1 commits from agent/bittle/odh-node-type-review into main 2026-10-03 02:32:38 +00:00
coah80 commented 2026-10-03 02:31:28 +00:00 (Migrated from github.com)

Source type reconstruction

Represent each of the two Huffman trees as 24 explicit const u16 nodes, and use const u16 pointers in the local tree record. The decoder actually loads halfword nodes and relative halfword indices; the former packed-u32 representation required mismatched object accesses.

Both original 48-byte big-endian tree payloads are preserved. No algorithm, public decoder signature, caller ABI, field offset, forced alignment or padding changes.

Independent parent verification

  • Full 43U all_source/report/progress/DOL passes
  • All 1027 allocated objects compared: no payload or canonical relocation changes; entire report unchanged
  • Decoder remains 95.57189%, 306/306 instructions; 26/28 exact functions and data 6360/6360 preserved
  • Parent compiled actual production decoder and u16 tables with strict aliasing enabled and reran 24000 cases against an independent canonical-code reference: 6657 successes, 17343 truncation/malformed-code errors, with output canaries and state checks
  • Worker separately exhaustively checked 2560 canonical tree prefixes
  • Pool 10/10; literal advisory checks 14 arguments in 28 functions with no candidates/skips/errors
  • Worktree and base-relative diff checks pass

Existing malformed overlong zero-run behavior is shared with the original and excluded from the bounded harness; no new validation or complete-image/Wii runtime equivalence claimed. No percentage gain or new exact function. Only owned source types plus evidence log change.

Base: a5e49ea578
Tested tree: 26bb4c3450
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Represent Huffman tree tables as 16-bit halfword nodes in odh.cpp

  • Changes the luminance and chrominance Huffman table entries from packed 32-bit words to ordered 16-bit halfwords, keeping the same 48-byte payload in odh.cpp.
  • Updates HufftreeData table pointer members to point to the 16-bit entry type.
  • Adds an engineering log in allhands-odh-node-types.attempts.md covering the audit and validation steps.
  • Behavioral Change: decoders reading gArDc_luminance_huffTable and gArDc_chrominance_huffTable now consume 16-bit entries (24 per table) instead of 32-bit packed words.

Macroscope summarized d798226.

## Source type reconstruction Represent each of the two Huffman trees as 24 explicit const u16 nodes, and use const u16 pointers in the local tree record. The decoder actually loads halfword nodes and relative halfword indices; the former packed-u32 representation required mismatched object accesses. Both original 48-byte big-endian tree payloads are preserved. No algorithm, public decoder signature, caller ABI, field offset, forced alignment or padding changes. ## Independent parent verification - Full 43U all_source/report/progress/DOL passes - All 1027 allocated objects compared: no payload or canonical relocation changes; entire report unchanged - Decoder remains 95.57189%, 306/306 instructions; 26/28 exact functions and data 6360/6360 preserved - Parent compiled actual production decoder and u16 tables with strict aliasing enabled and reran 24000 cases against an independent canonical-code reference: 6657 successes, 17343 truncation/malformed-code errors, with output canaries and state checks - Worker separately exhaustively checked 2560 canonical tree prefixes - Pool 10/10; literal advisory checks 14 arguments in 28 functions with no candidates/skips/errors - Worktree and base-relative diff checks pass Existing malformed overlong zero-run behavior is shared with the original and excluded from the bounded harness; no new validation or complete-image/Wii runtime equivalence claimed. No percentage gain or new exact function. Only owned source types plus evidence log change. Base: a5e49ea578b5c881241832ed1a51d9dd94b95df6 Tested tree: 26bb4c3450156adc1ec4a9d6d298a690b0c1a566 DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d No merge performed or requested by this author. <!-- 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] > ### Represent Huffman tree tables as 16-bit halfword nodes in `odh.cpp` > - Changes the luminance and chrominance Huffman table entries from packed 32-bit words to ordered 16-bit halfwords, keeping the same 48-byte payload in [odh.cpp](https://github.com/coah80/wii-ipl/pull/1025/files#diff-b4f1b2d49e5f2d6b0344fe0cf5528d2c74bc8636b899f934fb61d6ad06d091c4). > - Updates `HufftreeData` table pointer members to point to the 16-bit entry type. > - Adds an engineering log in [allhands-odh-node-types.attempts.md](https://github.com/coah80/wii-ipl/pull/1025/files#diff-284fae6f3cce6087f3c223db001b7520f815e27bc55e2dd911e584c6c9e7fd77) covering the audit and validation steps. > - Behavioral Change: decoders reading `gArDc_luminance_huffTable` and `gArDc_chrominance_huffTable` now consume 16-bit entries (24 per table) instead of 32-bit packed words. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized d798226.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 02:32:36 +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.