Skip to content

Start every fit from the parameter values no fit has touched - #219

Merged
yichao-liang merged 1 commit into
masterfrom
fit-anchors-never-fitted
Oct 10, 2026
Merged

yichao-liang merged 1 commit into
masterfrom
fit-anchors-never-fitted

Conversation

@yichao-liang

Copy link
Copy Markdown
Collaborator

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_info reports the applied value as the default.
So every sim.fit() started from the previous fit's answer, although the EMPIRIC 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 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_params read 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_anchors and the stale-parameter revert read their baselines there; physical_param_anchors now takes that registry.
  • A carried posterior still sets the anchors when code_sim_learning_carry_posterior is on.
  • The registries themselves are unchanged: the validate replays and the parameter sweep, which want the deployed point, keep reading the planning model.

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

  • New: a fit's anchors stay at the never-fitted values after a fit is applied to a planning model whose registry reports applied values, and the fresh build happens once per model class; the stale-parameter revert goes to the never-fitted default when the planning registry already reports the applied value.
  • Local CI replay: the static checks and the 8 shards.

🤖 Generated with Claude Code

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.
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