@luma.gl/graph 10.0.0-beta.1 → 10.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.cjs +22 -9
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts +11 -2
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js +27 -10
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.cjs +24 -13
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts +9 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js +41 -14
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +24 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +10 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +29 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +2 -0
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +1 -1
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +1 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/experimental-models.cjs +21 -0
- package/dist/experimental-models.d.ts +2 -0
- package/dist/experimental-models.d.ts.map +1 -0
- package/dist/experimental-models.js +5 -0
- package/dist/experimental-models.js.map +1 -0
- package/dist/experimental-simulation.cjs +21 -0
- package/dist/experimental-simulation.d.ts +2 -0
- package/dist/experimental-simulation.d.ts.map +1 -0
- package/dist/experimental-simulation.js +5 -0
- package/dist/experimental-simulation.js.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.cjs +63 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts +32 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.js +56 -0
- package/dist/gpu-core/gpu-bvh-bounds.js.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.cjs +92 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts +41 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js +85 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js.map +1 -0
- package/dist/gpu-core/index.cjs +6 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +4 -0
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +2 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.cjs +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +60 -15
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts +13 -2
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +69 -18
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.cjs +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.d.ts +10 -0
- package/dist/gpu-dataframe/gpu-data-frame.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.js +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.cjs +157 -25
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts +9 -5
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.js +184 -25
- package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +100 -8
- package/dist/gpu-dataframe/gpu-expression.d.ts +35 -3
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +92 -6
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +2 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +4 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +4 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts +5 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js +11 -5
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +136 -99
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +7 -2
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js +135 -97
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +286 -49
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts +17 -2
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +290 -40
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.cjs +10 -8
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts +7 -1
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.js +14 -8
- package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.cjs +8 -8
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.js +9 -9
- package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.cjs +38 -10
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts +3 -2
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.js +37 -9
- package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-query.cjs +13 -5
- package/dist/gpu-dataframe/gpu-sort-query.d.ts +4 -1
- package/dist/gpu-dataframe/gpu-sort-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-query.js +14 -5
- package/dist/gpu-dataframe/gpu-sort-query.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 +3 -3
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -2
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +68 -4
- package/dist/gpu-dataframe/portable-expression.d.ts +3 -1
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/portable-expression.js +69 -5
- package/dist/gpu-dataframe/portable-expression.js.map +1 -1
- package/dist/gpu-dggs-benchmarks.cjs +21 -0
- package/dist/gpu-dggs-benchmarks.d.ts +2 -0
- package/dist/gpu-dggs-benchmarks.d.ts.map +1 -0
- package/dist/gpu-dggs-benchmarks.js +5 -0
- package/dist/gpu-dggs-benchmarks.js.map +1 -0
- package/dist/gpu-graph-algorithms-benchmarks.cjs +21 -0
- package/dist/gpu-graph-algorithms-benchmarks.d.ts +2 -0
- package/dist/gpu-graph-algorithms-benchmarks.d.ts.map +1 -0
- package/dist/gpu-graph-algorithms-benchmarks.js +5 -0
- package/dist/gpu-graph-algorithms-benchmarks.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-batch.cjs +11 -10
- package/dist/gpu-physics/gpu-physics-batch.d.ts +1 -0
- package/dist/gpu-physics/gpu-physics-batch.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-batch.js +14 -10
- package/dist/gpu-physics/gpu-physics-batch.js.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.cjs +116 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts +42 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts.map +1 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.js +90 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-ensemble.cjs +105 -8
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts +40 -2
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.js +109 -6
- package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +737 -213
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +111 -5
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +842 -231
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs +23 -2
- package/dist/gpu-physics/index.cjs.map +3 -3
- package/dist/gpu-physics/index.d.ts +10 -3
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/index.js +6 -1
- package/dist/gpu-physics/index.js.map +1 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.cjs +21 -8
- package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.js +15 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.cjs +10 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.js +15 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.cjs +15 -2
- package/dist/gpu-physics/rigid-body-capacity.d.ts +3 -1
- package/dist/gpu-physics/rigid-body-capacity.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.js +21 -2
- package/dist/gpu-physics/rigid-body-capacity.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cast-index.cjs +192 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts +44 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-cast-index.js +194 -0
- package/dist/gpu-physics/rigid-body-cast-index.js.map +1 -0
- package/dist/gpu-physics/rigid-body-convex-shaders.cjs +3 -2
- package/dist/gpu-physics/rigid-body-convex-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-convex-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-convex-shaders.js +3 -2
- package/dist/gpu-physics/rigid-body-convex-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.cjs +4 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.js +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.cjs +45 -14
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.js +53 -14
- package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.cjs +14 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts +5 -0
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js +17 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +40 -8
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js +49 -9
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js.map +1 -1
- package/dist/gpu-physics/rigid-body-event-compaction.cjs +184 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js +168 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.cjs +51 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts +33 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js +34 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js.map +1 -0
- package/dist/gpu-physics/rigid-body-events.cjs +57 -25
- package/dist/gpu-physics/rigid-body-events.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-events.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-events.js +60 -25
- package/dist/gpu-physics/rigid-body-events.js.map +1 -1
- package/dist/gpu-physics/rigid-body-geometry.cjs +41 -4
- package/dist/gpu-physics/rigid-body-geometry.d.ts +10 -1
- package/dist/gpu-physics/rigid-body-geometry.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-geometry.js +44 -3
- package/dist/gpu-physics/rigid-body-geometry.js.map +1 -1
- package/dist/gpu-physics/rigid-body-height-field-shader.cjs +80 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.d.ts +3 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.js +56 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.js.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field.cjs +166 -0
- package/dist/gpu-physics/rigid-body-height-field.d.ts +55 -0
- package/dist/gpu-physics/rigid-body-height-field.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field.js +184 -0
- package/dist/gpu-physics/rigid-body-height-field.js.map +1 -0
- package/dist/gpu-physics/rigid-body-joints.cjs +8 -3
- package/dist/gpu-physics/rigid-body-joints.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-joints.js +10 -6
- package/dist/gpu-physics/rigid-body-joints.js.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.cjs +4 -2
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.js +4 -2
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh.cjs +72 -17
- package/dist/gpu-physics/rigid-body-mesh.d.ts +3 -0
- package/dist/gpu-physics/rigid-body-mesh.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh.js +76 -20
- package/dist/gpu-physics/rigid-body-mesh.js.map +1 -1
- package/dist/gpu-physics/rigid-body-properties.cjs +4 -4
- package/dist/gpu-physics/rigid-body-properties.d.ts +6 -0
- package/dist/gpu-physics/rigid-body-properties.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-properties.js +1 -1
- package/dist/gpu-physics/rigid-body-properties.js.map +1 -1
- package/dist/gpu-physics/rigid-body-publication.cjs +2 -2
- package/dist/gpu-physics/rigid-body-publication.js +1 -1
- package/dist/gpu-physics/rigid-body-publication.js.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.cjs +159 -16
- package/dist/gpu-physics/rigid-body-queries.d.ts +24 -1
- package/dist/gpu-physics/rigid-body-queries.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.js +166 -14
- package/dist/gpu-physics/rigid-body-queries.js.map +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.cjs +22 -4
- package/dist/gpu-physics/rigid-body-query-geometry.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.js +22 -4
- package/dist/gpu-physics/rigid-body-query-geometry.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +13 -7
- 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 +16 -8
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shape-properties.cjs +2 -0
- package/dist/gpu-physics/rigid-body-shape-properties.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shape-properties.js +2 -0
- package/dist/gpu-physics/rigid-body-shape-properties.js.map +1 -1
- package/dist/gpu-physics/rigid-body-terrain-atlas.cjs +287 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts +87 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.js +275 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.cjs +240 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.d.ts +76 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.js +247 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.cjs +215 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts +25 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.js +218 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.cjs +263 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.d.ts +97 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.js +250 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.js.map +1 -0
- package/dist/gpu-physics/rigid-body-triggers.cjs +54 -15
- package/dist/gpu-physics/rigid-body-triggers.d.ts +1 -0
- package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.js +56 -15
- package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +99 -44
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +15 -3
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.js +93 -40
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.cjs +48 -20
- package/dist/gpu-physics/sphere-world-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.js +51 -21
- package/dist/gpu-physics/sphere-world-shaders.js.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +1 -1
- package/dist/gpu-project/cpu-projection-operation.d.ts +1 -1
- package/dist/gpu-project/crs.cjs.map +3 -3
- package/dist/gpu-project/crs.d.ts +1 -1
- package/dist/gpu-project/index.cjs.map +2 -2
- package/dist/gpu-project/projection-crs-benchmark.cjs +2 -2
- package/dist/gpu-project/projection-crs-benchmark.d.ts +1 -1
- package/dist/gpu-project/projection-crs-benchmark.js +1 -1
- package/dist/gpu-project/projection-crs-input.cjs +7 -7
- package/dist/gpu-project/projection-crs-input.d.ts +1 -1
- package/dist/gpu-project/projection-crs-input.js +4 -4
- package/dist/gpu-project/projection-engine.d.ts +2 -2
- package/dist/gpu-project/projection-program.cjs +2 -9
- package/dist/gpu-project/projection-program.d.ts.map +1 -1
- package/dist/gpu-project/projection-program.js +1 -8
- package/dist/gpu-project/projection-program.js.map +1 -1
- package/dist/gpu-project-benchmarks.cjs +21 -0
- package/dist/gpu-project-benchmarks.d.ts +2 -0
- package/dist/gpu-project-benchmarks.d.ts.map +1 -0
- package/dist/gpu-project-benchmarks.js +5 -0
- package/dist/gpu-project-benchmarks.js.map +1 -0
- package/dist/gpu-project-crs.cjs +21 -0
- package/dist/gpu-project-crs.d.ts +2 -0
- package/dist/gpu-project-crs.d.ts.map +1 -0
- package/dist/gpu-project-crs.js +5 -0
- package/dist/gpu-project-crs.js.map +1 -0
- package/dist/gpu-project-geoarrow.cjs +21 -0
- package/dist/gpu-project-geoarrow.d.ts +2 -0
- package/dist/gpu-project-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project-geoarrow.js +5 -0
- package/dist/gpu-project-geoarrow.js.map +1 -0
- package/dist/gpu-project-graph.cjs +21 -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 +5 -0
- package/dist/gpu-project-graph.js.map +1 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/operation.d.ts +1 -1
- package/dist/gpu-simple-graph/operation/operation.d.ts.map +1 -1
- package/dist/gpu-simple-graph-cpu.cjs +21 -0
- package/dist/gpu-simple-graph-cpu.d.ts +2 -0
- package/dist/gpu-simple-graph-cpu.d.ts.map +1 -0
- package/dist/gpu-simple-graph-cpu.js +5 -0
- package/dist/gpu-simple-graph-cpu.js.map +1 -0
- package/dist/gpu-simple-graph-webgl.cjs +21 -0
- package/dist/gpu-simple-graph-webgl.d.ts +2 -0
- package/dist/gpu-simple-graph-webgl.d.ts.map +1 -0
- package/dist/gpu-simple-graph-webgl.js +5 -0
- package/dist/gpu-simple-graph-webgl.js.map +1 -0
- package/dist/gpu-simple-graph-webgpu.cjs +21 -0
- package/dist/gpu-simple-graph-webgpu.d.ts +2 -0
- package/dist/gpu-simple-graph-webgpu.d.ts.map +1 -0
- package/dist/gpu-simple-graph-webgpu.js +5 -0
- package/dist/gpu-simple-graph-webgpu.js.map +1 -0
- package/dist/gpu-sql/gpu-sql.cjs +269 -171
- package/dist/gpu-sql/gpu-sql.d.ts +36 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +313 -181
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-sql/index.d.ts +1 -1
- package/dist/gpu-sql/index.d.ts.map +1 -1
- package/dist/utils/float32.cjs +35 -0
- package/dist/utils/float32.d.ts +3 -0
- package/dist/utils/float32.d.ts.map +1 -0
- package/dist/utils/float32.js +16 -0
- package/dist/utils/float32.js.map +1 -0
- package/package.json +19 -19
- package/src/arrow/gpu/arrow-gpu-analytics-adapters.ts +77 -25
- package/src/arrow/gpu/arrow-gpu-analytics-readback.ts +52 -16
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +46 -1
- package/src/arrow/index.ts +1 -0
- package/src/experimental-models.ts +5 -0
- package/src/experimental-simulation.ts +5 -0
- package/src/gpu-core/gpu-bvh-bounds.ts +84 -0
- package/src/gpu-core/gpu-command-graph-submission-pacer.ts +102 -0
- package/src/gpu-core/index.ts +5 -0
- package/src/gpu-dataframe/gpu-analytics-compiler-utils.ts +7 -10
- package/src/gpu-dataframe/gpu-data-frame-query.ts +119 -25
- package/src/gpu-dataframe/gpu-data-frame.ts +35 -2
- package/src/gpu-dataframe/gpu-expression-shader.ts +267 -32
- package/src/gpu-dataframe/gpu-expression.ts +186 -10
- package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +6 -3
- package/src/gpu-dataframe/gpu-global-aggregation-query.ts +17 -6
- package/src/gpu-dataframe/gpu-global-sort-compiler.ts +177 -105
- package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +469 -53
- package/src/gpu-dataframe/gpu-group-by-query.ts +29 -13
- package/src/gpu-dataframe/gpu-histogram-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-join-compiler.ts +12 -8
- package/src/gpu-dataframe/gpu-query-compiler.ts +61 -19
- package/src/gpu-dataframe/gpu-sort-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-sort-query.ts +31 -5
- package/src/gpu-dataframe/index.ts +16 -3
- package/src/gpu-dataframe/portable-expression.ts +81 -4
- package/src/gpu-dggs-benchmarks.ts +5 -0
- package/src/gpu-graph-algorithms-benchmarks.ts +5 -0
- package/src/gpu-physics/gpu-physics-batch.ts +19 -13
- package/src/gpu-physics/gpu-physics-ensemble-terrain.ts +114 -0
- package/src/gpu-physics/gpu-physics-ensemble.ts +166 -7
- package/src/gpu-physics/gpu-rigid-body-world.ts +1085 -287
- package/src/gpu-physics/index.ts +46 -0
- package/src/gpu-physics/rigid-body-bounds-shaders.ts +16 -1
- package/src/gpu-physics/rigid-body-cache-shaders.ts +18 -6
- package/src/gpu-physics/rigid-body-capacity.ts +25 -4
- package/src/gpu-physics/rigid-body-cast-index.ts +277 -0
- package/src/gpu-physics/rigid-body-convex-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-ensemble-layout.ts +6 -2
- package/src/gpu-physics/rigid-body-ensemble-reset.ts +67 -15
- package/src/gpu-physics/rigid-body-ensemble-shaders.ts +18 -7
- package/src/gpu-physics/rigid-body-ensemble-transaction.ts +61 -10
- package/src/gpu-physics/rigid-body-event-compaction.ts +252 -0
- package/src/gpu-physics/rigid-body-event-snapshot.ts +76 -0
- package/src/gpu-physics/rigid-body-events.ts +63 -25
- package/src/gpu-physics/rigid-body-geometry.ts +49 -4
- package/src/gpu-physics/rigid-body-height-field-shader.ts +56 -0
- package/src/gpu-physics/rigid-body-height-field.ts +257 -0
- package/src/gpu-physics/rigid-body-joints.ts +9 -11
- package/src/gpu-physics/rigid-body-mesh-query-shaders.ts +4 -2
- package/src/gpu-physics/rigid-body-mesh.ts +97 -26
- package/src/gpu-physics/rigid-body-properties.ts +5 -2
- package/src/gpu-physics/rigid-body-publication.ts +1 -1
- package/src/gpu-physics/rigid-body-queries.ts +202 -14
- package/src/gpu-physics/rigid-body-query-geometry.ts +22 -4
- package/src/gpu-physics/rigid-body-shaders.ts +20 -8
- package/src/gpu-physics/rigid-body-shape-properties.ts +2 -0
- package/src/gpu-physics/rigid-body-terrain-atlas.ts +378 -0
- package/src/gpu-physics/rigid-body-terrain-lod.ts +332 -0
- package/src/gpu-physics/rigid-body-terrain-stitch.ts +286 -0
- package/src/gpu-physics/rigid-body-terrain-stream.ts +323 -0
- package/src/gpu-physics/rigid-body-triggers.ts +65 -20
- package/src/gpu-physics/rigid-body-vehicle.ts +108 -41
- package/src/gpu-physics/sphere-world-shaders.ts +53 -21
- package/src/gpu-project/README.md +2 -2
- package/src/gpu-project/cpu-geometry-pipelines.ts +1 -1
- package/src/gpu-project/cpu-projection-operation.ts +1 -1
- package/src/gpu-project/crs.ts +2 -2
- package/src/gpu-project/projection-crs-benchmark.ts +2 -2
- package/src/gpu-project/projection-crs-input.ts +4 -4
- package/src/gpu-project/projection-engine.ts +2 -2
- package/src/gpu-project/projection-program.ts +1 -9
- package/src/gpu-project-benchmarks.ts +5 -0
- package/src/gpu-project-crs.ts +5 -0
- package/src/gpu-project-geoarrow.ts +5 -0
- package/src/gpu-project-graph.ts +5 -0
- package/src/gpu-simple-graph/gpu-simple-graph-transfer.ts +1 -1
- package/src/gpu-simple-graph/gpu-simple-graph-value.ts +1 -1
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +1 -1
- package/src/gpu-simple-graph/operation/operation.ts +1 -1
- package/src/gpu-simple-graph/operations/swizzle.ts +1 -1
- package/src/gpu-simple-graph-cpu.ts +5 -0
- package/src/gpu-simple-graph-webgl.ts +5 -0
- package/src/gpu-simple-graph-webgpu.ts +5 -0
- package/src/gpu-sql/gpu-sql.ts +535 -223
- package/src/gpu-sql/index.ts +1 -1
- package/src/utils/float32.ts +16 -0
|
@@ -7,7 +7,7 @@ import type {GPUTypeMap} from '@luma.gl/graph/gpu-tables';
|
|
|
7
7
|
import type {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
|
|
8
8
|
import type {GPUDataFrameDictionary} from './gpu-data-frame';
|
|
9
9
|
import type {GPUDataFrameQuery} from './gpu-data-frame-query';
|
|
10
|
-
import {
|
|
10
|
+
import {getGPUExpressionResultFormats} from './gpu-expression';
|
|
11
11
|
import {
|
|
12
12
|
compileGPUDataFrameGroupedAggregation,
|
|
13
13
|
type CompiledGPUDataFrameGroupedAggregation
|
|
@@ -45,6 +45,7 @@ export type GPUDataFrameAggregationValue<
|
|
|
45
45
|
SelectedColumns extends keyof T & string
|
|
46
46
|
> =
|
|
47
47
|
| 'count'
|
|
48
|
+
| Readonly<{count: SelectedColumns}>
|
|
48
49
|
| Readonly<{sum: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
|
|
49
50
|
| Readonly<{min: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
|
|
50
51
|
| Readonly<{max: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
|
|
@@ -61,7 +62,9 @@ export type GPUDataFrameGroupedAggregationResult<
|
|
|
61
62
|
Key extends string,
|
|
62
63
|
Definitions extends Readonly<Record<string, unknown>>
|
|
63
64
|
> = Record<Key, 'uint32'> & {
|
|
64
|
-
[Name in keyof Definitions & string]: Definitions[Name] extends 'count'
|
|
65
|
+
[Name in keyof Definitions & string]: Definitions[Name] extends 'count' | {count: string}
|
|
66
|
+
? 'uint32'
|
|
67
|
+
: 'float32';
|
|
65
68
|
};
|
|
66
69
|
|
|
67
70
|
/**
|
|
@@ -187,15 +190,18 @@ export class GPUDataFrameGroupedAggregationQuery<
|
|
|
187
190
|
}
|
|
188
191
|
}
|
|
189
192
|
|
|
190
|
-
/** Normalizes a closed set of operation shapes without accepting arbitrary shader expressions. */
|
|
191
|
-
function normalizeGPUDataFrameAggregations<
|
|
193
|
+
/** Normalizes a closed set of operation shapes without accepting arbitrary shader expressions. @internal */
|
|
194
|
+
export function normalizeGPUDataFrameAggregations<
|
|
192
195
|
Logical extends GPUTypeMap,
|
|
193
196
|
SelectedColumns extends keyof Logical & string,
|
|
194
197
|
Source extends GPUTypeMap
|
|
195
198
|
>(
|
|
196
|
-
query:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
+
query: Pick<
|
|
200
|
+
GPUDataFrameQuery<Logical, SelectedColumns, Source>,
|
|
201
|
+
'source' | 'selectedColumns' | 'derivedColumns'
|
|
202
|
+
>,
|
|
203
|
+
outputKey: string | undefined,
|
|
204
|
+
definitions: Readonly<Record<string, unknown>>
|
|
199
205
|
): GPUDataFrameAggregationDefinition[] {
|
|
200
206
|
const entries = Object.entries(definitions);
|
|
201
207
|
if (entries.length === 0) {
|
|
@@ -205,7 +211,7 @@ function normalizeGPUDataFrameAggregations<
|
|
|
205
211
|
const formats = getGPUDataFrameQueryColumnFormats(query);
|
|
206
212
|
const normalized: GPUDataFrameAggregationDefinition[] = [];
|
|
207
213
|
for (const [name, value] of entries) {
|
|
208
|
-
if (name.length === 0 || name ===
|
|
214
|
+
if (name.length === 0 || name === outputKey) {
|
|
209
215
|
throw new Error('GPUDataFrame aggregation names must be distinct from the group key');
|
|
210
216
|
}
|
|
211
217
|
if (value === 'count') {
|
|
@@ -221,13 +227,19 @@ function normalizeGPUDataFrameAggregations<
|
|
|
221
227
|
throw new Error(`GPUDataFrame aggregation "${name}" requires exactly one operation`);
|
|
222
228
|
}
|
|
223
229
|
const [operation, column] = operations[0];
|
|
224
|
-
if (
|
|
230
|
+
if (
|
|
231
|
+
operation !== 'count' &&
|
|
232
|
+
operation !== 'sum' &&
|
|
233
|
+
operation !== 'min' &&
|
|
234
|
+
operation !== 'max' &&
|
|
235
|
+
operation !== 'mean'
|
|
236
|
+
) {
|
|
225
237
|
throw new Error(`GPUDataFrame aggregation "${name}" has an unsupported operation`);
|
|
226
238
|
}
|
|
227
239
|
if (typeof column !== 'string' || !query.selectedColumns.includes(column as SelectedColumns)) {
|
|
228
240
|
throw new Error(`GPUDataFrame aggregation "${name}" requires a selected input column`);
|
|
229
241
|
}
|
|
230
|
-
if (formats.get(column) !== 'float32') {
|
|
242
|
+
if (operation !== 'count' && formats.get(column) !== 'float32') {
|
|
231
243
|
throw new Error(`GPUDataFrame aggregation "${name}" requires a float32 input column`);
|
|
232
244
|
}
|
|
233
245
|
normalized.push(Object.freeze({name, operation, column}));
|
|
@@ -240,7 +252,9 @@ function normalizeGPUDataFrameAggregations<
|
|
|
240
252
|
function getGPUDataFrameQueryColumnFormats<
|
|
241
253
|
Logical extends GPUTypeMap,
|
|
242
254
|
SelectedColumns extends keyof Logical & string
|
|
243
|
-
>(
|
|
255
|
+
>(
|
|
256
|
+
query: Pick<GPUDataFrameQuery<Logical, SelectedColumns, any>, 'source' | 'derivedColumns'>
|
|
257
|
+
): Map<string, string | undefined> {
|
|
244
258
|
const formats = new Map<string, string | undefined>(
|
|
245
259
|
query.source.schema.fields.map(
|
|
246
260
|
field =>
|
|
@@ -249,8 +263,10 @@ function getGPUDataFrameQueryColumnFormats<
|
|
|
249
263
|
);
|
|
250
264
|
|
|
251
265
|
for (const definition of query.derivedColumns) {
|
|
252
|
-
const
|
|
253
|
-
|
|
266
|
+
const inferred = getGPUExpressionResultFormats(definition.expression.node, formats)
|
|
267
|
+
.values()
|
|
268
|
+
.next().value;
|
|
269
|
+
formats.set(definition.name, definition.format ?? inferred ?? 'float32');
|
|
254
270
|
}
|
|
255
271
|
|
|
256
272
|
return formats;
|
|
@@ -84,7 +84,6 @@ export function compileGPUDataFrameHistogram<
|
|
|
84
84
|
GPUHistogramResult,
|
|
85
85
|
CompiledGPUDataFrameHistogram
|
|
86
86
|
>(source, predicates, selectedColumns, graph, derivedColumns, {
|
|
87
|
-
allowEmptyPredicates: true,
|
|
88
87
|
prepare: context => addGPUHistogramToGraph(context, column, options)
|
|
89
88
|
});
|
|
90
89
|
}
|
|
@@ -39,6 +39,7 @@ import type {GPUDataFrameJoinType, GPUDataFrameNormalizedJoinOptions} from './gp
|
|
|
39
39
|
import {
|
|
40
40
|
CompiledGPUDataFrameQuery,
|
|
41
41
|
compileGPUDataFrameQuery,
|
|
42
|
+
projectGPUDataFrameQueryResult,
|
|
42
43
|
type CompiledGPUDataFrameQueryProps,
|
|
43
44
|
type GPUDataFrameQueryExtensionContext,
|
|
44
45
|
type GPUDataFrameQueryExtensionResult,
|
|
@@ -170,7 +171,8 @@ export function compileGPUDataFrameJoin<
|
|
|
170
171
|
right: GPUDataFrame<Right>,
|
|
171
172
|
options: GPUDataFrameNormalizedJoinOptions,
|
|
172
173
|
joinType: GPUDataFrameJoinType,
|
|
173
|
-
graph: GPUCommandGraph<GPUDataFrameQueryParameters
|
|
174
|
+
graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
|
|
175
|
+
resultColumns?: readonly (keyof Selection & string)[]
|
|
174
176
|
): CompiledGPUDataFrameJoin<Selection, Right> {
|
|
175
177
|
validateGPUJoinSources(source, right, options, graph);
|
|
176
178
|
const retainedRight = right.select(right.columnNames);
|
|
@@ -181,8 +183,8 @@ export function compileGPUDataFrameJoin<
|
|
|
181
183
|
Selection,
|
|
182
184
|
CompiledGPUDataFrameJoin<Selection, Right>
|
|
183
185
|
>(source, predicates, selectedColumns, graph, derivedColumns, {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
prepare: context =>
|
|
187
|
+
addGPUJoinToGraph(context, retainedRight, options, joinType, resultColumns)
|
|
186
188
|
});
|
|
187
189
|
} catch (error) {
|
|
188
190
|
retainedRight.destroy();
|
|
@@ -213,7 +215,6 @@ export function compileGPUDataFrameLookup<
|
|
|
213
215
|
Selection,
|
|
214
216
|
CompiledGPUDataFrameLookup<Selection, Right>
|
|
215
217
|
>(source, predicates, selectedColumns, graph, derivedColumns, {
|
|
216
|
-
allowEmptyPredicates: true,
|
|
217
218
|
prepare: context => addGPULookupToGraph(context, retainedRight, options)
|
|
218
219
|
});
|
|
219
220
|
} catch (error) {
|
|
@@ -263,7 +264,8 @@ function addGPUJoinToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
|
|
|
263
264
|
context: GPUDataFrameQueryExtensionContext<Left>,
|
|
264
265
|
right: GPUDataFrame<Right>,
|
|
265
266
|
options: GPUDataFrameNormalizedJoinOptions,
|
|
266
|
-
joinType: GPUDataFrameJoinType
|
|
267
|
+
joinType: GPUDataFrameJoinType,
|
|
268
|
+
resultColumns?: readonly (keyof Left & string)[]
|
|
267
269
|
): GPUDataFrameQueryExtensionResult<Left, CompiledGPUDataFrameJoin<Left, Right>> {
|
|
268
270
|
const ownedVectors: GPUVector[] = [];
|
|
269
271
|
const id = `${context.queryId}-${joinType}-join`;
|
|
@@ -403,10 +405,12 @@ function addGPUJoinToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
|
|
|
403
405
|
indexStatistics: indexState.indexStatistics,
|
|
404
406
|
contractViolation: indexState.contractViolation
|
|
405
407
|
};
|
|
408
|
+
const projection = resultColumns && projectGPUDataFrameQueryResult(context, resultColumns);
|
|
406
409
|
return {
|
|
407
|
-
table: context.table,
|
|
408
|
-
validity: context.validity,
|
|
409
|
-
dictionaries: context.dictionaries,
|
|
410
|
+
table: projection?.table ?? context.table,
|
|
411
|
+
validity: projection?.validity ?? context.validity,
|
|
412
|
+
dictionaries: projection?.dictionaries ?? context.dictionaries,
|
|
413
|
+
ownedTables: projection ? [projection] : [],
|
|
410
414
|
ownedVectors,
|
|
411
415
|
createCompiled: props => new CompiledGPUDataFrameJoin(props, resources)
|
|
412
416
|
};
|
|
@@ -10,8 +10,14 @@ import {
|
|
|
10
10
|
type CommandEncoder,
|
|
11
11
|
type Device
|
|
12
12
|
} from '@luma.gl/core';
|
|
13
|
+
import {
|
|
14
|
+
GPUData,
|
|
15
|
+
GPUVector,
|
|
16
|
+
getGPUVectorWGSLLayout,
|
|
17
|
+
type GPUConstant,
|
|
18
|
+
type GPUVectorWGSLFormat as GPUExpressionNumericFormat
|
|
19
|
+
} from '@luma.gl/graph/gpu-data';
|
|
13
20
|
import {Kernel} from '../execution/compute/kernel';
|
|
14
|
-
import {GPUData, GPUVector, type GPUConstant} from '@luma.gl/graph/gpu-data';
|
|
15
21
|
import {GPURecordBatch, GPUTable, type GPUField, type GPUTypeMap} from '@luma.gl/graph/gpu-tables';
|
|
16
22
|
import {
|
|
17
23
|
type CompiledGPUCommandGraph,
|
|
@@ -24,21 +30,40 @@ import {
|
|
|
24
30
|
import {getBoundedDispatchLayout, getBoundedInvocationIndexSource} from '@luma.gl/graph/gpu-core';
|
|
25
31
|
import {GPUVisibilityWorkflow} from '@luma.gl/graph/gpu-core';
|
|
26
32
|
import {createTransientView, getViewBinding, getViewElementOffset} from '@luma.gl/graph/gpu-core';
|
|
27
|
-
import
|
|
33
|
+
import {
|
|
34
|
+
GPUDataFrame,
|
|
35
|
+
type GPUDataFrameDictionaries,
|
|
36
|
+
type GPUDataFrameValidity
|
|
37
|
+
} from './gpu-data-frame';
|
|
28
38
|
import type {GPUDataFrameDerivedColumn} from './gpu-data-frame-query';
|
|
29
39
|
import type {GPUExpression} from './gpu-expression';
|
|
30
40
|
import {
|
|
31
41
|
encodeGPUQueryExpressionControls,
|
|
32
|
-
getGPUQueryShaderType,
|
|
33
42
|
makeGPUQueryExpressionShaderPlan,
|
|
34
43
|
type GPUQueryExpressionColumn,
|
|
35
44
|
type GPUQueryExpressionOutput,
|
|
36
|
-
type GPUQueryExpressionShaderPlan
|
|
37
|
-
type GPUQueryScalarFormat
|
|
45
|
+
type GPUQueryExpressionShaderPlan
|
|
38
46
|
} from './gpu-expression-shader';
|
|
39
47
|
|
|
40
48
|
const LU_QUERY_WORKGROUP_SIZE = 256;
|
|
41
|
-
|
|
49
|
+
|
|
50
|
+
/** Borrows projected columns while the query owns its working table. @internal */
|
|
51
|
+
export function projectGPUDataFrameQueryResult<Selection extends GPUTypeMap>(
|
|
52
|
+
context: GPUDataFrameQueryExtensionContext<Selection>,
|
|
53
|
+
columns: readonly (keyof Selection & string)[]
|
|
54
|
+
): GPUDataFrame<Selection> {
|
|
55
|
+
const working = new GPUDataFrame<Selection>({
|
|
56
|
+
table: context.table,
|
|
57
|
+
validity: context.validity,
|
|
58
|
+
dictionaries: context.dictionaries,
|
|
59
|
+
ownership: 'borrowed'
|
|
60
|
+
});
|
|
61
|
+
try {
|
|
62
|
+
return working.select(columns) as GPUDataFrame<Selection>;
|
|
63
|
+
} finally {
|
|
64
|
+
working.destroy();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
42
67
|
|
|
43
68
|
/** Caller-owned scalar values supplied to an already compiled dataframe filter. */
|
|
44
69
|
export type GPUDataFrameQueryParameters = Readonly<Record<string, number | boolean | null>>;
|
|
@@ -50,12 +75,12 @@ type GPUQuerySourceView = {
|
|
|
50
75
|
|
|
51
76
|
type GPUQueryDerivedOutput = {
|
|
52
77
|
plan: GPUQueryExpressionOutput;
|
|
53
|
-
values: GPUVector<
|
|
78
|
+
values: GPUVector<GPUExpressionNumericFormat>;
|
|
54
79
|
validity?: GPUVector<'uint32'>;
|
|
55
80
|
};
|
|
56
81
|
|
|
57
82
|
type GPUQueryDerivedView = {
|
|
58
|
-
values: GraphVectorView<
|
|
83
|
+
values: GraphVectorView<GPUExpressionNumericFormat>;
|
|
59
84
|
validity?: GraphVectorView<'uint32'>;
|
|
60
85
|
};
|
|
61
86
|
|
|
@@ -104,7 +129,6 @@ export type GPUDataFrameQueryCompilationExtension<
|
|
|
104
129
|
Result extends GPUTypeMap,
|
|
105
130
|
Compiled extends CompiledGPUDataFrameQuery<Result> = CompiledGPUDataFrameQuery<Result>
|
|
106
131
|
> = {
|
|
107
|
-
allowEmptyPredicates?: boolean;
|
|
108
132
|
prepare: (
|
|
109
133
|
context: GPUDataFrameQueryExtensionContext<Row>
|
|
110
134
|
) => GPUDataFrameQueryExtensionResult<Result, Compiled>;
|
|
@@ -216,8 +240,7 @@ export function compileGPUDataFrameQuery<
|
|
|
216
240
|
retainedSource,
|
|
217
241
|
predicates,
|
|
218
242
|
derivedColumns,
|
|
219
|
-
selectedColumns
|
|
220
|
-
predicates.length === 0 || extension?.allowEmptyPredicates === true
|
|
243
|
+
selectedColumns
|
|
221
244
|
);
|
|
222
245
|
validateGPUQueryBatchCapacity(retainedSource, graph);
|
|
223
246
|
validateGPUQueryBindingCapacity(plan, graph);
|
|
@@ -421,7 +444,7 @@ function validateGPUQueryBindingCapacity(
|
|
|
421
444
|
}
|
|
422
445
|
|
|
423
446
|
/** Creates one independently owned fixed-width GPU output chunk for every source batch. */
|
|
424
|
-
function createGPUQueryOutputVector<Format extends
|
|
447
|
+
function createGPUQueryOutputVector<Format extends GPUExpressionNumericFormat>(
|
|
425
448
|
device: Device,
|
|
426
449
|
name: string,
|
|
427
450
|
lengths: readonly number[],
|
|
@@ -434,7 +457,7 @@ function createGPUQueryOutputVector<Format extends GPUQueryScalarFormat>(
|
|
|
434
457
|
for (const [batchIndex, length] of lengths.entries()) {
|
|
435
458
|
const buffer = device.createBuffer({
|
|
436
459
|
id: `${name}-batch-${batchIndex}`,
|
|
437
|
-
byteLength: Math.max(length, 1) *
|
|
460
|
+
byteLength: Math.max(length, 1) * getGPUVectorWGSLLayout(format).packedByteStride,
|
|
438
461
|
usage:
|
|
439
462
|
Buffer.STORAGE |
|
|
440
463
|
Buffer.COPY_SRC |
|
|
@@ -507,7 +530,13 @@ function createGPUQueryDerivedTable<Result extends GPUTypeMap>(
|
|
|
507
530
|
const layouts: BufferLayout[] = selectedColumns.flatMap(name => {
|
|
508
531
|
const output = outputsByName.get(name);
|
|
509
532
|
if (output) {
|
|
510
|
-
return [
|
|
533
|
+
return [
|
|
534
|
+
{
|
|
535
|
+
name,
|
|
536
|
+
format: output.plan.format,
|
|
537
|
+
byteStride: getGPUVectorWGSLLayout(output.plan.format).packedByteStride
|
|
538
|
+
}
|
|
539
|
+
];
|
|
511
540
|
}
|
|
512
541
|
return selectedSource.bufferLayout
|
|
513
542
|
.filter(layout => layout.name === name)
|
|
@@ -690,7 +719,16 @@ function addGPUQueryPredicatePass(
|
|
|
690
719
|
`const INPUT_${column.index}_OFFSET: u32 = ${getViewElementOffset(values)}u;`
|
|
691
720
|
);
|
|
692
721
|
declarations.push(
|
|
693
|
-
`@group(0) @binding(${bindingIndex++}) var<storage, read> input${column.index}: array<${
|
|
722
|
+
`@group(0) @binding(${bindingIndex++}) var<storage, read> input${column.index}: array<${getGPUVectorWGSLLayout(column.format).scalarType}>;`
|
|
723
|
+
);
|
|
724
|
+
const layout = getGPUVectorWGSLLayout(column.format);
|
|
725
|
+
const components = Array.from(
|
|
726
|
+
{length: layout.components},
|
|
727
|
+
(_, component) =>
|
|
728
|
+
`input${column.index}[INPUT_${column.index}_OFFSET + row * ${layout.components}u + ${component}u]`
|
|
729
|
+
);
|
|
730
|
+
declarations.push(
|
|
731
|
+
`fn readInput${column.index}(row: u32) -> ${layout.shaderType} { return ${layout.components === 1 ? components[0] : `${layout.shaderType}(${components.join(', ')})`}; }`
|
|
694
732
|
);
|
|
695
733
|
bindings[`input${column.index}`] = values;
|
|
696
734
|
resources.push({buffer: values, usage: 'storage-read'});
|
|
@@ -731,13 +769,16 @@ function addGPUQueryPredicatePass(
|
|
|
731
769
|
`const DERIVED_${output.index}_OFFSET: u32 = ${getViewElementOffset(values)}u;`
|
|
732
770
|
);
|
|
733
771
|
declarations.push(
|
|
734
|
-
`@group(0) @binding(${bindingIndex++}) var<storage, read_write> derived${output.index}: array<${
|
|
772
|
+
`@group(0) @binding(${bindingIndex++}) var<storage, read_write> derived${output.index}: array<${getGPUVectorWGSLLayout(output.format).scalarType}>;`
|
|
735
773
|
);
|
|
736
774
|
bindings[`derived${output.index}`] = values;
|
|
737
775
|
resources.push({buffer: values, usage: 'storage-write'});
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
776
|
+
const layout = getGPUVectorWGSLLayout(output.format);
|
|
777
|
+
for (let component = 0; component < layout.components; component++) {
|
|
778
|
+
derivedWrites.push(
|
|
779
|
+
`derived${output.index}[DERIVED_${output.index}_OFFSET + index * ${layout.components}u + ${component}u] = ${layout.components === 1 ? output.value : `${output.value}[${component}]`};`
|
|
780
|
+
);
|
|
781
|
+
}
|
|
741
782
|
|
|
742
783
|
if (output.nullable) {
|
|
743
784
|
const validity = views?.validity?.data[props.batchIndex];
|
|
@@ -774,6 +815,7 @@ function addGPUQueryPredicatePass(
|
|
|
774
815
|
const source = /* wgsl */ `
|
|
775
816
|
const ELEMENT_COUNT: u32 = ${props.output.length}u;
|
|
776
817
|
${declarations.join('\n')}
|
|
818
|
+
${props.plan.helpers.join('\n')}
|
|
777
819
|
|
|
778
820
|
@compute @workgroup_size(${LU_QUERY_WORKGROUP_SIZE})
|
|
779
821
|
fn main(
|
|
@@ -96,7 +96,6 @@ export function compileGPUDataFrameSort<Source extends GPUTypeMap, Selection ext
|
|
|
96
96
|
Selection,
|
|
97
97
|
CompiledGPUDataFrameSort<Selection>
|
|
98
98
|
>(source, predicates, selectedColumns, graph, derivedColumns, {
|
|
99
|
-
allowEmptyPredicates: true,
|
|
100
99
|
prepare: context => addGPUBatchSortToGraph(context, column, options)
|
|
101
100
|
});
|
|
102
101
|
}
|
|
@@ -38,6 +38,7 @@ export type GPUDataFrameNormalizedSortOptions = Readonly<{
|
|
|
38
38
|
nans: 'first' | 'last';
|
|
39
39
|
algorithm: 'auto' | 'bitonic' | 'radix';
|
|
40
40
|
limit?: number;
|
|
41
|
+
offset?: number;
|
|
41
42
|
}>;
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -66,7 +67,8 @@ export class GPUDataFrameSortQuery<
|
|
|
66
67
|
column: Column,
|
|
67
68
|
options: GPUDataFrameSortOptions = {},
|
|
68
69
|
limit?: number,
|
|
69
|
-
defaultDirection: 'ascending' | 'descending' = 'ascending'
|
|
70
|
+
defaultDirection: 'ascending' | 'descending' = 'ascending',
|
|
71
|
+
offset?: number
|
|
70
72
|
) {
|
|
71
73
|
if (!query.selectedColumns.includes(column)) {
|
|
72
74
|
throw new Error(`GPUDataFrame sort column "${column}" is not selected`);
|
|
@@ -80,7 +82,7 @@ export class GPUDataFrameSortQuery<
|
|
|
80
82
|
|
|
81
83
|
this.query = query;
|
|
82
84
|
this.column = column;
|
|
83
|
-
this.options = normalizeGPUDataFrameSortOptions(options, limit, defaultDirection);
|
|
85
|
+
this.options = normalizeGPUDataFrameSortOptions(options, limit, defaultDirection, offset);
|
|
84
86
|
Object.freeze(this);
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -121,7 +123,22 @@ export class GPUDataFrameGlobalSortQuery<
|
|
|
121
123
|
override topK(
|
|
122
124
|
limit: number
|
|
123
125
|
): GPUDataFrameGlobalSortQuery<Logical, SelectedColumns, Column, Source> {
|
|
124
|
-
return
|
|
126
|
+
return this.page(this.options.offset ?? 0, limit);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Selects a page from the globally sorted rows after filtering. */
|
|
130
|
+
page(
|
|
131
|
+
offset: number,
|
|
132
|
+
limit?: number
|
|
133
|
+
): GPUDataFrameGlobalSortQuery<Logical, SelectedColumns, Column, Source> {
|
|
134
|
+
return new GPUDataFrameGlobalSortQuery(
|
|
135
|
+
this.query,
|
|
136
|
+
this.column,
|
|
137
|
+
this.options,
|
|
138
|
+
limit,
|
|
139
|
+
'ascending',
|
|
140
|
+
offset
|
|
141
|
+
);
|
|
125
142
|
}
|
|
126
143
|
|
|
127
144
|
/** Adds one cross-batch GPU permutation and global selected count to a reusable command graph. */
|
|
@@ -144,7 +161,8 @@ export class GPUDataFrameGlobalSortQuery<
|
|
|
144
161
|
function normalizeGPUDataFrameSortOptions(
|
|
145
162
|
options: GPUDataFrameSortOptions,
|
|
146
163
|
limit: number | undefined,
|
|
147
|
-
defaultDirection: 'ascending' | 'descending'
|
|
164
|
+
defaultDirection: 'ascending' | 'descending',
|
|
165
|
+
offset?: number
|
|
148
166
|
): GPUDataFrameNormalizedSortOptions {
|
|
149
167
|
if (!options || typeof options !== 'object') {
|
|
150
168
|
throw new Error('GPUDataFrame sorting options must be an object');
|
|
@@ -173,11 +191,19 @@ function normalizeGPUDataFrameSortOptions(
|
|
|
173
191
|
throw new Error('GPUDataFrame top-K limits require a nonnegative uint32 count');
|
|
174
192
|
}
|
|
175
193
|
|
|
194
|
+
if (
|
|
195
|
+
offset !== undefined &&
|
|
196
|
+
(!Number.isSafeInteger(offset) || offset < 0 || offset > MAXIMUM_UINT32)
|
|
197
|
+
) {
|
|
198
|
+
throw new Error('GPUDataFrame page offsets require a nonnegative uint32 count');
|
|
199
|
+
}
|
|
200
|
+
|
|
176
201
|
return Object.freeze({
|
|
177
202
|
direction,
|
|
178
203
|
nulls,
|
|
179
204
|
nans,
|
|
180
205
|
algorithm,
|
|
181
|
-
...(limit === undefined ? {} : {limit})
|
|
206
|
+
...(limit === undefined ? {} : {limit}),
|
|
207
|
+
...(offset ? {offset} : {})
|
|
182
208
|
});
|
|
183
209
|
}
|
|
@@ -48,12 +48,25 @@ export type {
|
|
|
48
48
|
GPUDataFrameJoinType,
|
|
49
49
|
GPUDataFrameLookupOptions
|
|
50
50
|
} from './gpu-join-query';
|
|
51
|
-
export {
|
|
51
|
+
export {
|
|
52
|
+
and,
|
|
53
|
+
caseWhen,
|
|
54
|
+
coalesce,
|
|
55
|
+
column,
|
|
56
|
+
literal,
|
|
57
|
+
GPUExpression,
|
|
58
|
+
not,
|
|
59
|
+
nullIf,
|
|
60
|
+
or,
|
|
61
|
+
parameter,
|
|
62
|
+
scalarFunction
|
|
63
|
+
} from './gpu-expression';
|
|
52
64
|
export type {
|
|
53
65
|
GPUExpressionBinaryOperator,
|
|
54
66
|
GPUExpressionNode,
|
|
55
67
|
GPUExpressionUnaryOperator,
|
|
56
|
-
GPUExpressionValue
|
|
68
|
+
GPUExpressionValue,
|
|
69
|
+
GPUScalarFunction
|
|
57
70
|
} from './gpu-expression';
|
|
58
71
|
export {CompiledGPUDataFrameQuery} from './gpu-query-compiler';
|
|
59
72
|
export type {GPUDataFrameQueryParameters} from './gpu-query-compiler';
|
|
@@ -64,7 +77,7 @@ export {CompiledGPUDataFrameSort} from './gpu-sort-compiler';
|
|
|
64
77
|
export {CompiledGPUDataFrameGlobalSort} from './gpu-global-sort-compiler';
|
|
65
78
|
export {CompiledGPUDataFrameJoin, CompiledGPUDataFrameLookup} from './gpu-join-compiler';
|
|
66
79
|
|
|
67
|
-
export {vector, cast} from './gpu-expression';
|
|
80
|
+
export {vector, vectorColumn, cast} from './gpu-expression';
|
|
68
81
|
export type {GPUExpressionNumericValue} from './gpu-expression';
|
|
69
82
|
export type {
|
|
70
83
|
GPUVectorWGSLFormat as GPUExpressionNumericFormat,
|
|
@@ -7,6 +7,7 @@ import {validateExpressionAST, type Expression} from '@math.gl/sql/expressions';
|
|
|
7
7
|
import {
|
|
8
8
|
GPUExpression,
|
|
9
9
|
isBooleanExpressionNode,
|
|
10
|
+
isGPUScalarFunction,
|
|
10
11
|
makeGPUCastNode,
|
|
11
12
|
type GPUExpressionNode,
|
|
12
13
|
type GPUExpressionBinaryOperator,
|
|
@@ -43,7 +44,7 @@ export function makeGPUPredicateFromPortableAST(expression: Expression): GPUExpr
|
|
|
43
44
|
|
|
44
45
|
function convertPortableExpression(expression: Expression): GPUExpressionNode {
|
|
45
46
|
validateExpressionAST(expression);
|
|
46
|
-
return
|
|
47
|
+
return lowerPortableExpression(expression);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
const binaryOperators: Readonly<Record<string, GPUExpressionBinaryOperator>> = {
|
|
@@ -64,7 +65,13 @@ const binaryOperators: Readonly<Record<string, GPUExpressionBinaryOperator>> = {
|
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
/** Lowers one validated portable node and rejects unsupported operations. */
|
|
67
|
-
function
|
|
68
|
+
export function lowerPortableExpression(
|
|
69
|
+
expression: Expression,
|
|
70
|
+
resolveLeaf?: (expression: Expression) => GPUExpressionNode | undefined
|
|
71
|
+
): GPUExpressionNode {
|
|
72
|
+
const resolved = resolveLeaf?.(expression);
|
|
73
|
+
if (resolved) return resolved;
|
|
74
|
+
const convert = (child: Expression) => lowerPortableExpression(child, resolveLeaf);
|
|
68
75
|
// math.gl's public parser type includes nonportable nodes; validation above narrows at runtime.
|
|
69
76
|
const node = expression as any;
|
|
70
77
|
switch (node.type) {
|
|
@@ -93,8 +100,61 @@ function convert(expression: Expression): GPUExpressionNode {
|
|
|
93
100
|
return {kind: 'binary', operator, left: convert(node.left), right: convert(node.right)};
|
|
94
101
|
break;
|
|
95
102
|
}
|
|
103
|
+
case 'ConditionalExpression':
|
|
104
|
+
return {
|
|
105
|
+
kind: 'conditional',
|
|
106
|
+
condition: convert(node.test),
|
|
107
|
+
whenTrue: convert(node.consequent),
|
|
108
|
+
otherwise: convert(node.alternate)
|
|
109
|
+
};
|
|
96
110
|
case 'CallExpression': {
|
|
97
111
|
const name = node.callee.name;
|
|
112
|
+
const functionName = node.sqlFunction === true ? name.toLowerCase() : name;
|
|
113
|
+
if (functionName === 'coalesce' || functionName === 'nullif') {
|
|
114
|
+
const count = node.arguments.length;
|
|
115
|
+
if (functionName === 'nullif' ? count !== 2 : count < 2 || count > 64) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
'GPU DataFrame NULLIF requires two arguments and COALESCE requires 2–64 arguments'
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
const arguments_: GPUExpressionNode[] = node.arguments.map(convert);
|
|
121
|
+
return arguments_.reduceRight((right, left) => ({
|
|
122
|
+
kind: 'binary',
|
|
123
|
+
operator: functionName,
|
|
124
|
+
left,
|
|
125
|
+
right
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
if (isGPUScalarFunction(functionName)) {
|
|
129
|
+
if (node.arguments.length !== 1) {
|
|
130
|
+
throw new Error(`GPU DataFrame ${name} requires one argument`);
|
|
131
|
+
}
|
|
132
|
+
return {kind: 'unary', operator: functionName, operand: convert(node.arguments[0])};
|
|
133
|
+
}
|
|
134
|
+
if ((name === 'isNull' || name === 'isNotNull') && node.arguments.length === 1) {
|
|
135
|
+
return {
|
|
136
|
+
kind: 'unary',
|
|
137
|
+
operator: name === 'isNull' ? 'is-null' : 'is-valid',
|
|
138
|
+
operand: convert(node.arguments[0])
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
if (name === 'in') {
|
|
142
|
+
const [subject, ...arguments_] = node.arguments as Expression[];
|
|
143
|
+
if (arguments_.length === 0 || arguments_.length > 64) {
|
|
144
|
+
throw new Error('GPU dataframe IN requires between 1 and 64 candidates');
|
|
145
|
+
}
|
|
146
|
+
const value = convert(subject);
|
|
147
|
+
const candidates = arguments_.map(convert);
|
|
148
|
+
if (
|
|
149
|
+
value.kind !== 'column' ||
|
|
150
|
+
candidates.some(
|
|
151
|
+
candidate => candidate.kind !== 'literal' && candidate.kind !== 'parameter'
|
|
152
|
+
)
|
|
153
|
+
) {
|
|
154
|
+
throw new Error('GPU dataframe IN requires a column and literal or parameter candidates');
|
|
155
|
+
}
|
|
156
|
+
return makeMembershipPredicate(value, candidates);
|
|
157
|
+
}
|
|
98
158
|
if (name === 'array_float32' && [2, 3, 4].includes(node.arguments.length)) {
|
|
99
159
|
return {
|
|
100
160
|
kind: 'vector',
|
|
@@ -104,10 +164,10 @@ function convert(expression: Expression): GPUExpressionNode {
|
|
|
104
164
|
}
|
|
105
165
|
if (name === 'cast' && node.arguments.length === 2 && node.arguments[1].type === 'Literal') {
|
|
106
166
|
const target = node.arguments[1].value;
|
|
107
|
-
if (target === 'float32' || target === 'int32')
|
|
167
|
+
if (target === 'float32' || target === 'int32' || target === 'uint32')
|
|
108
168
|
return makeGPUCastNode(
|
|
109
169
|
convert(node.arguments[0]),
|
|
110
|
-
target === 'int32' ? 'sint32' :
|
|
170
|
+
target === 'int32' ? 'sint32' : target
|
|
111
171
|
);
|
|
112
172
|
}
|
|
113
173
|
break;
|
|
@@ -115,3 +175,20 @@ function convert(expression: Expression): GPUExpressionNode {
|
|
|
115
175
|
}
|
|
116
176
|
throw new Error('Unsupported portable GPU dataframe expression');
|
|
117
177
|
}
|
|
178
|
+
|
|
179
|
+
/** Balanced OR preserves three-valued comparisons and bounds tree depth. */
|
|
180
|
+
function makeMembershipPredicate(
|
|
181
|
+
value: GPUExpressionNode,
|
|
182
|
+
candidates: readonly GPUExpressionNode[]
|
|
183
|
+
): GPUExpressionNode {
|
|
184
|
+
if (candidates.length === 1) {
|
|
185
|
+
return {kind: 'binary', operator: 'equal', left: value, right: candidates[0]};
|
|
186
|
+
}
|
|
187
|
+
const middle = Math.floor(candidates.length / 2);
|
|
188
|
+
return {
|
|
189
|
+
kind: 'binary',
|
|
190
|
+
operator: 'or',
|
|
191
|
+
left: makeMembershipPredicate(value, candidates.slice(0, middle)),
|
|
192
|
+
right: makeMembershipPredicate(value, candidates.slice(middle))
|
|
193
|
+
};
|
|
194
|
+
}
|