Teaching a Duck to Walk on a MacBook, CPU Only
Open Duck Mini v2 learns to walk in MuJoCo on six CPU cores: 72.4 M steps in 3.57 hours, three rewards it found a way to cheat, and the torque the real motor does not have.
I did not buy the duck everyone was posting. I trained its sibling on my MacBook instead, on the CPU, and then spent two more experiments breaking it on purpose.
The robot is not mine and neither is the hard part. Open Duck Mini v2 and its training environment, rewards, reference motion and pretrained policy are Antoine Pirrone's, and I changed none of them. What is mine is the part that makes it run on a laptop: open-duck-mac is a Mac runner, a TensorFlow-free ONNX exporter, a set of evaluators, and the full log of every run behind the videos.
Six cores pretending to be six GPUs
MJX, MuJoCo's accelerated physics, wants a GPU. An Apple GPU is not one it can
use: jax-metal has no cholesky, so the whole thing falls back to the CPU.
That is the entire reason this repository exists — and the CPU turned out to be
fine once it was laid out properly. JAX sees one CPU as one device, so six
cores sit mostly idle; splitting them into six single-threaded virtual devices
and putting 256 ducks on each doubled the speed. 1,536 ducks walking in
parallel on a laptop.
It walks, slowly, at 68.4 million steps
The full run was 72.4 M steps in 3.57 hours on an M5 MacBook. The duck stood up after about 11 minutes, then spent three hours looking like it had stopped learning. The first checkpoint that actually lifted its feet was at 68.4 M steps: 29.8 cm in five seconds, against 58.5 cm for the pretrained policy that ships with the playground.
So: half the distance of a policy someone else trained properly, after three and a half hours on a machine with no GPU. I find that a good trade.
The duck is a lawyer
The second experiment changed nothing but the reward, and the same training produced three different ways of cheating:
- "Be fast" → it crawls along on its belly. Fast, technically. 14.9 minutes to find that.
- "Don't waste energy" → it freezes. 7.5 minutes.
- "Lift your feet" → it lies down and holds its feet in the air. 30 minutes.
None of these is a bug in PPO. Each one is the reward, read literally, by something with no idea what walking is supposed to look like. The reward is the specification, and the duck is the lawyer reading it back to you.
The motor on the box
The third experiment is the one that worries me most. The simulated motor can do ±3.23 N·m — that comes from the Open Duck motor model. The STS3215 on the real robot is rated 19 kg·cm on the box, which is about 1.86 N·m: the simulation is roughly 70 % more generous than the catalogue.
Capping it tells you what that is worth. At 1.86 N·m the same policy covers half the distance, and the knees ask for more than the catalogue limit 37–39 % of the time. So the walk it learned is partly paid for by torque the hardware does not have.
Training again from scratch with the motor randomised around the catalogue value did not walk at all by 72 M steps. Continued, it walked at 88.8 M: 34.8 cm at 1.86 N·m, two and a half times the old policy under the same cap. Then, by 170 M steps, it had forgotten how — while the mean training reward never dropped. The number I was watching did not notice the regression. That is the part I would want a bench test for before trusting any of it.
How much this proves
One seed, one run per experiment, simulation only, no real robot. These are
measurements of a laptop pipeline, not results about Open Duck Mini. Every log,
checkpoint table and rollout measurement is in results/ in the repository, so
the numbers above can be checked rather than believed.
If you want to run it, an Apple Silicon Mac with uv is enough:
git clone https://github.com/fport/open-duck-mac.git && cd open-duck-mac
./duck setup # pinned sim, env, smoke test, fastest CPU layout
./duck try # our walking duck, video and numbers
./duck eval duck1 --force 1.86 --no-video # the same duck with the motor on the box
./duck train --preset quick --detach # your own, 10 M steps, about 30 minutes
The documentation is in Turkish and English and goes from an empty Mac to your own experiments. Apache-2.0 — and if you build on it, credit Open Duck Mini first: it is their robot and their environment.