@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
|
@@ -3,9 +3,15 @@
|
|
|
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
|
+
import {getGPUExpressionCastWGSL, GPU_EXPRESSION_CAST_WGSL} from '../gpu-core/gpu-expression-cast';
|
|
6
11
|
import type {GPUTypeMap} from '@luma.gl/graph/gpu-tables';
|
|
7
12
|
import type {GPUDataFrame} from './gpu-data-frame';
|
|
8
13
|
import type {GPUDataFrameDerivedColumn} from './gpu-data-frame-query';
|
|
14
|
+
import {isGPUScalarFunction, type GPUExpressionUnaryOperator} from './gpu-expression';
|
|
9
15
|
import type {
|
|
10
16
|
GPUExpression,
|
|
11
17
|
GPUExpressionBinaryOperator,
|
|
@@ -23,7 +29,7 @@ export type GPUQueryScalarFormat = 'float32' | 'sint32' | 'uint32';
|
|
|
23
29
|
/** One deduplicated source vector and optional validity sidecar consumed by a predicate. @internal */
|
|
24
30
|
export type GPUQueryExpressionColumn = {
|
|
25
31
|
name: string;
|
|
26
|
-
format:
|
|
32
|
+
format: GPUExpressionNumericFormat;
|
|
27
33
|
nullable: boolean;
|
|
28
34
|
index: number;
|
|
29
35
|
};
|
|
@@ -31,6 +37,7 @@ export type GPUQueryExpressionColumn = {
|
|
|
31
37
|
/** One fixed-size literal or caller-controlled parameter stored outside shader source. @internal */
|
|
32
38
|
export type GPUQueryExpressionControl = {
|
|
33
39
|
name?: string;
|
|
40
|
+
convertInteger?: boolean;
|
|
34
41
|
value: GPUExpressionValue;
|
|
35
42
|
format: GPUQueryScalarFormat | 'boolean';
|
|
36
43
|
index: number;
|
|
@@ -39,7 +46,7 @@ export type GPUQueryExpressionControl = {
|
|
|
39
46
|
/** One selected numeric expression materialized into a source-aligned GPU vector. @internal */
|
|
40
47
|
export type GPUQueryExpressionOutput = {
|
|
41
48
|
name: string;
|
|
42
|
-
format:
|
|
49
|
+
format: GPUExpressionNumericFormat;
|
|
43
50
|
nullable: boolean;
|
|
44
51
|
value: string;
|
|
45
52
|
valid: string;
|
|
@@ -52,10 +59,12 @@ export type GPUQueryExpressionShaderPlan = {
|
|
|
52
59
|
controls: readonly GPUQueryExpressionControl[];
|
|
53
60
|
outputs: readonly GPUQueryExpressionOutput[];
|
|
54
61
|
statements: readonly string[];
|
|
62
|
+
helpers: readonly string[];
|
|
55
63
|
condition: string;
|
|
56
64
|
};
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
/** The WGSL value formats accepted by DataFrame expression lowering. */
|
|
67
|
+
type GPUQueryValueFormat = GPUExpressionNumericFormat | 'boolean';
|
|
59
68
|
|
|
60
69
|
type GPUQueryExpressionShaderValue = {
|
|
61
70
|
format: GPUQueryValueFormat;
|
|
@@ -74,13 +83,8 @@ export function makeGPUQueryExpressionShaderPlan<T extends GPUTypeMap>(
|
|
|
74
83
|
source: GPUDataFrame<T>,
|
|
75
84
|
predicates: readonly GPUExpression<boolean, string>[],
|
|
76
85
|
derivedColumns: readonly GPUDataFrameDerivedColumn[] = [],
|
|
77
|
-
selectedColumns: readonly string[] = []
|
|
78
|
-
allowEmptyPredicates = false
|
|
86
|
+
selectedColumns: readonly string[] = []
|
|
79
87
|
): GPUQueryExpressionShaderPlan {
|
|
80
|
-
if (predicates.length === 0 && derivedColumns.length === 0 && !allowEmptyPredicates) {
|
|
81
|
-
throw new Error('GPUDataFrame filtering requires at least one predicate');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
88
|
const planner = new GPUQueryExpressionShaderPlanner(source, derivedColumns);
|
|
85
89
|
const outputs = selectedColumns.flatMap(name => {
|
|
86
90
|
const derived = derivedColumns.find(column => column.name === name);
|
|
@@ -118,6 +122,7 @@ export function makeGPUQueryExpressionShaderPlan<T extends GPUTypeMap>(
|
|
|
118
122
|
controls: planner.controls,
|
|
119
123
|
outputs,
|
|
120
124
|
statements: planner.statements,
|
|
125
|
+
helpers: planner.helpers,
|
|
121
126
|
condition: conditions.join(' && ') || 'true'
|
|
122
127
|
};
|
|
123
128
|
}
|
|
@@ -131,7 +136,7 @@ export function encodeGPUQueryExpressionControls(
|
|
|
131
136
|
const floatingPointWords = new Float32Array(words.buffer);
|
|
132
137
|
|
|
133
138
|
for (const control of controls) {
|
|
134
|
-
|
|
139
|
+
let value =
|
|
135
140
|
control.name !== undefined && Object.prototype.hasOwnProperty.call(parameters, control.name)
|
|
136
141
|
? parameters[control.name]
|
|
137
142
|
: control.value;
|
|
@@ -162,6 +167,7 @@ export function encodeGPUQueryExpressionControls(
|
|
|
162
167
|
} else {
|
|
163
168
|
const minimum = control.format === 'sint32' ? MINIMUM_SINT32 : 0;
|
|
164
169
|
const maximum = control.format === 'sint32' ? MAXIMUM_SINT32 : MAXIMUM_UINT32;
|
|
170
|
+
if (control.convertInteger) value = Math.min(maximum, Math.max(minimum, Math.trunc(value)));
|
|
165
171
|
if (!Number.isInteger(value) || value < minimum || value > maximum) {
|
|
166
172
|
throw new Error('GPUDataFrame numeric parameters must fit their integer column');
|
|
167
173
|
}
|
|
@@ -178,6 +184,7 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
178
184
|
readonly columns: GPUQueryExpressionColumn[] = [];
|
|
179
185
|
readonly controls: GPUQueryExpressionControl[] = [];
|
|
180
186
|
readonly statements: string[] = [];
|
|
187
|
+
readonly helpers: string[] = [];
|
|
181
188
|
|
|
182
189
|
private readonly source: GPUDataFrame<T>;
|
|
183
190
|
private readonly columnsByName = new Map<string, GPUQueryExpressionColumn>();
|
|
@@ -225,12 +232,31 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
225
232
|
|
|
226
233
|
emit(node: GPUExpressionNode, expected?: GPUQueryValueFormat): GPUQueryExpressionShaderValue {
|
|
227
234
|
switch (node.kind) {
|
|
235
|
+
case 'vector':
|
|
236
|
+
return this.emitVector(node);
|
|
237
|
+
case 'cast':
|
|
238
|
+
return this.emitCast(node);
|
|
228
239
|
case 'column':
|
|
229
240
|
return this.emitColumn(node.name, expected);
|
|
230
241
|
case 'literal':
|
|
231
242
|
return this.emitControl(node.value, undefined, expected);
|
|
232
243
|
case 'parameter':
|
|
233
244
|
return this.emitControl(node.value, node.name, expected);
|
|
245
|
+
case 'conditional': {
|
|
246
|
+
const condition = this.emit(node.condition, 'boolean');
|
|
247
|
+
this.assertBoolean(condition);
|
|
248
|
+
const format =
|
|
249
|
+
this.inferFormat(node) ?? (expected === 'boolean' ? undefined : expected) ?? 'float32';
|
|
250
|
+
const whenTrue = this.emit(node.whenTrue, format);
|
|
251
|
+
const otherwise = this.emit(node.otherwise, format);
|
|
252
|
+
const match = `(${condition.valid} && ${condition.value})`;
|
|
253
|
+
return this.addValue(
|
|
254
|
+
format,
|
|
255
|
+
`select(${otherwise.value}, ${whenTrue.value}, ${match})`,
|
|
256
|
+
`select(${otherwise.valid}, ${whenTrue.valid}, ${match})`,
|
|
257
|
+
whenTrue.nullable || otherwise.nullable
|
|
258
|
+
);
|
|
259
|
+
}
|
|
234
260
|
case 'unary':
|
|
235
261
|
return this.emitUnary(node.operator, node.operand, expected);
|
|
236
262
|
case 'binary':
|
|
@@ -260,26 +286,141 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
260
286
|
if (expected && expected !== column.format && expected !== 'boolean') {
|
|
261
287
|
throw new Error('GPUDataFrame expression combines incompatible scalar column formats');
|
|
262
288
|
}
|
|
263
|
-
const value = `
|
|
289
|
+
const value = `readInput${column.index}(index)`;
|
|
264
290
|
const valid = column.nullable
|
|
265
291
|
? `validity${column.index}[VALIDITY_${column.index}_OFFSET + index] != 0u`
|
|
266
292
|
: 'true';
|
|
267
293
|
return this.addValue(column.format, value, valid, column.nullable);
|
|
268
294
|
}
|
|
269
295
|
|
|
296
|
+
/** Constructs a vector and combines validity across all of its components. */
|
|
297
|
+
private emitVector(
|
|
298
|
+
node: Extract<GPUExpressionNode, {kind: 'vector'}>
|
|
299
|
+
): GPUQueryExpressionShaderValue {
|
|
300
|
+
const layout = getGPUVectorWGSLLayout(node.format);
|
|
301
|
+
if (layout.components === 1 || node.components.length !== layout.components)
|
|
302
|
+
throw new Error('Vector width must match its format');
|
|
303
|
+
const components = node.components.map(component =>
|
|
304
|
+
this.emitConversion(component, layout.componentType)
|
|
305
|
+
);
|
|
306
|
+
return this.addValue(
|
|
307
|
+
node.format,
|
|
308
|
+
`${layout.shaderType}(${components.map(component => component.value).join(', ')})`,
|
|
309
|
+
components.map(component => component.valid).join(' && '),
|
|
310
|
+
components.some(component => component.nullable)
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Lowers a width-preserving numeric cast. */
|
|
315
|
+
private emitCast(
|
|
316
|
+
node: Extract<GPUExpressionNode, {kind: 'cast'}>
|
|
317
|
+
): GPUQueryExpressionShaderValue {
|
|
318
|
+
if (getGPUVectorWGSLLayout(node.format).components > 1) {
|
|
319
|
+
return this.emitConversion(node.operand, node.format);
|
|
320
|
+
}
|
|
321
|
+
const format = node.format;
|
|
322
|
+
if (format !== 'float32' && format !== 'sint32' && format !== 'uint32') {
|
|
323
|
+
throw new Error('GPUDataFrame casts require scalar 32-bit formats');
|
|
324
|
+
}
|
|
325
|
+
const operand = this.emit(node.operand, this.inferFormat(node.operand) ?? 'float32');
|
|
326
|
+
if (
|
|
327
|
+
operand.format !== 'float32' &&
|
|
328
|
+
operand.format !== 'uint32' &&
|
|
329
|
+
operand.format !== 'sint32'
|
|
330
|
+
) {
|
|
331
|
+
throw new Error('GPUDataFrame scalar casts require scalar numeric expressions');
|
|
332
|
+
}
|
|
333
|
+
const floatToInteger = operand.format === 'float32' && format !== 'float32';
|
|
334
|
+
const valid = floatToInteger
|
|
335
|
+
? `(${operand.valid} && (bitcast<u32>(${operand.value}) & 0x7fffffffu) < 0x7f800000u)`
|
|
336
|
+
: operand.valid;
|
|
337
|
+
const input = floatToInteger ? `select(0.0, ${operand.value}, ${valid})` : operand.value;
|
|
338
|
+
if (floatToInteger && !this.helpers.includes(GPU_EXPRESSION_CAST_WGSL))
|
|
339
|
+
this.helpers.push(GPU_EXPRESSION_CAST_WGSL);
|
|
340
|
+
return this.addValue(
|
|
341
|
+
format,
|
|
342
|
+
getGPUExpressionCastWGSL(input, operand.format, format, 'truncate'),
|
|
343
|
+
valid,
|
|
344
|
+
operand.nullable || floatToInteger
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** Encodes integer controls directly and lowers other conversions into WGSL. */
|
|
349
|
+
private emitConversion(
|
|
350
|
+
node: GPUExpressionNode,
|
|
351
|
+
target: GPUExpressionNumericFormat
|
|
352
|
+
): GPUQueryExpressionShaderValue {
|
|
353
|
+
if (
|
|
354
|
+
(target === 'sint32' || target === 'uint32') &&
|
|
355
|
+
(node.kind === 'literal' || node.kind === 'parameter') &&
|
|
356
|
+
(node.value === null || typeof node.value === 'number')
|
|
357
|
+
) {
|
|
358
|
+
// Convert controls before upload to retain values above f32 integer precision.
|
|
359
|
+
return this.emitControl(
|
|
360
|
+
node.value,
|
|
361
|
+
node.kind === 'parameter' ? node.name : undefined,
|
|
362
|
+
target,
|
|
363
|
+
true
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
return this.convertValue(this.emit(node, this.inferFormat(node) ?? 'float32'), target);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** Converts each component while preserving width and row validity. */
|
|
370
|
+
private convertValue(
|
|
371
|
+
source: GPUQueryExpressionShaderValue,
|
|
372
|
+
target: GPUExpressionNumericFormat
|
|
373
|
+
): GPUQueryExpressionShaderValue {
|
|
374
|
+
if (source.format === 'boolean') throw new Error('Numeric casts require numeric inputs');
|
|
375
|
+
const sourceLayout = getGPUVectorWGSLLayout(source.format);
|
|
376
|
+
const targetLayout = getGPUVectorWGSLLayout(target);
|
|
377
|
+
if (sourceLayout.components !== targetLayout.components)
|
|
378
|
+
throw new Error('Numeric casts must preserve width');
|
|
379
|
+
if (source.format === target) return source;
|
|
380
|
+
if (!this.helpers.includes(GPU_EXPRESSION_CAST_WGSL))
|
|
381
|
+
this.helpers.push(GPU_EXPRESSION_CAST_WGSL);
|
|
382
|
+
const components = Array.from({length: sourceLayout.components}, (_, index) => {
|
|
383
|
+
const value = sourceLayout.components === 1 ? source.value : `${source.value}[${index}]`;
|
|
384
|
+
return getGPUExpressionCastWGSL(
|
|
385
|
+
value,
|
|
386
|
+
sourceLayout.componentType,
|
|
387
|
+
targetLayout.componentType,
|
|
388
|
+
'truncate'
|
|
389
|
+
);
|
|
390
|
+
});
|
|
391
|
+
// Float NaN/Inf has no portable integer value: mark the entire row invalid.
|
|
392
|
+
const finite =
|
|
393
|
+
sourceLayout.componentType === 'float32' && targetLayout.componentType !== 'float32';
|
|
394
|
+
const valid = finite
|
|
395
|
+
? `${source.valid} && ${sourceLayout.components === 1 ? `abs(${source.value}) <= 3.4028234663852886e38f` : `all(abs(${source.value}) <= ${sourceLayout.shaderType}(3.4028234663852886e38f))`}`
|
|
396
|
+
: source.valid;
|
|
397
|
+
return this.addValue(
|
|
398
|
+
target,
|
|
399
|
+
targetLayout.components === 1
|
|
400
|
+
? components[0]
|
|
401
|
+
: `${targetLayout.shaderType}(${components.join(', ')})`,
|
|
402
|
+
valid,
|
|
403
|
+
source.nullable || finite
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
|
|
270
407
|
private emitControl(
|
|
271
408
|
value: GPUExpressionValue,
|
|
272
409
|
name: string | undefined,
|
|
273
|
-
expected?: GPUQueryValueFormat
|
|
410
|
+
expected?: GPUQueryValueFormat,
|
|
411
|
+
convertInteger = false
|
|
274
412
|
): GPUQueryExpressionShaderValue {
|
|
275
413
|
const inferred = typeof value === 'boolean' ? 'boolean' : (expected ?? 'float32');
|
|
414
|
+
if (inferred !== 'boolean' && getGPUVectorWGSLLayout(inferred).components !== 1)
|
|
415
|
+
throw new Error('Scalar literals cannot broadcast to vectors');
|
|
276
416
|
if (value !== null && (typeof value === 'boolean') !== (inferred === 'boolean')) {
|
|
277
417
|
throw new Error('GPUDataFrame expression combines incompatible literal and column formats');
|
|
278
418
|
}
|
|
279
419
|
const control: GPUQueryExpressionControl = {
|
|
280
420
|
...(name !== undefined ? {name} : {}),
|
|
281
421
|
value,
|
|
282
|
-
|
|
422
|
+
...(convertInteger ? {convertInteger} : {}),
|
|
423
|
+
format: inferred as GPUQueryScalarFormat | 'boolean',
|
|
283
424
|
index: this.controls.length
|
|
284
425
|
};
|
|
285
426
|
this.controls.push(control);
|
|
@@ -297,7 +438,7 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
297
438
|
}
|
|
298
439
|
|
|
299
440
|
private emitUnary(
|
|
300
|
-
operator:
|
|
441
|
+
operator: GPUExpressionUnaryOperator,
|
|
301
442
|
operandNode: GPUExpressionNode,
|
|
302
443
|
expected?: GPUQueryValueFormat
|
|
303
444
|
): GPUQueryExpressionShaderValue {
|
|
@@ -315,9 +456,58 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
315
456
|
const operand = this.emit(operandNode, this.inferFormat(operandNode));
|
|
316
457
|
return this.addValue('boolean', `!${operand.valid}`, 'true');
|
|
317
458
|
}
|
|
459
|
+
case 'sqrt':
|
|
460
|
+
case 'ln':
|
|
461
|
+
case 'log10':
|
|
462
|
+
case 'asin':
|
|
463
|
+
case 'acos': {
|
|
464
|
+
const operand = this.emit(operandNode, this.inferFormat(operandNode) ?? 'float32');
|
|
465
|
+
if (operand.format !== 'float32') {
|
|
466
|
+
throw new Error('GPUDataFrame domain-sensitive functions require Float32 input');
|
|
467
|
+
}
|
|
468
|
+
const value = operand.value;
|
|
469
|
+
const domain =
|
|
470
|
+
operator === 'sqrt'
|
|
471
|
+
? `${value} >= 0.0`
|
|
472
|
+
: operator === 'ln' || operator === 'log10'
|
|
473
|
+
? `${value} > 0.0`
|
|
474
|
+
: `abs(${value}) <= 1.0`;
|
|
475
|
+
const valid = `(${operand.valid} && (bitcast<u32>(${value}) & 0x7fffffffu) < 0x7f800000u && (${domain}))`;
|
|
476
|
+
const input = `select(1.0, ${value}, ${valid})`;
|
|
477
|
+
const result =
|
|
478
|
+
operator === 'log10'
|
|
479
|
+
? `(log2(${input}) / log2(10.0))`
|
|
480
|
+
: `${operator === 'ln' ? 'log' : operator}(${input})`;
|
|
481
|
+
return this.addValue('float32', result, valid, true);
|
|
482
|
+
}
|
|
483
|
+
case 'abs':
|
|
484
|
+
case 'floor':
|
|
485
|
+
case 'ceiling':
|
|
486
|
+
case 'round':
|
|
487
|
+
case 'trunc': {
|
|
488
|
+
const format = this.inferFormat(operandNode) ?? 'float32';
|
|
489
|
+
if (
|
|
490
|
+
(format !== 'float32' && format !== 'sint32' && format !== 'uint32') ||
|
|
491
|
+
(operator === 'abs' && format === 'sint32')
|
|
492
|
+
) {
|
|
493
|
+
throw new Error('GPUDataFrame scalar function requires a supported numeric format');
|
|
494
|
+
}
|
|
495
|
+
const operand = this.emit(operandNode, format);
|
|
496
|
+
if (format !== 'float32') {
|
|
497
|
+
return operand;
|
|
498
|
+
}
|
|
499
|
+
const value = operand.value;
|
|
500
|
+
const functionName = operator === 'ceiling' ? 'ceil' : operator;
|
|
501
|
+
const rounded = `trunc(${value})`;
|
|
502
|
+
const result =
|
|
503
|
+
operator === 'round'
|
|
504
|
+
? `(${rounded} + select(0.0, sign(${value}), abs(${value} - ${rounded}) >= 0.5))`
|
|
505
|
+
: `${functionName}(${value})`;
|
|
506
|
+
return this.addValue(format, result, operand.valid, operand.nullable);
|
|
507
|
+
}
|
|
318
508
|
case 'negate': {
|
|
319
509
|
const format = this.inferFormat(operandNode) ?? expected ?? 'float32';
|
|
320
|
-
if (format === 'boolean' || format === 'uint32') {
|
|
510
|
+
if (format === 'boolean' || getGPUVectorWGSLLayout(format).componentType === 'uint32') {
|
|
321
511
|
throw new Error('GPUDataFrame negation requires a signed numeric expression');
|
|
322
512
|
}
|
|
323
513
|
const operand = this.emit(operandNode, format);
|
|
@@ -369,8 +559,31 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
369
559
|
}
|
|
370
560
|
const left = this.emit(leftNode, format);
|
|
371
561
|
const right = this.emit(rightNode, format);
|
|
562
|
+
if (operator === 'coalesce') {
|
|
563
|
+
return this.addValue(
|
|
564
|
+
format,
|
|
565
|
+
`select(${right.value}, ${left.value}, ${left.valid})`,
|
|
566
|
+
`(${left.valid} || ${right.valid})`,
|
|
567
|
+
left.nullable && right.nullable
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
const vector = format !== 'boolean' && getGPUVectorWGSLLayout(format).components > 1;
|
|
571
|
+
if (operator === 'nullif') {
|
|
572
|
+
const equals = `(${left.value} == ${right.value})`;
|
|
573
|
+
return this.addValue(
|
|
574
|
+
format,
|
|
575
|
+
left.value,
|
|
576
|
+
`(${left.valid} && !(${right.valid} && ${vector ? `all(${equals})` : equals}))`,
|
|
577
|
+
true
|
|
578
|
+
);
|
|
579
|
+
}
|
|
372
580
|
const symbol = getGPUQueryBinaryOperator(operator);
|
|
373
|
-
|
|
581
|
+
let value = `(${left.value} ${symbol} ${right.value})`;
|
|
582
|
+
if (vector && !arithmetic) {
|
|
583
|
+
if (operator !== 'equal' && operator !== 'not-equal')
|
|
584
|
+
throw new Error('Vector ordering is unsupported');
|
|
585
|
+
value = `${operator === 'equal' ? 'all' : 'any'}(${value})`;
|
|
586
|
+
}
|
|
374
587
|
const valid = `${left.valid} && ${right.valid}`;
|
|
375
588
|
return this.addValue(
|
|
376
589
|
arithmetic ? format : 'boolean',
|
|
@@ -382,6 +595,9 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
382
595
|
|
|
383
596
|
private inferFormat(node: GPUExpressionNode): GPUQueryValueFormat | undefined {
|
|
384
597
|
switch (node.kind) {
|
|
598
|
+
case 'vector':
|
|
599
|
+
case 'cast':
|
|
600
|
+
return node.format;
|
|
385
601
|
case 'column':
|
|
386
602
|
return this.derivedByName.has(node.name)
|
|
387
603
|
? this.emitDerived(this.derivedByName.get(node.name)!).format
|
|
@@ -389,10 +605,27 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
389
605
|
case 'literal':
|
|
390
606
|
case 'parameter':
|
|
391
607
|
return typeof node.value === 'boolean' ? 'boolean' : undefined;
|
|
608
|
+
case 'conditional': {
|
|
609
|
+
const whenTrue = this.inferFormat(node.whenTrue);
|
|
610
|
+
const otherwise = this.inferFormat(node.otherwise);
|
|
611
|
+
if (
|
|
612
|
+
whenTrue === 'boolean' ||
|
|
613
|
+
otherwise === 'boolean' ||
|
|
614
|
+
(whenTrue && otherwise && whenTrue !== otherwise)
|
|
615
|
+
) {
|
|
616
|
+
throw new Error('GPUDataFrame CASE branches require matching numeric formats');
|
|
617
|
+
}
|
|
618
|
+
return whenTrue ?? otherwise;
|
|
619
|
+
}
|
|
392
620
|
case 'unary':
|
|
621
|
+
if (isGPUScalarFunction(node.operator)) {
|
|
622
|
+
return this.inferFormat(node.operand) ?? 'float32';
|
|
623
|
+
}
|
|
393
624
|
return node.operator === 'negate' ? this.inferFormat(node.operand) : 'boolean';
|
|
394
625
|
case 'binary':
|
|
395
626
|
if (
|
|
627
|
+
node.operator === 'coalesce' ||
|
|
628
|
+
node.operator === 'nullif' ||
|
|
396
629
|
node.operator === 'add' ||
|
|
397
630
|
node.operator === 'subtract' ||
|
|
398
631
|
node.operator === 'multiply' ||
|
|
@@ -450,14 +683,27 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
450
683
|
throw new Error(`GPUDataFrame expression column "${name}" is not a GPU vector`);
|
|
451
684
|
}
|
|
452
685
|
const format = vector?.format ?? field.format;
|
|
453
|
-
|
|
454
|
-
|
|
686
|
+
const layout = getGPUVectorWGSLLayout(format as GPUExpressionNumericFormat);
|
|
687
|
+
if (
|
|
688
|
+
vector?.data.some(
|
|
689
|
+
chunk =>
|
|
690
|
+
chunk.byteStride !== layout.packedByteStride ||
|
|
691
|
+
chunk.rowByteLength !== layout.byteLength ||
|
|
692
|
+
chunk.byteOffset % 4 !== 0
|
|
693
|
+
)
|
|
694
|
+
) {
|
|
695
|
+
throw new Error('GPUDataFrame expressions require packed, 32-bit-aligned numeric columns');
|
|
455
696
|
}
|
|
456
697
|
const nullable = field.nullable === true;
|
|
457
698
|
if (nullable && this.source.numRows > 0 && !this.source.validity[name as keyof T & string]) {
|
|
458
699
|
throw new Error(`GPUDataFrame nullable column "${name}" requires an explicit validity mask`);
|
|
459
700
|
}
|
|
460
|
-
const column = {
|
|
701
|
+
const column = {
|
|
702
|
+
name,
|
|
703
|
+
format: format as GPUExpressionNumericFormat,
|
|
704
|
+
nullable,
|
|
705
|
+
index: this.columns.length
|
|
706
|
+
};
|
|
461
707
|
this.columns.push(column);
|
|
462
708
|
this.columnsByName.set(name, column);
|
|
463
709
|
return column;
|
|
@@ -486,19 +732,8 @@ class GPUQueryExpressionShaderPlanner<T extends GPUTypeMap> {
|
|
|
486
732
|
}
|
|
487
733
|
|
|
488
734
|
/** Converts a closed scalar format to the corresponding native WGSL scalar type. @internal */
|
|
489
|
-
export function getGPUQueryShaderType(format: GPUQueryValueFormat):
|
|
490
|
-
|
|
491
|
-
case 'float32':
|
|
492
|
-
return 'f32';
|
|
493
|
-
case 'sint32':
|
|
494
|
-
return 'i32';
|
|
495
|
-
case 'uint32':
|
|
496
|
-
return 'u32';
|
|
497
|
-
case 'boolean':
|
|
498
|
-
return 'bool';
|
|
499
|
-
default:
|
|
500
|
-
throw new Error('GPUDataFrame expression contains an unsupported scalar format');
|
|
501
|
-
}
|
|
735
|
+
export function getGPUQueryShaderType(format: GPUQueryValueFormat): string {
|
|
736
|
+
return format === 'boolean' ? 'bool' : getGPUVectorWGSLLayout(format).shaderType;
|
|
502
737
|
}
|
|
503
738
|
|
|
504
739
|
/** Maps only known discriminants to WGSL operators without accepting application shader text. */
|