[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111320":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":27,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},111320,"NablaEngine","sailab-ai\u002FNablaEngine","sailab-ai","Fast, exact simulation gradients for the Unitree G1: a differentiable GPU physics engine with JAX and PyTorch interfaces.","https:\u002F\u002Fsailab.ai\u002Fnablamimic\u002F",null,"Python",70,9,57,1,0,3,6,13,11,53.3,"Apache License 2.0",false,"main",true,[],"2026-11-23 11:49:38","2026-11-23 10:59:00","# NablaEngine\n\n**Fast, exact simulation gradients for the Unitree G1 and other legged robots.**\n\n*Pronounced \"Nabla Engine\".*\n\n## News\n\n- **2026-11-07, 0.2.0:** other legged robots (Unitree Go1, Go2, A1 and H1, ANYbotics ANYmal C, Boston Dynamics Spot,\n  Booster T1, ROBOTIS OP3, Berkeley Humanoid; `docs\u002Frobots.md`) and terrain: boxes, heightfields and a height scan\n  (`docs\u002Fterrain.md`). The G1's results are unchanged.\n- **2026-10-31, 0.1.0:** first release: the Unitree G1.\n\nAll release notes: [Releases](https:\u002F\u002Fgithub.com\u002Fsailab-ai\u002FNablaEngine\u002Freleases), [`CHANGELOG.md`](CHANGELOG.md).\n\n\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Fassets\u002Fspeed_fwd.png\" alt=\"Forward step: NablaEngine 1.21 ms per control step, against MuJoCo Warp, Genesis, Isaac Lab, MJX and MuJoCo C\" width=\"820\">\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Fassets\u002Fspeed_bwd.png\" alt=\"A step and its gradient: NablaEngine 1.78 ms, MuJoCo Warp with its adjoint pull request 20.5 ms\" width=\"820\">\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Fassets\u002Fspeed_ppo.png\" alt=\"Time per PPO iteration: NablaEngine 0.123 s, MuJoCo Warp 0.355 s\" width=\"820\">\u003C\u002Fp>\n\n\u003Csub>One 20 ms control step for 4096 Unitree G1 worlds on one NVIDIA RTX PRO 6000 (forward, and forward with the\ngradient from the input state), and one PPO iteration (4096 environments x 24 steps, plus 20 gradient steps) with the\nsame configuration. MuJoCo Warp and MJX simulate the same model (medians over 3 processes,\n`docs\u002Fresults\u002Fpaper_rtx6000\u002Fpaper_bench.md`); Isaac Lab runs its own G1 asset with its task defaults (median over\nrounds, `docs\u002Fresults\u002Fphysx_rtx6000\u002Fphysx_bench_results.md`). Other GPUs (H100, RTX 3090, V100): the\n[project page](https:\u002F\u002Fsailab.ai\u002Fnablamimic\u002F).\u003C\u002Fsub>\n\nNablaEngine is a differentiable GPU physics engine for legged robots, built first for the Unitree G1 humanoid. It\nsimulates thousands of worlds per call with MuJoCo's physics and returns analytic gradients of every step with respect to the state and the actions,\nfor first-order policy learning, trajectory optimization and system identification. It plugs into JAX\n(`jax.jit`, `jax.grad`, `lax.scan`) and PyTorch (`torch.autograd`, CUDA graphs, `torch.compile`) as a differentiable\nfunction, with bitwise the same results in both.\n\n- **Fast.** One control step of 4096 worlds in 1.21 ms, its gradient in 1.78 ms, and the full 71x99 Jacobian of the\n  step in 9.7 µs per world (RTX PRO 6000).\n- **Exact.** Against float64 MuJoCo on 16,384 held-out states: forward median relative error 8.5e-7, gradient median\n  relative errors 3.6e-5 \u002F 1.0e-5 \u002F 1.9e-6 (qpos \u002F qvel \u002F ctrl) against float64 finite differences\n  (`docs\u002Fresults\u002Fpaper_accuracy_heldout_v100.md`).\n- **Deterministic.** Outputs and gradients are bitwise identical from run to run.\n\n**Used by.** [∇Mimic (NablaMimic)](https:\u002F\u002Fgithub.com\u002FOamIcs\u002FNablaMimic), whole-body motion tracking learned with\nthe engine's simulation gradients.\n\n**Paper.** [∇Mimic: Ultra-Efficient Humanoid Control with Differentiable Simulation](https:\u002F\u002Fsailab.ai\u002Fnablamimic\u002Fassets\u002Fnablamimic.pdf) ([project page](https:\u002F\u002Fsailab.ai\u002Fnablamimic\u002F))\n\n## Scope\n\nNablaEngine is specialized for one class of robot models, with the Unitree G1 (the mjlab model) as the first:\n- a floating base with one hinge per body;\n- contacts between planes, spheres, capsules and boxes;\n- joint limits, PD position actuators;\n- MuJoCo's Newton solver and implicitfast integration, in float32.\n\nBeyond the G1 it is validated on the Unitree Go1, Go2, A1 and H1, ANYbotics ANYmal C, Boston Dynamics Spot,\nBooster T1, ROBOTIS OP3 and Berkeley Humanoid (`docs\u002Frobots.md`).\n\nTerrain builds add static boxes and heightfields with a height scan (`docs\u002Fterrain.md`).\n\nOther models are rejected with an error that names the unsupported features.\n\nRequirements: Linux x86_64, an NVIDIA GPU of compute capability 7.0 or newer (tested: V100, RTX 3090, H100, RTX PRO\n6000), Python 3.12, and a CUDA 12.x toolkit (nvcc) for the one-time build of the CUDA library (about 15 s, cached).\n\n## Installation\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FOamIcs\u002FNablaEngine.git NablaEngine && cd NablaEngine\nscripts\u002Fsetup_env.sh               # a Python 3.12 environment in .dk_env\u002F with the tested versions\nsource .dk_env\u002Factivate.sh\nscripts\u002Fverify.sh --quick          # checks the installation in a few minutes\n```\n\nFor PyTorch, add it to that environment and build the engine's library once (`docs\u002Fapi_torch.md`):\n\n```bash\npip install torch                  # a CUDA 12 build; on a V100 the cu126 wheels\npython -m nablaengine.torch_ffi build\n```\n\nOptions, a PyTorch-only environment, a manual installation and use outside the checkout: `docs\u002Finstall.md`.\n\n## Quick start\n\nJAX:\n\n```python\nimport jax\nimport jax.numpy as jnp\n\nfrom nablaengine import fixtures, jax_ffi\n\njax_ffi.init()                         # builds the CUDA library on first use, then loads it from the cache\nz = fixtures.load_corpus(\"mf_s0\")      # 4096 states of the G1\nB = 256\nqpos, qvel, warm, ctrl, friction, com = (jnp.asarray(z[k][:B]) for k in\n                                         (\"qpos\", \"qvel\", \"qacc_warmstart\", \"ctrl\", \"friction\", \"com\"))\n\nqpos1, qvel1, warm1 = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com)  # one control step: 4 substeps of 5 ms\n\n\ndef loss(ctrl):\n    q, v, _ = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com)\n    return jnp.sum(v ** 2)\n\n\ng = jax.jit(jax.grad(loss))(ctrl)      # through the analytic adjoint\n```\n\nPyTorch (no JAX needed):\n\n```python\nimport torch\n\nfrom nablaengine import fixtures, torch_ffi\n\ntorch_ffi.init()                       # loads the library built by `python -m nablaengine.torch_ffi build`\nz = fixtures.load_corpus(\"mf_s0\")\nqpos, qvel, warm, ctrl, friction, com = (torch.from_numpy(z[k][:256]).cuda() for k in\n                                         (\"qpos\", \"qvel\", \"qacc_warmstart\", \"ctrl\", \"friction\", \"com\"))\nctrl.requires_grad_()\nqpos1, qvel1, warm1 = torch_ffi.step(qpos, qvel, warm, ctrl, friction, com)\n(qvel1 ** 2).sum().backward()          # ctrl.grad through the analytic adjoint\n```\n\nInputs are float32 arrays with the worlds as the leading dimension: `qpos (B, 36)`, `qvel (B, 35)`, the solver's warm\nstart `warm (B, 35)`, the position targets `ctrl (B, 29)`, and per-world foot `friction (B,)` and torso\ncentre-of-mass offset `com (B, 3)` for domain randomization. Each world holds up to 64 contacts and 192 constraint\nrows; a world beyond them (e.g. deep interpenetration after a fall) drops the extra ones and is flagged and counted\n(`docs\u002Fapi.md`, Diagnostics).\n\n## Documentation\n\n- `docs\u002Fapi.md`: the JAX interface: options, gradient modes, kinematics outputs, rollouts with `lax.scan` and\n  `jax.checkpoint`, diagnostics.\n- `docs\u002Fapi_torch.md`: the PyTorch interface: the build artifact, CUDA graphs, `torch.compile`, several GPUs.\n- `docs\u002Frobots.md`: other robots: exporting and checking a model, accuracy and timings.\n- `docs\u002Fterrain.md`: terrain builds: boxes, heightfields, the height scan.\n- `docs\u002Fverification.md`: what `scripts\u002Fverify.sh` checks, against which references.\n- `docs\u002Fconfiguration.md`: environment variables and build switches.\n- `benchmarks\u002FREADME.md`, `scripts\u002Fpaper_bench\u002FREADME.md`: reproduce the accuracy tables and the timings.\n\n## Licence\n\nApache License 2.0 (`LICENSE`), Copyright 2026 The NablaEngine Authors. `NOTICE` and `THIRD_PARTY_NOTICES.md` list the\ncode derived from MuJoCo Warp and MuJoCo (Apache-2.0) and the model, which is derived from MuJoCo Menagerie's Unitree\nG1 (BSD-3-Clause, `fixtures\u002Fmjlab\u002FLICENSE`) with mjlab's configuration (Apache-2.0).\n\n## Citation\n\nA paper reference will be added here. Until then, please cite the software (`CITATION.cff`):\n\n```bibtex\n@software{nablaengine,\n  title  = {NablaEngine: fused CUDA physics with an analytic adjoint for the Unitree G1},\n  author = {{The NablaEngine Authors}},\n  year   = {2026},\n  url    = {https:\u002F\u002Fgithub.com\u002FOamIcs\u002FNablaEngine}\n}\n```\n","NablaEngine 是一个面向仿生腿足机器人的可微分 GPU 物理仿真引擎，专为 Unitree G1 等主流四足\u002F双足机器人（如 Go1、Spot、ANYmal、H1）提供高速、精确的前向仿真与解析梯度计算。它基于 MuJoCo 物理模型实现，支持 JAX 和 PyTorch 原生自动微分接口（如 jax.grad、torch.autograd），在单卡上可并行仿真数千个环境，前向与梯度计算延迟均达毫秒级，且结果确定性高、浮点精度误差低于 1e-5。适用于基于梯度的策略优化（如 PPO）、运动轨迹规划、系统辨识及端到端运动控制学习等强化学习与最优控制任务。",2,"2026-11-24 04:40:49","CREATED_QUERY"]