Aim
Build a fair numerical and performance comparison before choosing an engine.
Time: about 120 minutes. Start with the linked lectures and the course notation contract. The reference program is complete and runnable; your work is to explain it, modify it, and test the results.
Run from this repository
uv sync --locked
uv run --locked python practices/p07-backends/run.py
The program writes configuration, MuJoCo version, and metrics to outputs/p07-backends/metrics.json. Experiments with a time history also write trajectory.csv. These are generated results and are not source material.
Use a separate configuration and output directory for each variation:
uv run --locked python practices/p07-backends/run.py --config practices/p07-backends/config.yml --output outputs/p07-backends/baseline
Keep the original configuration as the baseline. Record all changes in your report; avoid changing several physical and numerical parameters at once.
Tasks
- Run the CPU pendulum baseline and record the exact model and final state.
- Optionally install the mjx extra and use config-mjx.yml to compare batched MJX-JAX.
- Separate compilation from synchronized execution and report the batch size.
- Optionally compare Pinocchio and MuJoCo on the same contact-free pendulum using compare_pinocchio.py.
Expected checks
Optional commands (from this repository):
uv sync --locked --extra mjx --extra comparison
uv run --locked --extra mjx python practices/p07-backends/run.py --config practices/p07-backends/config-mjx.yml --output outputs/p07-backends/mjx
uv run --locked --extra comparison python practices/p07-backends/compare_pinocchio.py --output outputs/p07-backends/pinocchio
The default run is CPU-only and reports MJX as not requested. Optional paths must pass numerical-agreement checks before making speed claims. This is not a contact-solver equivalence benchmark.
Submission
Submit your YAML configuration, a short explanation of the equations and assumptions, labeled plots or numerical comparisons with units, and a paragraph explaining a failure or limitation. Include the exact run command. The weekly practice rubric awards 40% for correctness and checks, 30% for the controlled comparison, 20% for interpretation, and 10% for reproducibility.
Extension
Choose a project with one modeling question and one independent check. The final assessment supplies the required report and reproducibility checklist.