Recover ATERM discovery loop and timeout join (+2.984786 fuzzy) #1148

Merged
coah80 merged 1 commits from agent/aterm-discovery-recovery-20261004 into main 2026-10-04 01:22:18 +00:00
coah80 commented 2026-10-04 01:21:02 +00:00 (Migrated from github.com)

Change

Recover h2b trial 81's MAC formatting and shared timeout exit. Move the existing helper definitions intact before Discovery; do not duplicate them. Association remains instruction-identical to #1147. Preserve lazy final-time calls and cancellation reads, including the iteration-limit path skipping the final OSGetTime.

Historical patch provenance reproduces exact source SHA256 9f59e4faaf4b304fff6c417a9e69bdb0657c39397ac290f0480ebfe448b1647d; current helper-sharing context was independently rebuilt, not assumed equivalent from the old result. The old trial was restored because it remained nonexact.

Fresh independent verification on c5e1fe9cca

  • Discovery: 95.304184 -> 98.28897; unit: 97.575714 -> 97.73922
  • Actual 261 instructions / 1044 bytes before and after; target 263 / 1052. Partial fuzzy improvement, not exact or new linking
  • All 25 siblings including Association unchanged; all 20 existing exact functions independently have zero instruction differences
  • Exact code 12200/19204, data 18584/18864, exact/link measures unchanged; only ATERM changes across 1027 source objects/reports
  • All 145 symbol entries, section headers and allocated nontext identical. Four concrete private names change; precisely 14 owned relocation offsets move (one +4, thirteen +8), with identical symbol index/type/addend; other relocation entries unchanged
  • Fresh whole-function PPC/reference proof: 2008 cases / 6024 baseline/candidate/original executions per run, complete 261/261/263 instruction coverage
  • Tests cover all256 byte values at each MAC position, allocation/scan/error/cleanup paths, four valid layouts, five callback profiles, deadline equality/wrap and reachable iteration299/300 lazy paths. Values above300 are unreachable under the checked loop/ABI and untested
  • Returns, calls/order/arguments, nonstack memory and actual private MAC-store traces, final allocated state and ABI preservation pass
  • Modeled external contracts, no hardware/formal/all-input claim; malformed descriptors, invalid copies and unchecked third-allocation failure excluded
  • Initial proof-loader corrections and one baseline/reference ordering failure are preserved. The reference now orders a read of ordinary .sdata deadline before the independent ordinary .sbss state store, matching target; distinct storage/no intervening call or volatile access verified. No trace events filtered, no source changed to satisfy tests
  • Default43U, explicit ok, DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d pass
  • Pool0/0 and literal24 functions/7 arguments pass; existing Discovery/RunConfig size skips retained, with separate actual Discovery proof

Includes repeatable standalone metadata/PPC proof and log. Also corrects one prior documentation typo: Association symbol24 is .sdata2, not .sdata; immutable evidence already had the correct section.

Parent independently rebuilt and replayed original/standalone proofs. Tested tree3e85cdf166d71675478bb53422eeae57c3f71543; object SHA256 5498cfc85de5aa41eec67d461c8d287aa62f2a3932414c83a6967d852fc8f813.

No original binaries/DOL included. Draft for human review; no merge or auto-merge requested.

Note

Recover ATERM discovery loop and timeout join in ATERMDiscoverAccessPoints

  • Recovers the discovery loop and timeout handling in ATERMDiscoverAccessPoints in ATERM.c, rejoining the iteration-limit and elapsed-time failure branches under one timed-out label. The iteration-limit path still skips the final time read.
  • Moves the atermFormatHexByte and atermFormatMacAddress helpers above ATERMDiscoverAccessPoints, unchanged, and the discovery routine now calls the MAC formatter instead of an inline loop.
  • Adds an audit program in aterm_discovery_recovery_audit.py that runs 2008 generated cases through a PPC interpreter against baseline, candidate, and original DOL functions, compares against a sequential reference model, and writes JSON evidence or a model-failure record.
  • Adds the recovery report in aterm-discovery-recovery-20261004.md and fixes a symbol section in aterm-association-recovery-20261004.md from .sdata to .sdata2.

Macroscope summarized 4362477.

