Skip to content

feat(calibration): apply CA's DEBUG population defaults to the fields on toggle#121

Open
FinbarArgus wants to merge 2 commits into
mainfrom
feat/debug-population-defaults
Open

feat(calibration): apply CA's DEBUG population defaults to the fields on toggle#121
FinbarArgus wants to merge 2 commits into
mainfrom
feat/debug-population-defaults

Conversation

@FinbarArgus

Copy link
Copy Markdown
Contributor

Implements option 1 for the DEBUG-population issue: when the user toggles DEBUG for the genetic algorithm, the population fields (num_elite, num_survivors, num_mutations_per_survivor, num_cross_breed) switch to CA's advertised debug values, and restore when DEBUG is turned off.

Why

CA's _DEBUG_POPULATION only substitutes the small quick-run sizes for values omitted from optimiser_options. The schema-driven panel always pre-fills and sends the normal population values, so those small sizes never applied — DEBUG was a no-op. Now the panel shows and sends the debug values, so CA runs the small population.

No hardcoding

The values come from a new debug_default field on each GA population option in CA's PARAM_ID_METHODS schema — filed as circulatory_autogen #313. CUFLynx already forwards arbitrary option fields verbatim (_introspect_param_id_methods does dict(o)), so no CUFLynx backend change is needed — the frontend reads o.debug_default.

Behaviour

  • Toggle DEBUG on → each option with a debug_default snaps to it; options without one are untouched.
  • Toggle off → restores the pre-DEBUG value (including a value the user had manually edited).
  • Re-applies on a method switch while DEBUG is on; restores across methods.
  • Graceful on an older CA / before #313 lands: no debug_default → no change on toggle (same as today), so it's safe to merge now.

Dependency

  • circulatory_autogen #313 adds debug_default to the GA population options (single source = _DEBUG_POPULATION). This PR is inert until that lands — DEBUG shows no visible change to the fields until CA advertises the values.

Tests

Swap + restore, user-edit preserved across a toggle, and graceful no-op on an older CA. Frontend 309; yarn build clean.

🤖 Generated with Claude Code

FinbarArgus and others added 2 commits July 26, 2026 20:47
… on toggle

When DEBUG is on for the genetic algorithm, CUFLynx previously kept showing (and
sending) the normal population values, so CA ran the full population — DEBUG was a
no-op (CA's _DEBUG_POPULATION only fills values omitted from optimiser_options,
and the schema-driven panel always sends them).

Now toggling DEBUG swaps each population field to CA's advertised `debug_default`
and restores the prior value when turned off. The values come from the schema
(introspected, never hardcoded) — pairs with circulatory_autogen #313, which adds
`debug_default` to the GA population options in PARAM_ID_METHODS. Because the
option dicts pass through verbatim, no CUFLynx backend change is needed.

- CalibrationPanel: snapshot/restore per option; re-apply on method change while
  DEBUG is on; options without a `debug_default` (and any CA predating #313) are
  untouched — DEBUG then simply has no visible effect, as before.
- The emitted run settings carry the debug values, so CA runs the small
  population (it uses the explicit values, matching debug_default).

Tests: swap + restore, user-edit preserved across a toggle, and graceful no-op on
an older CA. Frontend 309; build clean.

Depends on circulatory_autogen #313 for the schema field; inert (no visible
change on DEBUG) until it lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…controlled InputNumber)

The DEBUG toggle set the population values correctly (and would send them), but
the fields didn't visibly change — PrimeVue InputNumber binds its <input> via
`defaultValue` (uncontrolled), so it reflects the model on mount but not on a later
programmatic change. On a method switch the fields remount and pick it up; a DEBUG
toggle changes the value in place, so nothing appeared to happen.

Key the InputNumber on the DEBUG state for options that carry a `debug_default`, so
it remounts and re-reads the swapped value. Options without one (e.g.
num_calls_to_function) are unaffected.

Test: a remount-counting InputNumber stub asserts the debug-defaulted field
remounts on toggle (and back), while a field without a debug_default doesn't — the
default auto-stub is controlled, which is why the earlier tests missed this.
Frontend 309; build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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