@luma.gl/graph 10.0.0-beta.1 → 10.0.0-beta.3
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.
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.cjs +22 -9
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts +11 -2
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js +27 -10
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.cjs +24 -13
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts +9 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js +41 -14
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +24 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +10 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +29 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +2 -0
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +1 -1
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +1 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/experimental-models.cjs +21 -0
- package/dist/experimental-models.d.ts +2 -0
- package/dist/experimental-models.d.ts.map +1 -0
- package/dist/experimental-models.js +5 -0
- package/dist/experimental-models.js.map +1 -0
- package/dist/experimental-simulation.cjs +21 -0
- package/dist/experimental-simulation.d.ts +2 -0
- package/dist/experimental-simulation.d.ts.map +1 -0
- package/dist/experimental-simulation.js +5 -0
- package/dist/experimental-simulation.js.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.cjs +63 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts +32 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.js +56 -0
- package/dist/gpu-core/gpu-bvh-bounds.js.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.cjs +92 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts +41 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js +85 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js.map +1 -0
- package/dist/gpu-core/index.cjs +6 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +4 -0
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +2 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.cjs +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +60 -15
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts +13 -2
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +69 -18
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.cjs +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.d.ts +10 -0
- package/dist/gpu-dataframe/gpu-data-frame.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.js +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.cjs +157 -25
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts +9 -5
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.js +184 -25
- package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +100 -8
- package/dist/gpu-dataframe/gpu-expression.d.ts +35 -3
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +92 -6
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +2 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +4 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +4 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts +5 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js +11 -5
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +136 -99
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +7 -2
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js +135 -97
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +286 -49
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts +17 -2
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +290 -40
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.cjs +10 -8
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts +7 -1
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.js +14 -8
- package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.cjs +8 -8
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.js +9 -9
- package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.cjs +38 -10
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts +3 -2
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.js +37 -9
- package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-query.cjs +13 -5
- package/dist/gpu-dataframe/gpu-sort-query.d.ts +4 -1
- package/dist/gpu-dataframe/gpu-sort-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-query.js +14 -5
- package/dist/gpu-dataframe/gpu-sort-query.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +12 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +3 -3
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -2
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +68 -4
- package/dist/gpu-dataframe/portable-expression.d.ts +3 -1
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/portable-expression.js +69 -5
- package/dist/gpu-dataframe/portable-expression.js.map +1 -1
- package/dist/gpu-dggs-benchmarks.cjs +21 -0
- package/dist/gpu-dggs-benchmarks.d.ts +2 -0
- package/dist/gpu-dggs-benchmarks.d.ts.map +1 -0
- package/dist/gpu-dggs-benchmarks.js +5 -0
- package/dist/gpu-dggs-benchmarks.js.map +1 -0
- package/dist/gpu-graph-algorithms-benchmarks.cjs +21 -0
- package/dist/gpu-graph-algorithms-benchmarks.d.ts +2 -0
- package/dist/gpu-graph-algorithms-benchmarks.d.ts.map +1 -0
- package/dist/gpu-graph-algorithms-benchmarks.js +5 -0
- package/dist/gpu-graph-algorithms-benchmarks.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-batch.cjs +11 -10
- package/dist/gpu-physics/gpu-physics-batch.d.ts +1 -0
- package/dist/gpu-physics/gpu-physics-batch.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-batch.js +14 -10
- package/dist/gpu-physics/gpu-physics-batch.js.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.cjs +116 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts +42 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts.map +1 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.js +90 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-ensemble.cjs +105 -8
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts +40 -2
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.js +109 -6
- package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +737 -213
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +111 -5
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +842 -231
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs +23 -2
- package/dist/gpu-physics/index.cjs.map +3 -3
- package/dist/gpu-physics/index.d.ts +10 -3
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/index.js +6 -1
- package/dist/gpu-physics/index.js.map +1 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.cjs +21 -8
- package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.js +15 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.cjs +10 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.js +15 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.cjs +15 -2
- package/dist/gpu-physics/rigid-body-capacity.d.ts +3 -1
- package/dist/gpu-physics/rigid-body-capacity.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.js +21 -2
- package/dist/gpu-physics/rigid-body-capacity.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cast-index.cjs +192 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts +44 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-cast-index.js +194 -0
- package/dist/gpu-physics/rigid-body-cast-index.js.map +1 -0
- package/dist/gpu-physics/rigid-body-convex-shaders.cjs +3 -2
- package/dist/gpu-physics/rigid-body-convex-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-convex-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-convex-shaders.js +3 -2
- package/dist/gpu-physics/rigid-body-convex-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.cjs +4 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.js +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.cjs +45 -14
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.js +53 -14
- package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.cjs +14 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts +5 -0
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js +17 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +40 -8
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js +49 -9
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js.map +1 -1
- package/dist/gpu-physics/rigid-body-event-compaction.cjs +184 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js +168 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.cjs +51 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts +33 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js +34 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js.map +1 -0
- package/dist/gpu-physics/rigid-body-events.cjs +57 -25
- package/dist/gpu-physics/rigid-body-events.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-events.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-events.js +60 -25
- package/dist/gpu-physics/rigid-body-events.js.map +1 -1
- package/dist/gpu-physics/rigid-body-geometry.cjs +41 -4
- package/dist/gpu-physics/rigid-body-geometry.d.ts +10 -1
- package/dist/gpu-physics/rigid-body-geometry.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-geometry.js +44 -3
- package/dist/gpu-physics/rigid-body-geometry.js.map +1 -1
- package/dist/gpu-physics/rigid-body-height-field-shader.cjs +80 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.d.ts +3 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.js +56 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.js.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field.cjs +166 -0
- package/dist/gpu-physics/rigid-body-height-field.d.ts +55 -0
- package/dist/gpu-physics/rigid-body-height-field.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field.js +184 -0
- package/dist/gpu-physics/rigid-body-height-field.js.map +1 -0
- package/dist/gpu-physics/rigid-body-joints.cjs +8 -3
- package/dist/gpu-physics/rigid-body-joints.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-joints.js +10 -6
- package/dist/gpu-physics/rigid-body-joints.js.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.cjs +4 -2
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.js +4 -2
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh.cjs +72 -17
- package/dist/gpu-physics/rigid-body-mesh.d.ts +3 -0
- package/dist/gpu-physics/rigid-body-mesh.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh.js +76 -20
- package/dist/gpu-physics/rigid-body-mesh.js.map +1 -1
- package/dist/gpu-physics/rigid-body-properties.cjs +4 -4
- package/dist/gpu-physics/rigid-body-properties.d.ts +6 -0
- package/dist/gpu-physics/rigid-body-properties.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-properties.js +1 -1
- package/dist/gpu-physics/rigid-body-properties.js.map +1 -1
- package/dist/gpu-physics/rigid-body-publication.cjs +2 -2
- package/dist/gpu-physics/rigid-body-publication.js +1 -1
- package/dist/gpu-physics/rigid-body-publication.js.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.cjs +159 -16
- package/dist/gpu-physics/rigid-body-queries.d.ts +24 -1
- package/dist/gpu-physics/rigid-body-queries.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.js +166 -14
- package/dist/gpu-physics/rigid-body-queries.js.map +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.cjs +22 -4
- package/dist/gpu-physics/rigid-body-query-geometry.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.js +22 -4
- package/dist/gpu-physics/rigid-body-query-geometry.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +13 -7
- package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.js +16 -8
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shape-properties.cjs +2 -0
- package/dist/gpu-physics/rigid-body-shape-properties.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shape-properties.js +2 -0
- package/dist/gpu-physics/rigid-body-shape-properties.js.map +1 -1
- package/dist/gpu-physics/rigid-body-terrain-atlas.cjs +287 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts +87 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.js +275 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.cjs +240 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.d.ts +76 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.js +247 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.cjs +215 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts +25 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.js +218 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.cjs +263 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.d.ts +97 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.js +250 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.js.map +1 -0
- package/dist/gpu-physics/rigid-body-triggers.cjs +54 -15
- package/dist/gpu-physics/rigid-body-triggers.d.ts +1 -0
- package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.js +56 -15
- package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +99 -44
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +15 -3
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.js +93 -40
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.cjs +48 -20
- package/dist/gpu-physics/sphere-world-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.js +51 -21
- package/dist/gpu-physics/sphere-world-shaders.js.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +1 -1
- package/dist/gpu-project/cpu-projection-operation.d.ts +1 -1
- package/dist/gpu-project/crs.cjs.map +3 -3
- package/dist/gpu-project/crs.d.ts +1 -1
- package/dist/gpu-project/index.cjs.map +2 -2
- package/dist/gpu-project/projection-crs-benchmark.cjs +2 -2
- package/dist/gpu-project/projection-crs-benchmark.d.ts +1 -1
- package/dist/gpu-project/projection-crs-benchmark.js +1 -1
- package/dist/gpu-project/projection-crs-input.cjs +7 -7
- package/dist/gpu-project/projection-crs-input.d.ts +1 -1
- package/dist/gpu-project/projection-crs-input.js +4 -4
- package/dist/gpu-project/projection-engine.d.ts +2 -2
- package/dist/gpu-project/projection-program.cjs +2 -9
- package/dist/gpu-project/projection-program.d.ts.map +1 -1
- package/dist/gpu-project/projection-program.js +1 -8
- package/dist/gpu-project/projection-program.js.map +1 -1
- package/dist/gpu-project-benchmarks.cjs +21 -0
- package/dist/gpu-project-benchmarks.d.ts +2 -0
- package/dist/gpu-project-benchmarks.d.ts.map +1 -0
- package/dist/gpu-project-benchmarks.js +5 -0
- package/dist/gpu-project-benchmarks.js.map +1 -0
- package/dist/gpu-project-crs.cjs +21 -0
- package/dist/gpu-project-crs.d.ts +2 -0
- package/dist/gpu-project-crs.d.ts.map +1 -0
- package/dist/gpu-project-crs.js +5 -0
- package/dist/gpu-project-crs.js.map +1 -0
- package/dist/gpu-project-geoarrow.cjs +21 -0
- package/dist/gpu-project-geoarrow.d.ts +2 -0
- package/dist/gpu-project-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project-geoarrow.js +5 -0
- package/dist/gpu-project-geoarrow.js.map +1 -0
- package/dist/gpu-project-graph.cjs +21 -0
- package/dist/gpu-project-graph.d.ts +2 -0
- package/dist/gpu-project-graph.d.ts.map +1 -0
- package/dist/gpu-project-graph.js +5 -0
- package/dist/gpu-project-graph.js.map +1 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/operation.d.ts +1 -1
- package/dist/gpu-simple-graph/operation/operation.d.ts.map +1 -1
- package/dist/gpu-simple-graph-cpu.cjs +21 -0
- package/dist/gpu-simple-graph-cpu.d.ts +2 -0
- package/dist/gpu-simple-graph-cpu.d.ts.map +1 -0
- package/dist/gpu-simple-graph-cpu.js +5 -0
- package/dist/gpu-simple-graph-cpu.js.map +1 -0
- package/dist/gpu-simple-graph-webgl.cjs +21 -0
- package/dist/gpu-simple-graph-webgl.d.ts +2 -0
- package/dist/gpu-simple-graph-webgl.d.ts.map +1 -0
- package/dist/gpu-simple-graph-webgl.js +5 -0
- package/dist/gpu-simple-graph-webgl.js.map +1 -0
- package/dist/gpu-simple-graph-webgpu.cjs +21 -0
- package/dist/gpu-simple-graph-webgpu.d.ts +2 -0
- package/dist/gpu-simple-graph-webgpu.d.ts.map +1 -0
- package/dist/gpu-simple-graph-webgpu.js +5 -0
- package/dist/gpu-simple-graph-webgpu.js.map +1 -0
- package/dist/gpu-sql/gpu-sql.cjs +269 -171
- package/dist/gpu-sql/gpu-sql.d.ts +36 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +313 -181
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-sql/index.d.ts +1 -1
- package/dist/gpu-sql/index.d.ts.map +1 -1
- package/dist/utils/float32.cjs +35 -0
- package/dist/utils/float32.d.ts +3 -0
- package/dist/utils/float32.d.ts.map +1 -0
- package/dist/utils/float32.js +16 -0
- package/dist/utils/float32.js.map +1 -0
- package/package.json +19 -19
- package/src/arrow/gpu/arrow-gpu-analytics-adapters.ts +77 -25
- package/src/arrow/gpu/arrow-gpu-analytics-readback.ts +52 -16
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +46 -1
- package/src/arrow/index.ts +1 -0
- package/src/experimental-models.ts +5 -0
- package/src/experimental-simulation.ts +5 -0
- package/src/gpu-core/gpu-bvh-bounds.ts +84 -0
- package/src/gpu-core/gpu-command-graph-submission-pacer.ts +102 -0
- package/src/gpu-core/index.ts +5 -0
- package/src/gpu-dataframe/gpu-analytics-compiler-utils.ts +7 -10
- package/src/gpu-dataframe/gpu-data-frame-query.ts +119 -25
- package/src/gpu-dataframe/gpu-data-frame.ts +35 -2
- package/src/gpu-dataframe/gpu-expression-shader.ts +267 -32
- package/src/gpu-dataframe/gpu-expression.ts +186 -10
- package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +6 -3
- package/src/gpu-dataframe/gpu-global-aggregation-query.ts +17 -6
- package/src/gpu-dataframe/gpu-global-sort-compiler.ts +177 -105
- package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +469 -53
- package/src/gpu-dataframe/gpu-group-by-query.ts +29 -13
- package/src/gpu-dataframe/gpu-histogram-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-join-compiler.ts +12 -8
- package/src/gpu-dataframe/gpu-query-compiler.ts +61 -19
- package/src/gpu-dataframe/gpu-sort-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-sort-query.ts +31 -5
- package/src/gpu-dataframe/index.ts +16 -3
- package/src/gpu-dataframe/portable-expression.ts +81 -4
- package/src/gpu-dggs-benchmarks.ts +5 -0
- package/src/gpu-graph-algorithms-benchmarks.ts +5 -0
- package/src/gpu-physics/gpu-physics-batch.ts +19 -13
- package/src/gpu-physics/gpu-physics-ensemble-terrain.ts +114 -0
- package/src/gpu-physics/gpu-physics-ensemble.ts +166 -7
- package/src/gpu-physics/gpu-rigid-body-world.ts +1085 -287
- package/src/gpu-physics/index.ts +46 -0
- package/src/gpu-physics/rigid-body-bounds-shaders.ts +16 -1
- package/src/gpu-physics/rigid-body-cache-shaders.ts +18 -6
- package/src/gpu-physics/rigid-body-capacity.ts +25 -4
- package/src/gpu-physics/rigid-body-cast-index.ts +277 -0
- package/src/gpu-physics/rigid-body-convex-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-ensemble-layout.ts +6 -2
- package/src/gpu-physics/rigid-body-ensemble-reset.ts +67 -15
- package/src/gpu-physics/rigid-body-ensemble-shaders.ts +18 -7
- package/src/gpu-physics/rigid-body-ensemble-transaction.ts +61 -10
- package/src/gpu-physics/rigid-body-event-compaction.ts +252 -0
- package/src/gpu-physics/rigid-body-event-snapshot.ts +76 -0
- package/src/gpu-physics/rigid-body-events.ts +63 -25
- package/src/gpu-physics/rigid-body-geometry.ts +49 -4
- package/src/gpu-physics/rigid-body-height-field-shader.ts +56 -0
- package/src/gpu-physics/rigid-body-height-field.ts +257 -0
- package/src/gpu-physics/rigid-body-joints.ts +9 -11
- package/src/gpu-physics/rigid-body-mesh-query-shaders.ts +4 -2
- package/src/gpu-physics/rigid-body-mesh.ts +97 -26
- package/src/gpu-physics/rigid-body-properties.ts +5 -2
- package/src/gpu-physics/rigid-body-publication.ts +1 -1
- package/src/gpu-physics/rigid-body-queries.ts +202 -14
- package/src/gpu-physics/rigid-body-query-geometry.ts +22 -4
- package/src/gpu-physics/rigid-body-shaders.ts +20 -8
- package/src/gpu-physics/rigid-body-shape-properties.ts +2 -0
- package/src/gpu-physics/rigid-body-terrain-atlas.ts +378 -0
- package/src/gpu-physics/rigid-body-terrain-lod.ts +332 -0
- package/src/gpu-physics/rigid-body-terrain-stitch.ts +286 -0
- package/src/gpu-physics/rigid-body-terrain-stream.ts +323 -0
- package/src/gpu-physics/rigid-body-triggers.ts +65 -20
- package/src/gpu-physics/rigid-body-vehicle.ts +108 -41
- package/src/gpu-physics/sphere-world-shaders.ts +53 -21
- package/src/gpu-project/README.md +2 -2
- package/src/gpu-project/cpu-geometry-pipelines.ts +1 -1
- package/src/gpu-project/cpu-projection-operation.ts +1 -1
- package/src/gpu-project/crs.ts +2 -2
- package/src/gpu-project/projection-crs-benchmark.ts +2 -2
- package/src/gpu-project/projection-crs-input.ts +4 -4
- package/src/gpu-project/projection-engine.ts +2 -2
- package/src/gpu-project/projection-program.ts +1 -9
- package/src/gpu-project-benchmarks.ts +5 -0
- package/src/gpu-project-crs.ts +5 -0
- package/src/gpu-project-geoarrow.ts +5 -0
- package/src/gpu-project-graph.ts +5 -0
- package/src/gpu-simple-graph/gpu-simple-graph-transfer.ts +1 -1
- package/src/gpu-simple-graph/gpu-simple-graph-value.ts +1 -1
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +1 -1
- package/src/gpu-simple-graph/operation/operation.ts +1 -1
- package/src/gpu-simple-graph/operations/swizzle.ts +1 -1
- package/src/gpu-simple-graph-cpu.ts +5 -0
- package/src/gpu-simple-graph-webgl.ts +5 -0
- package/src/gpu-simple-graph-webgpu.ts +5 -0
- package/src/gpu-sql/gpu-sql.ts +535 -223
- package/src/gpu-sql/index.ts +1 -1
- package/src/utils/float32.ts +16 -0
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type GPURigidBodyCapture,
|
|
15
15
|
type GPURigidBodyWorldProps
|
|
16
16
|
} from './gpu-rigid-body-world';
|
|
17
|
+
import type {GPURigidBodyCapacityInfo} from './rigid-body-capacity';
|
|
17
18
|
|
|
18
19
|
export type GPUPhysicsWorldHandle = Readonly<{id: string; generation: number}>;
|
|
19
20
|
export type GPUPhysicsBatchProps = {
|
|
@@ -34,6 +35,8 @@ type Slot = {
|
|
|
34
35
|
checkpoint: GPURigidBodyGPUCheckpoint;
|
|
35
36
|
bytes: number;
|
|
36
37
|
worldBytes: number;
|
|
38
|
+
/** Physical scratch for the simulation graph and the world's private query graph. */
|
|
39
|
+
graphBytes: number;
|
|
37
40
|
handle: GPUPhysicsWorldHandle | null;
|
|
38
41
|
origin: [number, number, number];
|
|
39
42
|
active: boolean;
|
|
@@ -72,7 +75,7 @@ export class GPUPhysicsBatch {
|
|
|
72
75
|
const definition = structuredClone(props);
|
|
73
76
|
const probe = new GPURigidBodyWorld(definition);
|
|
74
77
|
try {
|
|
75
|
-
if (this.estimateResidentBytes(probe) > this.props.maximumResidentBytes)
|
|
78
|
+
if (this.estimateResidentBytes(probe.getCapacityInfo()) > this.props.maximumResidentBytes)
|
|
76
79
|
throw new Error('World and reset snapshot exceed residency budget');
|
|
77
80
|
this.templates.set(id, definition);
|
|
78
81
|
} finally {
|
|
@@ -115,13 +118,18 @@ export class GPUPhysicsBatch {
|
|
|
115
118
|
let graph: CompiledGPUCommandGraph<undefined> | undefined;
|
|
116
119
|
let checkpoint: GPURigidBodyGPUCheckpoint | undefined;
|
|
117
120
|
try {
|
|
118
|
-
|
|
119
|
-
const expectedBytes = this.estimateResidentBytes(world);
|
|
120
|
-
this.makeRoom(expectedBytes);
|
|
121
|
+
this.makeRoom(this.estimateResidentBytes(world.getCapacityInfo()));
|
|
121
122
|
const commands = new GPUCommandGraph<undefined>(this.props.device);
|
|
122
123
|
world.addToGraph(commands);
|
|
123
124
|
graph = await commands.compileAsync();
|
|
124
|
-
|
|
125
|
+
/** Attachment resolves scratch aliasing in the private cast index. */
|
|
126
|
+
const capacity = world.getCapacityInfo();
|
|
127
|
+
/** Graph scratch is resident, but is not copied to the reset snapshot. */
|
|
128
|
+
const graphBytes =
|
|
129
|
+
graph.stats.physicalTransientResourceBytes + capacity.queryIndexScratchBytes;
|
|
130
|
+
/** The admission estimate includes the private graph once. */
|
|
131
|
+
const bytes =
|
|
132
|
+
this.estimateResidentBytes(capacity) + graph.stats.physicalTransientResourceBytes;
|
|
125
133
|
this.makeRoom(bytes);
|
|
126
134
|
checkpoint = world.createGPUCheckpoint({includeRollbackScratch: false});
|
|
127
135
|
checkpoint.save();
|
|
@@ -131,7 +139,8 @@ export class GPUPhysicsBatch {
|
|
|
131
139
|
graph,
|
|
132
140
|
checkpoint,
|
|
133
141
|
bytes,
|
|
134
|
-
worldBytes,
|
|
142
|
+
worldBytes: capacity.ownedBufferBytes,
|
|
143
|
+
graphBytes,
|
|
135
144
|
handle: null,
|
|
136
145
|
origin: [0, 0, 0],
|
|
137
146
|
active: true,
|
|
@@ -290,10 +299,7 @@ export class GPUPhysicsBatch {
|
|
|
290
299
|
residentBytes: this.slots.reduce((sum, slot) => sum + slot.bytes, 0),
|
|
291
300
|
worldBufferBytes: this.slots.reduce((sum, slot) => sum + slot.worldBytes, 0),
|
|
292
301
|
checkpointBytes: this.slots.reduce((sum, slot) => sum + slot.checkpoint.byteLength, 0),
|
|
293
|
-
graphTransientBytes: this.slots.reduce(
|
|
294
|
-
(sum, slot) => sum + slot.graph.stats.physicalTransientResourceBytes,
|
|
295
|
-
0
|
|
296
|
-
),
|
|
302
|
+
graphTransientBytes: this.slots.reduce((sum, slot) => sum + slot.graphBytes, 0),
|
|
297
303
|
createdSlots: this.createdSlots,
|
|
298
304
|
reusedSlots: this.reusedSlots,
|
|
299
305
|
evictedSlots: this.evictedSlots
|
|
@@ -313,12 +319,12 @@ export class GPUPhysicsBatch {
|
|
|
313
319
|
this.destroyed = true;
|
|
314
320
|
}
|
|
315
321
|
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
/** Account for one reset copy of owned buffers and one copy of query scratch. */
|
|
323
|
+
private estimateResidentBytes(capacity: GPURigidBodyCapacityInfo): number {
|
|
318
324
|
const rollbackScratchBytes = capacity.buffers
|
|
319
325
|
.filter(buffer => buffer.name.startsWith('checkpoint-'))
|
|
320
326
|
.reduce((sum, buffer) => sum + buffer.byteLength, 0);
|
|
321
|
-
return capacity.ownedBufferBytes * 2 - rollbackScratchBytes;
|
|
327
|
+
return capacity.ownedBufferBytes * 2 - rollbackScratchBytes + capacity.queryIndexScratchBytes;
|
|
322
328
|
}
|
|
323
329
|
|
|
324
330
|
private makeRoom(bytes: number): void {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
GPURigidBodyTerrainStream,
|
|
7
|
+
RigidBodyTerrainLoadQueue,
|
|
8
|
+
type GPURigidBodyTerrainStreamProps,
|
|
9
|
+
type GPURigidBodyTerrainWindow
|
|
10
|
+
} from './rigid-body-terrain-stream';
|
|
11
|
+
import type {GPURigidBodyHeightFieldEdit} from './gpu-rigid-body-world';
|
|
12
|
+
import type {GPURigidBodyTerrainTile} from './rigid-body-terrain-stitch';
|
|
13
|
+
|
|
14
|
+
/** A prepared instance window to publish using template-local indices. */
|
|
15
|
+
type TerrainPublication = {
|
|
16
|
+
/** Ensemble instance that owns the edited colliders. */
|
|
17
|
+
instance: number;
|
|
18
|
+
/** Changes required to replace the committed window. */
|
|
19
|
+
edits: readonly GPURigidBodyHeightFieldEdit[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Independent local terrain windows with one provider queue for a fused ensemble. */
|
|
23
|
+
export class GPUPhysicsEnsembleTerrain {
|
|
24
|
+
private readonly streams = new Map<number, GPURigidBodyTerrainStream>();
|
|
25
|
+
private readonly slots: ReadonlySet<number>;
|
|
26
|
+
private readonly loads: RigidBodyTerrainLoadQueue;
|
|
27
|
+
|
|
28
|
+
/** @internal Create with GPUPhysicsEnsemble.createTerrainStreamer(). */
|
|
29
|
+
constructor(
|
|
30
|
+
private readonly props: GPURigidBodyTerrainStreamProps,
|
|
31
|
+
slots: readonly number[],
|
|
32
|
+
private readonly validateInstance: (instance: number) => void,
|
|
33
|
+
private readonly publish: (windows: readonly TerrainPublication[]) => void
|
|
34
|
+
) {
|
|
35
|
+
this.slots = new Set(slots);
|
|
36
|
+
this.loads = new RigidBodyTerrainLoadQueue(props);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Stage an instance's complete window using template-local collider indices. */
|
|
40
|
+
async prepare(instance: number, window: GPURigidBodyTerrainWindow): Promise<boolean> {
|
|
41
|
+
this.validateInstance(instance);
|
|
42
|
+
if (window.tiles.some(({collider}) => !this.slots.has(collider)))
|
|
43
|
+
throw new Error('Invalid ensemble terrain slot');
|
|
44
|
+
let stream = this.streams.get(instance);
|
|
45
|
+
if (!stream) {
|
|
46
|
+
stream = new GPURigidBodyTerrainStream(
|
|
47
|
+
{setHeightFieldTiles: edits => this.publish([{instance, edits}])},
|
|
48
|
+
this.props,
|
|
49
|
+
this.loads
|
|
50
|
+
);
|
|
51
|
+
this.streams.set(instance, stream);
|
|
52
|
+
}
|
|
53
|
+
return stream.prepare(window);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Apply only this instance's staged window between fused graph submissions. */
|
|
57
|
+
apply(instance: number): boolean {
|
|
58
|
+
this.validateInstance(instance);
|
|
59
|
+
return this.streams.get(instance)?.apply() ?? false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Publish all ready windows in one transaction. Instances without a ready window are skipped.
|
|
64
|
+
* Use this for a shared-atlas handoff when the last users of an old page move together.
|
|
65
|
+
*/
|
|
66
|
+
applyMany(instances: readonly number[]): number {
|
|
67
|
+
const windows: TerrainPublication[] = [];
|
|
68
|
+
const streams: GPURigidBodyTerrainStream[] = [];
|
|
69
|
+
for (const instance of new Set(instances)) {
|
|
70
|
+
this.validateInstance(instance);
|
|
71
|
+
const stream = this.streams.get(instance);
|
|
72
|
+
const edits = stream?.getPreparedEdits();
|
|
73
|
+
if (stream && edits) {
|
|
74
|
+
windows.push({instance, edits});
|
|
75
|
+
streams.push(stream);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (windows.some(({edits}) => edits.length)) this.publish(windows);
|
|
79
|
+
for (const stream of streams) stream.commitPreparedWindow();
|
|
80
|
+
return streams.length;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Get the number of committed tiles in the selected instance. */
|
|
84
|
+
getResidentTileCount(instance: number): number {
|
|
85
|
+
this.validateInstance(instance);
|
|
86
|
+
return this.streams.get(instance)?.residentTileCount ?? 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Read a detached stitched surface from a template-local collider slot. */
|
|
90
|
+
getTile(instance: number, collider: number): GPURigidBodyTerrainTile | null {
|
|
91
|
+
this.validateInstance(instance);
|
|
92
|
+
if (!this.slots.has(collider)) throw new Error('Invalid ensemble terrain slot');
|
|
93
|
+
return this.streams.get(instance)?.getTile(collider) ?? null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Drop staged and pending requests for this instance, keeping its committed surfaces. */
|
|
97
|
+
cancel(instance: number): void {
|
|
98
|
+
this.validateInstance(instance);
|
|
99
|
+
this.streams.get(instance)?.cancel();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Evict every stream-owned tile in this instance between submissions. */
|
|
103
|
+
clear(instance: number): void {
|
|
104
|
+
this.validateInstance(instance);
|
|
105
|
+
this.streams.get(instance)?.clear();
|
|
106
|
+
this.streams.delete(instance);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @internal Cancel outstanding provider demand when the parent ensemble is destroyed. */
|
|
110
|
+
release(): void {
|
|
111
|
+
for (const stream of this.streams.values()) stream.release();
|
|
112
|
+
this.streams.clear();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -8,7 +8,15 @@ import {
|
|
|
8
8
|
type CompiledGPUCommandGraph,
|
|
9
9
|
type GPUCommandGraphEncoding
|
|
10
10
|
} from '../gpu-core/gpu-command-graph';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
GPURigidBodyWorld,
|
|
13
|
+
type GPURigidBodyHeightFieldEdit,
|
|
14
|
+
type GPURigidBodyWorldProps
|
|
15
|
+
} from './gpu-rigid-body-world';
|
|
16
|
+
import {GPUPhysicsEnsembleTerrain} from './gpu-physics-ensemble-terrain';
|
|
17
|
+
import type {GPURigidBodyTerrainStreamProps} from './rigid-body-terrain-stream';
|
|
18
|
+
import {getRigidBodyHeightFieldPageWords} from './rigid-body-height-field';
|
|
19
|
+
import {getTerrainAtlasBytes, type GPUPhysicsTerrainAtlasPool} from './rigid-body-terrain-atlas';
|
|
12
20
|
|
|
13
21
|
export type GPUPhysicsEnsembleProps = {
|
|
14
22
|
/** All instances share solver settings and topology, but have independent dynamic state. */
|
|
@@ -19,11 +27,24 @@ export type GPUPhysicsEnsembleProps = {
|
|
|
19
27
|
| 'continuous'
|
|
20
28
|
| 'collisionPartitionSize'
|
|
21
29
|
| 'ensembleBodiesPerInstance'
|
|
30
|
+
| 'ensemblePairsPerInstance'
|
|
31
|
+
| 'ensembleTerrainSlots'
|
|
32
|
+
| 'ensembleTerrainAtlas'
|
|
22
33
|
| 'maximumPairs'
|
|
23
34
|
>;
|
|
24
35
|
instances: number;
|
|
36
|
+
/** Template-local indices of vacant native height-field slots reserved per instance. */
|
|
37
|
+
terrainSlots?: readonly number[];
|
|
38
|
+
/** Optional shared atlas pools. Omit to give every reserved slot private storage. */
|
|
39
|
+
terrainAtlas?: readonly GPUPhysicsTerrainAtlasPool[];
|
|
25
40
|
/** Shared power-of-two contact capacity. Overflow rejects the entire ensemble step. */
|
|
26
41
|
maximumPairs: number;
|
|
42
|
+
/**
|
|
43
|
+
* Optional power-of-two persistent contact budget per instance. Cache exhaustion rolls back
|
|
44
|
+
* and quarantines only that instance until reset. Global discovery and solver faults still
|
|
45
|
+
* reject the shared step. All instance budgets must fit within maximumPairs.
|
|
46
|
+
*/
|
|
47
|
+
maximumPairsPerInstance?: number;
|
|
27
48
|
/** Retained world buffers plus compiled graph scratch; excludes driver and compilation peaks. */
|
|
28
49
|
maximumResidentBytes: number;
|
|
29
50
|
};
|
|
@@ -32,12 +53,20 @@ export type GPUPhysicsEnsembleProps = {
|
|
|
32
53
|
export class GPUPhysicsEnsemble {
|
|
33
54
|
readonly world: GPURigidBodyWorld;
|
|
34
55
|
readonly bodiesPerInstance: number;
|
|
56
|
+
readonly collidersPerInstance: number;
|
|
57
|
+
/** Writable terrain slots in template-local collider order. */
|
|
58
|
+
readonly terrainSlots: readonly number[];
|
|
35
59
|
readonly instances: number;
|
|
60
|
+
/** Number of chassis in each copy of the template. */
|
|
61
|
+
readonly vehiclesPerInstance: number;
|
|
36
62
|
private graph!: CompiledGPUCommandGraph<undefined>;
|
|
37
63
|
private encoding?: GPUCommandGraphEncoding;
|
|
38
64
|
private destroyed = false;
|
|
39
65
|
private preparing = false;
|
|
40
66
|
private resetBytes = 0;
|
|
67
|
+
private terrainStreamer?: GPUPhysicsEnsembleTerrain;
|
|
68
|
+
private directTerrain = false;
|
|
69
|
+
private readonly minimumTerrainBytes: number;
|
|
41
70
|
|
|
42
71
|
private constructor(props: GPUPhysicsEnsembleProps) {
|
|
43
72
|
const template: GPURigidBodyWorldProps = props.template;
|
|
@@ -59,8 +88,31 @@ export class GPUPhysicsEnsemble {
|
|
|
59
88
|
template.collisionPartitionSize
|
|
60
89
|
)
|
|
61
90
|
throw new Error('Invalid ensemble layout');
|
|
91
|
+
if (template.vehicle && template.vehicles) throw new Error('Choose vehicle or vehicles');
|
|
92
|
+
const templateVehicles = template.vehicles ?? (template.vehicle ? [template.vehicle] : []);
|
|
93
|
+
this.vehiclesPerInstance = templateVehicles.length;
|
|
62
94
|
this.instances = props.instances;
|
|
63
95
|
this.bodiesPerInstance = template.bodies.length;
|
|
96
|
+
this.collidersPerInstance = colliderCount;
|
|
97
|
+
this.terrainSlots = Object.freeze([...(props.terrainSlots ?? [])]);
|
|
98
|
+
let minimumTerrainBytes = 0;
|
|
99
|
+
if (this.terrainSlots.length) {
|
|
100
|
+
const shapes = template.bodies.flatMap(body =>
|
|
101
|
+
body.shape ? [body.shape] : body.colliders.map(collider => collider.shape)
|
|
102
|
+
);
|
|
103
|
+
if (new Set(this.terrainSlots).size !== this.terrainSlots.length)
|
|
104
|
+
throw new Error('Invalid ensemble terrain slots');
|
|
105
|
+
for (const index of this.terrainSlots) {
|
|
106
|
+
const shape = shapes[index];
|
|
107
|
+
if (!Number.isSafeInteger(index) || shape?.type !== 'height-field' || shape.field.heights)
|
|
108
|
+
throw new Error('Invalid ensemble terrain slot');
|
|
109
|
+
minimumTerrainBytes +=
|
|
110
|
+
4 * getRigidBodyHeightFieldPageWords(shape.field.width, shape.field.height);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
this.minimumTerrainBytes = props.terrainAtlas
|
|
114
|
+
? getTerrainAtlasBytes(props.terrainAtlas)
|
|
115
|
+
: minimumTerrainBytes * this.instances;
|
|
64
116
|
// Repeated mesh references intentionally survive the world's single structured clone.
|
|
65
117
|
const bodies = Array.from({length: props.instances}, (_, instance) =>
|
|
66
118
|
template.bodies.map(body => {
|
|
@@ -79,6 +131,17 @@ export class GPUPhysicsEnsemble {
|
|
|
79
131
|
this.world = new GPURigidBodyWorld({
|
|
80
132
|
...template,
|
|
81
133
|
bodies,
|
|
134
|
+
vehicle: undefined,
|
|
135
|
+
vehicles: Array.from({length: props.instances}, (_, instance) =>
|
|
136
|
+
templateVehicles.map(vehicle => ({
|
|
137
|
+
...vehicle,
|
|
138
|
+
chassis: vehicle.chassis + instance * this.bodiesPerInstance,
|
|
139
|
+
terrainCollider: vehicle.terrainCollider + instance * colliderCount,
|
|
140
|
+
additionalTerrainColliders: vehicle.additionalTerrainColliders?.map(
|
|
141
|
+
collider => collider + instance * colliderCount
|
|
142
|
+
)
|
|
143
|
+
}))
|
|
144
|
+
).flat(),
|
|
82
145
|
publicationBounds: template.publicationBounds
|
|
83
146
|
? Array.from({length: props.instances}, () => template.publicationBounds!).flat()
|
|
84
147
|
: undefined,
|
|
@@ -87,14 +150,31 @@ export class GPUPhysicsEnsemble {
|
|
|
87
150
|
failurePolicy: 'rollback',
|
|
88
151
|
maximumPairs: props.maximumPairs,
|
|
89
152
|
collisionPartitionSize: colliderCount,
|
|
90
|
-
ensembleBodiesPerInstance: this.bodiesPerInstance
|
|
153
|
+
ensembleBodiesPerInstance: this.bodiesPerInstance,
|
|
154
|
+
ensemblePairsPerInstance: props.maximumPairsPerInstance,
|
|
155
|
+
ensembleTerrainAtlas: props.terrainAtlas,
|
|
156
|
+
ensembleTerrainSlots: this.terrainSlots.length
|
|
157
|
+
? Array.from({length: this.instances}, (_, instance) =>
|
|
158
|
+
this.terrainSlots.map(collider => instance * colliderCount + collider)
|
|
159
|
+
).flat()
|
|
160
|
+
: undefined
|
|
91
161
|
});
|
|
92
162
|
}
|
|
93
163
|
|
|
94
164
|
static async create(device: Device, props: GPUPhysicsEnsembleProps): Promise<GPUPhysicsEnsemble> {
|
|
95
165
|
const ensemble = new GPUPhysicsEnsemble(props);
|
|
96
166
|
try {
|
|
97
|
-
if (
|
|
167
|
+
if (
|
|
168
|
+
ensemble.minimumTerrainBytes >
|
|
169
|
+
Math.min(device.limits.maxBufferSize, device.limits.maxStorageBufferBindingSize)
|
|
170
|
+
)
|
|
171
|
+
throw new Error('Ensemble terrain atlas exceeds device limits');
|
|
172
|
+
/** Reserve the private query graph along with the solver's owned buffers. */
|
|
173
|
+
const capacity = ensemble.world.getCapacityInfo();
|
|
174
|
+
if (
|
|
175
|
+
ensemble.minimumTerrainBytes > props.maximumResidentBytes ||
|
|
176
|
+
capacity.ownedBufferBytes + capacity.queryIndexScratchBytes > props.maximumResidentBytes
|
|
177
|
+
)
|
|
98
178
|
throw new Error('Ensemble residency budget exhausted');
|
|
99
179
|
const commands = new GPUCommandGraph<undefined>(device);
|
|
100
180
|
ensemble.world.addToGraph(commands);
|
|
@@ -125,6 +205,77 @@ export class GPUPhysicsEnsemble {
|
|
|
125
205
|
return instance * this.bodiesPerInstance + body;
|
|
126
206
|
}
|
|
127
207
|
|
|
208
|
+
/** Map a template collider to a fused world query or contact index. */
|
|
209
|
+
getColliderIndex(instance: number, collider: number): number {
|
|
210
|
+
this.getBodyIndex(instance, 0);
|
|
211
|
+
if (!Number.isSafeInteger(collider) || collider < 0 || collider >= this.collidersPerInstance)
|
|
212
|
+
throw new Error('Invalid ensemble collider');
|
|
213
|
+
return instance * this.collidersPerInstance + collider;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Publish predecoded tiles directly to one instance between submissions. */
|
|
217
|
+
setHeightFieldTiles(instance: number, edits: readonly GPURigidBodyHeightFieldEdit[]): void {
|
|
218
|
+
if (this.terrainStreamer) throw new Error('Terrain slots are owned by the ensemble streamer');
|
|
219
|
+
this.publishTerrain([{instance, edits}]);
|
|
220
|
+
this.directTerrain ||= edits.length > 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** Create the single provider streamer that owns this ensemble's reserved slots. */
|
|
224
|
+
createTerrainStreamer(props: GPURigidBodyTerrainStreamProps): GPUPhysicsEnsembleTerrain {
|
|
225
|
+
this.getBodyIndex(0, 0);
|
|
226
|
+
if (!this.terrainSlots.length || this.terrainStreamer || this.directTerrain)
|
|
227
|
+
throw new Error('Ensemble terrain streamer unavailable');
|
|
228
|
+
this.terrainStreamer = new GPUPhysicsEnsembleTerrain(
|
|
229
|
+
props,
|
|
230
|
+
this.terrainSlots,
|
|
231
|
+
instance => {
|
|
232
|
+
this.getBodyIndex(instance, 0);
|
|
233
|
+
},
|
|
234
|
+
windows => this.publishTerrain(windows)
|
|
235
|
+
);
|
|
236
|
+
return this.terrainStreamer;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** Translate template-local edits only after every slot is validated. */
|
|
240
|
+
private publishTerrain(
|
|
241
|
+
windows: readonly {instance: number; edits: readonly GPURigidBodyHeightFieldEdit[]}[]
|
|
242
|
+
): void {
|
|
243
|
+
this.world.setHeightFieldTiles(
|
|
244
|
+
windows.flatMap(({instance, edits}) => {
|
|
245
|
+
const start = this.getColliderIndex(instance, 0);
|
|
246
|
+
return edits.map(edit => {
|
|
247
|
+
if (!this.terrainSlots.includes(edit.collider))
|
|
248
|
+
throw new Error('Invalid ensemble terrain slot');
|
|
249
|
+
return {...edit, collider: start + edit.collider};
|
|
250
|
+
});
|
|
251
|
+
})
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Map a template vehicle to its index for telemetry and GPU wheel poses. */
|
|
256
|
+
getVehicleIndex(instance: number, vehicle: number): number {
|
|
257
|
+
this.getBodyIndex(instance, 0);
|
|
258
|
+
if (!Number.isSafeInteger(vehicle) || vehicle < 0 || vehicle >= this.vehiclesPerInstance)
|
|
259
|
+
throw new Error('Invalid ensemble vehicle');
|
|
260
|
+
return instance * this.vehiclesPerInstance + vehicle;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Update one vehicle, waking only its instance and respecting its enabled flag. */
|
|
264
|
+
setVehicleControls(
|
|
265
|
+
instance: number,
|
|
266
|
+
vehicle: number,
|
|
267
|
+
throttle: number,
|
|
268
|
+
steering: number,
|
|
269
|
+
brake: number
|
|
270
|
+
): void {
|
|
271
|
+
this.world.setVehicleControls(
|
|
272
|
+
throttle,
|
|
273
|
+
steering,
|
|
274
|
+
brake,
|
|
275
|
+
this.getVehicleIndex(instance, vehicle)
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
128
279
|
setActive(instance: number, active: boolean): void {
|
|
129
280
|
this.getBodyIndex(instance, 0);
|
|
130
281
|
this.world.setEnsembleActive(instance, active);
|
|
@@ -135,6 +286,7 @@ export class GPUPhysicsEnsemble {
|
|
|
135
286
|
this.world.wakeEnsembleInstance(instance);
|
|
136
287
|
}
|
|
137
288
|
|
|
289
|
+
/** Restore the template and clear this instance’s quarantine between submissions. */
|
|
138
290
|
async reset(instance: number): Promise<void> {
|
|
139
291
|
this.getBodyIndex(instance, 0);
|
|
140
292
|
this.preparing = true;
|
|
@@ -147,6 +299,7 @@ export class GPUPhysicsEnsemble {
|
|
|
147
299
|
}
|
|
148
300
|
}
|
|
149
301
|
|
|
302
|
+
/** Read the most recent scheduled participation and latched per-instance faults. */
|
|
150
303
|
async readStatus() {
|
|
151
304
|
const state = await this.world.readEnsembleState();
|
|
152
305
|
return {
|
|
@@ -157,7 +310,8 @@ export class GPUPhysicsEnsemble {
|
|
|
157
310
|
active: Boolean(state[17 + instance * 8]),
|
|
158
311
|
acceptedSteps: state[18 + instance * 8],
|
|
159
312
|
rejectedSteps: state[19 + instance * 8],
|
|
160
|
-
sharedFailure: Boolean(state[20 + instance * 8])
|
|
313
|
+
sharedFailure: Boolean(state[20 + instance * 8]),
|
|
314
|
+
failure: state[23 + instance * 8] ? ('contact-cache-capacity' as const) : null
|
|
161
315
|
}))
|
|
162
316
|
};
|
|
163
317
|
}
|
|
@@ -186,21 +340,26 @@ export class GPUPhysicsEnsemble {
|
|
|
186
340
|
}
|
|
187
341
|
|
|
188
342
|
getStats() {
|
|
189
|
-
|
|
190
|
-
const
|
|
343
|
+
/** Include query scratch in the same residency total as solver graph scratch. */
|
|
344
|
+
const {ownedBufferBytes: worldBufferBytes, queryIndexScratchBytes} =
|
|
345
|
+
this.world.getCapacityInfo();
|
|
346
|
+
const graphTransientBytes =
|
|
347
|
+
this.graph.stats.physicalTransientResourceBytes + queryIndexScratchBytes;
|
|
191
348
|
return {
|
|
192
349
|
instances: this.instances,
|
|
193
350
|
bodies: this.world.count,
|
|
194
351
|
worldBufferBytes,
|
|
195
352
|
graphTransientBytes,
|
|
196
353
|
residentBytes: worldBufferBytes + graphTransientBytes + this.resetBytes,
|
|
197
|
-
checkpointBytes: this.resetBytes
|
|
354
|
+
checkpointBytes: this.resetBytes,
|
|
355
|
+
terrainAtlas: this.world.getTerrainAtlasStats()
|
|
198
356
|
};
|
|
199
357
|
}
|
|
200
358
|
|
|
201
359
|
destroy(): void {
|
|
202
360
|
if (this.destroyed) return;
|
|
203
361
|
if (this.preparing) throw new Error('Ensemble operation pending');
|
|
362
|
+
this.terrainStreamer?.release();
|
|
204
363
|
this.graph?.destroy();
|
|
205
364
|
this.world.destroy();
|
|
206
365
|
this.destroyed = true;
|