Improve card loader comment-bounds rejection (+0.41015 fuzzy) #1146

Merged
coah80 merged 1 commits from agent/card-comment-short-circuit-20261003 into main 2026-10-03 23:27:11 +00:00
coah80 commented 2026-10-03 23:26:48 +00:00 (Migrated from github.com)

Change

Share the two invalid comment-base rejection arms through built-in short-circuit evaluation. The real fileSize value is assigned only on the nonnegative-base path and used only when that assignment executed. Preserve the separate end-offset rejection, metadata/callback ordering, and negative CARD results.

Independently verified on db6157b693

  • loadCardFileIcons: 90.37305 -> 90.7832; unit: 97.225334 -> 97.3106
  • Actual instructions: 508 -> 506; target 512. This is a partial fuzzy improvement, not an exact match or new linked-source claim
  • All 29 sibling bodies unchanged; all 27 existing exact functions independently disassemble identically to target
  • Exact code 4168/9852, data 1496/1496, function and link measures preserved; only this unit/object changes across all 1027
  • Whole-body proof maps every surviving instruction, operand, branch and relocation. Removes only the old duplicate li-zero/branch; common rejection now precedes the valid end-offset path like target
  • Exact symbol/relocation accounting includes 46 concrete compiler-local .data name pairs; no blanket name normalization. Original conservative name-gate rejection is preserved and separately resolved
  • Fresh bounded PPC slice: 1920 cases / 5760 executions, baseline/candidate/original compared to sequential reference; complete comment/return-region instruction coverage, valid contained aliases and six callback-mutation profiles
  • Scope limits: modeled SDK calls, unchanged image prefix not executed, no hardware/formal/all-input claim
  • Default 43U build, explicit ok, pool 43/43, literal audit 29 functions/45 arguments pass. Loader is explicitly skipped by generic literal audit for unequal size; its actual call/relocation/behavior proof is separate
  • DOL SHA1 unchanged: 26116613f624061ba99c8d1a299aaa6efa85670d

Included attempt log and standalone argument-driven PPC proof script. Source and evidence were independently rebuilt/replayed in a separate parent review tree. Tested tree: 125f757de2. Selected object SHA256: 58992542a70254d76f10d7933d15920d88bb9bc9277e120d42df0a99038bc6bf.

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

Note

Short-circuit comment-bounds rejection in iplCardSequence::loadCardFileIcons (+0.41015 fuzzy)

  • Reworks the comment-buffer bounds block in iplCardSequence::loadCardFileIcons so the negative-base and upper-base checks share one short-circuit rejection condition, and scopes the file-size calculation inside that block. End-offset validation, card read, buffer clearing, comment copy, and label flow are unchanged.
  • Adds an audit tool card_comment_short_circuit_audit.py that loads baseline, candidate, original ELF/DOL, and symbols, verifies the candidate's instruction and relocation mapping, and executes 1,920 cases (5,760 instruction-model runs and 1,920 reference runs) through a bounded PPC interpreter, comparing baseline, candidate, and reference behavior.
  • Adds an evidence report card-comment-short-circuit-20261003.md covering the selected source form, measured object differences, build/hash validation, and saved-only and fresh-proof commands.
  • Risk: none — the rejection condition is logically equivalent to the previous separate checks; see the case-generation and audit loop in card_comment_short_circuit_audit.py for coverage evidence.

Macroscope summarized 0a23e81.

## Change Share the two invalid comment-base rejection arms through built-in short-circuit evaluation. The real fileSize value is assigned only on the nonnegative-base path and used only when that assignment executed. Preserve the separate end-offset rejection, metadata/callback ordering, and negative CARD results. ## Independently verified on db6157b693be9cbd8daa01693e5334d1bc5c2657 - loadCardFileIcons: 90.37305 -> 90.7832; unit: 97.225334 -> 97.3106 - Actual instructions: 508 -> 506; target 512. This is a partial fuzzy improvement, not an exact match or new linked-source claim - All 29 sibling bodies unchanged; all 27 existing exact functions independently disassemble identically to target - Exact code 4168/9852, data 1496/1496, function and link measures preserved; only this unit/object changes across all 1027 - Whole-body proof maps every surviving instruction, operand, branch and relocation. Removes only the old duplicate li-zero/branch; common rejection now precedes the valid end-offset path like target - Exact symbol/relocation accounting includes 46 concrete compiler-local .data name pairs; no blanket name normalization. Original conservative name-gate rejection is preserved and separately resolved - Fresh bounded PPC slice: 1920 cases / 5760 executions, baseline/candidate/original compared to sequential reference; complete comment/return-region instruction coverage, valid contained aliases and six callback-mutation profiles - Scope limits: modeled SDK calls, unchanged image prefix not executed, no hardware/formal/all-input claim - Default 43U build, explicit ok, pool 43/43, literal audit 29 functions/45 arguments pass. Loader is explicitly skipped by generic literal audit for unequal size; its actual call/relocation/behavior proof is separate - DOL SHA1 unchanged: 26116613f624061ba99c8d1a299aaa6efa85670d Included attempt log and standalone argument-driven PPC proof script. Source and evidence were independently rebuilt/replayed in a separate parent review tree. Tested tree: 125f757de23bda7b0b8cad78472508a5f94a0506. Selected object SHA256: 58992542a70254d76f10d7933d15920d88bb9bc9277e120d42df0a99038bc6bf. No binaries or original 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] > ### Short-circuit comment-bounds rejection in `iplCardSequence::loadCardFileIcons` (+0.41015 fuzzy) > - Reworks the comment-buffer bounds block in `iplCardSequence::loadCardFileIcons` so the negative-base and upper-base checks share one short-circuit rejection condition, and scopes the file-size calculation inside that block. End-offset validation, card read, buffer clearing, comment copy, and label flow are unchanged. > - Adds an audit tool [card_comment_short_circuit_audit.py](https://github.com/coah80/wii-ipl/pull/1146/files#diff-957dcf742f406670e7c6e25655f1732bd238ece533ac3ddba810beb3ae08def2) that loads baseline, candidate, original ELF/DOL, and symbols, verifies the candidate's instruction and relocation mapping, and executes 1,920 cases (5,760 instruction-model runs and 1,920 reference runs) through a bounded PPC interpreter, comparing baseline, candidate, and reference behavior. > - Adds an evidence report [card-comment-short-circuit-20261003.md](https://github.com/coah80/wii-ipl/pull/1146/files#diff-248b0537af2f21bffb187ab82a619fb6ea82c707beb9766b65633198b5f487a0) covering the selected source form, measured object differences, build/hash validation, and saved-only and fresh-proof commands. > - Risk: none — the rejection condition is logically equivalent to the previous separate checks; see the case-generation and audit loop in `card_comment_short_circuit_audit.py` for coverage evidence. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 0a23e81.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 23:27:09 +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.