@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
|
@@ -37,7 +37,12 @@ export type GPUDataFrameColumnNamesOfFormat<
|
|
|
37
37
|
}[SelectedColumns];
|
|
38
38
|
|
|
39
39
|
/** Optional dense key-domain size when source categorical labels cannot establish it. */
|
|
40
|
-
export type GPUDataFrameGroupByOptions = Readonly<{
|
|
40
|
+
export type GPUDataFrameGroupByOptions = Readonly<{
|
|
41
|
+
/** Dense category count when no dictionary supplies it. */
|
|
42
|
+
groupCount?: number;
|
|
43
|
+
/** Maximum temporary bytes for a partition of AVG accumulators. */
|
|
44
|
+
maxMeanScratchBytes?: number;
|
|
45
|
+
}>;
|
|
41
46
|
|
|
42
47
|
/** One named count or a float32 statistic referencing a selected numerical column. */
|
|
43
48
|
export type GPUDataFrameAggregationValue<
|
|
@@ -45,6 +50,7 @@ export type GPUDataFrameAggregationValue<
|
|
|
45
50
|
SelectedColumns extends keyof T & string
|
|
46
51
|
> =
|
|
47
52
|
| 'count'
|
|
53
|
+
| Readonly<{count: SelectedColumns}>
|
|
48
54
|
| Readonly<{sum: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
|
|
49
55
|
| Readonly<{min: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
|
|
50
56
|
| Readonly<{max: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
|
|
@@ -61,7 +67,9 @@ export type GPUDataFrameGroupedAggregationResult<
|
|
|
61
67
|
Key extends string,
|
|
62
68
|
Definitions extends Readonly<Record<string, unknown>>
|
|
63
69
|
> = Record<Key, 'uint32'> & {
|
|
64
|
-
[Name in keyof Definitions & string]: Definitions[Name] extends 'count'
|
|
70
|
+
[Name in keyof Definitions & string]: Definitions[Name] extends 'count' | {count: string}
|
|
71
|
+
? 'uint32'
|
|
72
|
+
: 'float32';
|
|
65
73
|
};
|
|
66
74
|
|
|
67
75
|
/**
|
|
@@ -82,6 +90,8 @@ export class GPUDataFrameGroupByQuery<
|
|
|
82
90
|
readonly key: Key;
|
|
83
91
|
/** Number of output groups inferred from labels or supplied explicitly by the caller. */
|
|
84
92
|
readonly groupCount: number;
|
|
93
|
+
/** Optional temporary AVG count budget. */
|
|
94
|
+
readonly maxMeanScratchBytes?: number;
|
|
85
95
|
|
|
86
96
|
/** Validates grouping metadata entirely on the CPU. @internal */
|
|
87
97
|
constructor(
|
|
@@ -113,6 +123,13 @@ export class GPUDataFrameGroupByQuery<
|
|
|
113
123
|
throw new Error('GPUDataFrame grouping requires a positive uint32 group count');
|
|
114
124
|
}
|
|
115
125
|
|
|
126
|
+
if (
|
|
127
|
+
options.maxMeanScratchBytes !== undefined &&
|
|
128
|
+
(!Number.isSafeInteger(options.maxMeanScratchBytes) || options.maxMeanScratchBytes < 4)
|
|
129
|
+
) {
|
|
130
|
+
throw new Error('GPUDataFrame mean scratch budget requires at least four bytes');
|
|
131
|
+
}
|
|
132
|
+
this.maxMeanScratchBytes = options.maxMeanScratchBytes;
|
|
116
133
|
this.query = query;
|
|
117
134
|
this.key = key;
|
|
118
135
|
this.groupCount = groupCount;
|
|
@@ -129,7 +146,7 @@ export class GPUDataFrameGroupByQuery<
|
|
|
129
146
|
Key,
|
|
130
147
|
Definitions,
|
|
131
148
|
Source
|
|
132
|
-
>(this.query, this.key, this.groupCount, definitions);
|
|
149
|
+
>(this.query, this.key, this.groupCount, definitions, this.maxMeanScratchBytes);
|
|
133
150
|
}
|
|
134
151
|
}
|
|
135
152
|
|
|
@@ -147,6 +164,8 @@ export class GPUDataFrameGroupedAggregationQuery<
|
|
|
147
164
|
readonly key: Key;
|
|
148
165
|
/** Complete category domain and grouped output row count. */
|
|
149
166
|
readonly groupCount: number;
|
|
167
|
+
/** Optional temporary AVG count budget. */
|
|
168
|
+
readonly maxMeanScratchBytes?: number;
|
|
150
169
|
/** Named operations normalized in the caller's original object insertion order. */
|
|
151
170
|
readonly definitions: readonly GPUDataFrameAggregationDefinition[];
|
|
152
171
|
|
|
@@ -155,8 +174,10 @@ export class GPUDataFrameGroupedAggregationQuery<
|
|
|
155
174
|
query: GPUDataFrameQuery<Logical, SelectedColumns, Source>,
|
|
156
175
|
key: Key,
|
|
157
176
|
groupCount: number,
|
|
158
|
-
definitions: Definitions
|
|
177
|
+
definitions: Definitions,
|
|
178
|
+
maxMeanScratchBytes?: number
|
|
159
179
|
) {
|
|
180
|
+
this.maxMeanScratchBytes = maxMeanScratchBytes;
|
|
160
181
|
this.query = query;
|
|
161
182
|
this.key = key;
|
|
162
183
|
this.groupCount = groupCount;
|
|
@@ -182,20 +203,28 @@ export class GPUDataFrameGroupedAggregationQuery<
|
|
|
182
203
|
this.key,
|
|
183
204
|
this.groupCount,
|
|
184
205
|
this.definitions,
|
|
185
|
-
graph
|
|
206
|
+
graph,
|
|
207
|
+
undefined,
|
|
208
|
+
undefined,
|
|
209
|
+
undefined,
|
|
210
|
+
undefined,
|
|
211
|
+
this.maxMeanScratchBytes
|
|
186
212
|
);
|
|
187
213
|
}
|
|
188
214
|
}
|
|
189
215
|
|
|
190
|
-
/** Normalizes a closed set of operation shapes without accepting arbitrary shader expressions. */
|
|
191
|
-
function normalizeGPUDataFrameAggregations<
|
|
216
|
+
/** Normalizes a closed set of operation shapes without accepting arbitrary shader expressions. @internal */
|
|
217
|
+
export function normalizeGPUDataFrameAggregations<
|
|
192
218
|
Logical extends GPUTypeMap,
|
|
193
219
|
SelectedColumns extends keyof Logical & string,
|
|
194
220
|
Source extends GPUTypeMap
|
|
195
221
|
>(
|
|
196
|
-
query:
|
|
197
|
-
|
|
198
|
-
|
|
222
|
+
query: Pick<
|
|
223
|
+
GPUDataFrameQuery<Logical, SelectedColumns, Source>,
|
|
224
|
+
'source' | 'selectedColumns' | 'derivedColumns'
|
|
225
|
+
>,
|
|
226
|
+
outputKey: string | undefined,
|
|
227
|
+
definitions: Readonly<Record<string, unknown>>
|
|
199
228
|
): GPUDataFrameAggregationDefinition[] {
|
|
200
229
|
const entries = Object.entries(definitions);
|
|
201
230
|
if (entries.length === 0) {
|
|
@@ -205,7 +234,7 @@ function normalizeGPUDataFrameAggregations<
|
|
|
205
234
|
const formats = getGPUDataFrameQueryColumnFormats(query);
|
|
206
235
|
const normalized: GPUDataFrameAggregationDefinition[] = [];
|
|
207
236
|
for (const [name, value] of entries) {
|
|
208
|
-
if (name.length === 0 || name ===
|
|
237
|
+
if (name.length === 0 || name === outputKey) {
|
|
209
238
|
throw new Error('GPUDataFrame aggregation names must be distinct from the group key');
|
|
210
239
|
}
|
|
211
240
|
if (value === 'count') {
|
|
@@ -221,13 +250,19 @@ function normalizeGPUDataFrameAggregations<
|
|
|
221
250
|
throw new Error(`GPUDataFrame aggregation "${name}" requires exactly one operation`);
|
|
222
251
|
}
|
|
223
252
|
const [operation, column] = operations[0];
|
|
224
|
-
if (
|
|
253
|
+
if (
|
|
254
|
+
operation !== 'count' &&
|
|
255
|
+
operation !== 'sum' &&
|
|
256
|
+
operation !== 'min' &&
|
|
257
|
+
operation !== 'max' &&
|
|
258
|
+
operation !== 'mean'
|
|
259
|
+
) {
|
|
225
260
|
throw new Error(`GPUDataFrame aggregation "${name}" has an unsupported operation`);
|
|
226
261
|
}
|
|
227
262
|
if (typeof column !== 'string' || !query.selectedColumns.includes(column as SelectedColumns)) {
|
|
228
263
|
throw new Error(`GPUDataFrame aggregation "${name}" requires a selected input column`);
|
|
229
264
|
}
|
|
230
|
-
if (formats.get(column) !== 'float32') {
|
|
265
|
+
if (operation !== 'count' && formats.get(column) !== 'float32') {
|
|
231
266
|
throw new Error(`GPUDataFrame aggregation "${name}" requires a float32 input column`);
|
|
232
267
|
}
|
|
233
268
|
normalized.push(Object.freeze({name, operation, column}));
|
|
@@ -240,7 +275,9 @@ function normalizeGPUDataFrameAggregations<
|
|
|
240
275
|
function getGPUDataFrameQueryColumnFormats<
|
|
241
276
|
Logical extends GPUTypeMap,
|
|
242
277
|
SelectedColumns extends keyof Logical & string
|
|
243
|
-
>(
|
|
278
|
+
>(
|
|
279
|
+
query: Pick<GPUDataFrameQuery<Logical, SelectedColumns, any>, 'source' | 'derivedColumns'>
|
|
280
|
+
): Map<string, string | undefined> {
|
|
244
281
|
const formats = new Map<string, string | undefined>(
|
|
245
282
|
query.source.schema.fields.map(
|
|
246
283
|
field =>
|
|
@@ -39,6 +39,7 @@ import type {GPUDataFrameJoinType, GPUDataFrameNormalizedJoinOptions} from './gp
|
|
|
39
39
|
import {
|
|
40
40
|
CompiledGPUDataFrameQuery,
|
|
41
41
|
compileGPUDataFrameQuery,
|
|
42
|
+
projectGPUDataFrameQueryResult,
|
|
42
43
|
type CompiledGPUDataFrameQueryProps,
|
|
43
44
|
type GPUDataFrameQueryExtensionContext,
|
|
44
45
|
type GPUDataFrameQueryExtensionResult,
|
|
@@ -170,7 +171,8 @@ export function compileGPUDataFrameJoin<
|
|
|
170
171
|
right: GPUDataFrame<Right>,
|
|
171
172
|
options: GPUDataFrameNormalizedJoinOptions,
|
|
172
173
|
joinType: GPUDataFrameJoinType,
|
|
173
|
-
graph: GPUCommandGraph<GPUDataFrameQueryParameters
|
|
174
|
+
graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
|
|
175
|
+
resultColumns?: readonly (keyof Selection & string)[]
|
|
174
176
|
): CompiledGPUDataFrameJoin<Selection, Right> {
|
|
175
177
|
validateGPUJoinSources(source, right, options, graph);
|
|
176
178
|
const retainedRight = right.select(right.columnNames);
|
|
@@ -181,7 +183,8 @@ export function compileGPUDataFrameJoin<
|
|
|
181
183
|
Selection,
|
|
182
184
|
CompiledGPUDataFrameJoin<Selection, Right>
|
|
183
185
|
>(source, predicates, selectedColumns, graph, derivedColumns, {
|
|
184
|
-
prepare: context =>
|
|
186
|
+
prepare: context =>
|
|
187
|
+
addGPUJoinToGraph(context, retainedRight, options, joinType, resultColumns)
|
|
185
188
|
});
|
|
186
189
|
} catch (error) {
|
|
187
190
|
retainedRight.destroy();
|
|
@@ -261,7 +264,8 @@ function addGPUJoinToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
|
|
|
261
264
|
context: GPUDataFrameQueryExtensionContext<Left>,
|
|
262
265
|
right: GPUDataFrame<Right>,
|
|
263
266
|
options: GPUDataFrameNormalizedJoinOptions,
|
|
264
|
-
joinType: GPUDataFrameJoinType
|
|
267
|
+
joinType: GPUDataFrameJoinType,
|
|
268
|
+
resultColumns?: readonly (keyof Left & string)[]
|
|
265
269
|
): GPUDataFrameQueryExtensionResult<Left, CompiledGPUDataFrameJoin<Left, Right>> {
|
|
266
270
|
const ownedVectors: GPUVector[] = [];
|
|
267
271
|
const id = `${context.queryId}-${joinType}-join`;
|
|
@@ -401,10 +405,12 @@ function addGPUJoinToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
|
|
|
401
405
|
indexStatistics: indexState.indexStatistics,
|
|
402
406
|
contractViolation: indexState.contractViolation
|
|
403
407
|
};
|
|
408
|
+
const projection = resultColumns && projectGPUDataFrameQueryResult(context, resultColumns);
|
|
404
409
|
return {
|
|
405
|
-
table: context.table,
|
|
406
|
-
validity: context.validity,
|
|
407
|
-
dictionaries: context.dictionaries,
|
|
410
|
+
table: projection?.table ?? context.table,
|
|
411
|
+
validity: projection?.validity ?? context.validity,
|
|
412
|
+
dictionaries: projection?.dictionaries ?? context.dictionaries,
|
|
413
|
+
ownedTables: projection ? [projection] : [],
|
|
408
414
|
ownedVectors,
|
|
409
415
|
createCompiled: props => new CompiledGPUDataFrameJoin(props, resources)
|
|
410
416
|
};
|
|
@@ -484,6 +490,81 @@ function addGPULookupToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
|
|
|
484
490
|
}
|
|
485
491
|
}
|
|
486
492
|
|
|
493
|
+
/** Bound unique-right join consumed as a source-aligned mask by aggregation. @internal */
|
|
494
|
+
export type GPUAggregateJoin = Readonly<{
|
|
495
|
+
right: GPUDataFrame;
|
|
496
|
+
options: GPUDataFrameNormalizedJoinOptions;
|
|
497
|
+
type: GPUDataFrameJoinType;
|
|
498
|
+
}>;
|
|
499
|
+
|
|
500
|
+
/** Inserts join matching before an aggregate contribution without compacting the left columns. */
|
|
501
|
+
export function prepareGPUJoinAggregation<
|
|
502
|
+
Source extends GPUTypeMap,
|
|
503
|
+
Selection extends GPUTypeMap,
|
|
504
|
+
Result extends GPUTypeMap,
|
|
505
|
+
Compiled extends CompiledGPUDataFrameQuery<Result>
|
|
506
|
+
>(
|
|
507
|
+
source: GPUDataFrame<Source>,
|
|
508
|
+
context: GPUDataFrameQueryExtensionContext<Selection>,
|
|
509
|
+
join: GPUAggregateJoin,
|
|
510
|
+
prepare: (
|
|
511
|
+
context: GPUDataFrameQueryExtensionContext<Selection>
|
|
512
|
+
) => GPUDataFrameQueryExtensionResult<Result, Compiled>
|
|
513
|
+
): GPUDataFrameQueryExtensionResult<Result, Compiled> {
|
|
514
|
+
const {graph} = context;
|
|
515
|
+
validateGPUJoinSources(source, join.right, join.options, graph);
|
|
516
|
+
const right = join.right.select(join.right.columnNames);
|
|
517
|
+
const ownedVectors: GPUVector[] = [];
|
|
518
|
+
const id = context.queryId + '-aggregate-join';
|
|
519
|
+
try {
|
|
520
|
+
const state = buildGPUJoinIndex(context, right, join.options, ownedVectors, id);
|
|
521
|
+
const violation = graph.importGPUVector(id + '-violation', state.contractViolation).data[0];
|
|
522
|
+
const matches = createTransientVectorView(graph, id + '-matches', context.selectionMask);
|
|
523
|
+
const values = createTransientVectorView(graph, id + '-values', context.selectionMask);
|
|
524
|
+
const probes = createTransientVectorView(graph, id + '-probes', context.selectionMask);
|
|
525
|
+
const included = createTransientVectorView(graph, id + '-included', context.selectionMask);
|
|
526
|
+
const statistics = createTransientView(
|
|
527
|
+
graph,
|
|
528
|
+
id + '-statistics',
|
|
529
|
+
'uint32',
|
|
530
|
+
GPU_HASH_QUERY_STATISTICS_LENGTH
|
|
531
|
+
);
|
|
532
|
+
for (const [batchIndex, keys] of state.maskedLeftKeys.data.entries()) {
|
|
533
|
+
if (!keys.length) continue;
|
|
534
|
+
const batchId = id + '-' + batchIndex;
|
|
535
|
+
graph.add(
|
|
536
|
+
new GPUHashIndexQuery({
|
|
537
|
+
id: batchId,
|
|
538
|
+
index: state.index,
|
|
539
|
+
keys,
|
|
540
|
+
values: values.data[batchIndex],
|
|
541
|
+
found: matches.data[batchIndex],
|
|
542
|
+
probes: probes.data[batchIndex],
|
|
543
|
+
statistics,
|
|
544
|
+
maxProbeCount: join.options.maxProbeCount
|
|
545
|
+
})
|
|
546
|
+
);
|
|
547
|
+
addGPUJoinClassifyPass(graph, batchId + '-classify', {
|
|
548
|
+
matches: matches.data[batchIndex],
|
|
549
|
+
selection: context.selectionMask.data[batchIndex],
|
|
550
|
+
violation,
|
|
551
|
+
included: included.data[batchIndex],
|
|
552
|
+
joinType: join.type
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
const result = prepare({...context, selectionMask: included});
|
|
556
|
+
return {
|
|
557
|
+
...result,
|
|
558
|
+
ownedVectors: [...ownedVectors, ...(result.ownedVectors ?? [])],
|
|
559
|
+
ownedTables: [...(result.ownedTables ?? []), right]
|
|
560
|
+
};
|
|
561
|
+
} catch (error) {
|
|
562
|
+
for (const vector of ownedVectors) vector.destroy();
|
|
563
|
+
right.destroy();
|
|
564
|
+
throw error;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
487
568
|
/** Builds one right index without concatenation and sanitizes filtered/nullable left source keys. */
|
|
488
569
|
function buildGPUJoinIndex<Left extends GPUTypeMap, Right extends GPUTypeMap>(
|
|
489
570
|
context: GPUDataFrameQueryExtensionContext<Left>,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
// SPDX-FileComment: Independently implemented for WebGPU; inspired by NVIDIA RAPIDS cuDF.
|
|
5
5
|
|
|
6
|
-
import {GPU_EXPRESSION_CAST_WGSL} from '../gpu-core/gpu-expression-cast';
|
|
7
6
|
import {
|
|
8
7
|
Buffer,
|
|
9
8
|
type Binding,
|
|
@@ -11,8 +10,14 @@ import {
|
|
|
11
10
|
type CommandEncoder,
|
|
12
11
|
type Device
|
|
13
12
|
} from '@luma.gl/core';
|
|
13
|
+
import {
|
|
14
|
+
GPUData,
|
|
15
|
+
GPUVector,
|
|
16
|
+
getGPUVectorWGSLLayout,
|
|
17
|
+
type GPUConstant,
|
|
18
|
+
type GPUVectorWGSLFormat as GPUExpressionNumericFormat
|
|
19
|
+
} from '@luma.gl/graph/gpu-data';
|
|
14
20
|
import {Kernel} from '../execution/compute/kernel';
|
|
15
|
-
import {GPUData, GPUVector, type GPUConstant} from '@luma.gl/graph/gpu-data';
|
|
16
21
|
import {GPURecordBatch, GPUTable, type GPUField, type GPUTypeMap} from '@luma.gl/graph/gpu-tables';
|
|
17
22
|
import {
|
|
18
23
|
type CompiledGPUCommandGraph,
|
|
@@ -25,21 +30,43 @@ import {
|
|
|
25
30
|
import {getBoundedDispatchLayout, getBoundedInvocationIndexSource} from '@luma.gl/graph/gpu-core';
|
|
26
31
|
import {GPUVisibilityWorkflow} from '@luma.gl/graph/gpu-core';
|
|
27
32
|
import {createTransientView, getViewBinding, getViewElementOffset} from '@luma.gl/graph/gpu-core';
|
|
28
|
-
import
|
|
33
|
+
import {
|
|
34
|
+
GPUDataFrame,
|
|
35
|
+
type GPUDataFrameDictionaries,
|
|
36
|
+
type GPUDataFrameValidity
|
|
37
|
+
} from './gpu-data-frame';
|
|
29
38
|
import type {GPUDataFrameDerivedColumn} from './gpu-data-frame-query';
|
|
30
39
|
import type {GPUExpression} from './gpu-expression';
|
|
31
40
|
import {
|
|
32
41
|
encodeGPUQueryExpressionControls,
|
|
33
|
-
getGPUQueryShaderType,
|
|
34
42
|
makeGPUQueryExpressionShaderPlan,
|
|
35
43
|
type GPUQueryExpressionColumn,
|
|
36
44
|
type GPUQueryExpressionOutput,
|
|
37
|
-
type GPUQueryExpressionShaderPlan
|
|
38
|
-
type GPUQueryScalarFormat
|
|
45
|
+
type GPUQueryExpressionShaderPlan
|
|
39
46
|
} from './gpu-expression-shader';
|
|
40
47
|
|
|
41
48
|
const LU_QUERY_WORKGROUP_SIZE = 256;
|
|
42
|
-
|
|
49
|
+
|
|
50
|
+
/** Borrows projected columns while the query owns its working table. @internal */
|
|
51
|
+
export function projectGPUDataFrameQueryResult<Selection extends GPUTypeMap>(
|
|
52
|
+
context: Pick<
|
|
53
|
+
GPUDataFrameQueryExtensionContext<Selection>,
|
|
54
|
+
'table' | 'validity' | 'dictionaries'
|
|
55
|
+
>,
|
|
56
|
+
columns: readonly (keyof Selection & string)[]
|
|
57
|
+
): GPUDataFrame<Selection> {
|
|
58
|
+
const working = new GPUDataFrame<Selection>({
|
|
59
|
+
table: context.table,
|
|
60
|
+
validity: context.validity,
|
|
61
|
+
dictionaries: context.dictionaries,
|
|
62
|
+
ownership: 'borrowed'
|
|
63
|
+
});
|
|
64
|
+
try {
|
|
65
|
+
return working.select(columns) as GPUDataFrame<Selection>;
|
|
66
|
+
} finally {
|
|
67
|
+
working.destroy();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
43
70
|
|
|
44
71
|
/** Caller-owned scalar values supplied to an already compiled dataframe filter. */
|
|
45
72
|
export type GPUDataFrameQueryParameters = Readonly<Record<string, number | boolean | null>>;
|
|
@@ -51,12 +78,12 @@ type GPUQuerySourceView = {
|
|
|
51
78
|
|
|
52
79
|
type GPUQueryDerivedOutput = {
|
|
53
80
|
plan: GPUQueryExpressionOutput;
|
|
54
|
-
values: GPUVector<
|
|
81
|
+
values: GPUVector<GPUExpressionNumericFormat>;
|
|
55
82
|
validity?: GPUVector<'uint32'>;
|
|
56
83
|
};
|
|
57
84
|
|
|
58
85
|
type GPUQueryDerivedView = {
|
|
59
|
-
values: GraphVectorView<
|
|
86
|
+
values: GraphVectorView<GPUExpressionNumericFormat>;
|
|
60
87
|
validity?: GraphVectorView<'uint32'>;
|
|
61
88
|
};
|
|
62
89
|
|
|
@@ -420,7 +447,7 @@ function validateGPUQueryBindingCapacity(
|
|
|
420
447
|
}
|
|
421
448
|
|
|
422
449
|
/** Creates one independently owned fixed-width GPU output chunk for every source batch. */
|
|
423
|
-
function createGPUQueryOutputVector<Format extends
|
|
450
|
+
function createGPUQueryOutputVector<Format extends GPUExpressionNumericFormat>(
|
|
424
451
|
device: Device,
|
|
425
452
|
name: string,
|
|
426
453
|
lengths: readonly number[],
|
|
@@ -433,7 +460,7 @@ function createGPUQueryOutputVector<Format extends GPUQueryScalarFormat>(
|
|
|
433
460
|
for (const [batchIndex, length] of lengths.entries()) {
|
|
434
461
|
const buffer = device.createBuffer({
|
|
435
462
|
id: `${name}-batch-${batchIndex}`,
|
|
436
|
-
byteLength: Math.max(length, 1) *
|
|
463
|
+
byteLength: Math.max(length, 1) * getGPUVectorWGSLLayout(format).packedByteStride,
|
|
437
464
|
usage:
|
|
438
465
|
Buffer.STORAGE |
|
|
439
466
|
Buffer.COPY_SRC |
|
|
@@ -506,7 +533,13 @@ function createGPUQueryDerivedTable<Result extends GPUTypeMap>(
|
|
|
506
533
|
const layouts: BufferLayout[] = selectedColumns.flatMap(name => {
|
|
507
534
|
const output = outputsByName.get(name);
|
|
508
535
|
if (output) {
|
|
509
|
-
return [
|
|
536
|
+
return [
|
|
537
|
+
{
|
|
538
|
+
name,
|
|
539
|
+
format: output.plan.format,
|
|
540
|
+
byteStride: getGPUVectorWGSLLayout(output.plan.format).packedByteStride
|
|
541
|
+
}
|
|
542
|
+
];
|
|
510
543
|
}
|
|
511
544
|
return selectedSource.bufferLayout
|
|
512
545
|
.filter(layout => layout.name === name)
|
|
@@ -660,6 +693,43 @@ function addGPUQueryControlUpload(
|
|
|
660
693
|
});
|
|
661
694
|
}
|
|
662
695
|
|
|
696
|
+
/** Adds a predicate on an already prepared graph table into a caller-supplied mask. @internal */
|
|
697
|
+
export function addGPUDataFrameResultPredicate<T extends GPUTypeMap>(
|
|
698
|
+
graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
|
|
699
|
+
queryId: string,
|
|
700
|
+
source: GPUDataFrame<T>,
|
|
701
|
+
predicate: GPUExpression<boolean, string>,
|
|
702
|
+
output: GraphVectorView<'uint32'>
|
|
703
|
+
): void {
|
|
704
|
+
const plan = makeGPUQueryExpressionShaderPlan(source, [predicate], [], []);
|
|
705
|
+
validateGPUQueryBindingCapacity(plan, graph);
|
|
706
|
+
const sourceViews = importGPUQuerySourceViews(graph, source, plan, queryId);
|
|
707
|
+
const controls =
|
|
708
|
+
plan.controls.length && output.length
|
|
709
|
+
? createTransientView(
|
|
710
|
+
graph,
|
|
711
|
+
queryId + '-controls',
|
|
712
|
+
'uint32',
|
|
713
|
+
plan.controls.length * 2,
|
|
714
|
+
Buffer.STORAGE | Buffer.COPY_DST
|
|
715
|
+
)
|
|
716
|
+
: undefined;
|
|
717
|
+
if (controls) addGPUQueryControlUpload(graph, queryId, controls, plan);
|
|
718
|
+
for (const [batchIndex, chunk] of output.data.entries()) {
|
|
719
|
+
if (!chunk.length) continue;
|
|
720
|
+
addGPUQueryPredicatePass(graph, {
|
|
721
|
+
id: queryId + '-batch-' + batchIndex,
|
|
722
|
+
batchIndex,
|
|
723
|
+
columns: plan.columns,
|
|
724
|
+
sourceViews,
|
|
725
|
+
derivedViews: new Map(),
|
|
726
|
+
controls,
|
|
727
|
+
output: chunk,
|
|
728
|
+
plan
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
663
733
|
/** Emits one closed-AST expression kernel for one preserved, nonempty source record batch. */
|
|
664
734
|
function addGPUQueryPredicatePass(
|
|
665
735
|
graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
|
|
@@ -689,7 +759,16 @@ function addGPUQueryPredicatePass(
|
|
|
689
759
|
`const INPUT_${column.index}_OFFSET: u32 = ${getViewElementOffset(values)}u;`
|
|
690
760
|
);
|
|
691
761
|
declarations.push(
|
|
692
|
-
`@group(0) @binding(${bindingIndex++}) var<storage, read> input${column.index}: array<${
|
|
762
|
+
`@group(0) @binding(${bindingIndex++}) var<storage, read> input${column.index}: array<${getGPUVectorWGSLLayout(column.format).scalarType}>;`
|
|
763
|
+
);
|
|
764
|
+
const layout = getGPUVectorWGSLLayout(column.format);
|
|
765
|
+
const components = Array.from(
|
|
766
|
+
{length: layout.components},
|
|
767
|
+
(_, component) =>
|
|
768
|
+
`input${column.index}[INPUT_${column.index}_OFFSET + row * ${layout.components}u + ${component}u]`
|
|
769
|
+
);
|
|
770
|
+
declarations.push(
|
|
771
|
+
`fn readInput${column.index}(row: u32) -> ${layout.shaderType} { return ${layout.components === 1 ? components[0] : `${layout.shaderType}(${components.join(', ')})`}; }`
|
|
693
772
|
);
|
|
694
773
|
bindings[`input${column.index}`] = values;
|
|
695
774
|
resources.push({buffer: values, usage: 'storage-read'});
|
|
@@ -730,13 +809,16 @@ function addGPUQueryPredicatePass(
|
|
|
730
809
|
`const DERIVED_${output.index}_OFFSET: u32 = ${getViewElementOffset(values)}u;`
|
|
731
810
|
);
|
|
732
811
|
declarations.push(
|
|
733
|
-
`@group(0) @binding(${bindingIndex++}) var<storage, read_write> derived${output.index}: array<${
|
|
812
|
+
`@group(0) @binding(${bindingIndex++}) var<storage, read_write> derived${output.index}: array<${getGPUVectorWGSLLayout(output.format).scalarType}>;`
|
|
734
813
|
);
|
|
735
814
|
bindings[`derived${output.index}`] = values;
|
|
736
815
|
resources.push({buffer: values, usage: 'storage-write'});
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
816
|
+
const layout = getGPUVectorWGSLLayout(output.format);
|
|
817
|
+
for (let component = 0; component < layout.components; component++) {
|
|
818
|
+
derivedWrites.push(
|
|
819
|
+
`derived${output.index}[DERIVED_${output.index}_OFFSET + index * ${layout.components}u + ${component}u] = ${layout.components === 1 ? output.value : `${output.value}[${component}]`};`
|
|
820
|
+
);
|
|
821
|
+
}
|
|
740
822
|
|
|
741
823
|
if (output.nullable) {
|
|
742
824
|
const validity = views?.validity?.data[props.batchIndex];
|
|
@@ -773,7 +855,7 @@ function addGPUQueryPredicatePass(
|
|
|
773
855
|
const source = /* wgsl */ `
|
|
774
856
|
const ELEMENT_COUNT: u32 = ${props.output.length}u;
|
|
775
857
|
${declarations.join('\n')}
|
|
776
|
-
${props.plan.
|
|
858
|
+
${props.plan.helpers.join('\n')}
|
|
777
859
|
|
|
778
860
|
@compute @workgroup_size(${LU_QUERY_WORKGROUP_SIZE})
|
|
779
861
|
fn main(
|
|
@@ -77,7 +77,7 @@ export {CompiledGPUDataFrameSort} from './gpu-sort-compiler';
|
|
|
77
77
|
export {CompiledGPUDataFrameGlobalSort} from './gpu-global-sort-compiler';
|
|
78
78
|
export {CompiledGPUDataFrameJoin, CompiledGPUDataFrameLookup} from './gpu-join-compiler';
|
|
79
79
|
|
|
80
|
-
export {vector, cast} from './gpu-expression';
|
|
80
|
+
export {vector, vectorColumn, cast} from './gpu-expression';
|
|
81
81
|
export type {GPUExpressionNumericValue} from './gpu-expression';
|
|
82
82
|
export type {
|
|
83
83
|
GPUVectorWGSLFormat as GPUExpressionNumericFormat,
|
|
@@ -81,8 +81,10 @@ extends beyond the standard and does not become a seventh official workload.
|
|
|
81
81
|
one chosen vertex. Existing nonnegative `float32` edge weights determine route cost; missing
|
|
82
82
|
weights mean every relationship costs one. Unreachable vertices receive `+Infinity`, equal-cost
|
|
83
83
|
routes choose fewer hops and then the lowest stable predecessor, and invalid or negative weights
|
|
84
|
-
fail closed.
|
|
85
|
-
|
|
84
|
+
fail closed. Synchronized relaxation stops on the GPU in the first round that changes nothing;
|
|
85
|
+
`run()` continues in batches past the 1,024 rounds that one command graph encodes and reports
|
|
86
|
+
`converged` and `iterations`. Caller-owned `seeds` let one compiled search serve any source, or
|
|
87
|
+
several sources at once. Negative weights are not supported.
|
|
86
88
|
|
|
87
89
|
`GPUGraphAlgorithmsLocalClusteringCoefficient` asks whether each vertex's distinct incoming-or-outgoing
|
|
88
90
|
neighbors also connect to one another. Directed graphs count distinct directed links among those
|