expert_replay — scripted-expert data collection
Overview
Every sim backend supported by RoboRSI ships scripted experts (RoboTwin's
play_once, ManiSkill's SolutionEnv, …). This skill is the thin wrapper
that iterates seeds, calls env.run_expert, and drops each resulting
SimRollout into the DataStore.
It's the dumbest reliable way to get clean trajectories. Use it to
bootstrap a dataset before you have any learned policy.
When to use
- You want a "known-good" seed set for a task.
- You're about to train π₀ / π₀.₅ on this task.
- Parallel farm: N workers run this skill concurrently with disjoint
seed_start ranges.
When NOT to use
- The expert doesn't exist for your task (→ use
rollout_vlm). - The expert is flaky on your embodiment (→ fix the expert, don't wrap
retries here).
Phases
- Resolve backend (
get_backend(backend)), assert available. - For each
seed_start + iinrange(episodes):
1. env.run_expert(seed).
2. DataStore().write(rollout, skill=skill_label).
- Return a JSON summary.
Success criteria
- Every episode lands on disk with
meta.json.successreflecting the
expert's own check_success.
episodes.hdf5is NOT produced (we use parquet, not HDF5 — swap later
if needed).
Failure modes
| Symptom | Likely cause | Fix |
|---|---|---|
| SimBackendUnavailable | RoboTwin not installed / wrong env | See docs/sim-robotwin.md |
| Zero success across 10 seeds | Expert broken on this embodiment | Fix upstream, don't paper over here |
| Disk fills up fast | Default captures start+end obs only; full-fidelity HDF5 would be bigger | Leave as-is for MVP |
Why
Expert replay is the honest baseline. Every evaluation / training run
should measure ΔVM_expert (did the learned policy improve over the expert
or just memorise it?). Treating expert replay as a first-class skill
makes the comparison point explicit.