@luma.gl/graph 10.0.0-alpha.9 → 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 +157 -280
- package/dist/gpu-sql/gpu-sql.d.ts +1 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +168 -291
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- 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/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 +179 -293
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +21 -0
package/src/gpu-sql/gpu-sql.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
// SPDX-FileComment: Independently implemented for WebGPU; inspired by relational SQL semantics.
|
|
5
5
|
|
|
6
|
+
import {parseSQLSelectStatement} from '@math.gl/sql/parser';
|
|
7
|
+
import type {Expression} from '@math.gl/sql/expressions';
|
|
6
8
|
import type {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
|
|
7
9
|
import {GPUDataFrame} from '../gpu-dataframe/gpu-data-frame';
|
|
8
10
|
import {GPUDataFrameQuery} from '../gpu-dataframe/gpu-data-frame-query';
|
|
@@ -19,20 +21,12 @@ import type {
|
|
|
19
21
|
GPUDataFrameQueryParameters
|
|
20
22
|
} from '../gpu-dataframe/gpu-query-compiler';
|
|
21
23
|
|
|
22
|
-
const MAXIMUM_SQL_LENGTH = 65_536;
|
|
23
|
-
const MAXIMUM_SQL_TOKENS = 4_096;
|
|
24
|
-
const MAXIMUM_EXPRESSION_DEPTH = 64;
|
|
25
|
-
|
|
26
24
|
/** Explicit GPU dataframe registrations; Arrow remains exclusively an adapter boundary. */
|
|
27
25
|
export type GPUSQLTables = Readonly<Record<string, GPUDataFrame>>;
|
|
28
26
|
|
|
29
27
|
/** Defaults for named SQL parameters such as `:minimumFare`; values remain caller-controlled. */
|
|
30
28
|
export type GPUSQLQueryOptions = Readonly<{parameters?: GPUDataFrameQueryParameters}>;
|
|
31
29
|
|
|
32
|
-
type GPUSQLToken = Readonly<{
|
|
33
|
-
kind: 'identifier' | 'number' | 'parameter' | 'symbol';
|
|
34
|
-
value: string;
|
|
35
|
-
}>;
|
|
36
30
|
type GPUSQLSelectItem = Readonly<{
|
|
37
31
|
expression?: GPUExpressionNode;
|
|
38
32
|
aggregate?: 'count' | 'sum' | 'min' | 'max' | 'mean';
|
|
@@ -97,7 +91,7 @@ type GPUSQLDynamicQuery = GPUSQLCompiledPlan & {
|
|
|
97
91
|
};
|
|
98
92
|
|
|
99
93
|
/**
|
|
100
|
-
*
|
|
94
|
+
* SQL frontend over explicitly registered, already GPU-resident dataframes.
|
|
101
95
|
*
|
|
102
96
|
* Parsing and planning never upload data, submit work, or read GPU buffers. Arrow upload/output
|
|
103
97
|
* remain explicit `@luma.gl/graph/arrow` operations around the shared GPU table execution core.
|
|
@@ -121,8 +115,7 @@ export class GPUSQLContext {
|
|
|
121
115
|
|
|
122
116
|
/** Parses and validates one immutable SELECT plan without touching registered GPU sources. */
|
|
123
117
|
query(source: string, options: GPUSQLQueryOptions = {}): GPUSQLQuery {
|
|
124
|
-
const
|
|
125
|
-
const statement = parser.parse();
|
|
118
|
+
const statement = parseGPUSQLStatement(source, options.parameters ?? {});
|
|
126
119
|
return new GPUSQLQuery(source, buildGPUSQLPlan(this.tables, statement));
|
|
127
120
|
}
|
|
128
121
|
}
|
|
@@ -245,15 +238,14 @@ function buildGPUSQLPlan(
|
|
|
245
238
|
}
|
|
246
239
|
|
|
247
240
|
if (statement.orderBy) {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
resolve(statement.orderBy.column);
|
|
241
|
+
const {column: requested, direction, nulls} = statement.orderBy;
|
|
242
|
+
const orderColumn = selected.includes(requested) ? requested : resolve(requested);
|
|
251
243
|
if (!selected.includes(orderColumn)) {
|
|
252
244
|
throw new Error('GPUSQL ORDER BY requires the sort column in the SELECT projection');
|
|
253
245
|
}
|
|
254
246
|
const sort = query.select(selected).sortByGlobal(orderColumn, {
|
|
255
|
-
direction
|
|
256
|
-
...(
|
|
247
|
+
direction,
|
|
248
|
+
...(nulls ? {nulls} : {})
|
|
257
249
|
});
|
|
258
250
|
return statement.limit === undefined ? sort : sort.topK(statement.limit);
|
|
259
251
|
}
|
|
@@ -285,9 +277,8 @@ function resolveGPUSQLColumn(name: string, qualifier: string, columns: readonly
|
|
|
285
277
|
throw new Error(`GPUSQL column "${name}" has an unknown table qualifier`);
|
|
286
278
|
}
|
|
287
279
|
const requested = parts[parts.length - 1];
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return matches[0];
|
|
280
|
+
if (!columns.includes(requested)) throw new Error(`GPUSQL column "${name}" does not exist`);
|
|
281
|
+
return requested;
|
|
291
282
|
}
|
|
292
283
|
|
|
293
284
|
function resolveGPUSQLExpression(
|
|
@@ -310,299 +301,194 @@ function resolveGPUSQLExpression(
|
|
|
310
301
|
}
|
|
311
302
|
}
|
|
312
303
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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');
|
|
321
315
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
+
}
|
|
350
346
|
}
|
|
351
|
-
orderBy = {column: sortColumn, direction, ...(nulls ? {nulls} : {})};
|
|
352
|
-
if (this.takeSymbol(',')) throw new Error('GPUSQL currently supports one ORDER BY column');
|
|
353
347
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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');
|
|
364
360
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
...(alias ? {alias} : {}),
|
|
372
|
-
...(join ? {join} : {}),
|
|
373
|
-
...(predicate ? {predicate} : {}),
|
|
374
|
-
...(groupBy ? {groupBy} : {}),
|
|
375
|
-
...(orderBy ? {orderBy} : {}),
|
|
376
|
-
...(limit !== undefined ? {limit} : {})
|
|
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)
|
|
377
367
|
};
|
|
378
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
|
+
}
|
|
379
385
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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;
|
|
383
399
|
if (
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
400
|
+
object.type === 'Identifier' &&
|
|
401
|
+
property.type === 'Identifier' &&
|
|
402
|
+
!('gpuSQLParameter' in object) &&
|
|
403
|
+
!object.name.includes('.') &&
|
|
404
|
+
!property.name.includes('.')
|
|
387
405
|
) {
|
|
388
|
-
|
|
389
|
-
this.expectSymbol('(');
|
|
390
|
-
const aggregate = token.value.toLowerCase();
|
|
391
|
-
const aggregateColumn = this.takeSymbol('*') ? undefined : this.parseIdentifier();
|
|
392
|
-
this.expectSymbol(')');
|
|
393
|
-
if (!aggregateColumn && aggregate !== 'count') {
|
|
394
|
-
throw new Error('GPUSQL only permits COUNT(*) as a wildcard aggregation');
|
|
395
|
-
}
|
|
396
|
-
if (aggregateColumn && aggregate === 'count') {
|
|
397
|
-
throw new Error('GPUSQL currently supports COUNT(*) but not nullable COUNT(column)');
|
|
398
|
-
}
|
|
399
|
-
return {
|
|
400
|
-
aggregate: aggregate === 'avg' ? 'mean' : (aggregate as GPUSQLSelectItem['aggregate']),
|
|
401
|
-
...(aggregateColumn ? {aggregateColumn} : {}),
|
|
402
|
-
...(this.takeKeyword('AS') ? {alias: this.parseIdentifier()} : {})
|
|
403
|
-
};
|
|
406
|
+
return `${object.name}.${property.name}`;
|
|
404
407
|
}
|
|
405
|
-
const expression = this.parseExpression(0);
|
|
406
|
-
return {
|
|
407
|
-
...(expression ? {expression} : {}),
|
|
408
|
-
...(this.takeKeyword('AS') ? {alias: this.parseIdentifier()} : {})
|
|
409
|
-
};
|
|
410
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
|
+
};
|
|
411
428
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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;
|
|
423
443
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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;
|
|
427
456
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const left = this.parseIdentifier();
|
|
432
|
-
this.expectSymbol('=');
|
|
433
|
-
const right = this.parseIdentifier();
|
|
434
|
-
return {type, table, ...(alias ? {alias} : {}), left, right};
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
private parseExpression(depth: number, minimumPrecedence = 0): GPUExpressionNode {
|
|
438
|
-
if (depth > MAXIMUM_EXPRESSION_DEPTH)
|
|
439
|
-
throw new Error('GPUSQL expression nesting exceeds its safe limit');
|
|
440
|
-
let expression = this.parseUnary(depth + 1);
|
|
441
|
-
while (true) {
|
|
442
|
-
if (minimumPrecedence <= 3 && this.takeKeyword('IS')) {
|
|
443
|
-
const negated = this.takeKeyword('NOT');
|
|
444
|
-
this.expectKeyword('NULL');
|
|
445
|
-
expression = {
|
|
457
|
+
case 'UnaryExpression':
|
|
458
|
+
if (expression.operator === '!' || expression.operator === '-') {
|
|
459
|
+
return {
|
|
446
460
|
kind: 'unary',
|
|
447
|
-
operator:
|
|
448
|
-
operand: expression
|
|
461
|
+
operator: expression.operator === '!' ? 'not' : 'negate',
|
|
462
|
+
operand: lowerSQLExpression(expression.argument, parameters)
|
|
449
463
|
};
|
|
450
|
-
continue;
|
|
451
464
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
return expression;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
private parseUnary(depth: number): GPUExpressionNode {
|
|
467
|
-
if (this.takeKeyword('NOT')) {
|
|
468
|
-
return {kind: 'unary', operator: 'not', operand: this.parseExpression(depth, 3)};
|
|
469
|
-
}
|
|
470
|
-
if (this.takeSymbol('-')) {
|
|
471
|
-
return {kind: 'unary', operator: 'negate', operand: this.parseUnary(depth + 1)};
|
|
472
|
-
}
|
|
473
|
-
if (this.takeSymbol('(')) {
|
|
474
|
-
const expression = this.parseExpression(depth + 1);
|
|
475
|
-
this.expectSymbol(')');
|
|
476
|
-
return expression;
|
|
477
|
-
}
|
|
478
|
-
const token = this.take();
|
|
479
|
-
if (!token) throw new Error('GPUSQL expected an expression');
|
|
480
|
-
if (token.kind === 'number') {
|
|
481
|
-
const value = Number(token.value);
|
|
482
|
-
if (!Number.isFinite(value)) throw new Error('GPUSQL numeric literals must be finite');
|
|
483
|
-
return literal(value).node;
|
|
484
|
-
}
|
|
485
|
-
if (token.kind === 'parameter') {
|
|
486
|
-
if (!Object.hasOwn(this.parameters, token.value)) {
|
|
487
|
-
throw new Error(`GPUSQL parameter ":${token.value}" requires an explicit default`);
|
|
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
|
+
};
|
|
488
475
|
}
|
|
489
|
-
|
|
476
|
+
break;
|
|
490
477
|
}
|
|
491
|
-
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
return token?.kind === 'identifier' &&
|
|
504
|
-
!/^(WHERE|GROUP|ORDER|LIMIT|JOIN|INNER|LEFT|OUTER|SEMI|ANTI|ON)$/i.test(token.value)
|
|
505
|
-
? this.parseIdentifier()
|
|
506
|
-
: undefined;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
private parseIdentifier(): string {
|
|
510
|
-
const token = this.take();
|
|
511
|
-
if (token?.kind !== 'identifier')
|
|
512
|
-
throw new Error('GPUSQL expected a table or column identifier');
|
|
513
|
-
return token.value;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
private expectKeyword(keyword: string): true {
|
|
517
|
-
if (!this.takeKeyword(keyword)) throw new Error(`GPUSQL expected ${keyword}`);
|
|
518
|
-
return true;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
private takeKeyword(keyword: string): boolean {
|
|
522
|
-
const token = this.peek();
|
|
523
|
-
if (token?.kind !== 'identifier' || token.value.toUpperCase() !== keyword) return false;
|
|
524
|
-
this.position++;
|
|
525
|
-
return true;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
private expectSymbol(symbol: string): void {
|
|
529
|
-
if (!this.takeSymbol(symbol)) throw new Error(`GPUSQL expected "${symbol}"`);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
private takeSymbol(symbol: string): boolean {
|
|
533
|
-
const token = this.peek();
|
|
534
|
-
if (token?.kind !== 'symbol' || token.value !== symbol) return false;
|
|
535
|
-
this.position++;
|
|
536
|
-
return true;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
private take(): GPUSQLToken | undefined {
|
|
540
|
-
const token = this.tokens[this.position];
|
|
541
|
-
if (token) this.position++;
|
|
542
|
-
return token;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
private peek(): GPUSQLToken | undefined {
|
|
546
|
-
return this.tokens[this.position];
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
function tokenizeGPUSQL(source: string): GPUSQLToken[] {
|
|
551
|
-
if (typeof source !== 'string' || source.length === 0 || source.length > MAXIMUM_SQL_LENGTH) {
|
|
552
|
-
throw new Error('GPUSQL requires a nonempty, safely bounded SELECT statement');
|
|
553
|
-
}
|
|
554
|
-
const expression =
|
|
555
|
-
/\s+|(?:--[^\n\r]*)|(?::([A-Za-z_][A-Za-z0-9_]*))|([A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)?)|(\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(<=|>=|<>|!=|[(),;*+\-/=<>])/gy;
|
|
556
|
-
const tokens: GPUSQLToken[] = [];
|
|
557
|
-
let cursor = 0;
|
|
558
|
-
while (cursor < source.length) {
|
|
559
|
-
expression.lastIndex = cursor;
|
|
560
|
-
const match = expression.exec(source);
|
|
561
|
-
if (!match) throw new Error(`GPUSQL contains an unsupported token at character ${cursor}`);
|
|
562
|
-
cursor = expression.lastIndex;
|
|
563
|
-
if (match[1]) tokens.push({kind: 'parameter', value: match[1]});
|
|
564
|
-
else if (match[2]) tokens.push({kind: 'identifier', value: match[2]});
|
|
565
|
-
else if (match[3]) tokens.push({kind: 'number', value: match[3]});
|
|
566
|
-
else if (match[4]) tokens.push({kind: 'symbol', value: match[4]});
|
|
567
|
-
if (tokens.length > MAXIMUM_SQL_TOKENS)
|
|
568
|
-
throw new Error('GPUSQL statement exceeds its safe token limit');
|
|
569
|
-
}
|
|
570
|
-
return tokens;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
function getGPUSQLBinaryOperator(value: string):
|
|
574
|
-
| Readonly<{
|
|
575
|
-
operator: Extract<GPUExpressionNode, {kind: 'binary'}>['operator'];
|
|
576
|
-
precedence: number;
|
|
577
|
-
}>
|
|
578
|
-
| undefined {
|
|
579
|
-
switch (value.toUpperCase()) {
|
|
580
|
-
case 'OR':
|
|
581
|
-
return {operator: 'or', precedence: 1};
|
|
582
|
-
case 'AND':
|
|
583
|
-
return {operator: 'and', precedence: 2};
|
|
584
|
-
case '=':
|
|
585
|
-
return {operator: 'equal', precedence: 3};
|
|
586
|
-
case '!=':
|
|
587
|
-
case '<>':
|
|
588
|
-
return {operator: 'not-equal', precedence: 3};
|
|
589
|
-
case '>':
|
|
590
|
-
return {operator: 'greater-than', precedence: 3};
|
|
591
|
-
case '>=':
|
|
592
|
-
return {operator: 'greater-than-or-equal', precedence: 3};
|
|
593
|
-
case '<':
|
|
594
|
-
return {operator: 'less-than', precedence: 3};
|
|
595
|
-
case '<=':
|
|
596
|
-
return {operator: 'less-than-or-equal', precedence: 3};
|
|
597
|
-
case '+':
|
|
598
|
-
return {operator: 'add', precedence: 4};
|
|
599
|
-
case '-':
|
|
600
|
-
return {operator: 'subtract', precedence: 4};
|
|
601
|
-
case '*':
|
|
602
|
-
return {operator: 'multiply', precedence: 5};
|
|
603
|
-
case '/':
|
|
604
|
-
return {operator: 'divide', precedence: 5};
|
|
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;
|
|
605
490
|
default:
|
|
606
|
-
|
|
491
|
+
break;
|
|
607
492
|
}
|
|
493
|
+
throw new Error(`GPUSQL does not support SQL expression "${expression.type}"`);
|
|
608
494
|
}
|
|
@@ -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';
|