Skip to content

Keep a declared material's range at least as wide as its plausible range - #216

Merged
yichao-liang merged 2 commits into
masterfrom
from-assets-plausible-ranges
Oct 10, 2026
Merged

yichao-liang merged 2 commits into
masterfrom
from-assets-plausible-ranges

Conversation

@yichao-liang

@yichao-liang yichao-liang commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #219 (fit-anchors-never-fitted); review that one first.

Why

Seed 0 of the Domino round fixes_r2, which ran #214's code (merged), lost its test level.
It declared the dominoes' spinning friction on [0, 0.05] and rolling friction on [0, 0.002]; the world has 0.5 and 0.006.
Its level-1 recording, a straight chain, could not identify either, its unfitted prior spanned only the declared boxes, and its rehearsal said 16 of 16 joint draws cascade.
A replay of its episode in the real environment stalls at the world's values and cascades with either friction anywhere inside the declared ranges.
#214 samples only the materials an agent leaves undeclared, so a narrow declaration hides a material just as well.

What changes

  • The from-assets arm binds SceneBase with plausible_floor.
    Its parameter registry then names each declared material's plausible range (PLAUSIBLE_MATERIALS, renamed from SAMPLED_MATERIALS; a mass relative to the declared value).
    The range comes from the name and the declaration alone, because the approach stamps the specs before its world binds any observed body.
  • stamp_physical_spec_scales widens a declared box narrower than a registry entry's plausible range, so the fit, the prior, the joint draws and the physics sweep all use the wider range.
  • The model status lists each widened range, and the scene contract states the ranges (generated from the constant).
  • Real-to-sim keeps its declared boxes.

Evidence

A scripted run of the from-assets harness on seed 0's round: level 1 is seed 0's own simulator.py and its recorded actions.
On level 2 it makes seed 0's opening 120-step wait, then rehearses three plans from the current state on 16 joint draws and runs the physics sweep, unfitted as seed 0 played it:

Plan Joint draws, #214 Sweep, #214 Joint draws, this branch Sweep, this branch
Seed 0's Oct 8 plan (lost in the world) 16/16 8/23 2/16 10/23
Seed 0's Oct 3 plan (won; bridges 5 mm and 1 degree from the Oct 8 ones) 16/16 8/23 2/16 17/23
The oracle-dynamics arm's plan (won; bridges further out) 16/16 23/23 9/16 21/23

The joint draws now separate the robust plan from seed 0's knife-edge turn, which won once and lost once in the world.
Seven of the Oct 8 plan's 14 failing draws stall the chain; the other seven stall the push, mostly at lateral friction 0.1 to 0.15, which an unfitted prior over the widened box reaches.
The level-1 cascade constrains lateral friction strongly, so a fit (required on test levels by the next PR) narrows that part of the belief.

Tests

  • New: the stamping widens a narrower box and keeps a wider box, an open end and a parameter without a range; the scene base names plausible ranges only under the floor, for declared materials only, the same before and after its world binds bodies; the from-assets play test declares a narrow spinning friction and checks the widened spec, the status line, the prior's draws and the sweep, while real-to-sim keeps the declared box.
  • Local CI replay: the static checks and the 8 shards (with Resolve a registry name to its own class, never a subclass that inherits it #213 applied, for the registry flake it fixes).

🤖 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.
Seed 0 of the Domino round fixes_r2 declared spinning friction on
[0, 0.05] and rolling friction on [0, 0.002]; the world has 0.5 and
0.006. Its level-1 recording could not identify either, its unfitted
prior spanned only the declared boxes, and all 16 joint draws cascaded
where the world's chain stalls at the second bridge. A replay of its
episode in the real environment stalls at the world's values and
cascades with either friction anywhere inside the declared ranges.

The from-assets arm now binds SceneBase with plausible_floor. Its
registry names each declared material's plausible range
(PLAUSIBLE_MATERIALS, renamed from SAMPLED_MATERIALS; a mass relative
to the declared value), and stamp_physical_spec_scales widens a
narrower declared box to it, so the fit, the prior, the joint draws and
the physics sweep all use the wider range. The range comes from the
declaration alone, because the approach stamps the specs before its
world binds any observed body. The model status lists each widened
range and the scene contract states the ranges. Real-to-sim keeps its
declared boxes.
@yichao-liang
yichao-liang force-pushed the from-assets-plausible-ranges branch from 038db71 to 950cd14 Compare October 10, 2026 13:36
@yichao-liang
yichao-liang changed the base branch from master to fit-anchors-never-fitted October 10, 2026 13:36
@yichao-liang
yichao-liang changed the base branch from fit-anchors-never-fitted to master October 10, 2026 13:45
@yichao-liang
yichao-liang merged commit 74ac779 into master Oct 10, 2026
14 checks passed
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