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.

Real MuJoCo 3D renders of the graded trajectories: sphere drop, sliding and sticking boxes side by side, pendulum swing, then the PASS card. Made from real judge output, no illustrative data.

Measured

0.4406 s
sphere contact time
±3 % of 0.4401 s
1.6082 m/s²
sliding-box acceleration
±5 % of 1.6088 m/s²
1.8 mm
sticking-box travel
< 20 mm
2.0073 s
pendulum period
±2 % of 2.0073 s
8/8
known-bad artifacts rejected
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 replay
No 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 0

Results

Twelve real MuJoCo 3D renders of the graded trajectories: sphere release, contact and settling, sliding and sticking boxes, and pendulum extrema and centre, with measured values and analytic pass limits
Twelve real MuJoCo 3D renders of the graded trajectories: sphere release, contact and settling, sliding and sticking boxes, and pendulum extrema and centre, with measured values and analytic pass limits. Full size
Recorded agent-loop verdicts and the judge self-test: the known-good port passes and all eight mutants are rejected
Recorded agent-loop verdicts and the judge self-test: the known-good port passes and all eight mutants are rejected. Full size

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

StepWall 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.py4–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.