Sim-to-Real Controller Iteration
Use alongside sim2real-gauntlet (src/robosim_gauntlet on sys.path) when tuning or debugging a manipulation controller for physical deployment. Never claim an improvement from single-seed runs, T0-only checks, or unpaired rollouts. Reference consumers: ../sim2real-gauntlet/examples/playground_tasks.py and ../sim2real-gauntlet/examples/color_blob_ik_controller.py.
Loop
- Preflight gate: Audit compiled
MjModelphysics and positive/negative goal controls (safety.goal_setterfor articulated fixtures) before iterating:
Fix every reported issue (manipuland welds, non-robot actuators, manipuland margin/gap, contact overrides, or vacuous/unsatisfiablebashpython -m robosim_gauntlet.cli --task-py=../sim2real-gauntlet/examples/playground_tasks.py --robot=yam --tasks=cube_in_bowl --preflight-onlytask.success). - Unprivileged controller contract: Drive
proxy.RemoteDeviceLayer(os.environ["GAUNTLET_URL"])out of process (or an in-processfn(dl)behindwrappers.AllowlistWrapper) using onlytask.deployment_keys()and<cam>_timestamp. OnT4terminal faults (camera_freezeordead_gripper), observe post-onset state and exit with{"status": "abort", "fault": "<fault>"}; aborting without an active fault fails withspurious_abort. - Inner-loop diagnosis (
episode.fork): Inspectresult.grade.violations,result.grade.metrics, andresult.log(poses_at,FORCES) to find the earliest causal failure tick, then replay deterministically on the exact seededT0-T4plant totickand hand off to a candidate command or callable:
Confirm fixes on full-episode sweeps after fork debugging.pythonforked = episode.fork(result, task, tick, candidate_cmd_or_fn) - Paired CRN hill-climbing: Set
GAUNTLET_CRN_SECRET(>= 16bytes) for HMAC-locked evaluation and compare baseline (v0) vs candidate (v1) on identical--task-py,--robot,--tiers=T0,T1,T2,T3,T4,--episodes, and--seed:
Or compare saved runs viabashGAUNTLET_CRN_SECRET="$KEY" python -m robosim_gauntlet.cli \ --task-py=../sim2real-gauntlet/examples/playground_tasks.py --robot=yam \ --compare-controller="$V0_CMD" --controller="$V1_CMD" \ --tiers=T0,T1,T2,T3,T4 --episodes=4 --seed=0 --output-json=/tmp/crn.json--baseline-json=v0.json --candidate-json=v1.json. Verdicts (scorecard.compare):INVALID(fix key/seed/scene_sha256mismatch),WORSE(revert; safety regressions veto task gains),INDISTINGUISHABLE(keep simpler controller or increase--episodesto reach >= 6 discordant pairs),BETTER(promote only after passing critic_rubric.md, then run--mode=real --mcap-log-dir=...).


