decomp(nwc24): reconstruct writable-task validation lifetimes #1058

Merged
coah80 merged 1 commits from agent/bittle/nwc24-permission-review into main 2026-10-03 05:51:40 +00:00
coah80 commented 2026-10-03 05:50:16 +00:00 (Migrated from github.com)

Partial reconstruction

Give NWC24UpdateDlTask's two existing writable validations a private operation-local helper. Preserve cached-header acquisition, null/range errors, tool→owner→group query order, group-ID capture before its callback, and the second failure's existing behavior of suppressing only two reset stores. The shared validator used by other APIs is unchanged; no resource, dummy state or optimization barrier is added.

  • UpdateDlTask: 95.00395% → 98.695656%; 249 → 253/253 instructions, original 0x20 frame recovered
  • Unit: 99.252884% → 99.55186%
  • All 27 exact functions, 9,304 matched code bytes and 80/80 data bytes preserved

This remains a partial fuzzy gain, not an exact or linking claim.

Independent verification

Base 81ba279958fa6bbee69b5f14762243dd258ded6f; tested tree 5ceaef9188.

  • Full 43U build/progress/report/DOL passed; all 1,027 units compared, only this function's fuzzy changes, no regressions
  • 262,144 exhaustive group/flag/mutation cases, seven directed null/range/query/store-suppression cases and 60,000 production-source differential update scenarios pass ASan/UBSan; leak detection disabled under ptrace
  • Candidate and original place all nine calls at identical instruction indices/destinations; both group IDs are captured before querying
  • All 29 unrelated function streams/resolved relocations and allocated data unchanged; 27 exact functions independently checked
  • Pool 3/3 identical; literal audit five arguments/29 functions, no candidates/errors; pre-existing unequal-extent AddTaskInternal skipped
  • DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; worktree/diff checks pass

Focused modeled callback tests are not Wii runtime verification. Details: tools/decomp-assist/allhands-nwc24-write-permission.attempts.md. No retry-helper expansion, linking flags or shared headers changed.

Note

Add NWC24ValidateWritableDlTask validator for writable download tasks

  • Adds a private inline writable-task validator in NWC24Download.c. It checks the cached download-task header, rejects null tasks or an unavailable library, applies the existing tool/owner bypass plus group-and-flag permission rules, and validates non-sentinel task IDs against the cached maximum.
  • Replaces both calls to the prior writable validation routine in NWC24UpdateDlTask with ValidateWritableDlTask. The second validation still only controls whether the two reset fields are cleared; retry and store flows are unchanged.
  • Adds allhands-nwc24-write-permission.attempts.md with the source-recovery report for this validator.

Macroscope summarized 86679ae.

## Partial reconstruction Give NWC24UpdateDlTask's two existing writable validations a private operation-local helper. Preserve cached-header acquisition, null/range errors, tool→owner→group query order, group-ID capture before its callback, and the second failure's existing behavior of suppressing only two reset stores. The shared validator used by other APIs is unchanged; no resource, dummy state or optimization barrier is added. - UpdateDlTask: 95.00395% → 98.695656%; 249 → 253/253 instructions, original 0x20 frame recovered - Unit: 99.252884% → 99.55186% - All 27 exact functions, 9,304 matched code bytes and 80/80 data bytes preserved This remains a partial fuzzy gain, not an exact or linking claim. ## Independent verification Base 81ba279958fa6bbee69b5f14762243dd258ded6f; tested tree 5ceaef9188e200094e12463b1c69b949784ac55e. - Full 43U build/progress/report/DOL passed; all 1,027 units compared, only this function's fuzzy changes, no regressions - 262,144 exhaustive group/flag/mutation cases, seven directed null/range/query/store-suppression cases and 60,000 production-source differential update scenarios pass ASan/UBSan; leak detection disabled under ptrace - Candidate and original place all nine calls at identical instruction indices/destinations; both group IDs are captured before querying - All 29 unrelated function streams/resolved relocations and allocated data unchanged; 27 exact functions independently checked - Pool 3/3 identical; literal audit five arguments/29 functions, no candidates/errors; pre-existing unequal-extent AddTaskInternal skipped - DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; worktree/diff checks pass Focused modeled callback tests are not Wii runtime verification. Details: tools/decomp-assist/allhands-nwc24-write-permission.attempts.md. No retry-helper expansion, linking flags or shared headers changed. <!-- 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] > ### Add `NWC24ValidateWritableDlTask` validator for writable download tasks > - Adds a private inline writable-task validator in [NWC24Download.c](https://github.com/coah80/wii-ipl/pull/1058/files#diff-53d34245eea66baaef0947859495617886b7635ba408f2008242fdbc73404009). It checks the cached download-task header, rejects null tasks or an unavailable library, applies the existing tool/owner bypass plus group-and-flag permission rules, and validates non-sentinel task IDs against the cached maximum. > - Replaces both calls to the prior writable validation routine in `NWC24UpdateDlTask` with `ValidateWritableDlTask`. The second validation still only controls whether the two reset fields are cleared; retry and store flows are unchanged. > - Adds [allhands-nwc24-write-permission.attempts.md](https://github.com/coah80/wii-ipl/pull/1058/files#diff-7396f421e5f550230a33e492b3910f9052c3fb454f913f2eb4c26db32e6f7b0d) with the source-recovery report for this validator. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 86679ae.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 05:51:38 +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.