@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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {getLeafLayoutInfo, makeShaderBlockLayout} from '@luma.gl/shaders/types';
|
|
6
|
+
import {getGPUVectorFormatInfo} from './gpu-vector-format';
|
|
7
|
+
|
|
8
|
+
/** Scalar formats with matching 32-bit WGSL component representations. */
|
|
9
|
+
export type GPUVectorWGSLScalarFormat = 'float32' | 'sint32' | 'uint32';
|
|
10
|
+
|
|
11
|
+
/** Packed 32-bit numeric formats with a corresponding WGSL value type. */
|
|
12
|
+
export type GPUVectorWGSLFormat =
|
|
13
|
+
| GPUVectorWGSLScalarFormat
|
|
14
|
+
| `${GPUVectorWGSLScalarFormat}x${2 | 3 | 4}`;
|
|
15
|
+
|
|
16
|
+
/** Packed row metadata and the layout of the corresponding native WGSL storage value. */
|
|
17
|
+
export type GPUVectorWGSLLayout = {
|
|
18
|
+
/** The packed GPUVector format. */
|
|
19
|
+
format: GPUVectorWGSLFormat;
|
|
20
|
+
/** Number of scalar components in a row. */
|
|
21
|
+
components: 1 | 2 | 3 | 4;
|
|
22
|
+
/** GPUVector format of an individual component. */
|
|
23
|
+
componentType: GPUVectorWGSLScalarFormat;
|
|
24
|
+
/** WGSL type of an individual component. */
|
|
25
|
+
scalarType: 'f32' | 'i32' | 'u32';
|
|
26
|
+
/** WGSL scalar or vector type for one row. */
|
|
27
|
+
shaderType: 'f32' | 'i32' | 'u32' | `vec${2 | 3 | 4}<${'f32' | 'i32' | 'u32'}>`;
|
|
28
|
+
/** Number of bytes occupied by the components of one row. */
|
|
29
|
+
byteLength: number;
|
|
30
|
+
/** Distance in bytes between rows in a tightly packed GPUVector. */
|
|
31
|
+
packedByteStride: number;
|
|
32
|
+
/** Required byte alignment of the value in a native WGSL storage buffer. */
|
|
33
|
+
storageAlignment: number;
|
|
34
|
+
/** Distance in bytes between elements in a native WGSL storage array of this value type. */
|
|
35
|
+
nativeArrayByteStride: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Describes packed GPUVector rows and the corresponding native WGSL storage array.
|
|
40
|
+
*
|
|
41
|
+
* @param format - Packed 32-bit scalar or vector format.
|
|
42
|
+
* @returns Layout metadata in bytes. The helper does not allocate or modify storage.
|
|
43
|
+
* @throws If the format has no supported 32-bit WGSL representation.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const layout = getGPUVectorWGSLLayout('float32x3');
|
|
48
|
+
* layout.packedByteStride; // 12
|
|
49
|
+
* layout.nativeArrayByteStride; // 16
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function getGPUVectorWGSLLayout(format: GPUVectorWGSLFormat): GPUVectorWGSLLayout {
|
|
53
|
+
const {components, signedDataType, primitiveType, byteLength, elementFormat, normalized} =
|
|
54
|
+
getGPUVectorFormatInfo(format);
|
|
55
|
+
if (
|
|
56
|
+
normalized ||
|
|
57
|
+
elementFormat !== format ||
|
|
58
|
+
(signedDataType !== 'float32' && signedDataType !== 'sint32' && signedDataType !== 'uint32') ||
|
|
59
|
+
primitiveType === 'f16'
|
|
60
|
+
) {
|
|
61
|
+
throw new Error('Expected a packed 32-bit numeric vector format');
|
|
62
|
+
}
|
|
63
|
+
const scalarType = primitiveType;
|
|
64
|
+
const shaderType = components === 1 ? scalarType : (`vec${components}<${scalarType}>` as const);
|
|
65
|
+
const layout = 'wgsl-storage';
|
|
66
|
+
const {alignment} = getLeafLayoutInfo(shaderType, layout);
|
|
67
|
+
const arrayLayout = makeShaderBlockLayout({values: [shaderType, 2]}, {layout});
|
|
68
|
+
return {
|
|
69
|
+
format,
|
|
70
|
+
components,
|
|
71
|
+
componentType: signedDataType,
|
|
72
|
+
scalarType,
|
|
73
|
+
shaderType,
|
|
74
|
+
byteLength,
|
|
75
|
+
packedByteStride: byteLength,
|
|
76
|
+
storageAlignment: alignment * Uint32Array.BYTES_PER_ELEMENT,
|
|
77
|
+
nativeArrayByteStride: arrayLayout.byteLength / 2
|
|
78
|
+
};
|
|
79
|
+
}
|
package/src/gpu-data/index.ts
CHANGED
|
@@ -68,3 +68,18 @@ export {
|
|
|
68
68
|
export {getGPUVectorChunks, type GPUVectorChunk} from './gpu-vector-chunks';
|
|
69
69
|
|
|
70
70
|
export type {GPUVectorLike, GPUVectorInput} from './gpu-vector-like';
|
|
71
|
+
|
|
72
|
+
export {CPUData, type CPUDataProps} from './cpu-data';
|
|
73
|
+
export {CPUVector, type CPUVectorProps} from './cpu-vector';
|
|
74
|
+
|
|
75
|
+
export {makeGPUVectorFromCPUVector, makeCPUVectorFromGPUVector} from './cpu-gpu-vector-transfer';
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
getGPUVectorWGSLLayout,
|
|
79
|
+
type GPUVectorWGSLFormat,
|
|
80
|
+
type GPUVectorWGSLLayout,
|
|
81
|
+
type GPUVectorWGSLScalarFormat
|
|
82
|
+
} from './gpu-vector-wgsl-layout';
|
|
83
|
+
|
|
84
|
+
export {convertCPUColors, resolveColorOutputFormat} from './color-conversion';
|
|
85
|
+
export type {ColorOutputFormat, ColorConversionOptions} from './color-conversion';
|
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
import type {GPUTypeMap} from '@luma.gl/graph/gpu-tables';
|
|
7
7
|
import type {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
|
|
8
8
|
import type {GPUDataFrame} from './gpu-data-frame';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getGPUExpressionColumnNames,
|
|
11
|
+
GPUExpression,
|
|
12
|
+
isBooleanExpressionNode,
|
|
13
|
+
type GPUExpressionNode
|
|
14
|
+
} from './gpu-expression';
|
|
10
15
|
import {
|
|
11
16
|
GPUDataFrameAggregationQuery,
|
|
12
17
|
type GPUDataFrameGlobalAggregationDefinitions,
|
|
@@ -434,28 +439,3 @@ function isNumericExpressionNode(node: GPUExpressionNode): boolean {
|
|
|
434
439
|
return false;
|
|
435
440
|
}
|
|
436
441
|
}
|
|
437
|
-
|
|
438
|
-
function isBooleanExpressionNode(node: GPUExpressionNode): boolean {
|
|
439
|
-
switch (node.kind) {
|
|
440
|
-
case 'column':
|
|
441
|
-
return false;
|
|
442
|
-
case 'literal':
|
|
443
|
-
case 'parameter':
|
|
444
|
-
return typeof node.value === 'boolean';
|
|
445
|
-
case 'unary':
|
|
446
|
-
return node.operator === 'not' || node.operator === 'is-valid' || node.operator === 'is-null';
|
|
447
|
-
case 'binary':
|
|
448
|
-
return (
|
|
449
|
-
node.operator === 'equal' ||
|
|
450
|
-
node.operator === 'not-equal' ||
|
|
451
|
-
node.operator === 'greater-than' ||
|
|
452
|
-
node.operator === 'greater-than-or-equal' ||
|
|
453
|
-
node.operator === 'less-than' ||
|
|
454
|
-
node.operator === 'less-than-or-equal' ||
|
|
455
|
-
node.operator === 'and' ||
|
|
456
|
-
node.operator === 'or'
|
|
457
|
-
);
|
|
458
|
-
default:
|
|
459
|
-
return false;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
// SPDX-FileComment: Independently implemented for WebGPU; inspired by NVIDIA RAPIDS cuDF.
|
|
5
5
|
|
|
6
|
+
import {
|
|
7
|
+
getGPUVectorWGSLLayout,
|
|
8
|
+
type GPUVectorWGSLFormat as GPUExpressionNumericFormat
|
|
9
|
+
} from '@luma.gl/graph/gpu-data';
|
|
10
|
+
|
|
11
|
+
/** Numeric values, including fixed-width vectors. */
|
|
12
|
+
export type GPUExpressionNumericValue = number | readonly number[] | null;
|
|
13
|
+
|
|
6
14
|
/** Portable scalar values accepted by GPU-resident dataframe expressions. */
|
|
7
15
|
export type GPUExpressionValue = number | boolean | null;
|
|
8
16
|
|
|
@@ -26,6 +34,12 @@ export type GPUExpressionBinaryOperator =
|
|
|
26
34
|
|
|
27
35
|
/** Immutable, renderer-independent dataframe expression syntax. */
|
|
28
36
|
export type GPUExpressionNode =
|
|
37
|
+
| Readonly<{
|
|
38
|
+
kind: 'vector';
|
|
39
|
+
format: GPUExpressionNumericFormat;
|
|
40
|
+
components: readonly GPUExpressionNode[];
|
|
41
|
+
}>
|
|
42
|
+
| Readonly<{kind: 'cast'; format: GPUExpressionNumericFormat; operand: GPUExpressionNode}>
|
|
29
43
|
| Readonly<{kind: 'column'; name: string}>
|
|
30
44
|
| Readonly<{kind: 'literal'; value: GPUExpressionValue}>
|
|
31
45
|
| Readonly<{kind: 'parameter'; name: string; value: GPUExpressionValue}>
|
|
@@ -236,6 +250,18 @@ export function getGPUExpressionColumnNames(expression: GPUExpression<any, strin
|
|
|
236
250
|
/** Clones every closed node so caller-owned child objects cannot alter an immutable query plan. */
|
|
237
251
|
function cloneFrozenGPUExpressionNode(node: GPUExpressionNode): GPUExpressionNode {
|
|
238
252
|
switch (node.kind) {
|
|
253
|
+
case 'vector':
|
|
254
|
+
return Object.freeze({
|
|
255
|
+
kind: 'vector',
|
|
256
|
+
format: node.format,
|
|
257
|
+
components: Object.freeze(node.components.map(cloneFrozenGPUExpressionNode))
|
|
258
|
+
});
|
|
259
|
+
case 'cast':
|
|
260
|
+
return Object.freeze({
|
|
261
|
+
kind: 'cast',
|
|
262
|
+
format: node.format,
|
|
263
|
+
operand: cloneFrozenGPUExpressionNode(node.operand)
|
|
264
|
+
});
|
|
239
265
|
case 'column':
|
|
240
266
|
return Object.freeze({kind: 'column', name: node.name});
|
|
241
267
|
case 'literal':
|
|
@@ -262,6 +288,13 @@ function cloneFrozenGPUExpressionNode(node: GPUExpressionNode): GPUExpressionNod
|
|
|
262
288
|
|
|
263
289
|
function collectGPUExpressionColumnNames(node: GPUExpressionNode, columnNames: Set<string>): void {
|
|
264
290
|
switch (node.kind) {
|
|
291
|
+
case 'vector':
|
|
292
|
+
for (const component of node.components)
|
|
293
|
+
collectGPUExpressionColumnNames(component, columnNames);
|
|
294
|
+
break;
|
|
295
|
+
case 'cast':
|
|
296
|
+
collectGPUExpressionColumnNames(node.operand, columnNames);
|
|
297
|
+
break;
|
|
265
298
|
case 'column':
|
|
266
299
|
columnNames.add(node.name);
|
|
267
300
|
break;
|
|
@@ -307,3 +340,105 @@ function assertValidExpressionValue(
|
|
|
307
340
|
throw new Error(`GPUDataFrame ${kind} values must be finite numbers, booleans, or null`);
|
|
308
341
|
}
|
|
309
342
|
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Constructs a fixed-width numeric vector. A null component makes the whole row null.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
* ```ts
|
|
349
|
+
* const position = vector('float32x3', [column('x'), column('y'), column('z')]);
|
|
350
|
+
* ```
|
|
351
|
+
*/
|
|
352
|
+
export function vector<Columns extends string>(
|
|
353
|
+
format: GPUExpressionNumericFormat,
|
|
354
|
+
components: readonly GPUExpression<number | null, Columns>[]
|
|
355
|
+
): GPUExpression<readonly number[] | null, Columns> {
|
|
356
|
+
const width = getGPUVectorWGSLLayout(format).components;
|
|
357
|
+
if (![2, 3, 4].includes(width) || components.length !== width)
|
|
358
|
+
throw new Error('Vector width must match its format');
|
|
359
|
+
return new GPUExpression({
|
|
360
|
+
kind: 'vector',
|
|
361
|
+
format,
|
|
362
|
+
components: components.map(component => component.node)
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Converts a numeric expression to the requested format while preserving its width.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* const position = vector('sint32x2', [column('x'), column('y')]);
|
|
372
|
+
* const floatPosition = cast(position, 'float32x2');
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
export function cast<Value extends GPUExpressionNumericValue, Columns extends string>(
|
|
376
|
+
expression: GPUExpression<Value, Columns>,
|
|
377
|
+
format: GPUExpressionNumericFormat
|
|
378
|
+
): GPUExpression<Value, Columns> {
|
|
379
|
+
return new GPUExpression(makeGPUCastNode(expression.node, format));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export function makeGPUCastNode<Format extends GPUExpressionNumericFormat>(
|
|
383
|
+
operand: GPUExpressionNode,
|
|
384
|
+
format: Format
|
|
385
|
+
): {kind: 'cast'; format: Format; operand: GPUExpressionNode} {
|
|
386
|
+
const width = getGPUVectorWGSLLayout(format).components;
|
|
387
|
+
const operandWidth = getKnownExpressionWidth(operand);
|
|
388
|
+
if (operandWidth !== undefined && operandWidth !== width) {
|
|
389
|
+
throw new Error('Numeric casts must preserve width');
|
|
390
|
+
}
|
|
391
|
+
return {kind: 'cast', format, operand};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function getKnownExpressionWidth(node: GPUExpressionNode): number | undefined {
|
|
395
|
+
switch (node.kind) {
|
|
396
|
+
case 'vector':
|
|
397
|
+
case 'cast':
|
|
398
|
+
return getGPUVectorWGSLLayout(node.format).components;
|
|
399
|
+
case 'literal':
|
|
400
|
+
case 'parameter':
|
|
401
|
+
return node.value === null ? undefined : 1;
|
|
402
|
+
case 'unary':
|
|
403
|
+
return node.operator === 'negate' ? getKnownExpressionWidth(node.operand) : 1;
|
|
404
|
+
case 'binary': {
|
|
405
|
+
if (isBooleanExpressionNode(node)) {
|
|
406
|
+
return 1;
|
|
407
|
+
}
|
|
408
|
+
const leftWidth = getKnownExpressionWidth(node.left);
|
|
409
|
+
const rightWidth = getKnownExpressionWidth(node.right);
|
|
410
|
+
if (leftWidth !== undefined && rightWidth !== undefined && leftWidth !== rightWidth) {
|
|
411
|
+
throw new Error('Numeric arithmetic requires matching widths');
|
|
412
|
+
}
|
|
413
|
+
return leftWidth ?? rightWidth;
|
|
414
|
+
}
|
|
415
|
+
case 'column':
|
|
416
|
+
return undefined;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Checks whether the expression produces a boolean result. */
|
|
421
|
+
export function isBooleanExpressionNode(node: GPUExpressionNode): boolean {
|
|
422
|
+
switch (node.kind) {
|
|
423
|
+
case 'column':
|
|
424
|
+
return false;
|
|
425
|
+
case 'literal':
|
|
426
|
+
case 'parameter':
|
|
427
|
+
return typeof node.value === 'boolean';
|
|
428
|
+
case 'unary':
|
|
429
|
+
return node.operator === 'not' || node.operator === 'is-valid' || node.operator === 'is-null';
|
|
430
|
+
case 'binary':
|
|
431
|
+
return (
|
|
432
|
+
node.operator === 'equal' ||
|
|
433
|
+
node.operator === 'not-equal' ||
|
|
434
|
+
node.operator === 'greater-than' ||
|
|
435
|
+
node.operator === 'greater-than-or-equal' ||
|
|
436
|
+
node.operator === 'less-than' ||
|
|
437
|
+
node.operator === 'less-than-or-equal' ||
|
|
438
|
+
node.operator === 'and' ||
|
|
439
|
+
node.operator === 'or'
|
|
440
|
+
);
|
|
441
|
+
default:
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -63,3 +63,14 @@ export {CompiledGPUDataFrameHistogram} from './gpu-histogram-compiler';
|
|
|
63
63
|
export {CompiledGPUDataFrameSort} from './gpu-sort-compiler';
|
|
64
64
|
export {CompiledGPUDataFrameGlobalSort} from './gpu-global-sort-compiler';
|
|
65
65
|
export {CompiledGPUDataFrameJoin, CompiledGPUDataFrameLookup} from './gpu-join-compiler';
|
|
66
|
+
|
|
67
|
+
export {vector, cast} from './gpu-expression';
|
|
68
|
+
export type {GPUExpressionNumericValue} from './gpu-expression';
|
|
69
|
+
export type {
|
|
70
|
+
GPUVectorWGSLFormat as GPUExpressionNumericFormat,
|
|
71
|
+
GPUVectorWGSLScalarFormat as GPUExpressionScalarFormat
|
|
72
|
+
} from '@luma.gl/graph/gpu-data';
|
|
73
|
+
export {
|
|
74
|
+
makeGPUExpressionFromPortableAST,
|
|
75
|
+
makeGPUPredicateFromPortableAST
|
|
76
|
+
} from './portable-expression';
|
|
@@ -0,0 +1,117 @@
|
|
|
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 NVIDIA RAPIDS cuDF.
|
|
5
|
+
|
|
6
|
+
import {validateExpressionAST, type Expression} from '@math.gl/sql/expressions';
|
|
7
|
+
import {
|
|
8
|
+
GPUExpression,
|
|
9
|
+
isBooleanExpressionNode,
|
|
10
|
+
makeGPUCastNode,
|
|
11
|
+
type GPUExpressionNode,
|
|
12
|
+
type GPUExpressionBinaryOperator,
|
|
13
|
+
type GPUExpressionNumericValue
|
|
14
|
+
} from './gpu-expression';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Converts the supported subset of math.gl's portable AST into a DataFrame expression.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import {parseSQLExpression} from '@math.gl/sql/parser';
|
|
22
|
+
*
|
|
23
|
+
* const position = makeGPUExpressionFromPortableAST(
|
|
24
|
+
* parseSQLExpression('ARRAY[x,y,z]::REAL[3]')
|
|
25
|
+
* );
|
|
26
|
+
* const query = frame.withColumn('position', position, {format: 'float32x3'});
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function makeGPUExpressionFromPortableAST(
|
|
30
|
+
expression: Expression
|
|
31
|
+
): GPUExpression<GPUExpressionNumericValue | boolean> {
|
|
32
|
+
return new GPUExpression(convertPortableExpression(expression));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Converts a portable AST and requires a boolean result for use as a DataFrame predicate. */
|
|
36
|
+
export function makeGPUPredicateFromPortableAST(expression: Expression): GPUExpression<boolean> {
|
|
37
|
+
const node = convertPortableExpression(expression);
|
|
38
|
+
if (!isBooleanExpressionNode(node)) {
|
|
39
|
+
throw new Error('Expected a boolean portable GPU dataframe expression');
|
|
40
|
+
}
|
|
41
|
+
return new GPUExpression(node);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function convertPortableExpression(expression: Expression): GPUExpressionNode {
|
|
45
|
+
validateExpressionAST(expression);
|
|
46
|
+
return convert(expression);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const binaryOperators: Readonly<Record<string, GPUExpressionBinaryOperator>> = {
|
|
50
|
+
'+': 'add',
|
|
51
|
+
'-': 'subtract',
|
|
52
|
+
'*': 'multiply',
|
|
53
|
+
'/': 'divide',
|
|
54
|
+
'==': 'equal',
|
|
55
|
+
'===': 'equal',
|
|
56
|
+
'!=': 'not-equal',
|
|
57
|
+
'!==': 'not-equal',
|
|
58
|
+
'>': 'greater-than',
|
|
59
|
+
'>=': 'greater-than-or-equal',
|
|
60
|
+
'<': 'less-than',
|
|
61
|
+
'<=': 'less-than-or-equal',
|
|
62
|
+
'&&': 'and',
|
|
63
|
+
'||': 'or'
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** Lowers one validated portable node and rejects unsupported operations. */
|
|
67
|
+
function convert(expression: Expression): GPUExpressionNode {
|
|
68
|
+
// math.gl's public parser type includes nonportable nodes; validation above narrows at runtime.
|
|
69
|
+
const node = expression as any;
|
|
70
|
+
switch (node.type) {
|
|
71
|
+
case 'Identifier':
|
|
72
|
+
return {kind: 'column', name: node.name};
|
|
73
|
+
case 'Literal':
|
|
74
|
+
if (
|
|
75
|
+
node.value === null ||
|
|
76
|
+
typeof node.value === 'boolean' ||
|
|
77
|
+
(typeof node.value === 'number' && Number.isFinite(node.value))
|
|
78
|
+
)
|
|
79
|
+
return {kind: 'literal', value: node.value};
|
|
80
|
+
break;
|
|
81
|
+
case 'UnaryExpression':
|
|
82
|
+
if (node.operator === '-' || node.operator === '!')
|
|
83
|
+
return {
|
|
84
|
+
kind: 'unary',
|
|
85
|
+
operator: node.operator === '-' ? 'negate' : 'not',
|
|
86
|
+
operand: convert(node.argument)
|
|
87
|
+
};
|
|
88
|
+
break;
|
|
89
|
+
case 'BinaryExpression':
|
|
90
|
+
case 'LogicalExpression': {
|
|
91
|
+
const operator = binaryOperators[node.operator];
|
|
92
|
+
if (operator)
|
|
93
|
+
return {kind: 'binary', operator, left: convert(node.left), right: convert(node.right)};
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 'CallExpression': {
|
|
97
|
+
const name = node.callee.name;
|
|
98
|
+
if (name === 'array_float32' && [2, 3, 4].includes(node.arguments.length)) {
|
|
99
|
+
return {
|
|
100
|
+
kind: 'vector',
|
|
101
|
+
format: `float32x${node.arguments.length}` as 'float32x2' | 'float32x3' | 'float32x4',
|
|
102
|
+
components: node.arguments.map(convert)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (name === 'cast' && node.arguments.length === 2 && node.arguments[1].type === 'Literal') {
|
|
106
|
+
const target = node.arguments[1].value;
|
|
107
|
+
if (target === 'float32' || target === 'int32')
|
|
108
|
+
return makeGPUCastNode(
|
|
109
|
+
convert(node.arguments[0]),
|
|
110
|
+
target === 'int32' ? 'sint32' : 'float32'
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
throw new Error('Unsupported portable GPU dataframe expression');
|
|
117
|
+
}
|
package/src/gpu-graph/index.ts
CHANGED
|
@@ -74,3 +74,20 @@ export type {
|
|
|
74
74
|
} from '../gpu-core/gpu-operation-contract';
|
|
75
75
|
|
|
76
76
|
export {CompiledGPUGraph, PreparedGPUGraphExecution} from '../gpu-core/compiled-gpu-graph';
|
|
77
|
+
|
|
78
|
+
export {GPUCPUOperation} from '../gpu-core/gpu-cpu-operation';
|
|
79
|
+
export type {
|
|
80
|
+
GPUCPUOperationProps,
|
|
81
|
+
GPUCPUArray,
|
|
82
|
+
GPUCPUVector,
|
|
83
|
+
GPUCPUResult
|
|
84
|
+
} from '../gpu-core/gpu-cpu-operation';
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
GPUGraphGroupAggregation,
|
|
88
|
+
GPUGraphReduction
|
|
89
|
+
} from '../gpu-core/gpu-semantic-aggregation-operation';
|
|
90
|
+
export type {
|
|
91
|
+
GPUGraphGroupAggregationProps,
|
|
92
|
+
GPUGraphReductionProps
|
|
93
|
+
} from '../gpu-core/gpu-semantic-aggregation-operation';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
// SPDX-FileComment: Independently implemented for WebGPU; inspired by NVIDIA RAPIDS cuGraph.
|
|
5
5
|
|
|
6
|
+
import {GPU_GRID_COORDINATE_WGSL} from '../gpu-core/gpu-grid-coordinate';
|
|
6
7
|
import {addGPUCommandNodes} from '@luma.gl/graph/gpu-core';
|
|
7
8
|
import {type Binding} from '@luma.gl/core';
|
|
8
9
|
import {Kernel} from '../execution/compute/kernel';
|
|
@@ -423,21 +424,7 @@ const CELL_CENTERS_OFFSET: u32 = ${getViewElementOffset(state.cellCenters)}u;
|
|
|
423
424
|
const VALIDITY_OFFSET: u32 = ${getViewElementOffset(state.validity)}u;
|
|
424
425
|
${getBindingDeclarations(bindings)}
|
|
425
426
|
|
|
426
|
-
|
|
427
|
-
if (maximum == minimum || value == minimum) { return 0u; }
|
|
428
|
-
if (value == maximum) { return size - 1u; }
|
|
429
|
-
if (minimum < 0.0 && maximum > 0.0) {
|
|
430
|
-
let scale = max(abs(minimum), abs(maximum));
|
|
431
|
-
let scaledValue = value / scale;
|
|
432
|
-
let scaledMinimum = minimum / scale;
|
|
433
|
-
let scaledMaximum = maximum / scale;
|
|
434
|
-
return min(
|
|
435
|
-
u32((scaledValue - scaledMinimum) / (scaledMaximum - scaledMinimum) * f32(size)),
|
|
436
|
-
size - 1u
|
|
437
|
-
);
|
|
438
|
-
}
|
|
439
|
-
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
440
|
-
}
|
|
427
|
+
${GPU_GRID_COORDINATE_WGSL}
|
|
441
428
|
|
|
442
429
|
fn readPosition(vertex: u32) -> vec2<f32> {
|
|
443
430
|
let positionOffset = POSITIONS_OFFSET + vertex * 2u;
|