warp-lang 1.9.0__py3-none-win_amd64.whl → 1.10.0rc2__py3-none-win_amd64.whl

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.

Potentially problematic release.


This version of warp-lang might be problematic. Click here for more details.

Files changed (350) hide show
  1. warp/__init__.py +301 -287
  2. warp/__init__.pyi +2220 -313
  3. warp/_src/__init__.py +14 -0
  4. warp/_src/autograd.py +1075 -0
  5. warp/_src/build.py +618 -0
  6. warp/_src/build_dll.py +640 -0
  7. warp/{builtins.py → _src/builtins.py} +1497 -226
  8. warp/_src/codegen.py +4359 -0
  9. warp/{config.py → _src/config.py} +178 -169
  10. warp/_src/constants.py +57 -0
  11. warp/_src/context.py +8294 -0
  12. warp/_src/dlpack.py +462 -0
  13. warp/_src/fabric.py +355 -0
  14. warp/_src/fem/__init__.py +14 -0
  15. warp/_src/fem/adaptivity.py +508 -0
  16. warp/_src/fem/cache.py +687 -0
  17. warp/_src/fem/dirichlet.py +188 -0
  18. warp/{fem → _src/fem}/domain.py +40 -30
  19. warp/_src/fem/field/__init__.py +131 -0
  20. warp/_src/fem/field/field.py +701 -0
  21. warp/{fem → _src/fem}/field/nodal_field.py +30 -15
  22. warp/{fem → _src/fem}/field/restriction.py +1 -1
  23. warp/{fem → _src/fem}/field/virtual.py +53 -27
  24. warp/_src/fem/geometry/__init__.py +32 -0
  25. warp/{fem → _src/fem}/geometry/adaptive_nanogrid.py +77 -163
  26. warp/_src/fem/geometry/closest_point.py +97 -0
  27. warp/{fem → _src/fem}/geometry/deformed_geometry.py +14 -22
  28. warp/{fem → _src/fem}/geometry/element.py +32 -10
  29. warp/{fem → _src/fem}/geometry/geometry.py +48 -20
  30. warp/{fem → _src/fem}/geometry/grid_2d.py +12 -23
  31. warp/{fem → _src/fem}/geometry/grid_3d.py +12 -23
  32. warp/{fem → _src/fem}/geometry/hexmesh.py +40 -63
  33. warp/{fem → _src/fem}/geometry/nanogrid.py +255 -248
  34. warp/{fem → _src/fem}/geometry/partition.py +121 -63
  35. warp/{fem → _src/fem}/geometry/quadmesh.py +26 -45
  36. warp/{fem → _src/fem}/geometry/tetmesh.py +40 -63
  37. warp/{fem → _src/fem}/geometry/trimesh.py +26 -45
  38. warp/{fem → _src/fem}/integrate.py +164 -158
  39. warp/_src/fem/linalg.py +383 -0
  40. warp/_src/fem/operator.py +396 -0
  41. warp/_src/fem/polynomial.py +229 -0
  42. warp/{fem → _src/fem}/quadrature/pic_quadrature.py +15 -20
  43. warp/{fem → _src/fem}/quadrature/quadrature.py +95 -47
  44. warp/_src/fem/space/__init__.py +248 -0
  45. warp/{fem → _src/fem}/space/basis_function_space.py +20 -11
  46. warp/_src/fem/space/basis_space.py +679 -0
  47. warp/{fem → _src/fem}/space/dof_mapper.py +3 -3
  48. warp/{fem → _src/fem}/space/function_space.py +14 -13
  49. warp/{fem → _src/fem}/space/grid_2d_function_space.py +4 -7
  50. warp/{fem → _src/fem}/space/grid_3d_function_space.py +4 -4
  51. warp/{fem → _src/fem}/space/hexmesh_function_space.py +4 -10
  52. warp/{fem → _src/fem}/space/nanogrid_function_space.py +3 -9
  53. warp/{fem → _src/fem}/space/partition.py +117 -60
  54. warp/{fem → _src/fem}/space/quadmesh_function_space.py +4 -10
  55. warp/{fem → _src/fem}/space/restriction.py +66 -33
  56. warp/_src/fem/space/shape/__init__.py +152 -0
  57. warp/{fem → _src/fem}/space/shape/cube_shape_function.py +9 -9
  58. warp/{fem → _src/fem}/space/shape/shape_function.py +8 -9
  59. warp/{fem → _src/fem}/space/shape/square_shape_function.py +6 -6
  60. warp/{fem → _src/fem}/space/shape/tet_shape_function.py +3 -3
  61. warp/{fem → _src/fem}/space/shape/triangle_shape_function.py +3 -3
  62. warp/{fem → _src/fem}/space/tetmesh_function_space.py +3 -9
  63. warp/_src/fem/space/topology.py +459 -0
  64. warp/{fem → _src/fem}/space/trimesh_function_space.py +3 -9
  65. warp/_src/fem/types.py +112 -0
  66. warp/_src/fem/utils.py +486 -0
  67. warp/_src/jax.py +186 -0
  68. warp/_src/jax_experimental/__init__.py +14 -0
  69. warp/_src/jax_experimental/custom_call.py +387 -0
  70. warp/_src/jax_experimental/ffi.py +1284 -0
  71. warp/_src/jax_experimental/xla_ffi.py +656 -0
  72. warp/_src/marching_cubes.py +708 -0
  73. warp/_src/math.py +414 -0
  74. warp/_src/optim/__init__.py +14 -0
  75. warp/_src/optim/adam.py +163 -0
  76. warp/_src/optim/linear.py +1606 -0
  77. warp/_src/optim/sgd.py +112 -0
  78. warp/_src/paddle.py +406 -0
  79. warp/_src/render/__init__.py +14 -0
  80. warp/_src/render/imgui_manager.py +289 -0
  81. warp/_src/render/render_opengl.py +3636 -0
  82. warp/_src/render/render_usd.py +937 -0
  83. warp/_src/render/utils.py +160 -0
  84. warp/_src/sparse.py +2716 -0
  85. warp/_src/tape.py +1206 -0
  86. warp/{thirdparty → _src/thirdparty}/unittest_parallel.py +9 -2
  87. warp/_src/torch.py +391 -0
  88. warp/_src/types.py +5870 -0
  89. warp/_src/utils.py +1693 -0
  90. warp/autograd.py +12 -1054
  91. warp/bin/warp-clang.dll +0 -0
  92. warp/bin/warp.dll +0 -0
  93. warp/build.py +8 -588
  94. warp/build_dll.py +6 -471
  95. warp/codegen.py +6 -4246
  96. warp/constants.py +6 -39
  97. warp/context.py +12 -7851
  98. warp/dlpack.py +6 -444
  99. warp/examples/distributed/example_jacobi_mpi.py +4 -5
  100. warp/examples/fem/example_adaptive_grid.py +1 -1
  101. warp/examples/fem/example_apic_fluid.py +1 -1
  102. warp/examples/fem/example_burgers.py +8 -8
  103. warp/examples/fem/example_diffusion.py +1 -1
  104. warp/examples/fem/example_distortion_energy.py +1 -1
  105. warp/examples/fem/example_mixed_elasticity.py +2 -2
  106. warp/examples/fem/example_navier_stokes.py +1 -1
  107. warp/examples/fem/example_nonconforming_contact.py +7 -7
  108. warp/examples/fem/example_stokes.py +1 -1
  109. warp/examples/fem/example_stokes_transfer.py +1 -1
  110. warp/examples/fem/utils.py +2 -2
  111. warp/examples/interop/example_jax_callable.py +1 -1
  112. warp/examples/interop/example_jax_ffi_callback.py +1 -1
  113. warp/examples/interop/example_jax_kernel.py +3 -2
  114. warp/examples/tile/example_tile_mcgp.py +191 -0
  115. warp/fabric.py +6 -337
  116. warp/fem/__init__.py +159 -97
  117. warp/fem/adaptivity.py +7 -489
  118. warp/fem/cache.py +9 -648
  119. warp/fem/dirichlet.py +6 -184
  120. warp/fem/field/__init__.py +8 -109
  121. warp/fem/field/field.py +7 -652
  122. warp/fem/geometry/__init__.py +7 -18
  123. warp/fem/geometry/closest_point.py +11 -77
  124. warp/fem/linalg.py +18 -366
  125. warp/fem/operator.py +11 -369
  126. warp/fem/polynomial.py +9 -209
  127. warp/fem/space/__init__.py +5 -211
  128. warp/fem/space/basis_space.py +6 -662
  129. warp/fem/space/shape/__init__.py +41 -118
  130. warp/fem/space/topology.py +6 -437
  131. warp/fem/types.py +6 -81
  132. warp/fem/utils.py +11 -444
  133. warp/jax.py +8 -165
  134. warp/jax_experimental/__init__.py +14 -1
  135. warp/jax_experimental/custom_call.py +8 -342
  136. warp/jax_experimental/ffi.py +17 -853
  137. warp/jax_experimental/xla_ffi.py +5 -596
  138. warp/marching_cubes.py +5 -689
  139. warp/math.py +16 -393
  140. warp/native/array.h +385 -37
  141. warp/native/builtin.h +316 -39
  142. warp/native/bvh.cpp +43 -9
  143. warp/native/bvh.cu +62 -27
  144. warp/native/bvh.h +310 -309
  145. warp/native/clang/clang.cpp +102 -97
  146. warp/native/coloring.cpp +0 -1
  147. warp/native/crt.h +208 -0
  148. warp/native/exports.h +156 -0
  149. warp/native/hashgrid.cu +2 -0
  150. warp/native/intersect.h +24 -1
  151. warp/native/intersect_tri.h +44 -35
  152. warp/native/mat.h +1456 -276
  153. warp/native/mesh.cpp +4 -4
  154. warp/native/mesh.cu +4 -2
  155. warp/native/mesh.h +176 -61
  156. warp/native/quat.h +0 -52
  157. warp/native/scan.cu +2 -0
  158. warp/native/sort.cu +22 -13
  159. warp/native/sort.h +2 -0
  160. warp/native/sparse.cu +7 -3
  161. warp/native/spatial.h +12 -0
  162. warp/native/tile.h +837 -70
  163. warp/native/tile_radix_sort.h +1 -1
  164. warp/native/tile_reduce.h +394 -46
  165. warp/native/tile_scan.h +4 -4
  166. warp/native/vec.h +469 -53
  167. warp/native/version.h +23 -0
  168. warp/native/volume.cpp +1 -1
  169. warp/native/volume.cu +1 -0
  170. warp/native/volume.h +1 -1
  171. warp/native/volume_builder.cu +2 -0
  172. warp/native/warp.cpp +60 -32
  173. warp/native/warp.cu +313 -201
  174. warp/native/warp.h +14 -11
  175. warp/optim/__init__.py +6 -3
  176. warp/optim/adam.py +6 -145
  177. warp/optim/linear.py +14 -1585
  178. warp/optim/sgd.py +6 -94
  179. warp/paddle.py +6 -388
  180. warp/render/__init__.py +8 -4
  181. warp/render/imgui_manager.py +7 -267
  182. warp/render/render_opengl.py +6 -3616
  183. warp/render/render_usd.py +6 -918
  184. warp/render/utils.py +6 -142
  185. warp/sparse.py +37 -2563
  186. warp/tape.py +6 -1188
  187. warp/tests/__main__.py +1 -1
  188. warp/tests/cuda/test_async.py +4 -4
  189. warp/tests/cuda/test_conditional_captures.py +1 -1
  190. warp/tests/cuda/test_multigpu.py +1 -1
  191. warp/tests/cuda/test_streams.py +58 -1
  192. warp/tests/geometry/test_bvh.py +157 -22
  193. warp/tests/geometry/test_hash_grid.py +38 -0
  194. warp/tests/geometry/test_marching_cubes.py +0 -1
  195. warp/tests/geometry/test_mesh.py +5 -3
  196. warp/tests/geometry/test_mesh_query_aabb.py +5 -12
  197. warp/tests/geometry/test_mesh_query_point.py +5 -2
  198. warp/tests/geometry/test_mesh_query_ray.py +15 -3
  199. warp/tests/geometry/test_volume_write.py +5 -5
  200. warp/tests/interop/test_dlpack.py +14 -14
  201. warp/tests/interop/test_jax.py +1382 -79
  202. warp/tests/interop/test_paddle.py +1 -1
  203. warp/tests/test_adam.py +0 -1
  204. warp/tests/test_arithmetic.py +9 -9
  205. warp/tests/test_array.py +529 -100
  206. warp/tests/test_array_reduce.py +3 -3
  207. warp/tests/test_atomic.py +12 -8
  208. warp/tests/test_atomic_bitwise.py +209 -0
  209. warp/tests/test_atomic_cas.py +4 -4
  210. warp/tests/test_bool.py +2 -2
  211. warp/tests/test_builtins_resolution.py +5 -571
  212. warp/tests/test_codegen.py +34 -15
  213. warp/tests/test_conditional.py +1 -1
  214. warp/tests/test_context.py +6 -6
  215. warp/tests/test_copy.py +242 -161
  216. warp/tests/test_ctypes.py +3 -3
  217. warp/tests/test_devices.py +24 -2
  218. warp/tests/test_examples.py +16 -84
  219. warp/tests/test_fabricarray.py +35 -35
  220. warp/tests/test_fast_math.py +0 -2
  221. warp/tests/test_fem.py +60 -14
  222. warp/tests/test_fixedarray.py +3 -3
  223. warp/tests/test_func.py +8 -5
  224. warp/tests/test_generics.py +1 -1
  225. warp/tests/test_indexedarray.py +24 -24
  226. warp/tests/test_intersect.py +39 -9
  227. warp/tests/test_large.py +1 -1
  228. warp/tests/test_lerp.py +3 -1
  229. warp/tests/test_linear_solvers.py +1 -1
  230. warp/tests/test_map.py +49 -4
  231. warp/tests/test_mat.py +52 -62
  232. warp/tests/test_mat_constructors.py +4 -5
  233. warp/tests/test_mat_lite.py +1 -1
  234. warp/tests/test_mat_scalar_ops.py +121 -121
  235. warp/tests/test_math.py +34 -0
  236. warp/tests/test_module_aot.py +4 -4
  237. warp/tests/test_modules_lite.py +28 -2
  238. warp/tests/test_print.py +11 -11
  239. warp/tests/test_quat.py +93 -58
  240. warp/tests/test_runlength_encode.py +1 -1
  241. warp/tests/test_scalar_ops.py +38 -10
  242. warp/tests/test_smoothstep.py +1 -1
  243. warp/tests/test_sparse.py +126 -15
  244. warp/tests/test_spatial.py +105 -87
  245. warp/tests/test_special_values.py +6 -6
  246. warp/tests/test_static.py +7 -7
  247. warp/tests/test_struct.py +13 -2
  248. warp/tests/test_triangle_closest_point.py +48 -1
  249. warp/tests/test_tuple.py +96 -0
  250. warp/tests/test_types.py +82 -9
  251. warp/tests/test_utils.py +52 -52
  252. warp/tests/test_vec.py +29 -29
  253. warp/tests/test_vec_constructors.py +5 -5
  254. warp/tests/test_vec_scalar_ops.py +97 -97
  255. warp/tests/test_version.py +75 -0
  256. warp/tests/tile/test_tile.py +239 -0
  257. warp/tests/tile/test_tile_atomic_bitwise.py +403 -0
  258. warp/tests/tile/test_tile_cholesky.py +7 -4
  259. warp/tests/tile/test_tile_load.py +26 -2
  260. warp/tests/tile/test_tile_mathdx.py +3 -3
  261. warp/tests/tile/test_tile_matmul.py +1 -1
  262. warp/tests/tile/test_tile_mlp.py +2 -4
  263. warp/tests/tile/test_tile_reduce.py +214 -13
  264. warp/tests/unittest_suites.py +6 -14
  265. warp/tests/unittest_utils.py +10 -9
  266. warp/tests/walkthrough_debug.py +3 -1
  267. warp/torch.py +6 -373
  268. warp/types.py +29 -5750
  269. warp/utils.py +10 -1659
  270. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/METADATA +47 -103
  271. warp_lang-1.10.0rc2.dist-info/RECORD +468 -0
  272. warp_lang-1.10.0rc2.dist-info/licenses/licenses/Gaia-LICENSE.txt +6 -0
  273. warp_lang-1.10.0rc2.dist-info/licenses/licenses/appdirs-LICENSE.txt +22 -0
  274. warp_lang-1.10.0rc2.dist-info/licenses/licenses/asset_pixel_jpg-LICENSE.txt +3 -0
  275. warp_lang-1.10.0rc2.dist-info/licenses/licenses/cuda-LICENSE.txt +1582 -0
  276. warp_lang-1.10.0rc2.dist-info/licenses/licenses/dlpack-LICENSE.txt +201 -0
  277. warp_lang-1.10.0rc2.dist-info/licenses/licenses/fp16-LICENSE.txt +28 -0
  278. warp_lang-1.10.0rc2.dist-info/licenses/licenses/libmathdx-LICENSE.txt +220 -0
  279. warp_lang-1.10.0rc2.dist-info/licenses/licenses/llvm-LICENSE.txt +279 -0
  280. warp_lang-1.10.0rc2.dist-info/licenses/licenses/moller-LICENSE.txt +16 -0
  281. warp_lang-1.10.0rc2.dist-info/licenses/licenses/nanovdb-LICENSE.txt +2 -0
  282. warp_lang-1.10.0rc2.dist-info/licenses/licenses/nvrtc-LICENSE.txt +1592 -0
  283. warp_lang-1.10.0rc2.dist-info/licenses/licenses/svd-LICENSE.txt +23 -0
  284. warp_lang-1.10.0rc2.dist-info/licenses/licenses/unittest_parallel-LICENSE.txt +21 -0
  285. warp_lang-1.10.0rc2.dist-info/licenses/licenses/usd-LICENSE.txt +213 -0
  286. warp_lang-1.10.0rc2.dist-info/licenses/licenses/windingnumber-LICENSE.txt +21 -0
  287. warp/examples/assets/cartpole.urdf +0 -110
  288. warp/examples/assets/crazyflie.usd +0 -0
  289. warp/examples/assets/nv_ant.xml +0 -92
  290. warp/examples/assets/nv_humanoid.xml +0 -183
  291. warp/examples/assets/quadruped.urdf +0 -268
  292. warp/examples/optim/example_bounce.py +0 -266
  293. warp/examples/optim/example_cloth_throw.py +0 -228
  294. warp/examples/optim/example_drone.py +0 -870
  295. warp/examples/optim/example_inverse_kinematics.py +0 -182
  296. warp/examples/optim/example_inverse_kinematics_torch.py +0 -191
  297. warp/examples/optim/example_softbody_properties.py +0 -400
  298. warp/examples/optim/example_spring_cage.py +0 -245
  299. warp/examples/optim/example_trajectory.py +0 -227
  300. warp/examples/sim/example_cartpole.py +0 -143
  301. warp/examples/sim/example_cloth.py +0 -225
  302. warp/examples/sim/example_cloth_self_contact.py +0 -316
  303. warp/examples/sim/example_granular.py +0 -130
  304. warp/examples/sim/example_granular_collision_sdf.py +0 -202
  305. warp/examples/sim/example_jacobian_ik.py +0 -244
  306. warp/examples/sim/example_particle_chain.py +0 -124
  307. warp/examples/sim/example_quadruped.py +0 -203
  308. warp/examples/sim/example_rigid_chain.py +0 -203
  309. warp/examples/sim/example_rigid_contact.py +0 -195
  310. warp/examples/sim/example_rigid_force.py +0 -133
  311. warp/examples/sim/example_rigid_gyroscopic.py +0 -115
  312. warp/examples/sim/example_rigid_soft_contact.py +0 -140
  313. warp/examples/sim/example_soft_body.py +0 -196
  314. warp/examples/tile/example_tile_walker.py +0 -327
  315. warp/sim/__init__.py +0 -74
  316. warp/sim/articulation.py +0 -793
  317. warp/sim/collide.py +0 -2570
  318. warp/sim/graph_coloring.py +0 -307
  319. warp/sim/import_mjcf.py +0 -791
  320. warp/sim/import_snu.py +0 -227
  321. warp/sim/import_urdf.py +0 -579
  322. warp/sim/import_usd.py +0 -898
  323. warp/sim/inertia.py +0 -357
  324. warp/sim/integrator.py +0 -245
  325. warp/sim/integrator_euler.py +0 -2000
  326. warp/sim/integrator_featherstone.py +0 -2101
  327. warp/sim/integrator_vbd.py +0 -2487
  328. warp/sim/integrator_xpbd.py +0 -3295
  329. warp/sim/model.py +0 -4821
  330. warp/sim/particles.py +0 -121
  331. warp/sim/render.py +0 -431
  332. warp/sim/utils.py +0 -431
  333. warp/tests/sim/disabled_kinematics.py +0 -244
  334. warp/tests/sim/test_cloth.py +0 -863
  335. warp/tests/sim/test_collision.py +0 -743
  336. warp/tests/sim/test_coloring.py +0 -347
  337. warp/tests/sim/test_inertia.py +0 -161
  338. warp/tests/sim/test_model.py +0 -226
  339. warp/tests/sim/test_sim_grad.py +0 -287
  340. warp/tests/sim/test_sim_grad_bounce_linear.py +0 -212
  341. warp/tests/sim/test_sim_kinematics.py +0 -98
  342. warp/thirdparty/__init__.py +0 -0
  343. warp_lang-1.9.0.dist-info/RECORD +0 -456
  344. /warp/{fem → _src/fem}/quadrature/__init__.py +0 -0
  345. /warp/{tests/sim → _src/thirdparty}/__init__.py +0 -0
  346. /warp/{thirdparty → _src/thirdparty}/appdirs.py +0 -0
  347. /warp/{thirdparty → _src/thirdparty}/dlpack.py +0 -0
  348. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/WHEEL +0 -0
  349. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/licenses/LICENSE.md +0 -0
  350. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/top_level.txt +0 -0
