Improve NWC24InitDlTask writable validation (98.923615 → 99.201385%) #1144

Merged
coah80 merged 1 commits from agent/bittle/nwc24-writable-helper into main 2026-10-03 21:33:15 +00:00
coah80 commented 2026-10-03 21:32:19 +00:00 (Migrated from github.com)

Change

Move the two existing writable-validation helpers unchanged before NWC24InitDlTask, then use ValidateWritableDlTask instead of ValidateDlTask(..., TRUE) only in Init. No duplicated helper, implicit declaration, new layout/alias assumption or other caller change. The archived idea is recovered, but its exact rejected patch/placement was unavailable.

Fresh results

  • Init98.923615 →99.201385%; unit99.950386 →99.96319%
  • 144/144 instructions,576bytes,frame0x60 unchanged
  • Exact29/30,code11920/12496,data80/80,linking preserved
  • Global99.73627 →99.73631 on current base

Independent parent verification

Rebased on38cb84c8; tested tree89d7b9059ef543bad8d431e105ae586e9d64f938. Fresh full default43U build and explicit ok pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. All1027 whole objects compared: only NWC24Download differs; all1026 other complete unit records unchanged. No function/exact/data/link regressions. All29 exact siblings independently zero instruction differences. Pool3strings and literal audit30functions/7arguments pass with no skips.

Only10 instruction words change, all register operands. Parent independently verified the separate high/low ID, cached-header and group-ID definition/use lifetimes, unchanged branches/calls/field offsets and all sibling text. All allocated nontext bytes, relocation sections, ELF/section headers and raw symbol rows are identical. Exactly three local STT_OBJECT labels advance by6 in .strtab; their identities, offsets, sizes and relocation indices are explicitly accounted.

Getters are NOT assumed pure: GetGroupId may invoke NAND and modify workspace state. Field snapshots, conditional getter calls, cached header lifetime and later ID/capacity reads remain ordered identically. A separately rerun126000-case source-contract model covers returns/read-call traces/state effects with getter mutations; this is not PPC or hardware execution. Original DOL128nonrelocated words and12linked branch destinations verified. Remaining23raw target instruction differences are disclosed; diagnostic lifetime comparison was never applied to scoring.

Source and concise evidence log only; original binaries/raw evidence stay local. Draft for review; no merge or auto-merge requested.

Note

Use ValidateWritableDlTask in NWC24InitDlTask writable validation

NWC24InitDlTask now calls ValidateWritableDlTask instead of ValidateDlTask with the write flag set to TRUE in NWC24Download.c. The helper checks the task pointer, library-open state, ownership or writable-group authorization, and task-ID capacity. The IsDlTaskWritableGroup and ValidateWritableDlTask helpers moved above NWC24InitDlTask with no logic changes.

Macroscope summarized 6dd9dc9.

## Change Move the two existing writable-validation helpers unchanged before NWC24InitDlTask, then use ValidateWritableDlTask instead of ValidateDlTask(..., TRUE) only in Init. No duplicated helper, implicit declaration, new layout/alias assumption or other caller change. The archived idea is recovered, but its exact rejected patch/placement was unavailable. ## Fresh results - Init98.923615 →99.201385%; unit99.950386 →99.96319% - 144/144 instructions,576bytes,frame0x60 unchanged - Exact29/30,code11920/12496,data80/80,linking preserved - Global99.73627 →99.73631 on current base ## Independent parent verification Rebased on38cb84c8; tested tree89d7b9059ef543bad8d431e105ae586e9d64f938. Fresh full default43U build and explicit ok pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. All1027 whole objects compared: only NWC24Download differs; all1026 other complete unit records unchanged. No function/exact/data/link regressions. All29 exact siblings independently zero instruction differences. Pool3strings and literal audit30functions/7arguments pass with no skips. Only10 instruction words change, all register operands. Parent independently verified the separate high/low ID, cached-header and group-ID definition/use lifetimes, unchanged branches/calls/field offsets and all sibling text. All allocated nontext bytes, relocation sections, ELF/section headers and raw symbol rows are identical. Exactly three local STT_OBJECT labels advance by6 in .strtab; their identities, offsets, sizes and relocation indices are explicitly accounted. Getters are NOT assumed pure: GetGroupId may invoke NAND and modify workspace state. Field snapshots, conditional getter calls, cached header lifetime and later ID/capacity reads remain ordered identically. A separately rerun126000-case source-contract model covers returns/read-call traces/state effects with getter mutations; this is not PPC or hardware execution. Original DOL128nonrelocated words and12linked branch destinations verified. Remaining23raw target instruction differences are disclosed; diagnostic lifetime comparison was never applied to scoring. Source and concise evidence log only; original binaries/raw evidence stay local. Draft for 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] > ### Use `ValidateWritableDlTask` in `NWC24InitDlTask` writable validation > `NWC24InitDlTask` now calls `ValidateWritableDlTask` instead of `ValidateDlTask` with the write flag set to `TRUE` in [NWC24Download.c](https://github.com/coah80/wii-ipl/pull/1144/files#diff-53d34245eea66baaef0947859495617886b7635ba408f2008242fdbc73404009). The helper checks the task pointer, library-open state, ownership or writable-group authorization, and task-ID capacity. The `IsDlTaskWritableGroup` and `ValidateWritableDlTask` helpers moved above `NWC24InitDlTask` with no logic changes. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 6dd9dc9.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 21:33: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.