feat(calibration): apply CA's DEBUG population defaults to the fields on toggle#121
Open
FinbarArgus wants to merge 2 commits into
Open
feat(calibration): apply CA's DEBUG population defaults to the fields on toggle#121FinbarArgus wants to merge 2 commits into
FinbarArgus wants to merge 2 commits into
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_POPULATIONonly substitutes the small quick-run sizes for values omitted fromoptimiser_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_defaultfield on each GA population option in CA'sPARAM_ID_METHODSschema — filed as circulatory_autogen #313. CUFLynx already forwards arbitrary option fields verbatim (_introspect_param_id_methodsdoesdict(o)), so no CUFLynx backend change is needed — the frontend readso.debug_default.Behaviour
debug_defaultsnaps to it; options without one are untouched.debug_default→ no change on toggle (same as today), so it's safe to merge now.Dependency
debug_defaultto 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 buildclean.🤖 Generated with Claude Code