## Change Recover h2b trial 81's MAC formatting and shared timeout exit. Move the existing helper definitions intact before Discovery; do not duplicate them. Association remains instruction-identical to #1147. Preserve lazy final-time calls and cancellation reads, including the iteration-limit path skipping the final OSGetTime. Historical patch provenance reproduces exact source SHA256 9f59e4faaf4b304fff6c417a9e69bdb0657c39397ac290f0480ebfe448b1647d; current helper-sharing context was independently rebuilt, not assumed equivalent from the old result. The old trial was restored because it remained nonexact. ## Fresh independent verification on c5e1fe9cca350e658bf99aa50efd59ad16481f62 - Discovery: 95.304184 -> 98.28897; unit: 97.575714 -> 97.73922 - Actual 261 instructions / 1044 bytes before and after; target 263 / 1052. Partial fuzzy improvement, not exact or new linking - All 25 siblings including Association unchanged; all 20 existing exact functions independently have zero instruction differences - Exact code 12200/19204, data 18584/18864, exact/link measures unchanged; only ATERM changes across 1027 source objects/reports - All 145 symbol entries, section headers and allocated nontext identical. Four concrete private names change; precisely 14 owned relocation offsets move (one +4, thirteen +8), with identical symbol index/type/addend; other relocation entries unchanged - Fresh whole-function PPC/reference proof: 2008 cases / 6024 baseline/candidate/original executions per run, complete 261/261/263 instruction coverage - Tests cover all256 byte values at each MAC position, allocation/scan/error/cleanup paths, four valid layouts, five callback profiles, deadline equality/wrap and reachable iteration299/300 lazy paths. Values above300 are unreachable under the checked loop/ABI and untested - Returns, calls/order/arguments, nonstack memory and actual private MAC-store traces, final allocated state and ABI preservation pass - Modeled external contracts, no hardware/formal/all-input claim; malformed descriptors, invalid copies and unchecked third-allocation failure excluded - Initial proof-loader corrections and one baseline/reference ordering failure are preserved. The reference now orders a read of ordinary .sdata deadline before the independent ordinary .sbss state store, matching target; distinct storage/no intervening call or volatile access verified. No trace events filtered, no source changed to satisfy tests - Default43U, explicit ok, DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d pass - Pool0/0 and literal24 functions/7 arguments pass; existing Discovery/RunConfig size skips retained, with separate actual Discovery proof Includes repeatable standalone metadata/PPC proof and log. Also corrects one prior documentation typo: Association symbol24 is .sdata2, not .sdata; immutable evidence already had the correct section. Parent independently rebuilt and replayed original/standalone proofs. Tested tree3e85cdf166d71675478bb53422eeae57c3f71543; object SHA256 5498cfc85de5aa41eec67d461c8d287aa62f2a3932414c83a6967d852fc8f813. No original binaries/DOL included. 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] > ### Recover ATERM discovery loop and timeout join in `ATERMDiscoverAccessPoints` > - Recovers the discovery loop and timeout handling in `ATERMDiscoverAccessPoints` in [ATERM.c](https://github.com/coah80/wii-ipl/pull/1148/files#diff-e67bb234e10edec28359a3022bc49117cf56df7cd361cea3415fc9a54636e50d), rejoining the iteration-limit and elapsed-time failure branches under one timed-out label. The iteration-limit path still skips the final time read. > - Moves the `atermFormatHexByte` and `atermFormatMacAddress` helpers above `ATERMDiscoverAccessPoints`, unchanged, and the discovery routine now calls the MAC formatter instead of an inline loop. > - Adds an audit program in [aterm_discovery_recovery_audit.py](https://github.com/coah80/wii-ipl/pull/1148/files#diff-bb64bda16fbb811e9d04a3827d8708d08e040665fcf0d59fecef9d8b44077b0c) that runs 2008 generated cases through a PPC interpreter against baseline, candidate, and original DOL functions, compares against a sequential reference model, and writes JSON evidence or a model-failure record. > - Adds the recovery report in [aterm-discovery-recovery-20261004.md](https://github.com/coah80/wii-ipl/pull/1148/files#diff-f196f59afdb6a0b02347c034fc14961e263de9b15f119b0469d89e64a8342d81) and fixes a symbol section in [aterm-association-recovery-20261004.md](https://github.com/coah80/wii-ipl/pull/1148/files#diff-9b82c7506f9ba0e03474ab8625446ebe397a7bf6ada6e9a748f1034334fa4f85) from `.sdata` to `.sdata2`. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 4362477.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-04 01:22:16 +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.