Recover ATERM association MAC loops (+5.31579 fuzzy) #1147

Merged
coah80 merged 1 commits from agent/aterm-association-recovery-20261004 into main 2026-10-04 00:26:16 +00:00
coah80 commented 2026-10-04 00:24:39 +00:00 (Migrated from github.com)

Change

Recover h2b trial 61's real byte/MAC formatting helpers, replacing duplicated end-pointer loops with the target's six-count CTR loops. Both nibble values and output cursors are initialized and consumed. Existing input reads and high/low/NUL/colon store order are retained; no new dummy output arrays or flags.

Historical provenance is exact: applying the preserved patch to 34858f3f reproduces the logged source SHA256 6fa4cc5bdf9ec05f63b18be1e148ccdfa3b61438f40c3e87342ae09c33047998. It had been restored because it remained nonexact. All current results below were freshly compiled and independently verified, not copied from that score.

Independent verification on 9aa4a0d887

  • ATERMBuildAssociationRequest: 93.44361 -> 98.7594; unit 97.42845 -> 97.575714
  • Actual 133 instructions / 532 bytes before, after and target; partial fuzzy improvement, not a new exact/link claim
  • All 25 siblings unchanged; all 20 existing official exact functions independently have zero instruction differences
  • Exact code 12200/19204, data 18584/18864, exact functions and link measures unchanged
  • Only ATERM changes across 1027 source objects/reports; all report changes are fuzzy improvements
  • All 145 raw symbol entries, all section headers, raw relocation tables and allocated nontext bytes identical. Four concrete local-object names change at stable indices22-25; exact index/type/section/extent proof, no broad name normalization
  • Fresh whole-function actual-PPC/sequential-reference proof: 6656 cases / 19968 baseline/candidate/original executions per run, full133/133 instruction coverage each. Tests cover every byte value separately at all six positions of both inputs, structured/random MAC pairs, four contained-alias layouts and four callback profiles
  • Return values, calls/arguments/order, complete read/write traces and allocated state agree; stack/LR/nonvolatile preservation verified
  • Limits: modeled memcpy/memcmp/NCD, valid allocated buffers, no hardware/formal/exhaustive2^96 claim. NCD-error cases still supply initialized output bytes; unwritten-byte behavior is not exploited
  • Default43U, explicit ok and DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d pass
  • Pool0/0; literal audit24 functions/7 arguments passes, retaining existing Discovery/RunConfig unequal-size skips

Includes standalone argument-driven metadata/PPC proof and attempt log. Parent independently rebuilt in a separate review checkout and replayed both original and standalone proofs. Tested tree84acfe394de296e3ed9d45b0b3cc9f828654da96; selected object SHA256 feacf87770e385fe70dca985be22c1b93bfd557dea6855d9d60977f506ad31c2.

No original binaries/DOL uploaded. Draft for human review; no merge or auto-merge requested. Discovery recovery is reserved for a separate change.

Note

Recover ATERM association MAC formatting loops and add audit proof tooling

  • Replaces two duplicated MAC-formatting loops in ATERMBuildAssociationRequest with new atermFormatHexByte and atermFormatMacAddress helpers in ATERM.c
  • Adds a Python audit tool in aterm_association_recovery_audit.py that validates the recovered code against the original object. It compares ELF metadata and symbols, runs a small PPC interpreter and a sequential reference model over 6,656 generated cases, and writes JSON proof artifacts
  • Documents the recovery method, measurements, and limitations in aterm-association-recovery-20261004.md
  • Behavioral Change: the association-request builder now formats addresses through the shared helpers; output bytes and buffers are unchanged

Macroscope summarized 95c21a9.

## Change Recover h2b trial 61's real byte/MAC formatting helpers, replacing duplicated end-pointer loops with the target's six-count CTR loops. Both nibble values and output cursors are initialized and consumed. Existing input reads and high/low/NUL/colon store order are retained; no new dummy output arrays or flags. Historical provenance is exact: applying the preserved patch to 34858f3f reproduces the logged source SHA256 6fa4cc5bdf9ec05f63b18be1e148ccdfa3b61438f40c3e87342ae09c33047998. It had been restored because it remained nonexact. All current results below were freshly compiled and independently verified, not copied from that score. ## Independent verification on 9aa4a0d88748808c5b1e3a9e62518641a5624a72 - ATERMBuildAssociationRequest: 93.44361 -> 98.7594; unit 97.42845 -> 97.575714 - Actual 133 instructions / 532 bytes before, after and target; partial fuzzy improvement, not a new exact/link claim - All 25 siblings unchanged; all 20 existing official exact functions independently have zero instruction differences - Exact code 12200/19204, data 18584/18864, exact functions and link measures unchanged - Only ATERM changes across 1027 source objects/reports; all report changes are fuzzy improvements - All 145 raw symbol entries, all section headers, raw relocation tables and allocated nontext bytes identical. Four concrete local-object names change at stable indices22-25; exact index/type/section/extent proof, no broad name normalization - Fresh whole-function actual-PPC/sequential-reference proof: 6656 cases / 19968 baseline/candidate/original executions per run, full133/133 instruction coverage each. Tests cover every byte value separately at all six positions of both inputs, structured/random MAC pairs, four contained-alias layouts and four callback profiles - Return values, calls/arguments/order, complete read/write traces and allocated state agree; stack/LR/nonvolatile preservation verified - Limits: modeled memcpy/memcmp/NCD, valid allocated buffers, no hardware/formal/exhaustive2^96 claim. NCD-error cases still supply initialized output bytes; unwritten-byte behavior is not exploited - Default43U, explicit ok and DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d pass - Pool0/0; literal audit24 functions/7 arguments passes, retaining existing Discovery/RunConfig unequal-size skips Includes standalone argument-driven metadata/PPC proof and attempt log. Parent independently rebuilt in a separate review checkout and replayed both original and standalone proofs. Tested tree84acfe394de296e3ed9d45b0b3cc9f828654da96; selected object SHA256 feacf87770e385fe70dca985be22c1b93bfd557dea6855d9d60977f506ad31c2. No original binaries/DOL uploaded. Draft for human review; no merge or auto-merge requested. Discovery recovery is reserved for a separate change. <!-- 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] > ### Recover ATERM association MAC formatting loops and add audit proof tooling > - Replaces two duplicated MAC-formatting loops in `ATERMBuildAssociationRequest` with new `atermFormatHexByte` and `atermFormatMacAddress` helpers in [ATERM.c](https://github.com/coah80/wii-ipl/pull/1147/files#diff-e67bb234e10edec28359a3022bc49117cf56df7cd361cea3415fc9a54636e50d) > - Adds a Python audit tool in [aterm_association_recovery_audit.py](https://github.com/coah80/wii-ipl/pull/1147/files#diff-02ba037739d6eff4ff502f5de7c9f39ff6094b8f6760bfb3b9e06e04c261a4ba) that validates the recovered code against the original object. It compares ELF metadata and symbols, runs a small PPC interpreter and a sequential reference model over 6,656 generated cases, and writes JSON proof artifacts > - Documents the recovery method, measurements, and limitations in [aterm-association-recovery-20261004.md](https://github.com/coah80/wii-ipl/pull/1147/files#diff-9b82c7506f9ba0e03474ab8625446ebe397a7bf6ada6e9a748f1034334fa4f85) > - Behavioral Change: the association-request builder now formats addresses through the shared helpers; output bytes and buffers are unchanged > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 95c21a9.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-04 00:26:14 +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.