Home / Demos / Physics-engine arena with MuJoCo
Simulation MuJoCo 3.8.1 · mujoco_warp 3.8.1
Physics-engine arena with MuJoCo
The agent writes one MuJoCo port of a neutral scene spec: a falling sphere, a sticking box, a sliding box and a pendulum. The judge runs the port from a copy, checks the trajectory CSVs against analytic contact time, friction and pendulum-period rules, then compares them pointwise with its own reference MuJoCo port. The video and result image are real MuJoCo 3D renders of the graded trajectories, not illustrative plots.
Measured
±3 % of 0.4401 s
±5 % of 1.6088 m/s²
< 20 mm
±2 % of 2.0073 s
self-test, ≥ 90 % required
reproduced Independently reproduced: matching CPU verdicts except timing and matching GPU values at the reported precision. The pre-merge reproduction used the README's documented ref override. Numbers from the demo's README and receipt.
Ask your agent
With the sandbox plugin or any agent that can use a sandbox, paste:
Create a fresh sandbox. Inside it, clone https://github.com/agent-next/sandbox at ref `main`, then read `cookbook/sim-engine-arena/SPEC.md`. Run `bash cookbook/sim-engine-arena/judge/setup.sh` and write your own MuJoCo port in one file, `sim.py`: read `spec.json` at runtime and produce the four trajectory CSVs exactly as the artifact contract requires. Simulate honestly; do not hard-code oracle numbers or edit anything under `judge/`. Iterate with `bash cookbook/sim-engine-arena/judge/grade.sh <your-sim.py> --json verdict.json` until every gate passes, and run `bash cookbook/sim-engine-arena/judge/selftest.sh` to see the eight known-bad ports rejected. Report the final verdict JSON, including contact time, incline acceleration and travel, pendulum period and reference agreement. Kill the sandbox and confirm it is gone.Or run it yourself
Creates a sandbox, installs the pinned tools, runs the judge's self-test, grades the known-good example, prints the verdict and kills the sandbox.
pip install "git+https://github.com/agent-next/sandbox#subdirectory=cli"
export SBX_API_KEY=<your key> # from the console
git clone --depth 1 https://github.com/agent-next/sandbox && cd sandbox
python3 cookbook/sim-engine-arena/run.py # CPU sandbox: full judge
python3 cookbook/sim-engine-arena/run.py --gpu # optional 4 GiB GPU slice replayNo key? Run the judge on any Debian 12 box
# from cookbook/sim-engine-arena/
bash judge/setup.sh
bash judge/selftest.sh
bash judge/grade.sh examples/good/sim.py --seed 0Results


Why a sandbox
The agent needs a pinned MuJoCo toolchain and a scratch filesystem to build and run its Python port. The judge executes a copy inside a disposable sandbox, away from your machine; an optional GPU slice replays the models with mujoco_warp, reports the results and is destroyed and verified gone afterwards.
Measured wall time
| Step | Wall time |
|---|---|
judge/setup.sh (cold, fresh sandbox) | 24–36 s |
judge/selftest.sh (good + 8 mutants + determinism) | 15–17 s |
judge/grade.sh examples/good/sim.py | 4–6 s |
Limits, plainly
- MuJoCo only: agreement compares the agent's port with the judge's reference port in the same engine, not PyBullet, Genesis or Drake.
- Simple rigid-body scenes with the spec's contact, damping and friction settings; tuning them beyond the spec is not the task.
- No continuous collision, air drag or relativistic corrections; the oracle tolerances absorb contact-model differences.
- GPU replay is optional and reported, never gated; the CPU verdict stands if GPU access is unavailable.
Source
Demo folder · SPEC · RECEIPT · REPRODUCE — pinned at ba328e6
Run one yourself
Sign in with GitHub for a free key with 10 sandbox-hours. Every demo above finishes in minutes and kills its sandbox when it is done.