nablaengine 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. nablaengine-1.0.2/LICENSE +202 -0
  2. nablaengine-1.0.2/MANIFEST.in +3 -0
  3. nablaengine-1.0.2/NOTICE +23 -0
  4. nablaengine-1.0.2/PKG-INFO +236 -0
  5. nablaengine-1.0.2/README.md +196 -0
  6. nablaengine-1.0.2/THIRD_PARTY_NOTICES.md +176 -0
  7. nablaengine-1.0.2/benchmarks/data/mf_s0.npz +0 -0
  8. nablaengine-1.0.2/fixtures/mjlab/LICENSE +27 -0
  9. nablaengine-1.0.2/fixtures/mjlab/README.md +113 -0
  10. nablaengine-1.0.2/fixtures/mjlab/g1_meta.json +32 -0
  11. nablaengine-1.0.2/fixtures/mjlab/g1_train.mjb +0 -0
  12. nablaengine-1.0.2/pyproject.toml +78 -0
  13. nablaengine-1.0.2/setup.cfg +4 -0
  14. nablaengine-1.0.2/setup.py +34 -0
  15. nablaengine-1.0.2/src/nablaengine/__init__.py +4 -0
  16. nablaengine-1.0.2/src/nablaengine/_fixtures/README.md +19 -0
  17. nablaengine-1.0.2/src/nablaengine/_optional.py +30 -0
  18. nablaengine-1.0.2/src/nablaengine/_paths.py +38 -0
  19. nablaengine-1.0.2/src/nablaengine/actuators/__init__.py +169 -0
  20. nablaengine-1.0.2/src/nablaengine/actuators/bam.py +306 -0
  21. nablaengine-1.0.2/src/nablaengine/actuators/bam_params/LICENSE +202 -0
  22. nablaengine-1.0.2/src/nablaengine/actuators/bam_params/xl330/m6.json +19 -0
  23. nablaengine-1.0.2/src/nablaengine/boxbox.py +259 -0
  24. nablaengine-1.0.2/src/nablaengine/ccd.py +1122 -0
  25. nablaengine-1.0.2/src/nablaengine/checks.py +376 -0
  26. nablaengine-1.0.2/src/nablaengine/cuda.py +483 -0
  27. nablaengine-1.0.2/src/nablaengine/dist_query.py +628 -0
  28. nablaengine-1.0.2/src/nablaengine/dual.py +223 -0
  29. nablaengine-1.0.2/src/nablaengine/dyn_query.py +685 -0
  30. nablaengine-1.0.2/src/nablaengine/engines.py +114 -0
  31. nablaengine-1.0.2/src/nablaengine/envs/__init__.py +24 -0
  32. nablaengine-1.0.2/src/nablaengine/envs/brax.py +165 -0
  33. nablaengine-1.0.2/src/nablaengine/envs/convert.py +771 -0
  34. nablaengine-1.0.2/src/nablaengine/envs/dmc.py +523 -0
  35. nablaengine-1.0.2/src/nablaengine/envs/env.py +233 -0
  36. nablaengine-1.0.2/src/nablaengine/envs/kin.py +371 -0
  37. nablaengine-1.0.2/src/nablaengine/envs/ops.py +134 -0
  38. nablaengine-1.0.2/src/nablaengine/envs/rewards.py +57 -0
  39. nablaengine-1.0.2/src/nablaengine/fixtures.py +243 -0
  40. nablaengine-1.0.2/src/nablaengine/forest_engine/__init__.py +0 -0
  41. nablaengine-1.0.2/src/nablaengine/forest_engine/adjoint.py +1726 -0
  42. nablaengine-1.0.2/src/nablaengine/forest_engine/adjoint_contact.py +493 -0
  43. nablaengine-1.0.2/src/nablaengine/forest_engine/bam_hooks.py +248 -0
  44. nablaengine-1.0.2/src/nablaengine/forest_engine/body_params.py +1007 -0
  45. nablaengine-1.0.2/src/nablaengine/forest_engine/capacity_diag.py +116 -0
  46. nablaengine-1.0.2/src/nablaengine/forest_engine/ccd_coop.py +250 -0
  47. nablaengine-1.0.2/src/nablaengine/forest_engine/chol_blk.py +80 -0
  48. nablaengine-1.0.2/src/nablaengine/forest_engine/contact_forces.py +142 -0
  49. nablaengine-1.0.2/src/nablaengine/forest_engine/contact_vjp.py +462 -0
  50. nablaengine-1.0.2/src/nablaengine/forest_engine/convex.py +1331 -0
  51. nablaengine-1.0.2/src/nablaengine/forest_engine/cylinder.py +73 -0
  52. nablaengine-1.0.2/src/nablaengine/forest_engine/dist_device.py +923 -0
  53. nablaengine-1.0.2/src/nablaengine/forest_engine/dyn_device.py +696 -0
  54. nablaengine-1.0.2/src/nablaengine/forest_engine/ellipsoid.py +179 -0
  55. nablaengine-1.0.2/src/nablaengine/forest_engine/elliptic.py +272 -0
  56. nablaengine-1.0.2/src/nablaengine/forest_engine/equality.py +842 -0
  57. nablaengine-1.0.2/src/nablaengine/forest_engine/floss.py +148 -0
  58. nablaengine-1.0.2/src/nablaengine/forest_engine/foot_offset.py +368 -0
  59. nablaengine-1.0.2/src/nablaengine/forest_engine/free_gyro.py +288 -0
  60. nablaengine-1.0.2/src/nablaengine/forest_engine/host.py +530 -0
  61. nablaengine-1.0.2/src/nablaengine/forest_engine/kdof64.py +127 -0
  62. nablaengine-1.0.2/src/nablaengine/forest_engine/kinematics.py +320 -0
  63. nablaengine-1.0.2/src/nablaengine/forest_engine/margin.py +167 -0
  64. nablaengine-1.0.2/src/nablaengine/forest_engine/margin_convex.py +326 -0
  65. nablaengine-1.0.2/src/nablaengine/forest_engine/midphase.py +439 -0
  66. nablaengine-1.0.2/src/nablaengine/forest_engine/model_hooks.py +913 -0
  67. nablaengine-1.0.2/src/nablaengine/forest_engine/motor_hooks.py +50 -0
  68. nablaengine-1.0.2/src/nablaengine/forest_engine/muscle.py +485 -0
  69. nablaengine-1.0.2/src/nablaengine/forest_engine/nb128.py +118 -0
  70. nablaengine-1.0.2/src/nablaengine/forest_engine/nb64.py +163 -0
  71. nablaengine-1.0.2/src/nablaengine/forest_engine/noslip.py +1124 -0
  72. nablaengine-1.0.2/src/nablaengine/forest_engine/nv128.py +1944 -0
  73. nablaengine-1.0.2/src/nablaengine/forest_engine/object_size.py +283 -0
  74. nablaengine-1.0.2/src/nablaengine/forest_engine/replay_guard.py +40 -0
  75. nablaengine-1.0.2/src/nablaengine/forest_engine/root_spread.py +126 -0
  76. nablaengine-1.0.2/src/nablaengine/forest_engine/solref.py +74 -0
  77. nablaengine-1.0.2/src/nablaengine/forest_engine/source.py +1464 -0
  78. nablaengine-1.0.2/src/nablaengine/forest_engine/sparse_pattern.py +527 -0
  79. nablaengine-1.0.2/src/nablaengine/forest_engine/spatial.py +1045 -0
  80. nablaengine-1.0.2/src/nablaengine/forest_engine/step.py +3083 -0
  81. nablaengine-1.0.2/src/nablaengine/forest_engine/surrogate.py +498 -0
  82. nablaengine-1.0.2/src/nablaengine/forest_engine/tape.py +199 -0
  83. nablaengine-1.0.2/src/nablaengine/forest_engine/tendon.py +845 -0
  84. nablaengine-1.0.2/src/nablaengine/forest_engine/terrain.py +1059 -0
  85. nablaengine-1.0.2/src/nablaengine/forest_engine/world_forces.py +166 -0
  86. nablaengine-1.0.2/src/nablaengine/forest_engine/world_params.py +230 -0
  87. nablaengine-1.0.2/src/nablaengine/g1_engine/__init__.py +0 -0
  88. nablaengine-1.0.2/src/nablaengine/g1_engine/adjoint.py +1661 -0
  89. nablaengine-1.0.2/src/nablaengine/g1_engine/adjoint_contact.py +577 -0
  90. nablaengine-1.0.2/src/nablaengine/g1_engine/bam_hooks.py +596 -0
  91. nablaengine-1.0.2/src/nablaengine/g1_engine/condim4.py +245 -0
  92. nablaengine-1.0.2/src/nablaengine/g1_engine/contact_forces.py +500 -0
  93. nablaengine-1.0.2/src/nablaengine/g1_engine/cylccd.py +1158 -0
  94. nablaengine-1.0.2/src/nablaengine/g1_engine/cylinder.py +216 -0
  95. nablaengine-1.0.2/src/nablaengine/g1_engine/elliptic.py +565 -0
  96. nablaengine-1.0.2/src/nablaengine/g1_engine/exact_replay.py +61 -0
  97. nablaengine-1.0.2/src/nablaengine/g1_engine/host.py +358 -0
  98. nablaengine-1.0.2/src/nablaengine/g1_engine/kinematics.py +320 -0
  99. nablaengine-1.0.2/src/nablaengine/g1_engine/mesh.py +305 -0
  100. nablaengine-1.0.2/src/nablaengine/g1_engine/mesh_tables.py +79 -0
  101. nablaengine-1.0.2/src/nablaengine/g1_engine/model_hooks.py +919 -0
  102. nablaengine-1.0.2/src/nablaengine/g1_engine/motor_hooks.py +70 -0
  103. nablaengine-1.0.2/src/nablaengine/g1_engine/replay_guard.py +55 -0
  104. nablaengine-1.0.2/src/nablaengine/g1_engine/source.py +1107 -0
  105. nablaengine-1.0.2/src/nablaengine/g1_engine/sphbox.py +93 -0
  106. nablaengine-1.0.2/src/nablaengine/g1_engine/step.py +3716 -0
  107. nablaengine-1.0.2/src/nablaengine/g1_engine/tape.py +173 -0
  108. nablaengine-1.0.2/src/nablaengine/g1_engine/world_params.py +447 -0
  109. nablaengine-1.0.2/src/nablaengine/identity.py +401 -0
  110. nablaengine-1.0.2/src/nablaengine/jax_ffi.py +2536 -0
  111. nablaengine-1.0.2/src/nablaengine/model/__init__.py +1 -0
  112. nablaengine-1.0.2/src/nablaengine/model/capability.py +694 -0
  113. nablaengine-1.0.2/src/nablaengine/model/fields.py +317 -0
  114. nablaengine-1.0.2/src/nablaengine/model/gravcomp.py +64 -0
  115. nablaengine-1.0.2/src/nablaengine/model/invweight.py +145 -0
  116. nablaengine-1.0.2/src/nablaengine/motor.py +143 -0
  117. nablaengine-1.0.2/src/nablaengine/object_geometry.py +609 -0
  118. nablaengine-1.0.2/src/nablaengine/params.py +258 -0
  119. nablaengine-1.0.2/src/nablaengine/provenance.py +196 -0
  120. nablaengine-1.0.2/src/nablaengine/reference/__init__.py +0 -0
  121. nablaengine-1.0.2/src/nablaengine/reference/adjoint_groups.py +226 -0
  122. nablaengine-1.0.2/src/nablaengine/reference/jax64.py +690 -0
  123. nablaengine-1.0.2/src/nablaengine/reference/warp_physics.py +262 -0
  124. nablaengine-1.0.2/src/nablaengine/sensors/__init__.py +4 -0
  125. nablaengine-1.0.2/src/nablaengine/sensors/cameras.py +285 -0
  126. nablaengine-1.0.2/src/nablaengine/sensors/data/LIVOX_MID360_LICENSE +21 -0
  127. nablaengine-1.0.2/src/nablaengine/sensors/data/livox_mid360.npz +0 -0
  128. nablaengine-1.0.2/src/nablaengine/sensors/g1.py +521 -0
  129. nablaengine-1.0.2/src/nablaengine/sensors/jax_rays.py +364 -0
  130. nablaengine-1.0.2/src/nablaengine/sensors/optix_rays.py +725 -0
  131. nablaengine-1.0.2/src/nablaengine/sensors/raycore.py +630 -0
  132. nablaengine-1.0.2/src/nablaengine/sensors/raygrad.py +374 -0
  133. nablaengine-1.0.2/src/nablaengine/sensors/raygrad_cuda.py +191 -0
  134. nablaengine-1.0.2/src/nablaengine/sensors/robot_mesh.py +273 -0
  135. nablaengine-1.0.2/src/nablaengine/sensors/torch_rays.py +275 -0
  136. nablaengine-1.0.2/src/nablaengine/terrain.py +424 -0
  137. nablaengine-1.0.2/src/nablaengine/torch_ffi.py +1328 -0
  138. nablaengine-1.0.2/src/nablaengine/workdir.py +37 -0
  139. nablaengine-1.0.2/src/nablaengine.egg-info/PKG-INFO +236 -0
  140. nablaengine-1.0.2/src/nablaengine.egg-info/SOURCES.txt +141 -0
  141. nablaengine-1.0.2/src/nablaengine.egg-info/dependency_links.txt +1 -0
  142. nablaengine-1.0.2/src/nablaengine.egg-info/requires.txt +24 -0
  143. nablaengine-1.0.2/src/nablaengine.egg-info/top_level.txt +1 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 The NablaEngine Authors
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ # the default fixtures packaged into the wheel by setup.py
2
+ include fixtures/mjlab/g1_train.mjb fixtures/mjlab/g1_meta.json fixtures/mjlab/LICENSE fixtures/mjlab/README.md
3
+ include benchmarks/data/mf_s0.npz
@@ -0,0 +1,23 @@
1
+ NablaEngine
2
+ Copyright 2026 The NablaEngine Authors
3
+
4
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ This product includes code derived from MuJoCo Warp
7
+ (https://github.com/google-deepmind/mujoco_warp), Copyright 2025 The Newton Developers,
8
+ licensed under the Apache License, Version 2.0. Parts of that code follow MuJoCo
9
+ (https://github.com/google-deepmind/mujoco), Copyright 2021 DeepMind Technologies Limited,
10
+ licensed under the Apache License, Version 2.0.
11
+
12
+ The model fixtures/mjlab/g1_train.mjb is derived from the Unitree G1 description of
13
+ MuJoCo Menagerie (https://github.com/google-deepmind/mujoco_menagerie), Copyright (c)
14
+ 2016-2023 HangZhou YuShu TECHNOLOGY CO.,LTD. ("Unitree Robotics"), licensed under the
15
+ BSD 3-Clause License (see fixtures/mjlab/LICENSE). Its modifications follow the G1
16
+ configuration of mjlab (https://github.com/mujocolab/mjlab), Copyright 2025, The mjlab
17
+ Developers, licensed under the Apache License, Version 2.0.
18
+
19
+ The file src/nablaengine/actuators/bam_params/xl330/m6.json is copied from BAM (Better Actuator
20
+ Models, https://github.com/Rhoban/bam) by Marc Duclusaud and Grégoire Passault (Rhoban),
21
+ licensed under the Apache License, Version 2.0 (see src/nablaengine/actuators/bam_params/LICENSE).
22
+
23
+ THIRD_PARTY_NOTICES.md lists the files concerned, their sources and the changes made.
@@ -0,0 +1,236 @@
1
+ Metadata-Version: 2.4
2
+ Name: nablaengine
3
+ Version: 1.0.2
4
+ Summary: Fused CUDA physics with an analytic adjoint for MuJoCo models (legged robots, multi-body scenes), with JAX and PyTorch interfaces
5
+ Author: The NablaEngine Authors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/sailab-ai/NablaEngine
8
+ Keywords: physics,simulation,differentiable,cuda,jax,robotics,mujoco
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: GPU :: NVIDIA CUDA :: 12
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Scientific/Engineering :: Physics
16
+ Requires-Python: >=3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: NOTICE
20
+ License-File: THIRD_PARTY_NOTICES.md
21
+ Requires-Dist: numpy>=2.2
22
+ Requires-Dist: mujoco==3.17.0
23
+ Provides-Extra: jax
24
+ Requires-Dist: jax==0.12.0.1; extra == "jax"
25
+ Requires-Dist: jaxlib==0.12.0.1; extra == "jax"
26
+ Provides-Extra: cuda
27
+ Requires-Dist: jax-cuda12-plugin[with-cuda]==0.12.0.1; extra == "cuda"
28
+ Requires-Dist: jax-cuda12-pjrt==0.12.0.1; extra == "cuda"
29
+ Requires-Dist: nvidia-cuda-nvcc-cu12==12.9.86; extra == "cuda"
30
+ Provides-Extra: torch
31
+ Requires-Dist: torch>=2.6; extra == "torch"
32
+ Provides-Extra: dmc
33
+ Requires-Dist: dm_control; extra == "dmc"
34
+ Provides-Extra: brax
35
+ Requires-Dist: brax; extra == "brax"
36
+ Provides-Extra: checks
37
+ Requires-Dist: mujoco-mjx==3.17.0; extra == "checks"
38
+ Requires-Dist: scipy==1.18.1; extra == "checks"
39
+ Dynamic: license-file
40
+
41
+ # NablaEngine
42
+
43
+ **Thousands of worlds per call on one GPU, with analytic gradients for learning, control and system identification, aligned with MuJoCo.**
44
+
45
+ *Pronounced "Nabla Engine".*
46
+
47
+ ## News
48
+
49
+ - **2026-11-23, 1.0.2:** on PyPI: `pip install nablaengine`.
50
+ - **2026-11-23, 1.0.1:** Pollen Robotics' Microduck with BAM servo checks (#3), and an overview of the supported
51
+ scenes.
52
+ - **2026-11-22, 1.0.0:** the forest engine (several trees, motors, meshes, equality constraints, tendons, noslip),
53
+ per-world parameters, dynamics queries, the BAM servo model, and DeepMind Control Suite / Brax tasks.
54
+ - **2026-11-07, 0.2.0:** other legged robots (Unitree Go1, Go2, A1 and H1 (#1), ANYbotics ANYmal C, Boston Dynamics
55
+ Spot, Booster T1, ROBOTIS OP3, Berkeley Humanoid; `docs/robots.md`) and terrain: boxes, heightfields and a height
56
+ scan (`docs/terrain.md`). The G1's results are unchanged.
57
+ - **2026-10-31, 0.1.0:** first release: the Unitree G1.
58
+
59
+ All release notes: [Releases](https://github.com/sailab-ai/NablaEngine/releases), [`CHANGELOG.md`](https://github.com/sailab-ai/NablaEngine/blob/main/CHANGELOG.md).
60
+
61
+ <p align="center"><img src="https://raw.githubusercontent.com/sailab-ai/NablaEngine/main/docs/assets/speed_fwd.png" alt="Forward step: NablaEngine 1.21 ms per control step, against MuJoCo Warp, Genesis, Isaac Lab, MJX and MuJoCo C" width="820"></p>
62
+ <p align="center"><img src="https://raw.githubusercontent.com/sailab-ai/NablaEngine/main/docs/assets/speed_bwd.png" alt="A step and its gradient: NablaEngine 1.78 ms, MuJoCo Warp with its adjoint pull request 20.5 ms" width="820"></p>
63
+ <p align="center"><img src="https://raw.githubusercontent.com/sailab-ai/NablaEngine/main/docs/assets/speed_ppo.png" alt="Time per PPO iteration: NablaEngine 0.123 s, MuJoCo Warp 0.355 s" width="820"></p>
64
+
65
+ <sub>One 20 ms control step for 4096 Unitree G1 worlds on one NVIDIA RTX PRO 6000 (forward, and forward with the
66
+ gradient from the input state), and one PPO iteration (4096 environments x 24 steps, plus 20 gradient steps) with the
67
+ same configuration, on the G1 engine (`DK_ENGINE=tree`; the forest engine, the default since 1.0.0, is measured
68
+ against it in `docs/engines.md`). MuJoCo Warp and MJX simulate the same model (medians over 3 processes,
69
+ `docs/results/paper_rtx6000/paper_bench.md`); Isaac Lab runs its own G1 asset with its task defaults (median over
70
+ rounds, `docs/results/physx_rtx6000/physx_bench_results.md`). Other GPUs (H100, RTX 3090, V100): the
71
+ [project page](https://sailab.ai/nablamimic/).</sub>
72
+
73
+ NablaEngine is a differentiable GPU physics engine, built first for the Unitree G1 humanoid and since 1.0.0 for a
74
+ wider class of MuJoCo models. It simulates thousands of worlds per call with MuJoCo's physics and returns analytic gradients of every step with respect to the state and the actions,
75
+ for first-order policy learning, trajectory optimization and system identification. It plugs into JAX
76
+ (`jax.jit`, `jax.grad`, `lax.scan`) and PyTorch (`torch.autograd`, CUDA graphs, `torch.compile`) as a differentiable
77
+ function, with bitwise the same results in both.
78
+
79
+ - **Fast.** One control step of 4096 worlds in 1.21 ms, its gradient in 1.78 ms, and the full 71x99 Jacobian of the
80
+ step in 9.7 µs per world (RTX PRO 6000, the G1 engine).
81
+ - **Exact.** Against float64 MuJoCo on 16,384 held-out states: forward median relative error 8.5e-7, gradient median
82
+ relative errors 3.6e-5 / 1.0e-5 / 1.9e-6 (qpos / qvel / ctrl) against float64 finite differences
83
+ (`docs/results/paper_accuracy_heldout_v100.md`).
84
+ - **Deterministic.** Outputs and gradients are bitwise identical from run to run.
85
+
86
+ **Used by.** [∇Mimic (NablaMimic)](https://github.com/sailab-ai/NablaMimic), whole-body motion tracking learned with
87
+ the engine's simulation gradients.
88
+
89
+ **Paper.** [∇Mimic: Ultra-Efficient Humanoid Control with Differentiable Simulation](https://sailab.ai/nablamimic/assets/nablamimic.pdf) ([project page](https://sailab.ai/nablamimic/))
90
+
91
+ ## Scope
92
+
93
+ Two code generators share one interface; the engine is picked from the model (`docs/engines.md`):
94
+
95
+ - **Forest engine** (default): several kinematic trees, hinge and slide roots, motors and affine actuators, Euler and
96
+ implicitfast, up to 64 bodies; planes, spheres, capsules, boxes, cylinders, ellipsoids and convex meshes; equality
97
+ constraints and fixed tendons; noslip; per-world parameters; dynamics queries; the DeepMind Control Suite and Brax
98
+ tasks (`nablaengine.envs`).
99
+ - **G1 engine**: one free tree with position servos (the mjlab G1 and the robots of `docs/robots.md`); select it with
100
+ `DK_ENGINE=tree` or `engines.prefer_tree(m)`.
101
+
102
+ Both run MuJoCo's Newton solver in float32 with analytic gradients, terrain builds (`docs/terrain.md`) and the BAM
103
+ servo model (`docs/actuators.md`). Experimental features are listed in `CHANGELOG.md`. Unsupported models are
104
+ rejected with an error that names the missing features.
105
+
106
+ Requirements: Linux x86_64, an NVIDIA GPU of compute capability 7.0 or newer (tested: V100, RTX 3090, H100, RTX PRO
107
+ 6000), Python 3.12, and a CUDA 12.x toolkit (nvcc) for the one-time build of the CUDA library (about 15 s, cached).
108
+
109
+ ## What you can simulate
110
+
111
+ - **Humanoids on mixed terrain**: the Unitree G1 and other humanoids on stairs, steps, boxes and rough heightfields,
112
+ with a height scan and moving platforms (`docs/terrain.md`, `docs/robots.md`). Motion tracking built on the engine:
113
+ [∇Mimic](https://github.com/sailab-ai/NablaMimic).
114
+ - **Humanoid-object interaction and loco-manipulation**: humanoids and arms with free objects in one scene (forest
115
+ engine): contacts with boxes and convex meshes, per-world objects, contact forces and distance queries with gradients
116
+ (`docs/engines.md`, `docs/api.md`; example scene `scripts/forest/models/g1box.xml`).
117
+ - **Legged robots**: Unitree Go1, Go2, A1 and H1, ANYmal C, Spot, Booster T1, OP3, Microduck and others
118
+ (`docs/robots.md`, `scripts/robots/`).
119
+ - **Control benchmarks**: DeepMind Control Suite and Brax tasks (`nablaengine.envs`, `docs/envs.md`).
120
+ - **Actuator models**: the BAM servo model and torque-speed limits (`docs/actuators.md`).
121
+ - **Experimental**: models with up to 128 dofs, spatial tendons and muscles (`docs/engines.md`, `docs/equality.md`).
122
+
123
+ ## Installation
124
+
125
+ From PyPI (Linux, Python 3.12, an NVIDIA GPU):
126
+
127
+ ```bash
128
+ pip install "nablaengine[jax,cuda]" # the JAX interface, with JAX's CUDA 12 plugin
129
+ pip install "nablaengine[torch]" # the PyTorch interface (on a V100 the cu126 wheels of torch)
130
+ ```
131
+
132
+ The CUDA library is compiled on first use, so a CUDA 12.x toolkit is needed as well (`nvcc` on `PATH`, or
133
+ `NVCC=/path/to/cuda-12.x/bin/nvcc`). The package includes the G1 model and the corpus of the quick start; the checks,
134
+ the scripts and the other robot models need a checkout:
135
+
136
+ ```bash
137
+ git clone https://github.com/sailab-ai/NablaEngine.git NablaEngine && cd NablaEngine
138
+ scripts/setup_env.sh # a Python 3.12 environment in .dk_env/ with the tested versions
139
+ source .dk_env/activate.sh
140
+ scripts/verify.sh --quick # checks the installation in a few minutes
141
+ ```
142
+
143
+ For PyTorch, add it to that environment and build the engine's library once (`docs/api_torch.md`):
144
+
145
+ ```bash
146
+ pip install torch # a CUDA 12 build; on a V100 the cu126 wheels
147
+ python -m nablaengine.torch_ffi build
148
+ ```
149
+
150
+ Options, a PyTorch-only environment, a manual installation and the packaged files: `docs/install.md`.
151
+
152
+ ## Quick start
153
+
154
+ JAX:
155
+
156
+ ```python
157
+ import jax
158
+ import jax.numpy as jnp
159
+
160
+ from nablaengine import fixtures, jax_ffi
161
+
162
+ jax_ffi.init() # builds the CUDA library on first use, then loads it from the cache
163
+ z = fixtures.load_corpus("mf_s0") # 4096 states of the G1
164
+ B = 256
165
+ qpos, qvel, warm, ctrl, friction, com = (jnp.asarray(z[k][:B]) for k in
166
+ ("qpos", "qvel", "qacc_warmstart", "ctrl", "friction", "com"))
167
+
168
+ qpos1, qvel1, warm1 = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com) # one control step: 4 substeps of 5 ms
169
+
170
+
171
+ def loss(ctrl):
172
+ q, v, _ = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com)
173
+ return jnp.sum(v ** 2)
174
+
175
+
176
+ g = jax.jit(jax.grad(loss))(ctrl) # through the analytic adjoint
177
+ ```
178
+
179
+ PyTorch (no JAX needed):
180
+
181
+ ```python
182
+ import torch
183
+
184
+ from nablaengine import fixtures, torch_ffi
185
+
186
+ torch_ffi.init() # loads the library built by `python -m nablaengine.torch_ffi build`
187
+ z = fixtures.load_corpus("mf_s0")
188
+ qpos, qvel, warm, ctrl, friction, com = (torch.from_numpy(z[k][:256]).cuda() for k in
189
+ ("qpos", "qvel", "qacc_warmstart", "ctrl", "friction", "com"))
190
+ ctrl.requires_grad_()
191
+ qpos1, qvel1, warm1 = torch_ffi.step(qpos, qvel, warm, ctrl, friction, com)
192
+ (qvel1 ** 2).sum().backward() # ctrl.grad through the analytic adjoint
193
+ ```
194
+
195
+ Inputs are float32 arrays with the worlds as the leading dimension: `qpos (B, 36)`, `qvel (B, 35)`, the solver's warm
196
+ start `warm (B, 35)`, the position targets `ctrl (B, 29)`, and per-world foot `friction (B,)` and torso
197
+ centre-of-mass offset `com (B, 3)` for domain randomization. By default each world holds up to 64 contacts and 192
198
+ constraint rows (`init(max_contacts=, max_rows=)` raises them); a world beyond them (e.g. deep interpenetration after a
199
+ fall) drops the extra ones and is flagged and counted (`docs/api.md`, Diagnostics, Capacity).
200
+
201
+ ## Documentation
202
+
203
+ - `docs/api.md`: the JAX interface: options, gradient modes, kinematics outputs, rollouts with `lax.scan` and
204
+ `jax.checkpoint`, diagnostics.
205
+ - `docs/api_torch.md`: the PyTorch interface: the build artifact, CUDA graphs, `torch.compile`, several GPUs.
206
+ - `docs/engines.md`: the two engines: which model goes where, what each supports, measurements.
207
+ - `docs/equality.md`: equality constraints, fixed and spatial tendons, muscles (forest engine).
208
+ - `docs/envs.md`: the DeepMind Control Suite and Brax tasks and the MuJoCo model converter.
209
+ - `docs/robots.md`: other robots: exporting and checking a model, accuracy and timings.
210
+ - `docs/terrain.md`: terrain builds: boxes, heightfields, the height scan.
211
+ - `docs/sensors.md`: per-world objects, their geometry per world (`object_geometry`), and the G1's sensors (depth,
212
+ segmentation, RGB, LiDAR, height scan, IMU) with their gradients.
213
+ - `docs/verification.md`: what `scripts/verify.sh` checks, against which references.
214
+ - `docs/actuators.md`: the BAM servo model.
215
+ - `docs/configuration.md`: environment variables and build switches.
216
+ - `docs/orin.md`: build notes for Jetson Orin (sm_87).
217
+ - `benchmarks/README.md`, `scripts/paper_bench/README.md`: reproduce the accuracy tables and the timings.
218
+
219
+ ## Licence
220
+
221
+ Apache License 2.0 (`LICENSE`), Copyright 2026 The NablaEngine Authors. `NOTICE` and `THIRD_PARTY_NOTICES.md` list the
222
+ code derived from MuJoCo Warp and MuJoCo (Apache-2.0) and the model, which is derived from MuJoCo Menagerie's Unitree
223
+ G1 (BSD-3-Clause, `fixtures/mjlab/LICENSE`) with mjlab's configuration (Apache-2.0).
224
+
225
+ ## Citation
226
+
227
+ A paper reference will be added here. Until then, please cite the software (`CITATION.cff`):
228
+
229
+ ```bibtex
230
+ @software{nablaengine,
231
+ title = {NablaEngine: fast and exact differentiable physics simulation for embodied AI},
232
+ author = {{The NablaEngine Authors}},
233
+ year = {2026},
234
+ url = {https://github.com/sailab-ai/NablaEngine}
235
+ }
236
+ ```
@@ -0,0 +1,196 @@
1
+ # NablaEngine
2
+
3
+ **Thousands of worlds per call on one GPU, with analytic gradients for learning, control and system identification, aligned with MuJoCo.**
4
+
5
+ *Pronounced "Nabla Engine".*
6
+
7
+ ## News
8
+
9
+ - **2026-11-23, 1.0.2:** on PyPI: `pip install nablaengine`.
10
+ - **2026-11-23, 1.0.1:** Pollen Robotics' Microduck with BAM servo checks (#3), and an overview of the supported
11
+ scenes.
12
+ - **2026-11-22, 1.0.0:** the forest engine (several trees, motors, meshes, equality constraints, tendons, noslip),
13
+ per-world parameters, dynamics queries, the BAM servo model, and DeepMind Control Suite / Brax tasks.
14
+ - **2026-11-07, 0.2.0:** other legged robots (Unitree Go1, Go2, A1 and H1 (#1), ANYbotics ANYmal C, Boston Dynamics
15
+ Spot, Booster T1, ROBOTIS OP3, Berkeley Humanoid; `docs/robots.md`) and terrain: boxes, heightfields and a height
16
+ scan (`docs/terrain.md`). The G1's results are unchanged.
17
+ - **2026-10-31, 0.1.0:** first release: the Unitree G1.
18
+
19
+ All release notes: [Releases](https://github.com/sailab-ai/NablaEngine/releases), [`CHANGELOG.md`](https://github.com/sailab-ai/NablaEngine/blob/main/CHANGELOG.md).
20
+
21
+ <p align="center"><img src="https://raw.githubusercontent.com/sailab-ai/NablaEngine/main/docs/assets/speed_fwd.png" alt="Forward step: NablaEngine 1.21 ms per control step, against MuJoCo Warp, Genesis, Isaac Lab, MJX and MuJoCo C" width="820"></p>
22
+ <p align="center"><img src="https://raw.githubusercontent.com/sailab-ai/NablaEngine/main/docs/assets/speed_bwd.png" alt="A step and its gradient: NablaEngine 1.78 ms, MuJoCo Warp with its adjoint pull request 20.5 ms" width="820"></p>
23
+ <p align="center"><img src="https://raw.githubusercontent.com/sailab-ai/NablaEngine/main/docs/assets/speed_ppo.png" alt="Time per PPO iteration: NablaEngine 0.123 s, MuJoCo Warp 0.355 s" width="820"></p>
24
+
25
+ <sub>One 20 ms control step for 4096 Unitree G1 worlds on one NVIDIA RTX PRO 6000 (forward, and forward with the
26
+ gradient from the input state), and one PPO iteration (4096 environments x 24 steps, plus 20 gradient steps) with the
27
+ same configuration, on the G1 engine (`DK_ENGINE=tree`; the forest engine, the default since 1.0.0, is measured
28
+ against it in `docs/engines.md`). MuJoCo Warp and MJX simulate the same model (medians over 3 processes,
29
+ `docs/results/paper_rtx6000/paper_bench.md`); Isaac Lab runs its own G1 asset with its task defaults (median over
30
+ rounds, `docs/results/physx_rtx6000/physx_bench_results.md`). Other GPUs (H100, RTX 3090, V100): the
31
+ [project page](https://sailab.ai/nablamimic/).</sub>
32
+
33
+ NablaEngine is a differentiable GPU physics engine, built first for the Unitree G1 humanoid and since 1.0.0 for a
34
+ wider class of MuJoCo models. It simulates thousands of worlds per call with MuJoCo's physics and returns analytic gradients of every step with respect to the state and the actions,
35
+ for first-order policy learning, trajectory optimization and system identification. It plugs into JAX
36
+ (`jax.jit`, `jax.grad`, `lax.scan`) and PyTorch (`torch.autograd`, CUDA graphs, `torch.compile`) as a differentiable
37
+ function, with bitwise the same results in both.
38
+
39
+ - **Fast.** One control step of 4096 worlds in 1.21 ms, its gradient in 1.78 ms, and the full 71x99 Jacobian of the
40
+ step in 9.7 µs per world (RTX PRO 6000, the G1 engine).
41
+ - **Exact.** Against float64 MuJoCo on 16,384 held-out states: forward median relative error 8.5e-7, gradient median
42
+ relative errors 3.6e-5 / 1.0e-5 / 1.9e-6 (qpos / qvel / ctrl) against float64 finite differences
43
+ (`docs/results/paper_accuracy_heldout_v100.md`).
44
+ - **Deterministic.** Outputs and gradients are bitwise identical from run to run.
45
+
46
+ **Used by.** [∇Mimic (NablaMimic)](https://github.com/sailab-ai/NablaMimic), whole-body motion tracking learned with
47
+ the engine's simulation gradients.
48
+
49
+ **Paper.** [∇Mimic: Ultra-Efficient Humanoid Control with Differentiable Simulation](https://sailab.ai/nablamimic/assets/nablamimic.pdf) ([project page](https://sailab.ai/nablamimic/))
50
+
51
+ ## Scope
52
+
53
+ Two code generators share one interface; the engine is picked from the model (`docs/engines.md`):
54
+
55
+ - **Forest engine** (default): several kinematic trees, hinge and slide roots, motors and affine actuators, Euler and
56
+ implicitfast, up to 64 bodies; planes, spheres, capsules, boxes, cylinders, ellipsoids and convex meshes; equality
57
+ constraints and fixed tendons; noslip; per-world parameters; dynamics queries; the DeepMind Control Suite and Brax
58
+ tasks (`nablaengine.envs`).
59
+ - **G1 engine**: one free tree with position servos (the mjlab G1 and the robots of `docs/robots.md`); select it with
60
+ `DK_ENGINE=tree` or `engines.prefer_tree(m)`.
61
+
62
+ Both run MuJoCo's Newton solver in float32 with analytic gradients, terrain builds (`docs/terrain.md`) and the BAM
63
+ servo model (`docs/actuators.md`). Experimental features are listed in `CHANGELOG.md`. Unsupported models are
64
+ rejected with an error that names the missing features.
65
+
66
+ Requirements: Linux x86_64, an NVIDIA GPU of compute capability 7.0 or newer (tested: V100, RTX 3090, H100, RTX PRO
67
+ 6000), Python 3.12, and a CUDA 12.x toolkit (nvcc) for the one-time build of the CUDA library (about 15 s, cached).
68
+
69
+ ## What you can simulate
70
+
71
+ - **Humanoids on mixed terrain**: the Unitree G1 and other humanoids on stairs, steps, boxes and rough heightfields,
72
+ with a height scan and moving platforms (`docs/terrain.md`, `docs/robots.md`). Motion tracking built on the engine:
73
+ [∇Mimic](https://github.com/sailab-ai/NablaMimic).
74
+ - **Humanoid-object interaction and loco-manipulation**: humanoids and arms with free objects in one scene (forest
75
+ engine): contacts with boxes and convex meshes, per-world objects, contact forces and distance queries with gradients
76
+ (`docs/engines.md`, `docs/api.md`; example scene `scripts/forest/models/g1box.xml`).
77
+ - **Legged robots**: Unitree Go1, Go2, A1 and H1, ANYmal C, Spot, Booster T1, OP3, Microduck and others
78
+ (`docs/robots.md`, `scripts/robots/`).
79
+ - **Control benchmarks**: DeepMind Control Suite and Brax tasks (`nablaengine.envs`, `docs/envs.md`).
80
+ - **Actuator models**: the BAM servo model and torque-speed limits (`docs/actuators.md`).
81
+ - **Experimental**: models with up to 128 dofs, spatial tendons and muscles (`docs/engines.md`, `docs/equality.md`).
82
+
83
+ ## Installation
84
+
85
+ From PyPI (Linux, Python 3.12, an NVIDIA GPU):
86
+
87
+ ```bash
88
+ pip install "nablaengine[jax,cuda]" # the JAX interface, with JAX's CUDA 12 plugin
89
+ pip install "nablaengine[torch]" # the PyTorch interface (on a V100 the cu126 wheels of torch)
90
+ ```
91
+
92
+ The CUDA library is compiled on first use, so a CUDA 12.x toolkit is needed as well (`nvcc` on `PATH`, or
93
+ `NVCC=/path/to/cuda-12.x/bin/nvcc`). The package includes the G1 model and the corpus of the quick start; the checks,
94
+ the scripts and the other robot models need a checkout:
95
+
96
+ ```bash
97
+ git clone https://github.com/sailab-ai/NablaEngine.git NablaEngine && cd NablaEngine
98
+ scripts/setup_env.sh # a Python 3.12 environment in .dk_env/ with the tested versions
99
+ source .dk_env/activate.sh
100
+ scripts/verify.sh --quick # checks the installation in a few minutes
101
+ ```
102
+
103
+ For PyTorch, add it to that environment and build the engine's library once (`docs/api_torch.md`):
104
+
105
+ ```bash
106
+ pip install torch # a CUDA 12 build; on a V100 the cu126 wheels
107
+ python -m nablaengine.torch_ffi build
108
+ ```
109
+
110
+ Options, a PyTorch-only environment, a manual installation and the packaged files: `docs/install.md`.
111
+
112
+ ## Quick start
113
+
114
+ JAX:
115
+
116
+ ```python
117
+ import jax
118
+ import jax.numpy as jnp
119
+
120
+ from nablaengine import fixtures, jax_ffi
121
+
122
+ jax_ffi.init() # builds the CUDA library on first use, then loads it from the cache
123
+ z = fixtures.load_corpus("mf_s0") # 4096 states of the G1
124
+ B = 256
125
+ qpos, qvel, warm, ctrl, friction, com = (jnp.asarray(z[k][:B]) for k in
126
+ ("qpos", "qvel", "qacc_warmstart", "ctrl", "friction", "com"))
127
+
128
+ qpos1, qvel1, warm1 = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com) # one control step: 4 substeps of 5 ms
129
+
130
+
131
+ def loss(ctrl):
132
+ q, v, _ = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com)
133
+ return jnp.sum(v ** 2)
134
+
135
+
136
+ g = jax.jit(jax.grad(loss))(ctrl) # through the analytic adjoint
137
+ ```
138
+
139
+ PyTorch (no JAX needed):
140
+
141
+ ```python
142
+ import torch
143
+
144
+ from nablaengine import fixtures, torch_ffi
145
+
146
+ torch_ffi.init() # loads the library built by `python -m nablaengine.torch_ffi build`
147
+ z = fixtures.load_corpus("mf_s0")
148
+ qpos, qvel, warm, ctrl, friction, com = (torch.from_numpy(z[k][:256]).cuda() for k in
149
+ ("qpos", "qvel", "qacc_warmstart", "ctrl", "friction", "com"))
150
+ ctrl.requires_grad_()
151
+ qpos1, qvel1, warm1 = torch_ffi.step(qpos, qvel, warm, ctrl, friction, com)
152
+ (qvel1 ** 2).sum().backward() # ctrl.grad through the analytic adjoint
153
+ ```
154
+
155
+ Inputs are float32 arrays with the worlds as the leading dimension: `qpos (B, 36)`, `qvel (B, 35)`, the solver's warm
156
+ start `warm (B, 35)`, the position targets `ctrl (B, 29)`, and per-world foot `friction (B,)` and torso
157
+ centre-of-mass offset `com (B, 3)` for domain randomization. By default each world holds up to 64 contacts and 192
158
+ constraint rows (`init(max_contacts=, max_rows=)` raises them); a world beyond them (e.g. deep interpenetration after a
159
+ fall) drops the extra ones and is flagged and counted (`docs/api.md`, Diagnostics, Capacity).
160
+
161
+ ## Documentation
162
+
163
+ - `docs/api.md`: the JAX interface: options, gradient modes, kinematics outputs, rollouts with `lax.scan` and
164
+ `jax.checkpoint`, diagnostics.
165
+ - `docs/api_torch.md`: the PyTorch interface: the build artifact, CUDA graphs, `torch.compile`, several GPUs.
166
+ - `docs/engines.md`: the two engines: which model goes where, what each supports, measurements.
167
+ - `docs/equality.md`: equality constraints, fixed and spatial tendons, muscles (forest engine).
168
+ - `docs/envs.md`: the DeepMind Control Suite and Brax tasks and the MuJoCo model converter.
169
+ - `docs/robots.md`: other robots: exporting and checking a model, accuracy and timings.
170
+ - `docs/terrain.md`: terrain builds: boxes, heightfields, the height scan.
171
+ - `docs/sensors.md`: per-world objects, their geometry per world (`object_geometry`), and the G1's sensors (depth,
172
+ segmentation, RGB, LiDAR, height scan, IMU) with their gradients.
173
+ - `docs/verification.md`: what `scripts/verify.sh` checks, against which references.
174
+ - `docs/actuators.md`: the BAM servo model.
175
+ - `docs/configuration.md`: environment variables and build switches.
176
+ - `docs/orin.md`: build notes for Jetson Orin (sm_87).
177
+ - `benchmarks/README.md`, `scripts/paper_bench/README.md`: reproduce the accuracy tables and the timings.
178
+
179
+ ## Licence
180
+
181
+ Apache License 2.0 (`LICENSE`), Copyright 2026 The NablaEngine Authors. `NOTICE` and `THIRD_PARTY_NOTICES.md` list the
182
+ code derived from MuJoCo Warp and MuJoCo (Apache-2.0) and the model, which is derived from MuJoCo Menagerie's Unitree
183
+ G1 (BSD-3-Clause, `fixtures/mjlab/LICENSE`) with mjlab's configuration (Apache-2.0).
184
+
185
+ ## Citation
186
+
187
+ A paper reference will be added here. Until then, please cite the software (`CITATION.cff`):
188
+
189
+ ```bibtex
190
+ @software{nablaengine,
191
+ title = {NablaEngine: fast and exact differentiable physics simulation for embodied AI},
192
+ author = {{The NablaEngine Authors}},
193
+ year = {2026},
194
+ url = {https://github.com/sailab-ai/NablaEngine}
195
+ }
196
+ ```