Skip to content

Drop the :rms fit criterion and the -1 m_max/nd_max sentinel - #50

Merged
DavidSagan merged 1 commit into
mainfrom
dev/100
Aug 9, 2026
Merged

Drop the :rms fit criterion and the -1 m_max/nd_max sentinel#50
DavidSagan merged 1 commit into
mainfrom
dev/100

Conversation

@DavidSagan

@DavidSagan DavidSagan commented Aug 9, 2026

Copy link
Copy Markdown
Member

fit_criterion = :rms charged nothing for coefficients, so it always selected
the largest model offered in a scan. It was documented as a way to inspect the
raw residual ranking, but the scan table already reports rms_weighted for every
candidate, so it never chose a fit anyone wanted. Removing it also retires the
weight total W from the scoring path — :aic and :bic normalize by N — so
_fit_score no longer takes wdata.

m_max and nd_max now default to the ranges 4:8 and 3:7 rather than to
-1 meaning "every m in the table" / "2*n_planes_add". With real defaults in
place the sentinel had no remaining use: -1 is now just a negative cutoff and
errors out.

Note one consequence: the old nd_max default tied the derivative order to
2*n_planes_add, the order the plane count can actually resolve. Nothing
enforces that link now — nd_max is clamped only by what the coefficient table
holds, so n_planes_add = 1 with the new default fits nd up to 3.

Two tests reached a particular cutoff through the old sentinel; they now pin
nd_max explicitly so each still exercises its intended branch. The MMAX
docstring lives in both the generator and its generated table, and the table copy
is patched in place to what a rebuild would emit.

Full suite passes, 1078 tests.

🤖 Generated with Claude Code

`fit_criterion = :rms` charged nothing for coefficients, so it always
selected the largest model in a scan. It was documented as a way to
inspect the raw residual ranking, but the scan table already reports
`rms_weighted` per candidate, so it never chose a fit anyone wanted.
Removing it also retires `W` (the weight total) from the scoring path:
`:aic` and `:bic` normalize by `N`, so `_fit_score` no longer takes
`wdata`.

`m_max`/`nd_max` now default to the ranges `4:8` and `3:7` rather than
to `-1` meaning "every m in the table" / "2*n_planes_add". With real
defaults in place the sentinel had no remaining use, so `-1` is now
just a negative cutoff and errors out.

Two tests relied on the old sentinel to reach a particular cutoff; they
now pin `nd_max` explicitly so each still exercises its intended branch.

The `MMAX` docstring lives in both the generator and its generated
table; the table copy is patched in place to what a rebuild would emit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DavidSagan DavidSagan changed the title Merge the table generators, and drop the :rms criterion and -1 cutoff sentinel Drop the :rms fit criterion and the -1 m_max/nd_max sentinel Aug 9, 2026
@DavidSagan
DavidSagan merged commit ac0ae38 into main Aug 9, 2026
2 checks passed
@DavidSagan
DavidSagan deleted the dev/100 branch August 9, 2026 09:54
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation preview for this PR: https://bmad-sim.github.io/GeneralizedGradients.jl/previews/PR50/

Rebuilt on every push; removed automatically when the PR closes.

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