fix(sd): restore event metadata predicates #1010

Merged
coah80 merged 1 commits from agent/bittle/sd-event-predicates into main 2026-10-03 01:08:15 +00:00
coah80 commented 2026-10-03 01:07:21 +00:00 (Migrated from github.com)

Confirmed wrong-callee correction

Replace four event-handler calls to isChannelReady with the original hasAppMeta predicate. These are not aliases: isChannelReady reads channel offset 0x14 and accepts only state 3; hasAppMeta reads offset 0x84 and accepts flags 0 or 3.

Parent independently decoded the original DOL branches at 0x813E29D8, 0x813E2A90, 0x813E2ACC and 0x813E2B24: all target 0x813E3330 (hasAppMeta), not 0x813DF1E4 (isChannelReady). The original file SHA1 and extracted ELF relocations agree.

Independent verification

  • onEvent was already reported 100%, but had four wrong callee references. It now has relocation-aware ctxdiff zero, 168/168 instructions
  • Exactly four call relocation targets change; all allocated payload bytes, function extents and other normalized relocations are unchanged
  • Every report measure is unchanged across 1027 units; no percentage gain claimed
  • Parent reran 198 extracted-handler cases under ASan/UBSan, including 64 distinguishing state/flag/event combinations and existing scene/card/controller guards
  • State 0/flags 0 is accepted by target; state 3/flags 2 is rejected. The corrected source agrees
  • Pool 101/101 and literal audit clean; full 43U all_source/report/progress/DOL and worktree/diff checks pass

Tests use modeled event/controller/scene objects, not Wii runtime execution. Equivalent VEC3 constructor aliases are untouched. No header, metadata, layout, scissor or linking change.

Parent baseline: 7d6057adf6
Tested tree: 4667867157
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Fix SD channel event predicates to use app-metadata check

  • Replaces the channel-readiness predicate with the app-metadata predicate in SDChannelSelectEventHandler::onEvent at the trigger, drag, point, and leave call sites in iplSDChannelSelect.cpp
  • All scene-state, controller, broken-card, write-protection, and channel-limit guards stay unchanged
  • Adds a technical report (sd-selection-event-predicate-20261003.md) covering evidence, tests, and verification
  • Behavioral Change: the new predicate accepts channel state-flag values 0 and 3, where the old one accepted only 3, so events may now dispatch on channels previously filtered out

Macroscope summarized 2aec402.

## Confirmed wrong-callee correction Replace four event-handler calls to isChannelReady with the original hasAppMeta predicate. These are not aliases: isChannelReady reads channel offset 0x14 and accepts only state 3; hasAppMeta reads offset 0x84 and accepts flags 0 or 3. Parent independently decoded the original DOL branches at 0x813E29D8, 0x813E2A90, 0x813E2ACC and 0x813E2B24: all target 0x813E3330 (hasAppMeta), not 0x813DF1E4 (isChannelReady). The original file SHA1 and extracted ELF relocations agree. ## Independent verification - onEvent was already reported 100%, but had four wrong callee references. It now has relocation-aware ctxdiff zero, 168/168 instructions - Exactly four call relocation targets change; all allocated payload bytes, function extents and other normalized relocations are unchanged - Every report measure is unchanged across 1027 units; no percentage gain claimed - Parent reran 198 extracted-handler cases under ASan/UBSan, including 64 distinguishing state/flag/event combinations and existing scene/card/controller guards - State 0/flags 0 is accepted by target; state 3/flags 2 is rejected. The corrected source agrees - Pool 101/101 and literal audit clean; full 43U all_source/report/progress/DOL and worktree/diff checks pass Tests use modeled event/controller/scene objects, not Wii runtime execution. Equivalent VEC3 constructor aliases are untouched. No header, metadata, layout, scissor or linking change. Parent baseline: 7d6057adf62fab8b0d39c545af8fc7a05f524ac9 Tested tree: 4667867157ea822d5e792e2fed74b7b2f5dccb41 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] > ### Fix SD channel event predicates to use app-metadata check > - Replaces the channel-readiness predicate with the app-metadata predicate in `SDChannelSelectEventHandler::onEvent` at the trigger, drag, point, and leave call sites in [iplSDChannelSelect.cpp](https://github.com/coah80/wii-ipl/pull/1010/files#diff-e53501e65bee666a9170934feea187bf6eca90a50d75b60f63ea84bc4af67569) > - All scene-state, controller, broken-card, write-protection, and channel-limit guards stay unchanged > - Adds a technical report ([sd-selection-event-predicate-20261003.md](https://github.com/coah80/wii-ipl/pull/1010/files#diff-7752d3bd85cf28d51ce343811f23a9216fe57678d7c9af43a9efcb5cc9b4e97f)) covering evidence, tests, and verification > - Behavioral Change: the new predicate accepts channel state-flag values 0 and 3, where the old one accepted only 3, so events may now dispatch on channels previously filtered out > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 2aec402.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 01:08:13 +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.