Restore SDK path function order and link natively #772

Merged
coah80 merged 1 commits from agent/bittle/pf-path-link into main 2026-10-02 08:00:54 +00:00
coah80 commented 2026-10-02 07:59:37 +00:00 (Migrated from github.com)

Scope

Follow #769's extent correction with native linking. Move the unchanged PFPATH_MatchFileNameWithPattern definition after PFPATH_GetVolumeFromPath and before PFPATH_putShortName, leave a normal forward declaration at its old location, and set the SDK fa/pf_path Matching flag. No function body, compiler flag, metadata, data initializer, or padding change.

The flag-only attempt failed: the 784-byte matcher was emitted 2,368 bytes too early, shifting nine intervening functions +784 bytes. The definition move restores target order and the complete DOL.

Verification after rebase on 51d5dc519b

  • 27/27 instruction-exact functions, 11,872/11,872 exact code.
  • Full 43U all_source/progress/report/ok build passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d.
  • +11,872 linked code, +56 linked data, +1 complete unit. No new exact-code/data-score gain claimed.
  • All 1,027 source-object audit: only pf_path .text changes, retaining its 11,872-byte size. Every other object's allocated bytes and normalized relocations remain unchanged.
  • Global link-address audit: 0 differences.
  • .data string pool 0/0 identical; literal-reference audit 27 functions, 2 compared arguments, 0 candidates/errors/skips.
  • Tests: workflow 8, literal 36, jump-table 27, pool 8 pass. Diff/worktree checks pass.
  • Published tree 666104f312 matches tested local tree.

Honest data-score limit

Objdiff still reports only 8/56 matched data (14.285715%) and .sdata 97.87234%; those scores are unchanged. Raw .sdata is exactly 48/48 bytes with no relocations. Native .sdata2 has 6 bytes identical to the reference prefix; the reference has two trailing zero alignment bytes, reproduced naturally by the linked image. No artificial padding or symbol-size edits are added to raise that score. The exact full DOL is the linkage evidence; this PR does not claim the unit's reported data metric is 100%.

Draft for review; no merge performed.

Note

Mark fa/pf_path.c as Matching and restore SDK function order

Moves PFPATH_MatchFileNameWithPattern to a later position in pf_path.c to match the original SDK layout, with a forward declaration left at the old location. The function body is unchanged. configure.py now builds fa/pf_path.c as a Matching object in the system library instead of NonMatching.

Macroscope summarized ae7257a.

## Scope Follow #769's extent correction with native linking. Move the unchanged PFPATH_MatchFileNameWithPattern definition after PFPATH_GetVolumeFromPath and before PFPATH_putShortName, leave a normal forward declaration at its old location, and set the SDK fa/pf_path Matching flag. No function body, compiler flag, metadata, data initializer, or padding change. The flag-only attempt failed: the 784-byte matcher was emitted 2,368 bytes too early, shifting nine intervening functions +784 bytes. The definition move restores target order and the complete DOL. ## Verification after rebase on 51d5dc519bb5dc87c2cd284a7d3a74a6b87d32da - 27/27 instruction-exact functions, 11,872/11,872 exact code. - Full 43U all_source/progress/report/ok build passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. - +11,872 linked code, +56 linked data, +1 complete unit. No new exact-code/data-score gain claimed. - All 1,027 source-object audit: only pf_path .text changes, retaining its 11,872-byte size. Every other object's allocated bytes and normalized relocations remain unchanged. - Global link-address audit: 0 differences. - .data string pool 0/0 identical; literal-reference audit 27 functions, 2 compared arguments, 0 candidates/errors/skips. - Tests: workflow 8, literal 36, jump-table 27, pool 8 pass. Diff/worktree checks pass. - Published tree 666104f312b0d6ae193b59350808aa7d10f68ef3 matches tested local tree. ## Honest data-score limit Objdiff still reports only 8/56 matched data (14.285715%) and .sdata 97.87234%; those scores are unchanged. Raw .sdata is exactly 48/48 bytes with no relocations. Native .sdata2 has 6 bytes identical to the reference prefix; the reference has two trailing zero alignment bytes, reproduced naturally by the linked image. No artificial padding or symbol-size edits are added to raise that score. The exact full DOL is the linkage evidence; this PR does not claim the unit's reported data metric is 100%. Draft for review; no merge performed. <!-- 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] > ### Mark `fa/pf_path.c` as Matching and restore SDK function order > Moves `PFPATH_MatchFileNameWithPattern` to a later position in [pf_path.c](https://github.com/coah80/wii-ipl/pull/772/files#diff-33752e9f7203f476ffde0ab53aa38f1284518b36cbd4e878070600140b922e4a) to match the original SDK layout, with a forward declaration left at the old location. The function body is unchanged. [configure.py](https://github.com/coah80/wii-ipl/pull/772/files#diff-4d5f3192809ec1b9add6b33007e0c50031ad9a0a2f3f55a481b506468824db2c) now builds `fa/pf_path.c` as a Matching object in the system library instead of NonMatching. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized ae7257a.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 08:00:52 +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.