Repository navigation
Start every fit from the parameter values no fit has touched - #219
Merged
Merged
Conversation
A fit centred its prior on the planning model's parameter registry, and that model carries every applied fit: for a parameter the agent declares, the registry reports the applied value as the default. So each sim.fit() started from the previous fit's answer, although the runs set code_sim_learning_carry_posterior to False. Seed 0 of the Domino round fixes_r3 refit the same 10 segments three times and watched restitution move from 0.05 to 0.47; it called the fit unstable and stopped rehearsing with the joint draws. The anchors, and the value a parameter dropped from the declaration reverts to, now come from the registry of a freshly built model, built once per model class. A carried posterior still sets the anchors when its flag is on.
This was referenced Oct 10, 2026
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.
Why
A rollout fit centres its prior, the grid sweep's held values and the anchor ablation's baselines on the parameter registry's defaults.
The fit read them from the planning model, and that model carries every applied fit: an override sticks, and for a parameter the agent declares (
AGENT_PARAM_SPECS),_agent_param_inforeports the applied value as the default.So every
sim.fit()started from the previous fit's answer, although the EMPIRIC runs setcode_sim_learning_carry_posteriorto False.Seed 0 of the Domino round
fixes_r3refit the same 10 segments three times and saw restitution move from 0.05 to 0.47 (replay errors 9.88, 9.55, 9.55).It wrote that the fit was unstable and stopped rehearsing with the joint draws; it then lost the test level on a layout it had checked only without draws.
The stale-parameter revert in
_apply_identified_physical_paramsread the same registry, so a parameter dropped from the declaration "reverted" to the value it already had.What changes
AgentSimLearningApproach._baseline_param_info()returns the registry of a freshly built planning model, which no fit has touched, built once per model class.fit_prior_anchorsand the stale-parameter revert read their baselines there;physical_param_anchorsnow takes that registry.code_sim_learning_carry_posterioris on.Evidence
The scripted from-assets harness (with #216 and #218 applied) calls
sim.fit()twice on seed 0's unchanged level-1 recording.Without this change the prior centres before the second call had moved to the first fit's answers (domino lateral friction 0.35 to 0.954, table rolling friction 0.001 to 0.0025) and the second fit returned a different result.
With this branch the prior centres before the second call are the declared values again, the second call reuses the cached fit (0.2 s against 921 s for the first) and returns the identical result.
Tests
🤖 Generated with Claude Code