warp-lang 1.8.0__py3-none-macosx_10_13_universal2.whl → 1.9.0__py3-none-macosx_10_13_universal2.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.
- warp/__init__.py +282 -103
- warp/__init__.pyi +482 -110
- warp/bin/libwarp-clang.dylib +0 -0
- warp/bin/libwarp.dylib +0 -0
- warp/build.py +93 -30
- warp/build_dll.py +48 -63
- warp/builtins.py +955 -137
- warp/codegen.py +327 -209
- warp/config.py +1 -1
- warp/context.py +1363 -800
- warp/examples/core/example_marching_cubes.py +1 -0
- warp/examples/core/example_render_opengl.py +100 -3
- warp/examples/fem/example_apic_fluid.py +98 -52
- warp/examples/fem/example_convection_diffusion_dg.py +25 -4
- warp/examples/fem/example_diffusion_mgpu.py +8 -3
- warp/examples/fem/utils.py +68 -22
- warp/examples/interop/example_jax_callable.py +34 -4
- warp/examples/interop/example_jax_kernel.py +27 -1
- warp/fabric.py +1 -1
- warp/fem/cache.py +27 -19
- warp/fem/domain.py +2 -2
- warp/fem/field/nodal_field.py +2 -2
- warp/fem/field/virtual.py +266 -166
- warp/fem/geometry/geometry.py +5 -5
- warp/fem/integrate.py +200 -91
- warp/fem/space/restriction.py +4 -0
- warp/fem/space/shape/tet_shape_function.py +3 -10
- warp/jax_experimental/custom_call.py +1 -1
- warp/jax_experimental/ffi.py +203 -54
- warp/marching_cubes.py +708 -0
- warp/native/array.h +103 -8
- warp/native/builtin.h +90 -9
- warp/native/bvh.cpp +64 -28
- warp/native/bvh.cu +58 -58
- warp/native/bvh.h +2 -2
- warp/native/clang/clang.cpp +7 -7
- warp/native/coloring.cpp +13 -3
- warp/native/crt.cpp +2 -2
- warp/native/crt.h +3 -5
- warp/native/cuda_util.cpp +42 -11
- warp/native/cuda_util.h +10 -4
- warp/native/exports.h +1842 -1908
- warp/native/fabric.h +2 -1
- warp/native/hashgrid.cpp +37 -37
- warp/native/hashgrid.cu +2 -2
- warp/native/initializer_array.h +1 -1
- warp/native/intersect.h +4 -4
- warp/native/mat.h +1913 -119
- warp/native/mathdx.cpp +43 -43
- warp/native/mesh.cpp +24 -24
- warp/native/mesh.cu +26 -26
- warp/native/mesh.h +5 -3
- warp/native/nanovdb/GridHandle.h +179 -12
- warp/native/nanovdb/HostBuffer.h +8 -7
- warp/native/nanovdb/NanoVDB.h +517 -895
- warp/native/nanovdb/NodeManager.h +323 -0
- warp/native/nanovdb/PNanoVDB.h +2 -2
- warp/native/quat.h +337 -16
- warp/native/rand.h +7 -7
- warp/native/range.h +7 -1
- warp/native/reduce.cpp +10 -10
- warp/native/reduce.cu +13 -14
- warp/native/runlength_encode.cpp +2 -2
- warp/native/runlength_encode.cu +5 -5
- warp/native/scan.cpp +3 -3
- warp/native/scan.cu +4 -4
- warp/native/sort.cpp +10 -10
- warp/native/sort.cu +22 -22
- warp/native/sparse.cpp +8 -8
- warp/native/sparse.cu +14 -14
- warp/native/spatial.h +366 -17
- warp/native/svd.h +23 -8
- warp/native/temp_buffer.h +2 -2
- warp/native/tile.h +303 -70
- warp/native/tile_radix_sort.h +5 -1
- warp/native/tile_reduce.h +16 -25
- warp/native/tuple.h +2 -2
- warp/native/vec.h +385 -18
- warp/native/volume.cpp +54 -54
- warp/native/volume.cu +1 -1
- warp/native/volume.h +2 -1
- warp/native/volume_builder.cu +30 -37
- warp/native/warp.cpp +150 -149
- warp/native/warp.cu +337 -193
- warp/native/warp.h +227 -226
- warp/optim/linear.py +736 -271
- warp/render/imgui_manager.py +289 -0
- warp/render/render_opengl.py +137 -57
- warp/render/render_usd.py +0 -1
- warp/sim/collide.py +1 -2
- warp/sim/graph_coloring.py +2 -2
- warp/sim/integrator_vbd.py +10 -2
- warp/sparse.py +559 -176
- warp/tape.py +2 -0
- warp/tests/aux_test_module_aot.py +7 -0
- warp/tests/cuda/test_async.py +3 -3
- warp/tests/cuda/test_conditional_captures.py +101 -0
- warp/tests/geometry/test_marching_cubes.py +233 -12
- warp/tests/sim/test_cloth.py +89 -6
- warp/tests/sim/test_coloring.py +82 -7
- warp/tests/test_array.py +56 -5
- warp/tests/test_assert.py +53 -0
- warp/tests/test_atomic_cas.py +127 -114
- warp/tests/test_codegen.py +3 -2
- warp/tests/test_context.py +8 -15
- warp/tests/test_enum.py +136 -0
- warp/tests/test_examples.py +2 -2
- warp/tests/test_fem.py +45 -2
- warp/tests/test_fixedarray.py +229 -0
- warp/tests/test_func.py +18 -15
- warp/tests/test_future_annotations.py +7 -5
- warp/tests/test_linear_solvers.py +30 -0
- warp/tests/test_map.py +1 -1
- warp/tests/test_mat.py +1540 -378
- warp/tests/test_mat_assign_copy.py +178 -0
- warp/tests/test_mat_constructors.py +574 -0
- warp/tests/test_module_aot.py +287 -0
- warp/tests/test_print.py +69 -0
- warp/tests/test_quat.py +162 -34
- warp/tests/test_quat_assign_copy.py +145 -0
- warp/tests/test_reload.py +2 -1
- warp/tests/test_sparse.py +103 -0
- warp/tests/test_spatial.py +140 -34
- warp/tests/test_spatial_assign_copy.py +160 -0
- warp/tests/test_static.py +48 -0
- warp/tests/test_struct.py +43 -3
- warp/tests/test_tape.py +38 -0
- warp/tests/test_types.py +0 -20
- warp/tests/test_vec.py +216 -441
- warp/tests/test_vec_assign_copy.py +143 -0
- warp/tests/test_vec_constructors.py +325 -0
- warp/tests/tile/test_tile.py +206 -152
- warp/tests/tile/test_tile_cholesky.py +605 -0
- warp/tests/tile/test_tile_load.py +169 -0
- warp/tests/tile/test_tile_mathdx.py +2 -558
- warp/tests/tile/test_tile_matmul.py +179 -0
- warp/tests/tile/test_tile_mlp.py +1 -1
- warp/tests/tile/test_tile_reduce.py +100 -11
- warp/tests/tile/test_tile_shared_memory.py +16 -16
- warp/tests/tile/test_tile_sort.py +59 -55
- warp/tests/unittest_suites.py +16 -0
- warp/tests/walkthrough_debug.py +1 -1
- warp/thirdparty/unittest_parallel.py +108 -9
- warp/types.py +554 -264
- warp/utils.py +68 -86
- {warp_lang-1.8.0.dist-info → warp_lang-1.9.0.dist-info}/METADATA +28 -65
- {warp_lang-1.8.0.dist-info → warp_lang-1.9.0.dist-info}/RECORD +150 -138
- warp/native/marching.cpp +0 -19
- warp/native/marching.cu +0 -514
- warp/native/marching.h +0 -19
- {warp_lang-1.8.0.dist-info → warp_lang-1.9.0.dist-info}/WHEEL +0 -0
- {warp_lang-1.8.0.dist-info → warp_lang-1.9.0.dist-info}/licenses/LICENSE.md +0 -0
- {warp_lang-1.8.0.dist-info → warp_lang-1.9.0.dist-info}/top_level.txt +0 -0
warp/tests/unittest_suites.py
CHANGED
|
@@ -164,6 +164,7 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
|
|
|
164
164
|
from warp.tests.test_linear_solvers import TestLinearSolvers
|
|
165
165
|
from warp.tests.test_lvalue import TestLValue
|
|
166
166
|
from warp.tests.test_mat import TestMat
|
|
167
|
+
from warp.tests.test_mat_constructors import TestMatConstructors
|
|
167
168
|
from warp.tests.test_mat_lite import TestMatLite
|
|
168
169
|
from warp.tests.test_mat_scalar_ops import TestMatScalarOps
|
|
169
170
|
from warp.tests.test_math import TestMath
|
|
@@ -193,13 +194,19 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
|
|
|
193
194
|
from warp.tests.test_types import TestTypes
|
|
194
195
|
from warp.tests.test_utils import TestUtils
|
|
195
196
|
from warp.tests.test_vec import TestVec
|
|
197
|
+
from warp.tests.test_vec_constructors import TestVecConstructors
|
|
196
198
|
from warp.tests.test_vec_lite import TestVecLite
|
|
197
199
|
from warp.tests.test_vec_scalar_ops import TestVecScalarOps
|
|
198
200
|
from warp.tests.test_verify_fp import TestVerifyFP
|
|
199
201
|
from warp.tests.tile.test_tile import TestTile
|
|
202
|
+
from warp.tests.tile.test_tile_cholesky import TestTileCholesky
|
|
203
|
+
from warp.tests.tile.test_tile_load import TestTileLoad
|
|
200
204
|
from warp.tests.tile.test_tile_mathdx import TestTileMathDx
|
|
205
|
+
from warp.tests.tile.test_tile_matmul import TestTileMatmul
|
|
201
206
|
from warp.tests.tile.test_tile_reduce import TestTileReduce
|
|
202
207
|
from warp.tests.tile.test_tile_shared_memory import TestTileSharedMemory
|
|
208
|
+
from warp.tests.tile.test_tile_sort import TestTileSort
|
|
209
|
+
from warp.tests.tile.test_tile_view import TestTileView
|
|
203
210
|
|
|
204
211
|
test_classes = [
|
|
205
212
|
TestAdam,
|
|
@@ -256,6 +263,7 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
|
|
|
256
263
|
TestLValue,
|
|
257
264
|
TestMarchingCubes,
|
|
258
265
|
TestMat,
|
|
266
|
+
TestMatConstructors,
|
|
259
267
|
TestMatLite,
|
|
260
268
|
TestMatScalarOps,
|
|
261
269
|
TestMath,
|
|
@@ -293,15 +301,21 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
|
|
|
293
301
|
TestStruct,
|
|
294
302
|
TestTape,
|
|
295
303
|
TestTile,
|
|
304
|
+
TestTileCholesky,
|
|
305
|
+
TestTileLoad,
|
|
296
306
|
TestTileMathDx,
|
|
307
|
+
TestTileMatmul,
|
|
297
308
|
TestTileReduce,
|
|
298
309
|
TestTileSharedMemory,
|
|
310
|
+
TestTileSort,
|
|
311
|
+
TestTileView,
|
|
299
312
|
TestTorch,
|
|
300
313
|
TestTransientModule,
|
|
301
314
|
TestTriangleClosestPoint,
|
|
302
315
|
TestTypes,
|
|
303
316
|
TestUtils,
|
|
304
317
|
TestVec,
|
|
318
|
+
TestVecConstructors,
|
|
305
319
|
TestVecLite,
|
|
306
320
|
TestVecScalarOps,
|
|
307
321
|
TestVerifyFP,
|
|
@@ -350,6 +364,7 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
|
|
|
350
364
|
from warp.tests.test_lvalue import TestLValue
|
|
351
365
|
from warp.tests.test_mat_lite import TestMatLite
|
|
352
366
|
from warp.tests.test_math import TestMath
|
|
367
|
+
from warp.tests.test_module_aot import TestModuleAOT
|
|
353
368
|
from warp.tests.test_module_hashing import TestModuleHashing
|
|
354
369
|
from warp.tests.test_modules_lite import TestModuleLite
|
|
355
370
|
from warp.tests.test_noise import TestNoise
|
|
@@ -396,6 +411,7 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
|
|
|
396
411
|
TestMeshQueryAABBMethods,
|
|
397
412
|
TestMeshQueryPoint,
|
|
398
413
|
TestMeshQueryRay,
|
|
414
|
+
TestModuleAOT,
|
|
399
415
|
TestModuleHashing,
|
|
400
416
|
TestModuleLite,
|
|
401
417
|
TestNoise,
|
warp/tests/walkthrough_debug.py
CHANGED
|
@@ -68,7 +68,7 @@ wp.init()
|
|
|
68
68
|
wp.config.mode = "debug"
|
|
69
69
|
|
|
70
70
|
# Make sure Warp was built with `build_lib.py --mode=debug`
|
|
71
|
-
assert wp.context.runtime.core.
|
|
71
|
+
assert wp.context.runtime.core.wp_is_debug_enabled(), "Warp must be built in debug mode to enable debugging kernels"
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
@wp.kernel
|
|
@@ -28,6 +28,7 @@ import sys
|
|
|
28
28
|
import tempfile
|
|
29
29
|
import time
|
|
30
30
|
import unittest
|
|
31
|
+
from concurrent.futures.process import BrokenProcessPool
|
|
31
32
|
from contextlib import contextmanager
|
|
32
33
|
from io import StringIO
|
|
33
34
|
|
|
@@ -160,6 +161,7 @@ def main(argv=None):
|
|
|
160
161
|
group_warp.add_argument(
|
|
161
162
|
"--no-shared-cache", action="store_true", help="Use a separate kernel cache per test process."
|
|
162
163
|
)
|
|
164
|
+
group_warp.add_argument("--warp-debug", action="store_true", help="Set warp.config.mode to 'debug'")
|
|
163
165
|
args = parser.parse_args(args=argv)
|
|
164
166
|
|
|
165
167
|
if args.coverage_branch:
|
|
@@ -242,15 +244,76 @@ def main(argv=None):
|
|
|
242
244
|
test_manager = ParallelTestManager(manager, args, temp_dir)
|
|
243
245
|
results = pool.map(test_manager.run_tests, test_suites)
|
|
244
246
|
else:
|
|
245
|
-
# NVIDIA Modification added concurrent.futures
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
247
|
+
# NVIDIA Modification: added concurrent.futures with crash handling and per-suite isolated fallback
|
|
248
|
+
results = []
|
|
249
|
+
parallel_failed = False
|
|
250
|
+
|
|
251
|
+
try:
|
|
252
|
+
with concurrent.futures.ProcessPoolExecutor(
|
|
253
|
+
max_workers=process_count,
|
|
254
|
+
mp_context=multiprocessing.get_context(method="spawn"),
|
|
255
|
+
initializer=initialize_test_process,
|
|
256
|
+
initargs=(manager.Lock(), shared_index, args, temp_dir),
|
|
257
|
+
) as executor:
|
|
258
|
+
test_manager = ParallelTestManager(manager, args, temp_dir)
|
|
259
|
+
# Try parallel execution first using the original map approach
|
|
260
|
+
results = list(executor.map(test_manager.run_tests, test_suites, timeout=2400))
|
|
261
|
+
|
|
262
|
+
except BrokenProcessPool:
|
|
263
|
+
# Process pool is broken - switch to isolated single-process fallback
|
|
264
|
+
print(
|
|
265
|
+
"Warning: Process pool broken during parallel execution. Switching to isolated single-process fallback.",
|
|
266
|
+
file=sys.stderr,
|
|
267
|
+
)
|
|
268
|
+
parallel_failed = True
|
|
269
|
+
except Exception as e:
|
|
270
|
+
# Handle other pool-level exceptions
|
|
271
|
+
print(
|
|
272
|
+
f"Warning: Process pool error: {e}. Switching to isolated single-process fallback.",
|
|
273
|
+
file=sys.stderr,
|
|
274
|
+
)
|
|
275
|
+
parallel_failed = True
|
|
276
|
+
|
|
277
|
+
# Fallback to isolated single-process execution if parallel failed
|
|
278
|
+
if parallel_failed:
|
|
279
|
+
print("Running all tests in isolated single-process mode...", file=sys.stderr)
|
|
280
|
+
# Run all test suites in isolated single-process pools
|
|
281
|
+
results = []
|
|
282
|
+
for i, suite in enumerate(test_suites):
|
|
283
|
+
try:
|
|
284
|
+
# Create a new single-process pool for each test suite
|
|
285
|
+
with concurrent.futures.ProcessPoolExecutor(
|
|
286
|
+
max_workers=1,
|
|
287
|
+
mp_context=multiprocessing.get_context(method="spawn"),
|
|
288
|
+
initializer=initialize_test_process,
|
|
289
|
+
initargs=(manager.Lock(), shared_index, args, temp_dir),
|
|
290
|
+
) as executor:
|
|
291
|
+
test_manager = ParallelTestManager(manager, args, temp_dir)
|
|
292
|
+
future = executor.submit(test_manager.run_tests, suite)
|
|
293
|
+
try:
|
|
294
|
+
result = future.result(timeout=2400)
|
|
295
|
+
results.append(result)
|
|
296
|
+
except BrokenProcessPool:
|
|
297
|
+
print(
|
|
298
|
+
f"Warning: Process crashed or was terminated unexpectedly in isolated execution for test suite {i + 1}/{len(test_suites)}. Marking tests as crashed.",
|
|
299
|
+
file=sys.stderr,
|
|
300
|
+
)
|
|
301
|
+
crash_result = create_crash_result(suite)
|
|
302
|
+
results.append(crash_result)
|
|
303
|
+
except Exception as e:
|
|
304
|
+
print(
|
|
305
|
+
f"Warning: Error in isolated test suite {i + 1}/{len(test_suites)}: {e}. Marking tests as crashed.",
|
|
306
|
+
file=sys.stderr,
|
|
307
|
+
)
|
|
308
|
+
error_result = create_crash_result(suite)
|
|
309
|
+
results.append(error_result)
|
|
310
|
+
except Exception as e:
|
|
311
|
+
print(
|
|
312
|
+
f"Warning: Failed to create isolated process for test suite {i + 1}/{len(test_suites)}: {e}. Marking tests as crashed.",
|
|
313
|
+
file=sys.stderr,
|
|
314
|
+
)
|
|
315
|
+
error_result = create_crash_result(suite)
|
|
316
|
+
results.append(error_result)
|
|
254
317
|
else:
|
|
255
318
|
# This entire path is an NVIDIA Modification
|
|
256
319
|
|
|
@@ -259,6 +322,9 @@ def main(argv=None):
|
|
|
259
322
|
if args.verbose > 1:
|
|
260
323
|
print(file=sys.stderr)
|
|
261
324
|
|
|
325
|
+
if args.warp_debug:
|
|
326
|
+
wp.config.mode = "debug"
|
|
327
|
+
|
|
262
328
|
# Run the tests in serial
|
|
263
329
|
start_time = time.perf_counter()
|
|
264
330
|
|
|
@@ -423,6 +489,36 @@ def _iter_test_cases(test_suite):
|
|
|
423
489
|
yield from _iter_test_cases(suite)
|
|
424
490
|
|
|
425
491
|
|
|
492
|
+
def create_crash_result(test_suite):
|
|
493
|
+
"""Create a result indicating the process crashed or was terminated unexpectedly while running this test suite.
|
|
494
|
+
|
|
495
|
+
This entire function is an NVIDIA modification.
|
|
496
|
+
"""
|
|
497
|
+
test_count = test_suite.countTestCases()
|
|
498
|
+
crash_errors = []
|
|
499
|
+
|
|
500
|
+
# Create crash error entries for each test in the suite
|
|
501
|
+
# Note: We don't know which specific test caused the crash, just that the process crashed
|
|
502
|
+
for test in _iter_test_cases(test_suite):
|
|
503
|
+
error_msg = (
|
|
504
|
+
"Process crashed or was terminated unexpectedly while running this test suite "
|
|
505
|
+
f"(unknown which test caused the crash): {test}"
|
|
506
|
+
)
|
|
507
|
+
crash_errors.append(
|
|
508
|
+
"\n".join(
|
|
509
|
+
[
|
|
510
|
+
unittest.TextTestResult.separator1,
|
|
511
|
+
str(test),
|
|
512
|
+
unittest.TextTestResult.separator2,
|
|
513
|
+
error_msg,
|
|
514
|
+
]
|
|
515
|
+
)
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
# Return the same format as run_tests: (test_count, errors, failures, skipped, expected_failures, unexpected_successes, test_records)
|
|
519
|
+
return (test_count, crash_errors, [], 0, 0, 0, [])
|
|
520
|
+
|
|
521
|
+
|
|
426
522
|
class ParallelTestManager:
|
|
427
523
|
def __init__(self, manager, args, temp_dir):
|
|
428
524
|
self.args = args
|
|
@@ -547,6 +643,9 @@ def initialize_test_process(lock, shared_index, args, temp_dir):
|
|
|
547
643
|
with _coverage(args, temp_dir):
|
|
548
644
|
import warp as wp
|
|
549
645
|
|
|
646
|
+
if args.warp_debug:
|
|
647
|
+
wp.config.mode = "debug"
|
|
648
|
+
|
|
550
649
|
if args.no_shared_cache:
|
|
551
650
|
from warp.thirdparty import appdirs
|
|
552
651
|
|