Skip to content

Baseline-settings pass: remove per-function optimizer toggles where plain C matches - #6

Merged
Raikaru merged 29 commits into
mainfrom
pragmas/baseline
Oct 20, 2026
Merged

Raikaru merged 29 commits into
mainfrom
pragmas/baseline

Conversation

@Raikaru

@Raikaru Raikaru commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Baseline-settings pass, follow-up to #5. Per-function optimizer toggles are matching tools, not original source. For each first-party function whose toggles differed from the rest of its unit, this pass removed the toggle and looked for plain C that matches under the unit's own settings. Repeated per-function push/toggle/pop scaffolding is replaced by one commented unit setting near the top of the file. Matching is unchanged at every commit: 6860/6860 first-party MATCH, 8101 C functions linked, both retail SHA-1s OK. Recovery quality stays 100% named/typed/documented.

First-party optimizer-toggle lines main This PR
opt_loop_invariants 1,068 411
opt_propagation 1,046 375
opt_rebuildconditionals 276 46
opt_common_subs 254 96
opt_lifetimes 80 58
opt_dead_assignments 35 13
opt_pulloutconstants 23 19
opt_scalarize 21 4
Total (files with any) 2,803 (315) 1,022 (294)
  • Converted functions. Some needed no change at all once the toggle was gone. Others needed small honest source changes, such as a named snapshot of a loop-invariant value, a separate block-local counter instead of a reused local, a typed table pointer, or a switch in place of an if chain. No new helpers, volatile, asm or dummy locals.
  • Kept toggles. Each one has a one-line measured: comment saying what was tried and the residual without it. Per-function probe records are in the slice TSVs (not committed).
  • Untouched. schedule, tailcall, no_branch_likely and VU0 settings are unchanged. Six redundant optimization_level 2 restores inside repeated scaffolding were removed, and the files still match.
  • Lint. All five pre-existing unbalanced #pragma push scopes (P001) are fixed, so decomp_lint.py --errors-only is now clean across first-party code (it reported 5 errors on main). H003 warnings dropped in every slice.
  • Docs. docs/STYLE.md now says unit settings are stated once and per-function toggles need a measurement. It also notes that an optimization_level directive can reset the toggles.

Verification

Each commit was gated on whole-tree tools/verify.py (6860/6860), tools/build.py (8101 linked, both SHA-1s), no new decomp_lint.py errors in changed files, and the unit tests. Every slice also re-ran tools/recovery_quality.py on its files.

…units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
… EPL units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…combine units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…l manager

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
… and kernel units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…title and battle-calculation units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
… unit units; battle data, panel, scene and script units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…ed, calendar and community units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…d and message-manager units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…list units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…repeated unit settings

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…unplaced field units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…r units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
… title, facility and community units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…shuffle sequence units

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…, thunder and track effects

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…p unit settings

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…eld unit settings

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
… scene and Yajima unit settings

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
…mmunity, calendar, GSL and font unit settings

First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
@Raikaru
Raikaru deployed to p4-proprietary October 20, 2026 21:29 — with GitHub Actions Active
@Raikaru
Raikaru deployed to p4-proprietary October 20, 2026 21:29 — with GitHub Actions Active
First-party 6860/6860 MATCH; 8101 C functions linked; both retail SHA-1s OK.
@Raikaru
Raikaru deployed to p4-proprietary October 20, 2026 21:34 — with GitHub Actions Active
@Raikaru
Raikaru deployed to p4-proprietary October 20, 2026 21:34 — with GitHub Actions Active
@decomp-dev

decomp-dev Bot commented Oct 20, 2026

Copy link
Copy Markdown

Report for SLUS_217.82 (108806e - 6358f06)

No changes

@Raikaru
Raikaru merged commit 8a77688 into main Oct 20, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
p4-proprietary — 6358f06c Deployed Oct 20, 2026 by Raikaru via Proprietary build and verify #2709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant