Instructions to use Kyry10/microduck-arena-lab with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Microduck
How to use Kyry10/microduck-arena-lab with Microduck:
# Replace SLOT with the slot specified in the model card (walk, stand, sitstand, ground_pick, kick_left, kick_right, roulade). sudo robotctl policy load SLOT Kyry10/microduck-arena-lab
- Notebooks
- Google Colab
- Kaggle
Download docs/WORKFLOW.md from Kyry10/microduck-arena-lab: direct link, hf CLI and curl.
- Browser
- Download file 10.3 kB
-
https://huggingface.co/Kyry10/microduck-arena-lab/resolve/main/docs/WORKFLOW.md
- Command line
-
hf download hf://Kyry10/microduck-arena-lab/docs/WORKFLOW.md
-
curl -L -o WORKFLOW.md https://huggingface.co/Kyry10/microduck-arena-lab/resolve/main/docs/WORKFLOW.md
Complete experiment workflow
This guide reproduces the method we used, rather than promising the same training trajectory on another GPU. Exact Arena evaluation and stochastic PPO training are different things: our pinned x86_64 Linux evaluator matched official submissions, while training can produce different checkpoints on another machine or dependency revision.
1. Inspect the installed event
Our snapshot used Arena 0.4.3, MuJoCo 3.10.x, Python 3.12, Torch 2.9.1 and an H100.
The per-event source commits are in records/<event>/source.json; the selected ONNX
hashes and actual per-seed times are in models/manifest.json.
cd ~/microduck/events/sprint-2m/microduck-challenges
uv run --group workshop arena score --help
uv run --group workshop python - <<'PY'
from pathlib import Path
import arena
print(Path(arena.__file__).parent / 'events')
PY
Read the corresponding event TOML before changing rewards. Record course length, lane
width, walls, slope, rig/accessories, command sweep, start noise, settle duration,
fall-hold and timeout. The installed0.4.3 CLI has no --speed option; full event
evaluation chooses among its command candidates.
All three races run the policy during a0.50 s untimed settle. The finish origin is the trunk position after that settle. Tilt beyond60° must persist for0.30 s to fall. Arena resets the fall-hold counter after settling; training must keep it zero through control step25 and begin counting at26. Fall takes precedence over finish once its hold expires. The hill measures progress along the incline, rather than world x alone.
2. Establish licensed parents and baselines
We benchmarked the supplied Pollen references and the original Hannes running policy. Hannes' model card explicitly declares Apache-2.0. Pin the source revision:
HannesVonEssen/microduck-running
9f45af1f4b04252f3aa1f4c056fa7fa0d4b35e4c
Some downloadable reference/leader policies had no explicit license. They were benchmarked only and never used as parents. Public availability alone did not establish reuse rights.
We tried constant velocity commands first. The inherited sprint gait did not become faster when commanded above the Arena sweep. The final sprint/hill exports still bake rawvx2.6; the roller export bakes rawvx0.9. This is a command written before the existing actor normalizer, not a change to the normalizer or input/output dimensions.
3. Install an event overlay
Use isolated checkouts per event. The package contains our added files, not a complete upstream training repository. On a fresh setup:
git clone https://github.com/Kyk0/microduck-arena-lab.git
export MICRODUCK_ROOT="$HOME/microduck"
mkdir -p "$MICRODUCK_ROOT/events/sprint-2m"
git clone https://github.com/pollen-robotics/microduck-challenges.git \
"$MICRODUCK_ROOT/events/sprint-2m/microduck-challenges"
python3 microduck-arena-lab/tools/install_overlay.py \
--event sprint-2m \
--checkout "$MICRODUCK_ROOT/events/sprint-2m/microduck-challenges"
cd "$MICRODUCK_ROOT/events/sprint-2m/microduck-challenges"
git switch -c kyry-sprint-2m
uv sync --group workshop
git add scripts src experiments
git commit -m 'install race-matched sprint experiment overlay'
The installer checks out the recorded upstream base before copying the additions. Use
--revision selected for the selected checkpoint’s historical source, or the default
--revision current for the snapshot’s later alignment repairs. It
requires a clean target checkout. Repeat with the appropriate event id in a separate
folder for hill or roller. Let each fresh checkout manage its own virtual environment.
On our shared machine, agents reused an existing venv read-only and set their own
PYTHONPATH; they never ran uv sync against that shared environment.
4. Download and verify the selected model
uv run --with huggingface-hub python - <<'PY'
from huggingface_hub import hf_hub_download
for filename in ['sprint-2m/policy.onnx', 'sprint-2m/checkpoint.pt']:
print(hf_hub_download('Kyry10/microduck-arena-lab', filename,
local_dir='../downloaded-models'))
PY
For a durable reproduction, pin the bundle revision from models/hub-revision.json.
Check the ONNX SHA256 against models/manifest.json before scoring. The full PPO files
contain actor, critic and optimizer state; they are larger than deployable ONNX policies.
sha256sum ../downloaded-models/sprint-2m/policy.onnx
uv run --group workshop arena score \
../downloaded-models/sprint-2m/policy.onnx --event sprint-2m \
--store ../verification-store
5. Preserve actor semantics
The actor contract is61 observations and14 servo actions:
| Slice | Quantity |
|---|---|
| 0:3 | body gyro |
| 3:6 | projected gravity |
| 6:20 | servo joint positions relative to default pose |
| 20:34 | servo joint velocities, lagged one control step |
| 34:48 | last action |
| 48:61 | twist3 + head pose4 + body pose6 |
The ONNX import script reconstructs the actor MLP and frozen normalizer, then checks Torch/ONNX output parity. Do not replace the saved denominator with another normalization epsilon. Command overrides must preserve graph input/output names and all 61/14 dimensions. Roller passive wheel joints never enter those servo observations/actions.
An imported external ONNX actor gets a fresh critic and optimizer. A continuation from our own checkpoint uses full PPO resume. After loading, explicitly set the intended optimizer learning rate: loading restores the checkpoint's old rate. Keep Adam moments and critic weights unless the experiment intentionally changes the warm-start method.
6. Match the race environment
Our race env uses STAND plus Arena start perturbations, the actual lane/walls/slope/rig, nominal BAM7.35 V physics,3–6substep command delay and one-step velocity observation lag. Wide sim2real randomization, pushes, CoM offsets and strong style penalties are removed.
The core objective is forward motion plus finish bonus and a fall penalty; yaw/lateral terms and action-rate cost are light. The critic receives privileged progress/position, true velocity and race timing while the actor keeps its original61D contract. Episodes include the0.5 s run-up and target a short race, rather than long steady-state walking.
We later found and isolated the settle fall-clock mismatch. We also recorded a BAM compiled force-ceiling difference; nominal current-limited torque was lower than either ceiling, so that observation was not treated as a proven explanation of the speed plateau.
7. Launch and score a continuation
The selected sprint checkpoint came from B3 model 800 with a stronger early-forward reward. A continuation from the selected D1 model 900 is different from replaying that historical run, but uses the same method:
cd "$MICRODUCK_ROOT"
tmux new -d -s sprint-continuation \
'PYTHONPATH=events/sprint-2m/microduck-challenges/src \
events/sprint-2m/microduck-challenges/.venv/bin/python \
events/sprint-2m/microduck-challenges/scripts/finetune_sprint.py \
--run-name my_continuation \
--parent-checkpoint events/sprint-2m/downloaded-models/sprint-2m/checkpoint.pt \
--full-resume --num-envs 512 --iterations 1001 \
--lr 3.3333333333e-6 --std 0.05 --fixed-std \
--early-forward-weight 5 --save-interval 50 \
--target-score 0.988 --stage my_experiment \
> events/sprint-2m/my_continuation.log 2>&1'
Choose the correct model download location for your machine. Historical commands, checkpoint numbers and reward changes are documented in the event guides and overlays. The current overlay includes later alignment repairs and therefore is not identical to the source used to train the original selected checkpoint. Use the recorded training commit if reconstructing that historical code is necessary.
8. Select, diagnose and iterate
Only 5/5 policies count as event bests. Export/score every 100 iterations, or50for polish. Stop a run after approximately1000 iterations without a new reliable branch best, or three consecutive scores with fewer than 3/5 finishes. Branch improvements cannot overwrite a faster global event candidate.
Measure settle-end speed,100 ms peak speed, time to top speed, lateral drift, wall contacts, tilt and finish posture. Sprint diagnosis showed a consistent gait with slow acceleration; roller diagnosis also showed low launch speed and no wall contacts. Hill failures instead often drifted into walls. Those observations motivate different next experiments.
Keep one main change per run: learning rate, exploration, early acceleration reward, target-speed curriculum, heading hold, or a different discovery parent. Low-LR full resume helped roller polish, while stronger rewards and static action/feedback trims often failed.
9. Log every decision
Each event retains LOG.md, results.csv, LINEAGE.md, exact command/provenance/configs,
TensorBoard events and immutable best policy/checkpoint files. Commit before training.
Weights stay outside git; this repository hosts guides/code/media and points to the model bundle.
The GPU is shared: maximum3training processes total,512–1024envs initially, never touch
another user's jobs. Maximum2 CPUscorers; one reserved root scorer and one shared
flock slot. Long jobs run in tmux/nohup; check tails every 25–30minutes.
10. Publish and make honest media
Root publishes qualifying5/5 candidates only: first event entry, at least0.02 s faster than our published entry, or a podium/#1 result. Maximum3Arena publications per UTC day. Use descriptive names. Verify official/local equality; stop publishing if they differ.
uv run publish --onnx path/to/immutable/policy.onnx \
--repo Kyry10/microduck-roller-sprint-glide --kind perpetual --no-private \
--enter --event roller-sprint-2m --accessories rollers \
--base-model HannesVonEssen/microduck-running
The separate multi-event Hugging Face bundle hosts the selected artifacts; uploading that bundle does not submit a new Arena run. Website videos record actual Arena states on CPU, label individual-seed timing separately from the5 seedmean, and identify untimed settle and slow-motion replay. See the website/media guide.