warp/tests/__main__.py CHANGED
@@ -1,4 +1,4 @@
1
- from warp.thirdparty.unittest_parallel import main
1
+ from warp._src.thirdparty.unittest_parallel import main
2
2
 
3
3
  if __name__ == "__main__":
4
4
  main()
@@ -18,8 +18,8 @@ import unittest
18
18
  import numpy as np
19
19
 
20
20
  import warp as wp
21
+ from warp._src.utils import check_p2p
21
22
  from warp.tests.unittest_utils import *
22
- from warp.utils import check_p2p
23
23
 
24
24
 
25
25
  class Capturable:
@@ -426,13 +426,13 @@ def copy_template(test, src_ctor, dst_ctor, src_device, dst_device, n, params: C
426
426
  if expected_error_type is not None:
427
427
  # disable error output from Warp if we expect an exception
428
428
  try:
429
- saved_error_output_enabled = wp.context.runtime.core.wp_is_error_output_enabled()
430
- wp.context.runtime.core.wp_set_error_output_enabled(False)
429
+ saved_error_output_enabled = wp._src.context.runtime.core.wp_is_error_output_enabled()
430
+ wp._src.context.runtime.core.wp_set_error_output_enabled(False)
431
431
  with test.assertRaisesRegex(expected_error_type, expected_error_regex):
432
432
  with Capturable(use_graph=params.use_graph, stream=stream):
433
433
  wp.copy(dst, src, stream=stream_arg)
434
434
  finally:
435
- wp.context.runtime.core.wp_set_error_output_enabled(saved_error_output_enabled)
435
+ wp._src.context.runtime.core.wp_set_error_output_enabled(saved_error_output_enabled)
436
436
  wp.synchronize()
437
437
 
438
438
  # print(f"SUCCESSFUL ERROR PREDICTION: {expected_error_regex}")
@@ -20,7 +20,7 @@ import unittest
20
20
  import numpy as np
21
21
 
22
22
  import warp as wp
23
- from warp.context import assert_conditional_graph_support
23
+ from warp._src.context import assert_conditional_graph_support
24
24
  from warp.tests.unittest_utils import *
25
25
 
26
26
 
@@ -18,8 +18,8 @@ import unittest
18
18
  import numpy as np
19
19
 
20
20
  import warp as wp
21
+ from warp._src.utils import check_p2p
21
22
  from warp.tests.unittest_utils import *
22
- from warp.utils import check_p2p
23
23
 
24
24
 
25
25
  @wp.kernel
@@ -18,8 +18,8 @@ import unittest
18
18
  import numpy as np
19
19
 
20
20
  import warp as wp
21
+ from warp._src.utils import check_p2p
21
22
  from warp.tests.unittest_utils import *
22
- from warp.utils import check_p2p
23
23
 
24
24
 
25
25
  @wp.kernel
@@ -365,6 +365,41 @@ def test_event_elapsed_time_graph(test, device):
365
365
  test.assertGreater(elapsed, 0)
366
366
 
367
367
 
368
+ def test_event_external(test, device):
369
+ with wp.ScopedDevice(device):
370
+ # event used to synchronize two graphs (external event)
371
+ event = wp.Event()
372
+
373
+ n = 1_000_000
374
+ a = wp.zeros(n, dtype=float)
375
+ b = wp.zeros(n, dtype=float)
376
+ c = wp.zeros(n, dtype=float)
377
+
378
+ with wp.ScopedCapture() as capture1:
379
+ wp.launch(inc, dim=n, inputs=[a])
380
+ wp.launch(inc, dim=n, inputs=[b])
381
+ # record in first graph
382
+ wp.record_event(event, external=True)
383
+
384
+ with wp.ScopedCapture() as capture2:
385
+ # wait in second graph
386
+ wp.wait_event(event, external=True)
387
+ wp.launch(sum, dim=n, inputs=[a, b, c])
388
+
389
+ stream1 = wp.Stream()
390
+ stream2 = wp.Stream()
391
+ num_iters = 10
392
+
393
+ for _ in range(num_iters):
394
+ # Launch graphs on different streams, but they should be
395
+ # synchronized using the external event.
396
+ wp.capture_launch(capture1.graph, stream=stream1)
397
+ wp.capture_launch(capture2.graph, stream=stream2)
398
+
399
+ expected = np.full(n, 2 * num_iters, dtype=np.float32)
400
+ assert_np_equal(c.numpy(), expected)
401
+
402
+
368
403
  def test_stream_priority_basics(test, device):
369
404
  standard_stream = wp.Stream(device)
370
405
  test.assertEqual(standard_stream.priority, 0, "Default priority of streams must be 0.")
@@ -470,6 +505,25 @@ def test_stream_event_is_complete(test, device):
470
505
  test.assertEqual(a.numpy()[0], (iter + 1) * threads)
471
506
 
472
507
 
508
+ def test_graph_destroy_during_capture(test, device):
509
+ with wp.ScopedDevice(device):
510
+ n = 10
511
+ a = wp.zeros(n, dtype=float)
512
+
513
+ with wp.ScopedCapture() as capture1:
514
+ wp.launch(inc, dim=n, inputs=[a])
515
+
516
+ wp.capture_launch(capture1.graph)
517
+
518
+ with wp.ScopedCapture() as capture2:
519
+ del capture1 # <--- should be deferred
520
+ wp.launch(inc, dim=n, inputs=[a])
521
+
522
+ wp.capture_launch(capture2.graph)
523
+
524
+ assert_np_equal(a.numpy(), np.full(n, 2, dtype=np.float32))
525
+
526
+
473
527
  devices = get_selected_cuda_test_devices()
474
528
 
475
529
 
@@ -628,6 +682,9 @@ add_function_test(TestStreams, "test_stream_event_is_complete", test_stream_even
628
682
  add_function_test(TestStreams, "test_event_synchronize", test_event_synchronize, devices=devices)
629
683
  add_function_test(TestStreams, "test_event_elapsed_time", test_event_elapsed_time, devices=devices)
630
684
  add_function_test(TestStreams, "test_event_elapsed_time_graph", test_event_elapsed_time_graph, devices=devices)
685
+ add_function_test(TestStreams, "test_event_external", test_event_external, devices=devices)
686
+
687
+ add_function_test(TestStreams, "test_graph_destroy_during_capture", test_graph_destroy_during_capture, devices=devices)
631
688
 
632
689
  if __name__ == "__main__":
633
690
  wp.clear_kernel_cache()
@@ -75,7 +75,7 @@ def intersect_ray_aabb(start, rcp_dir, lower, upper):
75
75
  return 0
76
76
 
77
77
 
78
- def test_bvh(test, type, device):
78
+ def test_bvh(test, type, device, leaf_size):
79
79
  rng = np.random.default_rng(123)
80
80
 
81
81
  num_bounds = 100
@@ -85,7 +85,7 @@ def test_bvh(test, type, device):
85
85
  device_lowers = wp.array(lowers, dtype=wp.vec3, device=device)
86
86
  device_uppers = wp.array(uppers, dtype=wp.vec3, device=device)
87
87
 
88
- bvh = wp.Bvh(device_lowers, device_uppers)
88
+ bvh = wp.Bvh(device_lowers, device_uppers, leaf_size=leaf_size)
89
89
 
90
90
  bounds_intersected = wp.zeros(shape=(num_bounds), dtype=int, device=device)
91
91
 
@@ -95,18 +95,16 @@ def test_bvh(test, type, device):
95
95
  query_start = wp.vec3(0.0, 0.0, 0.0)
96
96
  query_dir = wp.normalize(wp.vec3(1.0, 1.0, 1.0))
97
97
 
98
- for test_case in range(2):
98
+ for test_case in range(3):
99
99
  if type == "AABB":
100
100
  wp.launch(
101
- kernel=bvh_query_aabb,
101
+ bvh_query_aabb,
102
102
  dim=1,
103
103
  inputs=[bvh.id, query_lower, query_upper, bounds_intersected],
104
104
  device=device,
105
105
  )
106
106
  else:
107
- wp.launch(
108
- kernel=bvh_query_ray, dim=1, inputs=[bvh.id, query_start, query_dir, bounds_intersected], device=device
109
- )
107
+ wp.launch(bvh_query_ray, dim=1, inputs=[bvh.id, query_start, query_dir, bounds_intersected], device=device)
110
108
 
111
109
  device_intersected = bounds_intersected.numpy()
112
110
 
@@ -120,48 +118,178 @@ def test_bvh(test, type, device):
120
118
 
121
119
  test.assertEqual(host_intersected, device_intersected[i])
122
120
 
123
- if test_case == 0:
121
+ if test_case == 0 or test_case == 1:
124
122
  lowers = rng.random(size=(num_bounds, 3)) * 5.0
125
123
  uppers = lowers + rng.random(size=(num_bounds, 3)) * 5.0
126
124
  wp.copy(device_lowers, wp.array(lowers, dtype=wp.vec3, device=device))
127
125
  wp.copy(device_uppers, wp.array(uppers, dtype=wp.vec3, device=device))
128
- bvh.refit()
129
126
  bounds_intersected.zero_()
130
127
 
128
+ if test_case == 0:
129
+ bvh.refit()
130
+ else:
131
+ bvh.rebuild()
132
+
131
133
 
132
134
  def test_bvh_query_aabb(test, device):
133
- test_bvh(test, "AABB", device)
135
+ for leaf_size in [1, 2, 4]:
136
+ test_bvh(test, "AABB", device, leaf_size)
134
137
 
135
138
 
136
139
  def test_bvh_query_ray(test, device):
137
- test_bvh(test, "ray", device)
140
+ for leaf_size in [1, 2, 4]:
141
+ test_bvh(test, "ray", device, leaf_size)
138
142
 
139
143
 
140
- def test_gh_288(test, device):
141
- num_bounds = 1
142
- lowers = ((0.5, -1.0, -1.0),) * num_bounds
143
- uppers = ((1.0, 1.0, 1.0),) * num_bounds
144
+ def test_bvh_ray_query_inside_and_outside_bounds(test, device):
145
+ """Regression test for issue #288: BVH ray queries should detect intersections
146
+ regardless of whether the ray origin is inside or outside the bounding volumes.
147
+
148
+ Previously, rays starting outside the bounds would fail to detect intersections.
149
+ """
150
+ # Create a single AABB spanning x=[0.5, 1.0], extending across y and z axes
151
+ lowers = ((0.5, -1.0, -1.0),)
152
+ uppers = ((1.0, 1.0, 1.0),)
144
153
 
145
154
  device_lowers = wp.array(lowers, dtype=wp.vec3f, device=device)
146
155
  device_uppers = wp.array(uppers, dtype=wp.vec3f, device=device)
147
156
 
148
157
  bvh = wp.Bvh(device_lowers, device_uppers)
149
158
 
150
- bounds_intersected = wp.zeros(shape=num_bounds, dtype=int, device=device)
159
+ bounds_intersected = wp.zeros(shape=1, dtype=int, device=device)
151
160
 
161
+ # Test both ray origins: outside (x=0.0) and inside (x=0.75) the AABB
152
162
  for x in (0.0, 0.75):
153
163
  query_start = wp.vec3(x, 0.0, 0.0)
154
- query_dir = wp.vec3(1.0, 0.0, 0.0)
164
+ query_dir = wp.vec3(1.0, 0.0, 0.0) # Ray pointing in +x direction
155
165
 
156
- wp.launch(
157
- kernel=bvh_query_ray, dim=1, inputs=[bvh.id, query_start, query_dir, bounds_intersected], device=device
158
- )
166
+ wp.launch(bvh_query_ray, dim=1, inputs=[bvh.id, query_start, query_dir, bounds_intersected], device=device)
159
167
 
160
168
  device_intersected = bounds_intersected.numpy()
161
- test.assertEqual(device_intersected.sum(), num_bounds)
169
+ # Both cases should detect the single intersection
170
+ test.assertEqual(device_intersected.sum(), 1)
171
+
172
+
173
+ def get_random_aabbs(n, center, relative_shift, relative_size, rng):
174
+ centers = rng.uniform(-0.5, 0.5, size=n * 3).reshape(n, 3) * relative_shift + center
175
+ diffs = 0.5 * rng.random(n * 3).reshape(n, 3) * relative_size
176
+
177
+ lowers = centers - diffs
178
+ uppers = centers + diffs
179
+
180
+ return lowers, uppers
181
+
182
+
183
+ @wp.kernel
184
+ def compute_num_contact_with_checksums(
185
+ lowers: wp.array(dtype=wp.vec3),
186
+ uppers: wp.array(dtype=wp.vec3),
187
+ bvh_id: wp.uint64,
188
+ counts: wp.array(dtype=int),
189
+ check_sums: wp.array(dtype=int),
190
+ ):
191
+ tid = wp.tid()
192
+
193
+ upper = uppers[tid]
194
+ lower = lowers[tid]
195
+
196
+ query = wp.bvh_query_aabb(bvh_id, lower, upper)
197
+ count = int(0)
198
+
199
+ check_sum = int(0)
200
+ index = int(0)
201
+ while wp.bvh_query_next(query, index):
202
+ check_sum = check_sum ^ index
203
+ count += 1
204
+
205
+ counts[tid] = count
206
+ check_sums[tid] = check_sum
207
+
208
+
209
+ def test_capture_bvh_rebuild(test, device):
210
+ with wp.ScopedDevice(device):
211
+ rng = np.random.default_rng(123)
212
+
213
+ num_item_bounds = 100000
214
+ item_bound_size = 0.01
215
+
216
+ relative_shift = 2
217
+
218
+ num_test_bounds = 10000
219
+ test_bound_relative_size = 0.05
220
+
221
+ center = np.array([0.0, 0.0, 0.0])
222
+
223
+ item_lowers_np, item_uppers_np = get_random_aabbs(num_item_bounds, center, relative_shift, item_bound_size, rng)
224
+ item_lowers = wp.array(item_lowers_np, dtype=wp.vec3)
225
+ item_uppers = wp.array(item_uppers_np, dtype=wp.vec3)
226
+ bvh_1 = wp.Bvh(item_lowers, item_uppers)
227
+ item_lowers_2 = wp.zeros_like(item_lowers)
228
+ item_uppers_2 = wp.zeros_like(item_lowers)
229
+
230
+ test_lowers_np, test_uppers_np = get_random_aabbs(
231
+ num_test_bounds, center, relative_shift, test_bound_relative_size, rng
232
+ )
233
+ test_lowers = wp.array(test_lowers_np, dtype=wp.vec3)
234
+ test_uppers = wp.array(test_uppers_np, dtype=wp.vec3)
235
+
236
+ item_lowers_2_np, item_uppers_2_np = get_random_aabbs(
237
+ num_item_bounds,
238
+ center,
239
+ relative_shift,
240
+ item_bound_size,
241
+ rng,
242
+ )
243
+ item_lowers_2.assign(item_lowers_2_np)
244
+ item_uppers_2.assign(item_uppers_2_np)
245
+
246
+ counts_1 = wp.empty(n=num_test_bounds, dtype=int)
247
+ checksums_1 = wp.empty(n=num_test_bounds, dtype=int)
248
+ counts_2 = wp.empty(n=num_test_bounds, dtype=int)
249
+ checksums_2 = wp.empty(n=num_test_bounds, dtype=int)
250
+
251
+ wp.load_module(device=device)
252
+ with wp.ScopedCapture(force_module_load=False) as capture:
253
+ wp.copy(item_lowers, item_lowers_2)
254
+ wp.copy(item_uppers, item_uppers_2)
255
+ bvh_1.rebuild()
256
+ wp.launch(
257
+ compute_num_contact_with_checksums,
258
+ dim=num_test_bounds,
259
+ inputs=[test_lowers, test_uppers, bvh_1.id],
260
+ outputs=[counts_1, checksums_1],
261
+ )
262
+
263
+ cuda_graph = capture.graph
264
+
265
+ for _ in range(10):
266
+ item_lowers_2_np, item_uppers_2_np = get_random_aabbs(
267
+ num_item_bounds,
268
+ center,
269
+ relative_shift,
270
+ item_bound_size,
271
+ rng,
272
+ )
273
+ item_lowers_2.assign(item_lowers_2_np)
274
+ item_uppers_2.assign(item_uppers_2_np)
275
+
276
+ wp.capture_launch(cuda_graph)
277
+
278
+ bvh_2 = wp.Bvh(item_lowers_2, item_uppers_2)
279
+ wp.launch(
280
+ compute_num_contact_with_checksums,
281
+ dim=num_test_bounds,
282
+ inputs=[test_lowers, test_uppers, bvh_2.id],
283
+ outputs=[counts_2, checksums_2],
284
+ device=device,
285
+ )
286
+
287
+ assert_array_equal(counts_1, counts_2)
288
+ assert_array_equal(checksums_1, checksums_2)
162
289
 
163
290
 
164
291
  devices = get_test_devices()
292
+ cuda_devices = get_cuda_test_devices()
165
293
 
166
294
 
167
295
  class TestBvh(unittest.TestCase):
@@ -193,7 +321,14 @@ class TestBvh(unittest.TestCase):
193
321
 
194
322
  add_function_test(TestBvh, "test_bvh_aabb", test_bvh_query_aabb, devices=devices)
195
323
  add_function_test(TestBvh, "test_bvh_ray", test_bvh_query_ray, devices=devices)
196
- add_function_test(TestBvh, "test_gh_288", test_gh_288, devices=devices)
324
+ add_function_test(
325
+ TestBvh,
326
+ "test_bvh_ray_query_inside_and_outside_bounds",
327
+ test_bvh_ray_query_inside_and_outside_bounds,
328
+ devices=devices,
329
+ )
330
+
331
+ add_function_test(TestBvh, "test_capture_bvh_rebuild", test_capture_bvh_rebuild, devices=cuda_devices)
197
332
 
198
333
  if __name__ == "__main__":
199
334
  wp.clear_kernel_cache()
@@ -191,7 +191,44 @@ def test_hashgrid_inputs(test, device):
191
191
  assert_array_equal(counts_ndim, counts_ref)
192
192
 
193
193
 
194
+ def test_hashgrid_multiple_streams(test, device):
195
+ with wp.ScopedDevice(device):
196
+ points = particle_grid(16, 32, 16, (0.0, 0.3, 0.0), cell_radius * 0.25, 0.1)
197
+ points_ref = wp.array(points, dtype=wp.vec3)
198
+ counts_ref = wp.zeros(len(points), dtype=int)
199
+
200
+ grid_dim = 64
201
+ grid_ref = wp.HashGrid(grid_dim, grid_dim, grid_dim)
202
+ grid_ref.build(points_ref, cell_radius)
203
+
204
+ # get reference counts
205
+ wp.launch(kernel=count_neighbors, dim=len(points), inputs=[grid_ref.id, query_radius, points_ref, counts_ref])
206
+
207
+ # create multiple streams
208
+ num_streams = 10
209
+ streams = [wp.Stream(device=device) for _ in range(num_streams)]
210
+ counts_per_stream = [wp.zeros(len(points), dtype=int) for _ in range(num_streams)]
211
+
212
+ # test whether HashGrid and radix sort work with multiple streams without race conditions
213
+ for i in range(num_streams):
214
+ with wp.ScopedStream(streams[i]):
215
+ grid = wp.HashGrid(grid_dim, grid_dim, grid_dim)
216
+ grid.build(points_ref, cell_radius)
217
+
218
+ # get counts for this stream
219
+ wp.launch(
220
+ kernel=count_neighbors,
221
+ dim=len(points),
222
+ inputs=[grid.id, query_radius, points_ref, counts_per_stream[i]],
223
+ )
224
+
225
+ # run this loop after all streams are scheduled to ensure asynchronous behaviour above
226
+ for i in range(num_streams):
227
+ assert_array_equal(counts_per_stream[i], counts_ref)
228
+
229
+
194
230
  devices = get_test_devices()
231
+ cuda_devices = get_cuda_test_devices()
195
232
 
196
233
 
197
234
  class TestHashGrid(unittest.TestCase):
@@ -214,6 +251,7 @@ class TestHashGrid(unittest.TestCase):
214
251
 
215
252
  add_function_test(TestHashGrid, "test_hashgrid_query", test_hashgrid_query, devices=devices)
216
253
  add_function_test(TestHashGrid, "test_hashgrid_inputs", test_hashgrid_inputs, devices=devices)
254
+ add_function_test(TestHashGrid, "test_hashgrid_multiple_streams", test_hashgrid_multiple_streams, devices=cuda_devices)
217
255
 
218
256
 
219
257
  if __name__ == "__main__":
@@ -232,7 +232,6 @@ def test_marching_cubes_differentiable(test, device):
232
232
  the sphere's radius.
233
233
  """
234
234
  node_dim = 64
235
- cell_dim = node_dim - 1
236
235
  bounds_low = wp.vec3(-1.0, -1.0, -1.0)
237
236
  bounds_high = wp.vec3(1.0, 1.0, 1.0)
238
237
 
@@ -12,7 +12,7 @@
12
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
-
15
+ import itertools
16
16
  import unittest
17
17
 
18
18
  import numpy as np
@@ -204,11 +204,13 @@ def test_mesh_query_ray(test, device):
204
204
  else:
205
205
  constructors = ["sah", "median", "lbvh"]
206
206
 
207
- for constructor in constructors:
207
+ leaf_sizes = [1, 2, 4]
208
+
209
+ for leaf_size, constructor in itertools.product(leaf_sizes, constructors):
208
210
  points = wp.array(POINT_POSITIONS, dtype=wp.vec3, device=device)
209
211
 
210
212
  indices = wp.array(RIGHT_HANDED_FACE_VERTEX_INDICES, dtype=int, device=device)
211
- mesh = wp.Mesh(points=points, indices=indices, bvh_constructor=constructor)
213
+ mesh = wp.Mesh(points=points, indices=indices, bvh_constructor=constructor, bvh_leaf_size=leaf_size)
212
214
  expected_sign = -1.0
213
215
  wp.launch(
214
216
  query_ray_kernel,
@@ -13,6 +13,7 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ import itertools
16
17
  import os
17
18
  import unittest
18
19
 
@@ -60,11 +61,6 @@ def compute_bounds(
60
61
  def compute_num_contacts(
61
62
  lowers: wp.array(dtype=wp.vec3), uppers: wp.array(dtype=wp.vec3), mesh_id: wp.uint64, counts: wp.array(dtype=int)
62
63
  ):
63
- face_index = int(0)
64
- face_u = float(0.0)
65
- face_v = float(0.0)
66
- sign = float(0.0)
67
-
68
64
  tid = wp.tid()
69
65
 
70
66
  upper = uppers[tid]
@@ -210,11 +206,6 @@ def compute_num_contact_with_checksums(
210
206
  counts: wp.array(dtype=int),
211
207
  check_sums: wp.array(dtype=int),
212
208
  ):
213
- face_index = int(0)
214
- face_u = float(0.0)
215
- face_v = float(0.0)
216
- sign = float(0.0)
217
-
218
209
  tid = wp.tid()
219
210
 
220
211
  upper = uppers[tid]
@@ -304,12 +295,14 @@ def test_mesh_query_aabb_count_overlap_with_checksum(test, device):
304
295
  else:
305
296
  constructors = ["sah", "median", "lbvh"]
306
297
 
298
+ leaf_sizes = [1, 2, 4]
299
+
307
300
  points, indices = load_mesh()
308
301
  points_wp = wp.array(points, dtype=wp.vec3, device=device)
309
302
  indices_wp = wp.array(indices, dtype=int, device=device)
310
303
 
311
- for constructor in constructors:
312
- m = wp.Mesh(points=points_wp, indices=indices_wp, bvh_constructor=constructor)
304
+ for leaf_size, constructor in itertools.product(leaf_sizes, constructors):
305
+ m = wp.Mesh(points=points_wp, indices=indices_wp, bvh_constructor=constructor, bvh_leaf_size=leaf_size)
313
306
 
314
307
  num_test_bounds = 10000
315
308
  test_bound_relative_size = 0.01
@@ -13,6 +13,7 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ import itertools
16
17
  import math
17
18
  import unittest
18
19
 
@@ -314,7 +315,9 @@ def test_mesh_query_point(test, device):
314
315
  else:
315
316
  constructors = ["sah", "median", "lbvh"]
316
317
 
317
- for constructor in constructors:
318
+ leaf_sizes = [1, 2, 4]
319
+
320
+ for leaf_size, constructor in itertools.product(leaf_sizes, constructors):
318
321
  # create mesh
319
322
  mesh = wp.Mesh(
320
323
  points=mesh_points,
@@ -322,6 +325,7 @@ def test_mesh_query_point(test, device):
322
325
  indices=mesh_indices,
323
326
  support_winding_number=True,
324
327
  bvh_constructor=constructor,
328
+ bvh_leaf_size=leaf_size,
325
329
  )
326
330
 
327
331
  p = particle_grid(32, 32, 32, np.array([-1.1, -1.1, -1.1]), 0.05, 0.0)
@@ -791,7 +795,6 @@ def point_query_aabb_and_closest(
791
795
 
792
796
  tri_index = wp.int32(0)
793
797
  num_collisions = wp.int32(0)
794
- min_dis_to_tris = query_radius
795
798
  while wp.mesh_query_aabb_next(query, tri_index):
796
799
  t1 = tri_indices[tri_index, 0]
797
800
  t2 = tri_indices[tri_index, 1]
@@ -13,6 +13,7 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ import itertools
16
17
  import unittest
17
18
 
18
19
  import numpy as np
@@ -104,12 +105,20 @@ def test_mesh_query_ray_grad(test, device):
104
105
  else:
105
106
  constructors = ["sah", "median", "lbvh"]
106
107
 
107
- for constructor in constructors:
108
+ leaf_sizes = [1, 2, 4]
109
+
110
+ for leaf_size, constructor in itertools.product(leaf_sizes, constructors):
108
111
  p = wp.vec3(50.0, 50.0, 0.0)
109
112
  D = wp.vec3(0.0, -1.0, 0.0)
110
113
 
111
114
  # create mesh
112
- mesh = wp.Mesh(points=mesh_points, velocities=None, indices=mesh_indices, bvh_constructor=constructor)
115
+ mesh = wp.Mesh(
116
+ points=mesh_points,
117
+ velocities=None,
118
+ indices=mesh_indices,
119
+ bvh_constructor=constructor,
120
+ bvh_leaf_size=leaf_size,
121
+ )
113
122
 
114
123
  tape = wp.Tape()
115
124
 
@@ -248,6 +257,8 @@ def test_mesh_query_ray_edge(test, device):
248
257
  else:
249
258
  constructors = ["sah", "median", "lbvh"]
250
259
 
260
+ leaf_sizes = [1, 2, 4]
261
+
251
262
  # Create raycast starts and directions
252
263
  xx, yy = np.meshgrid(np.arange(0.1, 0.4, 0.01), np.arange(0.1, 0.4, 0.01))
253
264
  xx = xx.flatten().reshape(-1, 1)
@@ -268,11 +279,12 @@ def test_mesh_query_ray_edge(test, device):
268
279
 
269
280
  triangles = np.array([[1, 0, 2], [1, 2, 3]], dtype=np.int32)
270
281
 
271
- for constructor in constructors:
282
+ for leaf_size, constructor in itertools.product(leaf_sizes, constructors):
272
283
  mesh = wp.Mesh(
273
284
  points=wp.array(vertices, dtype=wp.vec3, device=device),
274
285
  indices=wp.array(triangles.flatten(), dtype=int, device=device),
275
286
  bvh_constructor=constructor,
287
+ bvh_leaf_size=leaf_size,
276
288
  )
277
289
 
278
290
  counts = wp.zeros(1, dtype=int, device=device)
@@ -172,8 +172,8 @@ def test_volume_allocation(test, device):
172
172
  device=device,
173
173
  )
174
174
 
175
- assert wp.types.types_equal(volume_a.dtype, wp.float32)
176
- assert wp.types.types_equal(volume_b.dtype, wp.float32)
175
+ assert wp._src.types.types_equal(volume_a.dtype, wp.float32)
176
+ assert wp._src.types.types_equal(volume_b.dtype, wp.float32)
177
177
 
178
178
  points = wp.array(points_ref, dtype=wp.vec3, device=device)
179
179
  values_a = wp.empty(num_points, dtype=wp.float32, device=device)
@@ -211,8 +211,8 @@ def test_volume_allocate_by_tiles_f(test, device):
211
211
  volume_a = wp.Volume.allocate_by_tiles(points_is_d, voxel_size, background_value, translation, device=device)
212
212
  volume_b = wp.Volume.allocate_by_tiles(points_ws_d, voxel_size, background_value, translation, device=device)
213
213
 
214
- assert wp.types.types_equal(volume_a.dtype, wp.float32)
215
- assert wp.types.types_equal(volume_b.dtype, wp.float32)
214
+ assert wp._src.types.types_equal(volume_a.dtype, wp.float32)
215
+ assert wp._src.types.types_equal(volume_b.dtype, wp.float32)
216
216
 
217
217
  values_a = wp.empty(num_tiles * 512, dtype=wp.float32, device=device)
218
218
  values_b = wp.empty(num_tiles * 512, dtype=wp.float32, device=device)
@@ -243,7 +243,7 @@ def test_volume_allocate_by_tiles_v(test, device):
243
243
  points_d = wp.array(points_is, dtype=wp.int32, device=device)
244
244
  volume = wp.Volume.allocate_by_tiles(points_d, 0.1, wp.vec3(1, 2, 3), device=device)
245
245
 
246
- assert wp.types.types_equal(volume.dtype, wp.vec3)
246
+ assert wp._src.types.types_equal(volume.dtype, wp.vec3)
247
247
 
248
248
  values = wp.empty(len(points_d) * 512, dtype=wp.vec3, device=device)
249
249