decomp: recover typed partition word decoding #989

Merged
coah80 merged 1 commits from agent/bittle/partition-word-decoding into main 2026-10-02 23:37:04 +00:00
coah80 commented 2026-10-02 23:35:34 +00:00 (Migrated from github.com)

Reconstruction

Replace duplicated MBR word expressions and the macro with one typed little-endian reader. The shared helper retains the already reconstructed master-sector expression grouping and applies it consistently to partition and extended-partition entries. It does not change the decoder's unsigned 32-bit value.

  • pdm_part_get_start_sector: 82.56159% → 84.51811%; 276/276 instructions
  • Unit fuzzy: 93.598495% → 94.17976%; exact functions unchanged 18/20, exact code 2276/3716
  • All other emitted function bodies unchanged, including the master-sector reader; all allocated data unchanged
  • Independently extracted helper passed 808,224 ASan/UBSan decoder vectors at all eight sector offsets
  • Only same-sized pdm_partition .text changed among 1027 source objects; no report regressions
  • Pool identical (no strings), exact functions retain ctxdiff zero; full 43U build and required DOL SHA1 pass

Partial source reconstruction, no new exact function or linking claim. sd_drv is untouched.

Parent validation baseline

Rebased and independently rebuilt on main 13881c99fb. Tested tree 3e2e0fe015.
DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Worktree/diff checks pass. User requested decompilation first, matching next and linking last. No merge performed or requested by this author.

Note

Restore typed partition word decoding in pdm_partition.c

Replaces the removed file-local MBR_WORD macro with a read_partition_u32 helper that reads four-byte little-endian values. pdm_part_is_master_boot_sector and pdm_part_get_start_sector now use this helper with the same field offsets, so partition lookup logic is unchanged.

Macroscope summarized b58b3bd.

## Reconstruction Replace duplicated MBR word expressions and the macro with one typed little-endian reader. The shared helper retains the already reconstructed master-sector expression grouping and applies it consistently to partition and extended-partition entries. It does not change the decoder's unsigned 32-bit value. - pdm_part_get_start_sector: 82.56159% → 84.51811%; 276/276 instructions - Unit fuzzy: 93.598495% → 94.17976%; exact functions unchanged 18/20, exact code 2276/3716 - All other emitted function bodies unchanged, including the master-sector reader; all allocated data unchanged - Independently extracted helper passed 808,224 ASan/UBSan decoder vectors at all eight sector offsets - Only same-sized pdm_partition .text changed among 1027 source objects; no report regressions - Pool identical (no strings), exact functions retain ctxdiff zero; full 43U build and required DOL SHA1 pass Partial source reconstruction, no new exact function or linking claim. sd_drv is untouched. ## Parent validation baseline Rebased and independently rebuilt on main 13881c99fb2f3df970ea5c4308f0aaa063a931b1. Tested tree 3e2e0fe01599ac120eeea72970193ac2821ca431. DOL SHA1:26116613f624061ba99c8d1a299aaa6efa85670d. Worktree/diff checks pass. User requested decompilation first, matching next and linking last. 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] > ### Restore typed partition word decoding in `pdm_partition.c` > Replaces the removed file-local `MBR_WORD` macro with a `read_partition_u32` helper that reads four-byte little-endian values. `pdm_part_is_master_boot_sector` and `pdm_part_get_start_sector` now use this helper with the same field offsets, so partition lookup logic is unchanged. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized b58b3bd.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 23:37:02 +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.