@luma.gl/graph 10.0.0-alpha.8 → 10.0.0-beta.1
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/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +19 -0
- package/dist/arrow/arrow-colors.cjs +99 -18
- package/dist/arrow/arrow-colors.d.ts +27 -10
- package/dist/arrow/arrow-colors.d.ts.map +1 -1
- package/dist/arrow/arrow-colors.js +107 -24
- package/dist/arrow/arrow-colors.js.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
- package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
- package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
- package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +19 -2
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +5 -2
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +4 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +3820 -1646
- package/dist/dist.min.js +450 -136
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/simulation/index.cjs.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.cjs +2 -15
- package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.js +2 -15
- package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
- package/dist/geospatial/index.cjs.map +2 -2
- package/dist/gpu-a5/index.cjs.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.js +54 -1
- package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
- package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph.cjs +34 -11
- package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
- package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph.js +39 -11
- package/dist/gpu-core/gpu-command-graph.js.map +1 -1
- package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-execution.js +294 -0
- package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.js +35 -0
- package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
- package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
- package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
- package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
- package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
- package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
- package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.js +1 -1
- package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
- package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.js +7 -1
- package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.js +50 -0
- package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-graph.d.ts +2 -2
- package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
- package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.js +2 -5
- package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
- package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
- package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
- package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
- package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
- package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.js +2 -16
- package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +7 -18
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-operation.d.ts +4 -4
- package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-operation.js.map +1 -1
- package/dist/gpu-core/gpu-reduction.cjs +6 -14
- package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-reduction.js +6 -15
- package/dist/gpu-core/gpu-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-render-operation.cjs +39 -0
- package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
- package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-render-operation.js +22 -0
- package/dist/gpu-core/gpu-render-operation.js.map +1 -0
- package/dist/gpu-core/gpu-scan.cjs +46 -32
- package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-scan.js +56 -44
- package/dist/gpu-core/gpu-scan.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
- package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.js +73 -16
- package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
- package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
- package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
- package/dist/gpu-core/index.cjs +32 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +21 -1
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +10 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-data/color-conversion.cjs +105 -0
- package/dist/gpu-data/color-conversion.d.ts +30 -0
- package/dist/gpu-data/color-conversion.d.ts.map +1 -0
- package/dist/gpu-data/color-conversion.js +109 -0
- package/dist/gpu-data/color-conversion.js.map +1 -0
- package/dist/gpu-data/cpu-data.cjs +60 -0
- package/dist/gpu-data/cpu-data.d.ts +28 -0
- package/dist/gpu-data/cpu-data.d.ts.map +1 -0
- package/dist/gpu-data/cpu-data.js +41 -0
- package/dist/gpu-data/cpu-data.js.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
- package/dist/gpu-data/cpu-vector.cjs +42 -0
- package/dist/gpu-data/cpu-vector.d.ts +17 -0
- package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
- package/dist/gpu-data/cpu-vector.js +21 -0
- package/dist/gpu-data/cpu-vector.js.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
- package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
- package/dist/gpu-data/index.cjs +21 -2
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-data/index.d.ts +6 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +5 -0
- package/dist/gpu-data/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +1 -16
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +1 -23
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +91 -2
- package/dist/gpu-dataframe/gpu-expression.d.ts +37 -0
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +106 -0
- package/dist/gpu-dataframe/gpu-expression.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 +4 -0
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -0
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +103 -0
- package/dist/gpu-dataframe/portable-expression.d.ts +19 -0
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
- package/dist/gpu-dataframe/portable-expression.js +98 -0
- package/dist/gpu-dataframe/portable-expression.js.map +1 -0
- package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
- package/dist/gpu-dggs/index.cjs.map +1 -1
- package/dist/gpu-geometry/index.cjs.map +1 -1
- package/dist/gpu-graph/index.cjs +8 -0
- package/dist/gpu-graph/index.cjs.map +3 -3
- package/dist/gpu-graph/index.d.ts +4 -0
- package/dist/gpu-graph/index.d.ts.map +1 -1
- package/dist/gpu-graph/index.js +2 -0
- package/dist/gpu-graph/index.js.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
- package/dist/gpu-h3/index.cjs.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +162 -2
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +25 -0
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +181 -2
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs.map +2 -2
- package/dist/gpu-physics/index.d.ts +1 -0
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +24 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +2 -2
- 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 +2 -2
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
- package/dist/gpu-pointcloud/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
- package/dist/gpu-project/coordinate-projection-graph.js +40 -0
- package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.js +103 -0
- package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.js +37 -0
- package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/geoarrow.cjs +36 -0
- package/dist/gpu-project/geoarrow.cjs.map +6 -0
- package/dist/gpu-project/geoarrow.d.ts +3 -0
- package/dist/gpu-project/geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/geoarrow.js +7 -0
- package/dist/gpu-project/geoarrow.js.map +1 -0
- package/dist/gpu-project/graph.cjs +27 -0
- package/dist/gpu-project/graph.cjs.map +6 -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 +6 -0
- package/dist/gpu-project/graph.js.map +1 -0
- package/dist/gpu-project/index.cjs +3 -0
- package/dist/gpu-project/index.cjs.map +3 -3
- package/dist/gpu-project/index.d.ts +1 -0
- package/dist/gpu-project/index.d.ts.map +1 -1
- package/dist/gpu-project/index.js +1 -0
- package/dist/gpu-project/index.js.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +75 -5
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.cjs +126 -10
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
- package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/index.d.ts +1 -1
- package/dist/gpu-simple-graph/index.d.ts.map +1 -1
- package/dist/gpu-simple-graph/index.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +6 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
- package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
- package/dist/gpu-sql/gpu-sql.cjs +376 -0
- package/dist/gpu-sql/gpu-sql.d.ts +36 -0
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -0
- package/dist/gpu-sql/gpu-sql.js +374 -0
- package/dist/gpu-sql/gpu-sql.js.map +1 -0
- package/dist/gpu-sql/index.cjs +5 -5
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-sql/index.d.ts +2 -2
- package/dist/gpu-sql/index.d.ts.map +1 -1
- package/dist/gpu-sql/index.js +1 -1
- package/dist/gpu-sql/index.js.map +1 -1
- package/dist/gpu-tables/index.cjs.map +2 -2
- package/dist/gpu-tables/table/gpu-table.cjs +2 -2
- package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
- package/dist/gpu-tables/table/gpu-table.js +2 -2
- package/dist/gpu-tables/table/gpu-table.js.map +1 -1
- package/dist/gpu-timeseries/index.cjs.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +21 -7
- package/src/arrow/arrow-colors.ts +194 -33
- package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
- package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
- package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
- package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
- package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
- package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
- package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
- package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
- package/src/arrow/index.ts +14 -0
- package/src/geospatial/gpu-point-spatial-query.ts +2 -15
- package/src/gpu-core/compiled-gpu-graph.ts +73 -1
- package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
- package/src/gpu-core/gpu-command-graph-types.ts +20 -0
- package/src/gpu-core/gpu-command-graph.ts +48 -11
- package/src/gpu-core/gpu-cpu-execution.ts +345 -0
- package/src/gpu-core/gpu-cpu-operation.ts +65 -0
- package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
- package/src/gpu-core/gpu-expression-operation.ts +1 -1
- package/src/gpu-core/gpu-expression-plan.ts +11 -3
- package/src/gpu-core/gpu-graph-compiler.ts +61 -0
- package/src/gpu-core/gpu-graph.ts +3 -3
- package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
- package/src/gpu-core/gpu-grid-binning.ts +2 -5
- package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
- package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
- package/src/gpu-core/gpu-grid-index-query.ts +2 -16
- package/src/gpu-core/gpu-group-aggregation.ts +38 -50
- package/src/gpu-core/gpu-operation.ts +9 -7
- package/src/gpu-core/gpu-reduction.ts +32 -42
- package/src/gpu-core/gpu-render-operation.ts +42 -0
- package/src/gpu-core/gpu-scan.ts +59 -45
- package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
- package/src/gpu-core/gpu-segmented-scan.ts +82 -17
- package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
- package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
- package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
- package/src/gpu-core/gpu-texture-plan.ts +3 -2
- package/src/gpu-core/index.ts +39 -0
- package/src/gpu-data/color-conversion.ts +158 -0
- package/src/gpu-data/cpu-data.ts +62 -0
- package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
- package/src/gpu-data/cpu-vector.ts +31 -0
- package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
- package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
- package/src/gpu-data/index.ts +15 -0
- package/src/gpu-dataframe/gpu-data-frame-query.ts +6 -26
- package/src/gpu-dataframe/gpu-expression.ts +135 -0
- package/src/gpu-dataframe/index.ts +11 -0
- package/src/gpu-dataframe/portable-expression.ts +117 -0
- package/src/gpu-graph/index.ts +17 -0
- package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
- package/src/gpu-physics/gpu-rigid-body-world.ts +227 -2
- package/src/gpu-physics/index.ts +1 -0
- package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
- package/src/gpu-physics/rigid-body-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
- package/src/gpu-project/README.md +4 -4
- package/src/gpu-project/coordinate-projection-graph.ts +59 -0
- package/src/gpu-project/cpu-geoarrow.ts +135 -0
- package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
- package/src/gpu-project/cpu-projection-operation.ts +49 -0
- package/src/gpu-project/geoarrow.ts +11 -0
- package/src/gpu-project/graph.ts +10 -0
- package/src/gpu-project/index.ts +2 -0
- package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +97 -6
- package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -0
- package/src/gpu-simple-graph/gpu-simple-graph.ts +163 -19
- package/src/gpu-simple-graph/index.ts +1 -0
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +24 -0
- package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
- package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
- package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
- package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
- package/src/gpu-sql/gpu-sql.ts +494 -0
- package/src/gpu-sql/index.ts +2 -2
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +21 -0
- package/dist/gpu-sql/lu-sql.cjs +0 -499
- package/dist/gpu-sql/lu-sql.d.ts +0 -36
- package/dist/gpu-sql/lu-sql.d.ts.map +0 -1
- package/dist/gpu-sql/lu-sql.js +0 -497
- package/dist/gpu-sql/lu-sql.js.map +0 -1
- package/src/gpu-sql/lu-sql.ts +0 -599
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileComment: Independently implemented for WebGPU; inspired by relational SQL semantics.
|
|
5
|
+
|
|
6
|
+
import {parseSQLSelectStatement} from '@math.gl/sql/parser';
|
|
7
|
+
import type {Expression} from '@math.gl/sql/expressions';
|
|
8
|
+
import type {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
|
|
9
|
+
import {GPUDataFrame} from '../gpu-dataframe/gpu-data-frame';
|
|
10
|
+
import {GPUDataFrameQuery} from '../gpu-dataframe/gpu-data-frame-query';
|
|
11
|
+
import {
|
|
12
|
+
GPUExpression,
|
|
13
|
+
column,
|
|
14
|
+
literal,
|
|
15
|
+
parameter,
|
|
16
|
+
type GPUExpressionNode
|
|
17
|
+
} from '../gpu-dataframe/gpu-expression';
|
|
18
|
+
import type {GPUDataFrameJoinType} from '../gpu-dataframe/gpu-join-query';
|
|
19
|
+
import type {
|
|
20
|
+
CompiledGPUDataFrameQuery,
|
|
21
|
+
GPUDataFrameQueryParameters
|
|
22
|
+
} from '../gpu-dataframe/gpu-query-compiler';
|
|
23
|
+
|
|
24
|
+
/** Explicit GPU dataframe registrations; Arrow remains exclusively an adapter boundary. */
|
|
25
|
+
export type GPUSQLTables = Readonly<Record<string, GPUDataFrame>>;
|
|
26
|
+
|
|
27
|
+
/** Defaults for named SQL parameters such as `:minimumFare`; values remain caller-controlled. */
|
|
28
|
+
export type GPUSQLQueryOptions = Readonly<{parameters?: GPUDataFrameQueryParameters}>;
|
|
29
|
+
|
|
30
|
+
type GPUSQLSelectItem = Readonly<{
|
|
31
|
+
expression?: GPUExpressionNode;
|
|
32
|
+
aggregate?: 'count' | 'sum' | 'min' | 'max' | 'mean';
|
|
33
|
+
aggregateColumn?: string;
|
|
34
|
+
alias?: string;
|
|
35
|
+
star?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
type GPUSQLStatement = Readonly<{
|
|
38
|
+
items: readonly GPUSQLSelectItem[];
|
|
39
|
+
table: string;
|
|
40
|
+
alias?: string;
|
|
41
|
+
join?: Readonly<{
|
|
42
|
+
type: GPUDataFrameJoinType;
|
|
43
|
+
table: string;
|
|
44
|
+
alias?: string;
|
|
45
|
+
left: string;
|
|
46
|
+
right: string;
|
|
47
|
+
}>;
|
|
48
|
+
predicate?: GPUExpressionNode;
|
|
49
|
+
groupBy?: string;
|
|
50
|
+
orderBy?: Readonly<{
|
|
51
|
+
column: string;
|
|
52
|
+
direction: 'ascending' | 'descending';
|
|
53
|
+
nulls?: 'first' | 'last';
|
|
54
|
+
}>;
|
|
55
|
+
limit?: number;
|
|
56
|
+
}>;
|
|
57
|
+
|
|
58
|
+
type GPUSQLCompiledPlan = Readonly<{
|
|
59
|
+
compile: (graph: GPUCommandGraph<GPUDataFrameQueryParameters>) => CompiledGPUDataFrameQuery;
|
|
60
|
+
}>;
|
|
61
|
+
|
|
62
|
+
type GPUSQLAggregationDefinitions = Record<
|
|
63
|
+
string,
|
|
64
|
+
'count' | {sum: string} | {min: string} | {max: string} | {mean: string}
|
|
65
|
+
>;
|
|
66
|
+
|
|
67
|
+
/** Runtime-validated SQL names cross the strongly typed dataframe boundary exactly once. */
|
|
68
|
+
type GPUSQLDynamicQuery = GPUSQLCompiledPlan & {
|
|
69
|
+
predicates: readonly GPUExpression<boolean, string>[];
|
|
70
|
+
filter: (predicate: GPUExpression<boolean, string>) => GPUSQLDynamicQuery;
|
|
71
|
+
select: (names: readonly string[]) => GPUSQLDynamicQuery;
|
|
72
|
+
withColumn: (
|
|
73
|
+
name: string,
|
|
74
|
+
expression: GPUExpression<number | null, string>
|
|
75
|
+
) => GPUSQLDynamicQuery;
|
|
76
|
+
groupBy: (key: string) => {
|
|
77
|
+
aggregate: (definitions: GPUSQLAggregationDefinitions) => GPUSQLCompiledPlan;
|
|
78
|
+
};
|
|
79
|
+
aggregate: (definitions: GPUSQLAggregationDefinitions) => GPUSQLCompiledPlan;
|
|
80
|
+
sortByGlobal: (
|
|
81
|
+
name: string,
|
|
82
|
+
options: {direction: 'ascending' | 'descending'; nulls?: 'first' | 'last'}
|
|
83
|
+
) => GPUSQLCompiledPlan & {topK: (limit: number) => GPUSQLCompiledPlan};
|
|
84
|
+
innerJoin: (
|
|
85
|
+
right: GPUDataFrame,
|
|
86
|
+
options: {leftOn: string; rightOn: string}
|
|
87
|
+
) => GPUSQLCompiledPlan;
|
|
88
|
+
leftJoin: (right: GPUDataFrame, options: {leftOn: string; rightOn: string}) => GPUSQLCompiledPlan;
|
|
89
|
+
semiJoin: (right: GPUDataFrame, options: {leftOn: string; rightOn: string}) => GPUSQLCompiledPlan;
|
|
90
|
+
antiJoin: (right: GPUDataFrame, options: {leftOn: string; rightOn: string}) => GPUSQLCompiledPlan;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* SQL frontend over explicitly registered, already GPU-resident dataframes.
|
|
95
|
+
*
|
|
96
|
+
* Parsing and planning never upload data, submit work, or read GPU buffers. Arrow upload/output
|
|
97
|
+
* remain explicit `@luma.gl/graph/arrow` operations around the shared GPU table execution core.
|
|
98
|
+
*/
|
|
99
|
+
export class GPUSQLContext {
|
|
100
|
+
private readonly tables: Readonly<Record<string, GPUDataFrame>>;
|
|
101
|
+
|
|
102
|
+
constructor(tables: GPUSQLTables) {
|
|
103
|
+
const registered: Record<string, GPUDataFrame> = {};
|
|
104
|
+
for (const [name, table] of Object.entries(tables)) {
|
|
105
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name) || !(table instanceof GPUDataFrame)) {
|
|
106
|
+
throw new Error('GPUSQL requires valid names mapped to existing GPU dataframes');
|
|
107
|
+
}
|
|
108
|
+
const canonical = name.toLowerCase();
|
|
109
|
+
if (registered[canonical]) throw new Error(`GPUSQL table "${name}" is already registered`);
|
|
110
|
+
registered[canonical] = table;
|
|
111
|
+
}
|
|
112
|
+
this.tables = Object.freeze(registered);
|
|
113
|
+
Object.freeze(this);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Parses and validates one immutable SELECT plan without touching registered GPU sources. */
|
|
117
|
+
query(source: string, options: GPUSQLQueryOptions = {}): GPUSQLQuery {
|
|
118
|
+
const statement = parseGPUSQLStatement(source, options.parameters ?? {});
|
|
119
|
+
return new GPUSQLQuery(source, buildGPUSQLPlan(this.tables, statement));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Immutable SQL plan lowered directly into existing reusable GPU dataframe command graphs. */
|
|
124
|
+
export class GPUSQLQuery {
|
|
125
|
+
/** Original application-owned SQL text, retained solely for diagnostics and inspection. */
|
|
126
|
+
readonly sql: string;
|
|
127
|
+
private readonly plan: GPUSQLCompiledPlan;
|
|
128
|
+
|
|
129
|
+
/** @internal */
|
|
130
|
+
constructor(sql: string, plan: GPUSQLCompiledPlan) {
|
|
131
|
+
this.sql = sql;
|
|
132
|
+
this.plan = plan;
|
|
133
|
+
Object.freeze(this);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Compiles existing dataframe operations into the caller-owned GPU command graph. */
|
|
137
|
+
compile(graph: GPUCommandGraph<GPUDataFrameQueryParameters>): CompiledGPUDataFrameQuery {
|
|
138
|
+
return this.plan.compile(graph);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function buildGPUSQLPlan(
|
|
143
|
+
tables: Readonly<Record<string, GPUDataFrame>>,
|
|
144
|
+
statement: GPUSQLStatement
|
|
145
|
+
): GPUSQLCompiledPlan {
|
|
146
|
+
const frame = tables[statement.table.toLowerCase()];
|
|
147
|
+
if (!frame) throw new Error(`GPUSQL table "${statement.table}" is not registered`);
|
|
148
|
+
let query = new GPUDataFrameQuery(frame, [], frame.columnNames) as unknown as GPUSQLDynamicQuery;
|
|
149
|
+
const qualifier = statement.alias ?? statement.table;
|
|
150
|
+
const resolve = (name: string): string => resolveGPUSQLColumn(name, qualifier, frame.columnNames);
|
|
151
|
+
if (statement.predicate) {
|
|
152
|
+
query = query.filter(
|
|
153
|
+
new GPUExpression<boolean, string>(resolveGPUSQLExpression(statement.predicate, resolve))
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const aggregates = statement.items.filter(item => item.aggregate);
|
|
158
|
+
if (aggregates.length > 0) {
|
|
159
|
+
if (statement.join || statement.orderBy || statement.limit !== undefined) {
|
|
160
|
+
throw new Error('GPUSQL aggregate queries do not yet support joins, ordering, or limits');
|
|
161
|
+
}
|
|
162
|
+
const definitions: GPUSQLAggregationDefinitions = {};
|
|
163
|
+
for (const item of aggregates) {
|
|
164
|
+
const name = item.alias ?? `${item.aggregate}_${item.aggregateColumn ?? 'all'}`;
|
|
165
|
+
if (definitions[name]) throw new Error(`GPUSQL aggregate alias "${name}" is duplicated`);
|
|
166
|
+
definitions[name] =
|
|
167
|
+
item.aggregate === 'count'
|
|
168
|
+
? 'count'
|
|
169
|
+
: ({[item.aggregate!]: resolve(item.aggregateColumn!)} as
|
|
170
|
+
| {sum: string}
|
|
171
|
+
| {min: string}
|
|
172
|
+
| {max: string}
|
|
173
|
+
| {mean: string});
|
|
174
|
+
}
|
|
175
|
+
if (statement.groupBy) {
|
|
176
|
+
const key = resolve(statement.groupBy);
|
|
177
|
+
const nonAggregates = statement.items.filter(item => !item.aggregate);
|
|
178
|
+
if (
|
|
179
|
+
nonAggregates.length !== 1 ||
|
|
180
|
+
resolveGPUSQLProjectionName(nonAggregates[0], resolve) !== key
|
|
181
|
+
) {
|
|
182
|
+
throw new Error('GPUSQL grouped queries must select their single GROUP BY key');
|
|
183
|
+
}
|
|
184
|
+
return query.groupBy(key).aggregate(definitions);
|
|
185
|
+
}
|
|
186
|
+
if (aggregates.length !== statement.items.length) {
|
|
187
|
+
throw new Error('GPUSQL global aggregates cannot mix ordinary source columns');
|
|
188
|
+
}
|
|
189
|
+
return query.aggregate(definitions);
|
|
190
|
+
}
|
|
191
|
+
if (statement.groupBy) throw new Error('GPUSQL GROUP BY requires at least one aggregation');
|
|
192
|
+
|
|
193
|
+
const selected: string[] = [];
|
|
194
|
+
for (const item of statement.items) {
|
|
195
|
+
if (item.star) {
|
|
196
|
+
if (statement.items.length !== 1)
|
|
197
|
+
throw new Error('GPUSQL SELECT * cannot include other columns');
|
|
198
|
+
selected.push(...frame.columnNames);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const node = resolveGPUSQLExpression(item.expression!, resolve);
|
|
202
|
+
const name = item.alias ?? (node.kind === 'column' ? node.name : undefined);
|
|
203
|
+
if (!name) throw new Error('GPUSQL computed SELECT expressions require an explicit AS alias');
|
|
204
|
+
if (selected.includes(name)) throw new Error(`GPUSQL output column "${name}" is duplicated`);
|
|
205
|
+
if (node.kind !== 'column' || node.name !== name) {
|
|
206
|
+
if (frame.columnNames.includes(name)) {
|
|
207
|
+
throw new Error(`GPUSQL derived alias "${name}" conflicts with an existing source column`);
|
|
208
|
+
}
|
|
209
|
+
query = query.withColumn(name, new GPUExpression<number | null, string>(node));
|
|
210
|
+
}
|
|
211
|
+
selected.push(name);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (statement.join) {
|
|
215
|
+
if (statement.orderBy || statement.limit !== undefined) {
|
|
216
|
+
throw new Error('GPUSQL joined results do not yet support ORDER BY or LIMIT');
|
|
217
|
+
}
|
|
218
|
+
const right = tables[statement.join.table.toLowerCase()];
|
|
219
|
+
if (!right) throw new Error(`GPUSQL table "${statement.join.table}" is not registered`);
|
|
220
|
+
const leftKey = resolve(statement.join.left);
|
|
221
|
+
const rightQualifier = statement.join.alias ?? statement.join.table;
|
|
222
|
+
const rightKey = resolveGPUSQLColumn(statement.join.right, rightQualifier, right.columnNames);
|
|
223
|
+
if (!selected.includes(leftKey)) {
|
|
224
|
+
throw new Error('GPUSQL joins require the left join key to remain selected');
|
|
225
|
+
}
|
|
226
|
+
query = query.select(selected);
|
|
227
|
+
const options = {leftOn: leftKey, rightOn: rightKey};
|
|
228
|
+
switch (statement.join.type) {
|
|
229
|
+
case 'left':
|
|
230
|
+
return query.leftJoin(right, options);
|
|
231
|
+
case 'semi':
|
|
232
|
+
return query.semiJoin(right, options);
|
|
233
|
+
case 'anti':
|
|
234
|
+
return query.antiJoin(right, options);
|
|
235
|
+
default:
|
|
236
|
+
return query.innerJoin(right, options);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (statement.orderBy) {
|
|
241
|
+
const {column: requested, direction, nulls} = statement.orderBy;
|
|
242
|
+
const orderColumn = selected.includes(requested) ? requested : resolve(requested);
|
|
243
|
+
if (!selected.includes(orderColumn)) {
|
|
244
|
+
throw new Error('GPUSQL ORDER BY requires the sort column in the SELECT projection');
|
|
245
|
+
}
|
|
246
|
+
const sort = query.select(selected).sortByGlobal(orderColumn, {
|
|
247
|
+
direction,
|
|
248
|
+
...(nulls ? {nulls} : {})
|
|
249
|
+
});
|
|
250
|
+
return statement.limit === undefined ? sort : sort.topK(statement.limit);
|
|
251
|
+
}
|
|
252
|
+
if (statement.limit !== undefined) throw new Error('GPUSQL LIMIT currently requires ORDER BY');
|
|
253
|
+
if (query.predicates.length === 0) {
|
|
254
|
+
const firstColumn = frame.columnNames[0];
|
|
255
|
+
if (!firstColumn) throw new Error('GPUSQL SELECT requires at least one GPU source column');
|
|
256
|
+
query = query.filter(column(firstColumn).isValid().or(column(firstColumn).isNull()));
|
|
257
|
+
}
|
|
258
|
+
return query.select(selected);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function resolveGPUSQLProjectionName(
|
|
262
|
+
item: GPUSQLSelectItem,
|
|
263
|
+
resolve: (name: string) => string
|
|
264
|
+
): string {
|
|
265
|
+
if (item.expression?.kind !== 'column') {
|
|
266
|
+
throw new Error('GPUSQL grouped source expressions must reference the group key directly');
|
|
267
|
+
}
|
|
268
|
+
return resolve(item.expression.name);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function resolveGPUSQLColumn(name: string, qualifier: string, columns: readonly string[]): string {
|
|
272
|
+
const parts = name.split('.');
|
|
273
|
+
if (
|
|
274
|
+
parts.length > 2 ||
|
|
275
|
+
(parts.length === 2 && parts[0].toLowerCase() !== qualifier.toLowerCase())
|
|
276
|
+
) {
|
|
277
|
+
throw new Error(`GPUSQL column "${name}" has an unknown table qualifier`);
|
|
278
|
+
}
|
|
279
|
+
const requested = parts[parts.length - 1];
|
|
280
|
+
if (!columns.includes(requested)) throw new Error(`GPUSQL column "${name}" does not exist`);
|
|
281
|
+
return requested;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function resolveGPUSQLExpression(
|
|
285
|
+
expression: GPUExpressionNode,
|
|
286
|
+
resolve: (name: string) => string
|
|
287
|
+
): GPUExpressionNode {
|
|
288
|
+
switch (expression.kind) {
|
|
289
|
+
case 'column':
|
|
290
|
+
return {kind: 'column', name: resolve(expression.name)};
|
|
291
|
+
case 'unary':
|
|
292
|
+
return {...expression, operand: resolveGPUSQLExpression(expression.operand, resolve)};
|
|
293
|
+
case 'binary':
|
|
294
|
+
return {
|
|
295
|
+
...expression,
|
|
296
|
+
left: resolveGPUSQLExpression(expression.left, resolve),
|
|
297
|
+
right: resolveGPUSQLExpression(expression.right, resolve)
|
|
298
|
+
};
|
|
299
|
+
default:
|
|
300
|
+
return expression;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function parseGPUSQLStatement(
|
|
305
|
+
source: string,
|
|
306
|
+
parameters: GPUDataFrameQueryParameters
|
|
307
|
+
): GPUSQLStatement {
|
|
308
|
+
const statement = parseSQLSelectStatement(source, {
|
|
309
|
+
parseParameter: name => ({type: 'Identifier', name, gpuSQLParameter: true})
|
|
310
|
+
});
|
|
311
|
+
if (statement.offset !== undefined) throw new Error('GPUSQL does not support OFFSET');
|
|
312
|
+
if (statement.joins.length > 1) throw new Error('GPUSQL currently supports one JOIN');
|
|
313
|
+
if ((statement.groupBy?.length ?? 0) > 1) {
|
|
314
|
+
throw new Error('GPUSQL currently supports one GROUP BY column');
|
|
315
|
+
}
|
|
316
|
+
if ((statement.orderBy?.length ?? 0) > 1) {
|
|
317
|
+
throw new Error('GPUSQL currently supports one ORDER BY column');
|
|
318
|
+
}
|
|
319
|
+
if (statement.limit !== undefined && statement.limit > 0xffffffff) {
|
|
320
|
+
throw new Error('GPUSQL LIMIT must fit an unsigned 32-bit row count');
|
|
321
|
+
}
|
|
322
|
+
const items: GPUSQLSelectItem[] = statement.select?.map(({expression, alias}) => {
|
|
323
|
+
if (expression.type === 'CallExpression' && expression.callee.type === 'Identifier') {
|
|
324
|
+
const name = String(expression.callee['name']).toLowerCase();
|
|
325
|
+
const aggregate = name === 'avg' ? 'mean' : name;
|
|
326
|
+
switch (aggregate) {
|
|
327
|
+
case 'count':
|
|
328
|
+
case 'sum':
|
|
329
|
+
case 'min':
|
|
330
|
+
case 'max':
|
|
331
|
+
case 'mean': {
|
|
332
|
+
if (expression.arguments.length !== 1) {
|
|
333
|
+
throw new Error('GPUSQL aggregates require one argument');
|
|
334
|
+
}
|
|
335
|
+
const argument = expression.arguments[0] as Expression;
|
|
336
|
+
const wildcard = argument.type === 'Identifier' && argument['sqlWildcard'] === true;
|
|
337
|
+
if ((aggregate === 'count') !== wildcard) {
|
|
338
|
+
throw new Error('GPUSQL only permits COUNT(*) as a wildcard aggregation');
|
|
339
|
+
}
|
|
340
|
+
return {
|
|
341
|
+
aggregate,
|
|
342
|
+
...(wildcard ? {} : {aggregateColumn: readGPUSQLColumn(argument)}),
|
|
343
|
+
alias
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return {expression: lowerSQLExpression(expression, parameters), alias};
|
|
349
|
+
}) ?? [{star: true}];
|
|
350
|
+
const join = statement.joins[0];
|
|
351
|
+
if (statement.from.inputTable !== undefined || join?.table.inputTable !== undefined) {
|
|
352
|
+
throw new Error('GPUSQL does not support table functions');
|
|
353
|
+
}
|
|
354
|
+
let loweredJoin: GPUSQLStatement['join'];
|
|
355
|
+
if (join) {
|
|
356
|
+
if (join.unnest) throw new Error('GPUSQL does not support JOIN UNNEST');
|
|
357
|
+
if (join.type === 'cross') throw new Error('GPUSQL does not support CROSS JOIN');
|
|
358
|
+
if (join.on.type !== 'BinaryExpression' || join.on.operator !== '==') {
|
|
359
|
+
throw new Error('GPUSQL JOIN requires equality between two columns');
|
|
360
|
+
}
|
|
361
|
+
loweredJoin = {
|
|
362
|
+
type: join.type,
|
|
363
|
+
table: join.table.name,
|
|
364
|
+
alias: join.table.alias,
|
|
365
|
+
left: readGPUSQLColumn(join.on.left),
|
|
366
|
+
right: readGPUSQLColumn(join.on.right)
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
const sort = statement.orderBy?.[0];
|
|
370
|
+
return {
|
|
371
|
+
items,
|
|
372
|
+
table: statement.from.name,
|
|
373
|
+
alias: statement.from.alias,
|
|
374
|
+
join: loweredJoin,
|
|
375
|
+
predicate: statement.where && lowerSQLExpression(statement.where, parameters),
|
|
376
|
+
groupBy: statement.groupBy?.[0] && readGPUSQLColumn(statement.groupBy[0]),
|
|
377
|
+
orderBy: sort && {
|
|
378
|
+
column: readGPUSQLColumn(sort.expression),
|
|
379
|
+
direction: sort.direction === 'desc' ? 'descending' : 'ascending',
|
|
380
|
+
nulls: sort.nulls
|
|
381
|
+
},
|
|
382
|
+
limit: statement.limit
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Reads a source column name or a two-part qualified column reference. */
|
|
387
|
+
function readGPUSQLColumn(node: Extract<Expression, {type: 'BinaryExpression'}>['left']): string {
|
|
388
|
+
const expression = node as Expression;
|
|
389
|
+
if (
|
|
390
|
+
expression.type === 'Identifier' &&
|
|
391
|
+
!('gpuSQLParameter' in expression) &&
|
|
392
|
+
!expression.name.includes('.')
|
|
393
|
+
) {
|
|
394
|
+
return expression.name;
|
|
395
|
+
}
|
|
396
|
+
if (expression.type === 'MemberExpression' && !expression.computed) {
|
|
397
|
+
const object = expression.object as Expression;
|
|
398
|
+
const property = expression.property as Expression;
|
|
399
|
+
if (
|
|
400
|
+
object.type === 'Identifier' &&
|
|
401
|
+
property.type === 'Identifier' &&
|
|
402
|
+
!('gpuSQLParameter' in object) &&
|
|
403
|
+
!object.name.includes('.') &&
|
|
404
|
+
!property.name.includes('.')
|
|
405
|
+
) {
|
|
406
|
+
return `${object.name}.${property.name}`;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
throw new Error('GPUSQL expected a table or column identifier');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const SQL_BINARY_OPERATORS: Readonly<
|
|
413
|
+
Partial<Record<string, Extract<GPUExpressionNode, {kind: 'binary'}>['operator']>>
|
|
414
|
+
> = {
|
|
415
|
+
'||': 'or',
|
|
416
|
+
'&&': 'and',
|
|
417
|
+
'==': 'equal',
|
|
418
|
+
'!=': 'not-equal',
|
|
419
|
+
'>': 'greater-than',
|
|
420
|
+
'>=': 'greater-than-or-equal',
|
|
421
|
+
'<': 'less-than',
|
|
422
|
+
'<=': 'less-than-or-equal',
|
|
423
|
+
'+': 'add',
|
|
424
|
+
'-': 'subtract',
|
|
425
|
+
'*': 'multiply',
|
|
426
|
+
'/': 'divide'
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
function lowerSQLExpression(
|
|
430
|
+
node: Extract<Expression, {type: 'BinaryExpression'}>['left'],
|
|
431
|
+
parameters: GPUDataFrameQueryParameters
|
|
432
|
+
): GPUExpressionNode {
|
|
433
|
+
// math.gl types child nodes as generic expressions, though the SQL parser emits the AST union.
|
|
434
|
+
const expression = node as Expression;
|
|
435
|
+
switch (expression.type) {
|
|
436
|
+
case 'Identifier': {
|
|
437
|
+
if (!('gpuSQLParameter' in expression)) return column(readGPUSQLColumn(expression)).node;
|
|
438
|
+
const name = expression.name;
|
|
439
|
+
if (!Object.hasOwn(parameters, name)) {
|
|
440
|
+
throw new Error(`GPUSQL parameter ":${name}" requires an explicit default`);
|
|
441
|
+
}
|
|
442
|
+
return parameter(name, parameters[name]).node;
|
|
443
|
+
}
|
|
444
|
+
case 'MemberExpression':
|
|
445
|
+
return column(readGPUSQLColumn(expression)).node;
|
|
446
|
+
case 'Literal': {
|
|
447
|
+
const value = expression.value;
|
|
448
|
+
if (
|
|
449
|
+
value === null ||
|
|
450
|
+
typeof value === 'boolean' ||
|
|
451
|
+
(typeof value === 'number' && Number.isFinite(value))
|
|
452
|
+
) {
|
|
453
|
+
return literal(value).node;
|
|
454
|
+
}
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
case 'UnaryExpression':
|
|
458
|
+
if (expression.operator === '!' || expression.operator === '-') {
|
|
459
|
+
return {
|
|
460
|
+
kind: 'unary',
|
|
461
|
+
operator: expression.operator === '!' ? 'not' : 'negate',
|
|
462
|
+
operand: lowerSQLExpression(expression.argument, parameters)
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
break;
|
|
466
|
+
case 'BinaryExpression': {
|
|
467
|
+
const operator = SQL_BINARY_OPERATORS[expression.operator];
|
|
468
|
+
if (operator) {
|
|
469
|
+
return {
|
|
470
|
+
kind: 'binary',
|
|
471
|
+
operator,
|
|
472
|
+
left: lowerSQLExpression(expression.left, parameters),
|
|
473
|
+
right: lowerSQLExpression(expression.right, parameters)
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
case 'CallExpression':
|
|
479
|
+
if (
|
|
480
|
+
expression.arguments.length === 1 &&
|
|
481
|
+
(expression.callee['name'] === 'isNull' || expression.callee['name'] === 'isNotNull')
|
|
482
|
+
) {
|
|
483
|
+
return {
|
|
484
|
+
kind: 'unary',
|
|
485
|
+
operator: expression.callee['name'] === 'isNull' ? 'is-null' : 'is-valid',
|
|
486
|
+
operand: lowerSQLExpression(expression.arguments[0], parameters)
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
break;
|
|
490
|
+
default:
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
throw new Error(`GPUSQL does not support SQL expression "${expression.type}"`);
|
|
494
|
+
}
|
package/src/gpu-sql/index.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
5
|
+
export {GPUSQLContext, GPUSQLQuery} from './gpu-sql';
|
|
6
|
+
export type {GPUSQLQueryOptions, GPUSQLTables} from './gpu-sql';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {getGPUDataBufferProps} from '../../gpu-data/gpu-data-buffer-props';
|
|
5
6
|
import {Buffer, type BufferLayout, type VertexFormat} from '@luma.gl/core';
|
|
6
7
|
import {DynamicBuffer} from '@luma.gl/core/dynamic';
|
|
7
8
|
import type {GPUField, GPUSchema, GPUTypeMap} from './gpu-schema';
|
|
@@ -545,7 +546,7 @@ function createPackedGPURecordBatch(
|
|
|
545
546
|
0
|
|
546
547
|
);
|
|
547
548
|
const buffer = device.createBuffer({
|
|
548
|
-
|
|
549
|
+
...getGPUDataBufferProps(device, firstData.format === 'uint16' ? 'uint16' : 'uint32'),
|
|
549
550
|
byteLength
|
|
550
551
|
});
|
|
551
552
|
let destinationOffset = 0;
|
package/src/index.ts
CHANGED
|
@@ -53,6 +53,8 @@ export {
|
|
|
53
53
|
type GPUCommandGraphNodeConditionPreflight,
|
|
54
54
|
type GPUCommandGraphNodeEncodingStats,
|
|
55
55
|
type GPUCommandGraphNodePreflight,
|
|
56
|
+
type GPUCommandGraphCompileOptions,
|
|
57
|
+
type GPUCommandGraphKernelMetadata,
|
|
56
58
|
type GPUCommandGraphResourceSummary,
|
|
57
59
|
type GPUCommandGraphNodePublication,
|
|
58
60
|
type GPUCommandGraphNodeTiming,
|
|
@@ -193,6 +195,8 @@ export type {
|
|
|
193
195
|
} from './gpu-core/gpu-operation-contract';
|
|
194
196
|
|
|
195
197
|
export {GPUUploadOperation, GPUCopyOperation} from './gpu-core/gpu-transfer-operation';
|
|
198
|
+
export {GPUShaderPassOperation} from './gpu-core/gpu-shader-pass-operation';
|
|
199
|
+
export type {GPUShaderPassOperationProps} from './gpu-core/gpu-shader-pass-operation';
|
|
196
200
|
export type {
|
|
197
201
|
GPUUploadOperationProps,
|
|
198
202
|
GPUCopyOperationProps
|
|
@@ -206,3 +210,20 @@ export type {
|
|
|
206
210
|
GPUGraphOutput,
|
|
207
211
|
GPUGraphOutputs
|
|
208
212
|
} from './gpu-core/gpu-texture-plan';
|
|
213
|
+
|
|
214
|
+
export {GPUCPUOperation} from './gpu-core/gpu-cpu-operation';
|
|
215
|
+
export type {
|
|
216
|
+
GPUCPUOperationProps,
|
|
217
|
+
GPUCPUArray,
|
|
218
|
+
GPUCPUVector,
|
|
219
|
+
GPUCPUResult
|
|
220
|
+
} from './gpu-core/gpu-cpu-operation';
|
|
221
|
+
|
|
222
|
+
export {
|
|
223
|
+
GPUGraphGroupAggregation,
|
|
224
|
+
GPUGraphReduction
|
|
225
|
+
} from './gpu-core/gpu-semantic-aggregation-operation';
|
|
226
|
+
export type {
|
|
227
|
+
GPUGraphGroupAggregationProps,
|
|
228
|
+
GPUGraphReductionProps
|
|
229
|
+
} from './gpu-core/gpu-semantic-aggregation-operation';
|