@luma.gl/graph 10.0.0-beta.2 → 10.0.0-beta.4
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 +82 -23
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +16 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +98 -24
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +7 -0
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +2 -0
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +14 -0
- package/dist/arrow/gpu/arrow-gpu-vector-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/arrow/vectors/arrow-temporal-gpu-vector.cjs +1 -2
- package/dist/arrow/vectors/arrow-temporal-gpu-vector.js +2 -2
- package/dist/arrow/vectors/arrow-temporal-gpu-vector.js.map +1 -1
- package/dist/dist.dev.js +62 -27
- package/dist/dist.min.js +48 -47
- 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-budget-controller.cjs +10 -2
- package/dist/gpu-core/gpu-command-graph-budget-controller.d.ts +4 -0
- package/dist/gpu-core/gpu-command-graph-budget-controller.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-budget-controller.js +10 -2
- package/dist/gpu-core/gpu-command-graph-budget-controller.js.map +1 -1
- 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/gpu-group-aggregation.cjs +45 -21
- package/dist/gpu-core/gpu-group-aggregation.d.ts +4 -0
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +58 -24
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- 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 +55 -14
- 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 +58 -17
- 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 +94 -44
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts +8 -5
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.js +110 -47
- package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +14 -8
- package/dist/gpu-dataframe/gpu-expression.d.ts +12 -1
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +11 -6
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +8 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts +2 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +10 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +2 -2
- 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 +6 -2
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +156 -124
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +12 -2
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js +160 -128
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +366 -53
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts +26 -4
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +378 -47
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.cjs +20 -9
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts +15 -2
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.js +22 -8
- package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.cjs +61 -8
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts +10 -2
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.js +60 -7
- package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.cjs +61 -11
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts +5 -1
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.js +61 -10
- package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +4 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +1 -1
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +1 -1
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-graph/index.cjs.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.cjs +182 -62
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.d.ts +29 -2
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.js +200 -64
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.cjs +135 -9
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.d.ts +55 -8
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.js +145 -14
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +3 -3
- package/dist/gpu-physics/articulation-tree-shader.cjs +177 -0
- package/dist/gpu-physics/articulation-tree-shader.d.ts +3 -0
- package/dist/gpu-physics/articulation-tree-shader.d.ts.map +1 -0
- package/dist/gpu-physics/articulation-tree-shader.js +159 -0
- package/dist/gpu-physics/articulation-tree-shader.js.map +1 -0
- package/dist/gpu-physics/gpu-articulation-tree.cjs +203 -0
- package/dist/gpu-physics/gpu-articulation-tree.d.ts +81 -0
- package/dist/gpu-physics/gpu-articulation-tree.d.ts.map +1 -0
- package/dist/gpu-physics/gpu-articulation-tree.js +205 -0
- package/dist/gpu-physics/gpu-articulation-tree.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.cjs +9 -4
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts +10 -1
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.js +11 -4
- package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +323 -68
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +59 -2
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +400 -75
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs +3 -0
- package/dist/gpu-physics/index.cjs.map +3 -3
- package/dist/gpu-physics/index.d.ts +3 -1
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/index.js +1 -0
- package/dist/gpu-physics/index.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-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 +11 -9
- 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 +13 -9
- 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 +21 -11
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +2 -2
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js +28 -12
- 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-joints.cjs +8 -3
- package/dist/gpu-physics/rigid-body-joints.d.ts +2 -0
- 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-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-shaders.cjs +3 -3
- 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 +3 -3
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.cjs +53 -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 +55 -15
- package/dist/gpu-physics/rigid-body-triggers.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/crs.cjs.map +2 -2
- package/dist/gpu-project/graph.cjs.map +2 -2
- package/dist/gpu-project/index.cjs.map +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-simple-graph/index.cjs.map +2 -2
- package/dist/gpu-sql/gpu-sql.cjs +345 -81
- package/dist/gpu-sql/gpu-sql.d.ts +42 -2
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +393 -90
- 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/index.cjs.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 +8 -8
- 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 +130 -31
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +19 -0
- package/src/arrow/index.ts +1 -0
- package/src/arrow/vectors/arrow-temporal-gpu-vector.ts +2 -2
- package/src/gpu-core/gpu-bvh-bounds.ts +84 -0
- package/src/gpu-core/gpu-command-graph-budget-controller.ts +22 -2
- package/src/gpu-core/gpu-command-graph-submission-pacer.ts +102 -0
- package/src/gpu-core/gpu-group-aggregation.ts +68 -30
- 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 +106 -25
- package/src/gpu-dataframe/gpu-data-frame.ts +35 -2
- package/src/gpu-dataframe/gpu-expression-shader.ts +172 -58
- package/src/gpu-dataframe/gpu-expression.ts +62 -9
- package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +15 -4
- package/src/gpu-dataframe/gpu-global-aggregation-query.ts +12 -3
- package/src/gpu-dataframe/gpu-global-sort-compiler.ts +231 -156
- package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +645 -61
- package/src/gpu-dataframe/gpu-group-by-query.ts +51 -14
- package/src/gpu-dataframe/gpu-join-compiler.ts +87 -6
- package/src/gpu-dataframe/gpu-query-compiler.ts +100 -18
- package/src/gpu-dataframe/index.ts +1 -1
- package/src/gpu-graph-algorithms/README.md +4 -2
- package/src/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.ts +248 -66
- package/src/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.ts +218 -20
- package/src/gpu-physics/articulation-tree-shader.ts +169 -0
- package/src/gpu-physics/gpu-articulation-tree.ts +279 -0
- package/src/gpu-physics/gpu-physics-batch.ts +19 -13
- package/src/gpu-physics/gpu-physics-ensemble.ts +20 -4
- package/src/gpu-physics/gpu-rigid-body-world.ts +510 -93
- package/src/gpu-physics/index.ts +16 -0
- 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-ensemble-layout.ts +6 -2
- package/src/gpu-physics/rigid-body-ensemble-reset.ts +21 -9
- package/src/gpu-physics/rigid-body-ensemble-shaders.ts +18 -7
- package/src/gpu-physics/rigid-body-ensemble-transaction.ts +31 -13
- 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-joints.ts +11 -11
- package/src/gpu-physics/rigid-body-queries.ts +202 -14
- package/src/gpu-physics/rigid-body-shaders.ts +4 -3
- package/src/gpu-physics/rigid-body-triggers.ts +64 -20
- package/src/gpu-physics/sphere-world-shaders.ts +53 -21
- package/src/gpu-project/projection-program.ts +1 -9
- package/src/gpu-sql/gpu-sql.ts +629 -124
- package/src/gpu-sql/index.ts +1 -1
- package/src/utils/float32.ts +16 -0
|
@@ -95,6 +95,8 @@ export type ArrowGPUConversionCost = {
|
|
|
95
95
|
sourceByteLength: number;
|
|
96
96
|
/** Bytes expected in the prepared GPU payload, excluding auxiliary metadata. */
|
|
97
97
|
targetByteLength: number;
|
|
98
|
+
/** Estimated transient GPU source and configuration storage during conversion. */
|
|
99
|
+
temporaryGPUByteLength: number;
|
|
98
100
|
/** Number of Arrow chunks that must be uploaded. */
|
|
99
101
|
uploadCount: number;
|
|
100
102
|
/** Number of CPU transformation passes over source values. */
|
|
@@ -201,6 +203,8 @@ export function planArrowGPUConversion(
|
|
|
201
203
|
validateConversionNullability(source, semantic);
|
|
202
204
|
|
|
203
205
|
const chunkCount = getSourceChunkCount(source);
|
|
206
|
+
const temporalInfo =
|
|
207
|
+
semantic === 'temporal' ? getArrowTemporalVectorInfo(source, options.field) : undefined;
|
|
204
208
|
const sourceByteLength = getSourceByteLength(source);
|
|
205
209
|
const backend = resolveConversionBackend(device, strategy, source, options.policy ?? 'auto');
|
|
206
210
|
const targetByteLength =
|
|
@@ -208,6 +212,16 @@ export function planArrowGPUConversion(
|
|
|
208
212
|
(backend === 'webgpu' && source instanceof Vector && isArrowFloat64NumericType(source.type)
|
|
209
213
|
? 2
|
|
210
214
|
: 1);
|
|
215
|
+
const temporarySourceBytes =
|
|
216
|
+
temporalInfo && source instanceof Vector
|
|
217
|
+
? source.data.reduce((total, chunk) => {
|
|
218
|
+
const offsets = DataType.isList(chunk.type)
|
|
219
|
+
? (chunk.valueOffsets as Int32Array)
|
|
220
|
+
: undefined;
|
|
221
|
+
const values = offsets ? offsets[chunk.length] - offsets[0] : chunk.length;
|
|
222
|
+
return total + Math.max(4, (values * temporalInfo.bitWidth) / 8);
|
|
223
|
+
}, 0)
|
|
224
|
+
: Math.max(sourceByteLength, chunkCount * Float64Array.BYTES_PER_ELEMENT);
|
|
211
225
|
const transforms = strategy.startsWith('convert-');
|
|
212
226
|
const sourceIsArrow = source instanceof Vector;
|
|
213
227
|
const uploadCount = sourceIsArrow ? chunkCount : 0;
|
|
@@ -226,6 +240,11 @@ export function planArrowGPUConversion(
|
|
|
226
240
|
cost: {
|
|
227
241
|
sourceByteLength,
|
|
228
242
|
targetByteLength,
|
|
243
|
+
temporaryGPUByteLength:
|
|
244
|
+
sourceIsArrow && backend === 'webgpu'
|
|
245
|
+
? temporarySourceBytes +
|
|
246
|
+
(strategy === 'convert-temporal' ? chunkCount * 3 * Uint32Array.BYTES_PER_ELEMENT : 0)
|
|
247
|
+
: 0,
|
|
229
248
|
uploadCount,
|
|
230
249
|
cpuPassCount: transforms && backend === 'cpu' ? 1 : 0,
|
|
231
250
|
gpuPassCount: transforms && (backend === 'webgpu' || backend === 'webgl') ? 1 : 0,
|
package/src/arrow/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export {
|
|
|
28
28
|
type ArrowTableFromGPUAnalyticsTableProps
|
|
29
29
|
} from './gpu/arrow-gpu-analytics-readback';
|
|
30
30
|
export {
|
|
31
|
+
consumeArrowGPURecordBatches,
|
|
31
32
|
convertArrowRecordBatchToGPURecordBatch,
|
|
32
33
|
convertArrowRecordBatchesToGPURecordBatches,
|
|
33
34
|
convertArrowTableToGPUTable,
|
|
@@ -716,8 +716,8 @@ function getArrowTemporalScalarDataBufferSource(
|
|
|
716
716
|
if (!values) {
|
|
717
717
|
return data.type.ArrayType === BigInt64Array ? new BigInt64Array(0) : new Int32Array(0);
|
|
718
718
|
}
|
|
719
|
-
|
|
720
|
-
return values.subarray(
|
|
719
|
+
// Arrow slices fixed-width values directly; the row offset still applies to the null bitmap.
|
|
720
|
+
return values.subarray(0, data.length) as Int32Array | BigInt64Array;
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
function getNormalizedArrowValueOffsets(data: Data<List<any>>): Int32Array {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {nextFloat32} from '../utils/float32';
|
|
6
|
+
|
|
7
|
+
/** Vertex format for each supported box dimension. */
|
|
8
|
+
const BOUNDS_FORMATS = {2: 'float32x2', 3: 'float32x3'} as const;
|
|
9
|
+
|
|
10
|
+
/** Smallest normal binary32 magnitude, also valid on GPUs that flush subnormals. */
|
|
11
|
+
const MINIMUM_NORMAL = 2 ** -126;
|
|
12
|
+
|
|
13
|
+
/** Interleaved min/max records, compatible with math.gl BoxIndex input. */
|
|
14
|
+
export type GPUBVHBoundsInput<Dimension extends 2 | 3 = 2 | 3> = {
|
|
15
|
+
/** Number of coordinates in each minimum or maximum. */
|
|
16
|
+
dimension: Dimension;
|
|
17
|
+
/** One record per source row, with minimum coordinates followed by maximum coordinates. */
|
|
18
|
+
bounds: ArrayLike<number>;
|
|
19
|
+
/** Optional origin subtracted in number precision before narrowing each coordinate. */
|
|
20
|
+
origin?: ArrayLike<number>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Split bounds ready to upload into two packed GPUBVH source views. */
|
|
24
|
+
export type GPUBVHPackedBounds<Dimension extends 2 | 3 = 2 | 3> = {
|
|
25
|
+
/** GPU format of each minimum and maximum row. */
|
|
26
|
+
format: (typeof BOUNDS_FORMATS)[Dimension];
|
|
27
|
+
/** Source box count, in original row order. */
|
|
28
|
+
length: number;
|
|
29
|
+
/** Packed local lower bounds, rounded outward. */
|
|
30
|
+
minima: Float32Array;
|
|
31
|
+
/** Packed local upper bounds, rounded outward. */
|
|
32
|
+
maxima: Float32Array;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Convert CPU box data shared with math.gl BoxIndex to the split buffers used by GPUBVH.
|
|
37
|
+
* Rows keep their input IDs. With an origin, subsequent GPU queries must use the same local frame.
|
|
38
|
+
*/
|
|
39
|
+
export function packGPUBVHBounds<Dimension extends 2 | 3>({
|
|
40
|
+
bounds,
|
|
41
|
+
dimension,
|
|
42
|
+
origin
|
|
43
|
+
}: GPUBVHBoundsInput<Dimension>): GPUBVHPackedBounds<Dimension> {
|
|
44
|
+
/** Each interleaved row holds one minimum and one maximum. */
|
|
45
|
+
const stride = 2 * dimension;
|
|
46
|
+
if ((dimension !== 2 && dimension !== 3) || bounds.length % stride !== 0)
|
|
47
|
+
throw new Error('Invalid packed BVH bounds layout');
|
|
48
|
+
if (origin && (origin.length !== dimension || !Array.from(origin).every(Number.isFinite)))
|
|
49
|
+
throw new Error('Invalid BVH bounds origin');
|
|
50
|
+
|
|
51
|
+
/** Output rows retain the source order and leave input storage untouched. */
|
|
52
|
+
const length = bounds.length / stride;
|
|
53
|
+
/** Lower bounds occupy one contiguous buffer. */
|
|
54
|
+
const minima = new Float32Array(length * dimension);
|
|
55
|
+
/** Upper bounds occupy a separate contiguous buffer. */
|
|
56
|
+
const maxima = new Float32Array(length * dimension);
|
|
57
|
+
for (let row = 0; row < length; row++) {
|
|
58
|
+
for (let coordinate = 0; coordinate < dimension; coordinate++) {
|
|
59
|
+
/** Compute local coordinates before reducing precision. */
|
|
60
|
+
const shift = origin?.[coordinate] ?? 0;
|
|
61
|
+
/** Check source ordering before subtracting a potentially distant origin. */
|
|
62
|
+
const minimum = bounds[row * stride + coordinate];
|
|
63
|
+
/** Upper bound in the same dimension. */
|
|
64
|
+
const maximum = bounds[row * stride + dimension + coordinate];
|
|
65
|
+
if (minimum > maximum) throw new Error('Invalid BVH bounds order');
|
|
66
|
+
minima[row * dimension + coordinate] = roundBoundsCoordinate(minimum - shift, false);
|
|
67
|
+
maxima[row * dimension + coordinate] = roundBoundsCoordinate(maximum - shift, true);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return {format: BOUNDS_FORMATS[dimension], length, minima, maxima};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Keep the float32 bound conservative even when the adapter flushes subnormal values. */
|
|
74
|
+
function roundBoundsCoordinate(value: number, increase: boolean): number {
|
|
75
|
+
if (value === 0) return 0;
|
|
76
|
+
if (Math.abs(value) < MINIMUM_NORMAL)
|
|
77
|
+
return value > 0 === increase ? Math.sign(value) * MINIMUM_NORMAL : 0;
|
|
78
|
+
/** Start with nearest rounding and step outward only if it moved the bound inward. */
|
|
79
|
+
let rounded = Math.fround(value);
|
|
80
|
+
if (Number.isFinite(rounded) && (increase ? rounded < value : rounded > value))
|
|
81
|
+
rounded = nextFloat32(rounded, increase);
|
|
82
|
+
if (!Number.isFinite(rounded)) throw new Error('BVH bounds exceed finite float32 range');
|
|
83
|
+
return rounded;
|
|
84
|
+
}
|
|
@@ -123,9 +123,29 @@ export class GPUCommandGraphExecutionBudgetController {
|
|
|
123
123
|
/** Budget used to create the immutable execution that produced this step. */
|
|
124
124
|
executionBudget: Readonly<GPUCommandGraphExecutionBudget> = this.currentBudget
|
|
125
125
|
): GPUCommandGraphExecutionBudgetObservation {
|
|
126
|
-
validatePositiveNumber(durationMilliseconds, 'durationMilliseconds');
|
|
127
126
|
validateExecutionBudget(executionBudget);
|
|
128
|
-
|
|
127
|
+
return this.observeSaturation(getBudgetSaturation(step, executionBudget), durationMilliseconds);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Calibrates an application-sized dispatch using GPU time and its observed invocation count. */
|
|
131
|
+
observeInvocations(
|
|
132
|
+
invocationCount: number,
|
|
133
|
+
durationMilliseconds: number,
|
|
134
|
+
executionBudget: Readonly<GPUCommandGraphExecutionBudget> = this.currentBudget
|
|
135
|
+
): GPUCommandGraphExecutionBudgetObservation {
|
|
136
|
+
validateExecutionBudget(executionBudget);
|
|
137
|
+
return this.observeSaturation(
|
|
138
|
+
invocationCount / executionBudget.maximumInvocationCount,
|
|
139
|
+
durationMilliseconds
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Updates the next execution budget from one completed workload observation. */
|
|
144
|
+
private observeSaturation(
|
|
145
|
+
saturation: number,
|
|
146
|
+
durationMilliseconds: number
|
|
147
|
+
): GPUCommandGraphExecutionBudgetObservation {
|
|
148
|
+
validatePositiveNumber(durationMilliseconds, 'durationMilliseconds');
|
|
129
149
|
if (saturation > 0) {
|
|
130
150
|
const desiredAdjustment =
|
|
131
151
|
(this.targetStepMilliseconds * Math.min(saturation, 1)) / durationMilliseconds;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import {assert} from '@luma.gl/core';
|
|
5
|
+
|
|
6
|
+
/** Controls the spacing of graph submissions on an application-owned queue. */
|
|
7
|
+
export type GPUCommandGraphSubmissionPacerProps = {
|
|
8
|
+
/** Target fraction of the submission cycle spent waiting for GPU completion. */
|
|
9
|
+
dutyCycle?: number;
|
|
10
|
+
/** Minimum quiet time after completion, in milliseconds. */
|
|
11
|
+
minimumCooldownMilliseconds?: number;
|
|
12
|
+
/** Upper bound on the quiet time, in milliseconds. */
|
|
13
|
+
maximumCooldownMilliseconds?: number;
|
|
14
|
+
/** Monotonic clock, in milliseconds. Defaults to performance.now. */
|
|
15
|
+
now?: () => number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** Allows one tracked submission in flight and adapts the pause after it completes. */
|
|
19
|
+
export class GPUCommandGraphSubmissionPacer {
|
|
20
|
+
/** Target completion-to-cycle ratio. */
|
|
21
|
+
private readonly dutyCycle: number;
|
|
22
|
+
/** Quiet time floor following completion. */
|
|
23
|
+
private readonly minimumCooldown: number;
|
|
24
|
+
/** Quiet time ceiling following completion. */
|
|
25
|
+
private readonly maximumCooldown: number;
|
|
26
|
+
/** Monotonic clock used for observations. */
|
|
27
|
+
private readonly now: () => number;
|
|
28
|
+
/** Whether a submitted batch is awaiting completion. */
|
|
29
|
+
private pending = false;
|
|
30
|
+
/** Earliest time the next batch may start. */
|
|
31
|
+
private nextSubmissionTime = -Infinity;
|
|
32
|
+
/** Most recent completed submission duration, excluding cooldown. */
|
|
33
|
+
private lastDuration: number | null = null;
|
|
34
|
+
/** Workload generation for rejecting obsolete timing and cooldown observations. */
|
|
35
|
+
private generation = 0;
|
|
36
|
+
|
|
37
|
+
/** Creates a pacer. The caller retains command encoding and submission ownership. */
|
|
38
|
+
constructor(props: GPUCommandGraphSubmissionPacerProps = {}) {
|
|
39
|
+
this.dutyCycle = props.dutyCycle ?? 0.5;
|
|
40
|
+
this.minimumCooldown = props.minimumCooldownMilliseconds ?? 8;
|
|
41
|
+
this.maximumCooldown = props.maximumCooldownMilliseconds ?? 250;
|
|
42
|
+
this.now = props.now ?? (() => performance.now());
|
|
43
|
+
// A valid duty cycle and finite ordered cooldown bounds are required.
|
|
44
|
+
assert(
|
|
45
|
+
this.dutyCycle > 0 &&
|
|
46
|
+
this.dutyCycle <= 1 &&
|
|
47
|
+
Number.isFinite(this.minimumCooldown) &&
|
|
48
|
+
this.minimumCooldown >= 0 &&
|
|
49
|
+
Number.isFinite(this.maximumCooldown) &&
|
|
50
|
+
this.maximumCooldown >= this.minimumCooldown
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Queue-completion time of the last batch, before adaptive cooldown. */
|
|
55
|
+
get lastSubmissionMilliseconds(): number | null {
|
|
56
|
+
return this.lastDuration;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Reports whether a caller may encode and submit its next batch. */
|
|
60
|
+
isReady(): boolean {
|
|
61
|
+
return !this.pending && this.now() >= this.nextSubmissionTime;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Clears timing and cooldown for a changed workload while retaining in-flight backpressure. */
|
|
65
|
+
resetCooldown(): void {
|
|
66
|
+
this.generation++;
|
|
67
|
+
this.nextSubmissionTime = -Infinity;
|
|
68
|
+
this.lastDuration = null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Tracks completion of a submitted batch and preserves rejection for the caller. */
|
|
72
|
+
async trackSubmission(completion: Promise<unknown>): Promise<void> {
|
|
73
|
+
// The caller must check readiness before submitting another batch.
|
|
74
|
+
assert(!this.pending);
|
|
75
|
+
this.pending = true;
|
|
76
|
+
/** Timestamp immediately after the caller submitted its batch. */
|
|
77
|
+
const startedAt = this.now();
|
|
78
|
+
/** Workload that submitted the fenced batch. */
|
|
79
|
+
const generation = this.generation;
|
|
80
|
+
try {
|
|
81
|
+
await completion;
|
|
82
|
+
if (generation !== this.generation) return;
|
|
83
|
+
/** Timestamp when the fence settled successfully. */
|
|
84
|
+
const finishedAt = this.now();
|
|
85
|
+
/** Queue latency of the completed batch, without intentional idle time. */
|
|
86
|
+
const duration = Math.max(0, finishedAt - startedAt);
|
|
87
|
+
/** Idle share required by the requested duty cycle. */
|
|
88
|
+
const cooldown = duration / this.dutyCycle - duration;
|
|
89
|
+
this.lastDuration = duration > 0 ? duration : null;
|
|
90
|
+
this.nextSubmissionTime =
|
|
91
|
+
finishedAt + Math.max(this.minimumCooldown, Math.min(this.maximumCooldown, cooldown));
|
|
92
|
+
} catch (error) {
|
|
93
|
+
if (generation === this.generation) {
|
|
94
|
+
this.lastDuration = null;
|
|
95
|
+
this.nextSubmissionTime = this.now() + this.minimumCooldown;
|
|
96
|
+
}
|
|
97
|
+
throw error;
|
|
98
|
+
} finally {
|
|
99
|
+
this.pending = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -58,6 +58,8 @@ type GPUGroupAggregationBaseProps = {
|
|
|
58
58
|
keys: GPUGroupAggregationKeys;
|
|
59
59
|
/** Optional nonzero/zero selection with the same logical length as `keys`; chunk boundaries may differ. */
|
|
60
60
|
mask?: GPUGroupAggregationMask;
|
|
61
|
+
/** Upper bound on mean count scratch, in bytes. Partitions the output key domain. */
|
|
62
|
+
maxMeanScratchBytes?: number;
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
/** Properties for graph-native dense group aggregation. */
|
|
@@ -102,6 +104,8 @@ export class GPUGroupAggregation {
|
|
|
102
104
|
readonly mask?: GPUGroupAggregationMask;
|
|
103
105
|
/** Group statistic computed by this aggregation. */
|
|
104
106
|
readonly operation: GPUGroupAggregationOperation;
|
|
107
|
+
/** Maximum number of groups using one shared count scratch buffer. */
|
|
108
|
+
readonly meanPartitionSize: number;
|
|
105
109
|
|
|
106
110
|
/** Creates and validates a dense group-aggregation description. */
|
|
107
111
|
constructor(props: GPUGroupAggregationProps) {
|
|
@@ -111,6 +115,11 @@ export class GPUGroupAggregation {
|
|
|
111
115
|
this.output = props.output;
|
|
112
116
|
this.mask = props.mask;
|
|
113
117
|
this.operation = props.operation ?? 'count';
|
|
118
|
+
const budget = props.maxMeanScratchBytes;
|
|
119
|
+
if (budget !== undefined && (!Number.isSafeInteger(budget) || budget < 4)) {
|
|
120
|
+
throw new Error(`${this.id} mean scratch budget requires at least four bytes`);
|
|
121
|
+
}
|
|
122
|
+
this.meanPartitionSize = Math.min(this.output.length, Math.floor((budget ?? Infinity) / 4));
|
|
114
123
|
|
|
115
124
|
for (const [chunkIndex, chunk] of getGroupChunks(this.keys).entries()) {
|
|
116
125
|
validateScalarInputView(chunk, 'uint32', `${this.id} keys chunk ${chunkIndex}`);
|
|
@@ -219,37 +228,64 @@ export class GPUGroupAggregation {
|
|
|
219
228
|
|
|
220
229
|
const output = this.output as GraphDataView<'float32'>;
|
|
221
230
|
const operation = this.operation;
|
|
222
|
-
|
|
231
|
+
/** Number of domain keys processed together under the configured mean budget. */
|
|
232
|
+
const partitionSize = operation === 'mean' ? this.meanPartitionSize : output.length;
|
|
233
|
+
/** Scratch reused from initialization through finalization for each key range. */
|
|
234
|
+
const countScratch =
|
|
223
235
|
operation === 'mean'
|
|
224
|
-
? createTransientView(graph,
|
|
236
|
+
? createTransientView(graph, this.id + '-counts', 'uint32', partitionSize)
|
|
225
237
|
: undefined;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
238
|
+
for (let firstGroup = 0; firstGroup < output.length; firstGroup += partitionSize) {
|
|
239
|
+
/** Final partitions may be smaller than the configured range. */
|
|
240
|
+
const length = Math.min(partitionSize, output.length - firstGroup);
|
|
241
|
+
/** Writable subview of the final output for the current key range. */
|
|
242
|
+
const partition =
|
|
243
|
+
firstGroup === 0 && length === output.length
|
|
244
|
+
? output
|
|
245
|
+
: graph.createDataView(output.buffer, {
|
|
246
|
+
format: 'float32',
|
|
247
|
+
length,
|
|
248
|
+
byteOffset: output.byteOffset + firstGroup * 4
|
|
249
|
+
});
|
|
250
|
+
/** The active prefix of the shared count buffer for this partition. */
|
|
251
|
+
const counts =
|
|
252
|
+
countScratch && length !== countScratch.length
|
|
253
|
+
? graph.createDataView(countScratch.buffer, {
|
|
254
|
+
format: 'uint32',
|
|
255
|
+
length,
|
|
256
|
+
byteOffset: countScratch.byteOffset
|
|
257
|
+
})
|
|
258
|
+
: countScratch;
|
|
259
|
+
/** Distinguishes partition command IDs while preserving existing single-pass IDs. */
|
|
260
|
+
const id = partitionSize === output.length ? this.id : this.id + '-partition-' + firstGroup;
|
|
261
|
+
nodes.push(...addInitializeGroupStatisticsPass(graph, id, partition, operation, counts));
|
|
262
|
+
for (let chunkIndex = 0; chunkIndex < keyChunks.length; chunkIndex++) {
|
|
263
|
+
const keys = keyChunks[chunkIndex];
|
|
264
|
+
if (keys.length === 0) continue;
|
|
265
|
+
nodes.push(
|
|
266
|
+
...addGroupStatisticPass(graph, {
|
|
267
|
+
id:
|
|
268
|
+
this.keys instanceof GraphVectorView || keyChunks.length > 1
|
|
269
|
+
? id + '-chunk-' + chunkIndex
|
|
270
|
+
: id,
|
|
271
|
+
keys,
|
|
272
|
+
values: valueChunks![chunkIndex],
|
|
273
|
+
mask: maskChunks?.[chunkIndex],
|
|
274
|
+
output: partition,
|
|
275
|
+
operation,
|
|
276
|
+
counts,
|
|
277
|
+
firstGroup,
|
|
278
|
+
dispatchLayout: getGPUGroupAggregationDispatchLayout(
|
|
279
|
+
keys.length,
|
|
280
|
+
graph.device.limits.maxComputeWorkgroupsPerDimension
|
|
281
|
+
)
|
|
282
|
+
})
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
if (operation !== 'sum') {
|
|
286
|
+
nodes.push(...addFinalizeGroupStatisticsPass(graph, id, partition, operation, counts));
|
|
287
|
+
}
|
|
251
288
|
}
|
|
252
|
-
|
|
253
289
|
return nodes;
|
|
254
290
|
}
|
|
255
291
|
}
|
|
@@ -488,6 +524,7 @@ function addGroupStatisticPass<Parameters>(
|
|
|
488
524
|
output: GraphDataView<'float32'>;
|
|
489
525
|
operation: Exclude<GPUGroupAggregationOperation, 'count'>;
|
|
490
526
|
counts?: GraphDataView<'uint32'>;
|
|
527
|
+
firstGroup: number;
|
|
491
528
|
dispatchLayout: GPUGroupAggregationDispatchLayout;
|
|
492
529
|
}
|
|
493
530
|
): readonly GPUCommandNode<Parameters>[] {
|
|
@@ -539,10 +576,11 @@ ${useSubgroups ? getSubgroupBallotHelpersWGSL() : ''}
|
|
|
539
576
|
var groupIndex = 0u;
|
|
540
577
|
var value = 0.0;
|
|
541
578
|
if (index < ELEMENT_COUNT && ${maskCondition}) {
|
|
542
|
-
|
|
579
|
+
let key = groupKeys[KEYS_OFFSET + index * KEYS_STRIDE];
|
|
580
|
+
groupIndex = key - ${props.firstGroup}u;
|
|
543
581
|
value = inputValues[VALUES_OFFSET + index * VALUES_STRIDE];
|
|
544
582
|
let finiteValue = value == value && abs(value) <= 3.402823466e+38;
|
|
545
|
-
accepted = groupIndex < GROUP_COUNT && finiteValue;
|
|
583
|
+
accepted = key >= ${props.firstGroup}u && groupIndex < GROUP_COUNT && finiteValue;
|
|
546
584
|
}
|
|
547
585
|
${accumulation}
|
|
548
586
|
}`;
|
package/src/gpu-core/index.ts
CHANGED
|
@@ -439,6 +439,8 @@ export type {
|
|
|
439
439
|
|
|
440
440
|
export {GPUBVH} from './gpu-bvh';
|
|
441
441
|
export type {GPUBVHBoundsView, GPUBVHProps, GPUBVHStorageStats, GPUBVHStrategy} from './gpu-bvh';
|
|
442
|
+
export {packGPUBVHBounds} from './gpu-bvh-bounds';
|
|
443
|
+
export type {GPUBVHBoundsInput, GPUBVHPackedBounds} from './gpu-bvh-bounds';
|
|
442
444
|
export {GPUSegmentedBVH} from './gpu-segmented-bvh';
|
|
443
445
|
export type {GPUBVHSegment, GPUSegmentedBVHProps} from './gpu-segmented-bvh';
|
|
444
446
|
|
|
@@ -729,3 +731,6 @@ export type {
|
|
|
729
731
|
GPUGraphGroupAggregationProps,
|
|
730
732
|
GPUGraphReductionProps
|
|
731
733
|
} from './gpu-semantic-aggregation-operation';
|
|
734
|
+
|
|
735
|
+
export {GPUCommandGraphSubmissionPacer} from './gpu-command-graph-submission-pacer';
|
|
736
|
+
export type {GPUCommandGraphSubmissionPacerProps} from './gpu-command-graph-submission-pacer';
|
|
@@ -126,29 +126,26 @@ function validateGPUAnalyticsVectorLayout(vector: GPUVector, name: string): void
|
|
|
126
126
|
export function getGPUAnalyticsSelectionMask<Selection extends GPUTypeMap>(
|
|
127
127
|
context: GPUDataFrameQueryExtensionContext<Selection>,
|
|
128
128
|
name: string,
|
|
129
|
-
id: string
|
|
129
|
+
id: string,
|
|
130
|
+
baseMask = context.selectionMask
|
|
130
131
|
): GraphVectorView<'uint32'> {
|
|
131
132
|
const field = context.table.schema.fields.find(candidate => candidate.name === name);
|
|
132
133
|
if (!field?.nullable) {
|
|
133
|
-
return
|
|
134
|
+
return baseMask;
|
|
134
135
|
}
|
|
135
136
|
const validity = context.validity[name as keyof Selection & string];
|
|
136
137
|
if (!validity) {
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
138
|
+
if (baseMask.length === 0) {
|
|
139
|
+
return baseMask;
|
|
139
140
|
}
|
|
140
141
|
throw new Error(`GPUDataFrame nullable analytics column "${name}" requires GPU validity`);
|
|
141
142
|
}
|
|
142
143
|
const validityView = context.graph.importGPUVector(`${id}-validity`, validity);
|
|
143
|
-
const output = createTransientVectorView(
|
|
144
|
-
context.graph,
|
|
145
|
-
`${id}-combined-mask`,
|
|
146
|
-
context.selectionMask
|
|
147
|
-
);
|
|
144
|
+
const output = createTransientVectorView(context.graph, `${id}-combined-mask`, baseMask);
|
|
148
145
|
context.graph.add(
|
|
149
146
|
new GPUMask({
|
|
150
147
|
id: `${id}-combine-validity`,
|
|
151
|
-
inputs: [
|
|
148
|
+
inputs: [baseMask, validityView],
|
|
152
149
|
output
|
|
153
150
|
})
|
|
154
151
|
);
|