@luma.gl/graph 10.0.0-alpha.9 → 10.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +19 -0
- package/dist/arrow/arrow-colors.cjs +99 -18
- package/dist/arrow/arrow-colors.d.ts +27 -10
- package/dist/arrow/arrow-colors.d.ts.map +1 -1
- package/dist/arrow/arrow-colors.js +107 -24
- package/dist/arrow/arrow-colors.js.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
- package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
- package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
- package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +19 -2
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +5 -2
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +4 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +3820 -1646
- package/dist/dist.min.js +450 -136
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/simulation/index.cjs.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.cjs +2 -15
- package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.js +2 -15
- package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
- package/dist/geospatial/index.cjs.map +2 -2
- package/dist/gpu-a5/index.cjs.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.js +54 -1
- package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
- package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph.cjs +34 -11
- package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
- package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph.js +39 -11
- package/dist/gpu-core/gpu-command-graph.js.map +1 -1
- package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-execution.js +294 -0
- package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.js +35 -0
- package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
- package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
- package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
- package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
- package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
- package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
- package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.js +1 -1
- package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
- package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.js +7 -1
- package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.js +50 -0
- package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-graph.d.ts +2 -2
- package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
- package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.js +2 -5
- package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
- package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
- package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
- package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
- package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
- package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.js +2 -16
- package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +7 -18
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-operation.d.ts +4 -4
- package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-operation.js.map +1 -1
- package/dist/gpu-core/gpu-reduction.cjs +6 -14
- package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-reduction.js +6 -15
- package/dist/gpu-core/gpu-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-render-operation.cjs +39 -0
- package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
- package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-render-operation.js +22 -0
- package/dist/gpu-core/gpu-render-operation.js.map +1 -0
- package/dist/gpu-core/gpu-scan.cjs +46 -32
- package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-scan.js +56 -44
- package/dist/gpu-core/gpu-scan.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
- package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.js +73 -16
- package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
- package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
- package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
- package/dist/gpu-core/index.cjs +32 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +21 -1
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +10 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-data/color-conversion.cjs +105 -0
- package/dist/gpu-data/color-conversion.d.ts +30 -0
- package/dist/gpu-data/color-conversion.d.ts.map +1 -0
- package/dist/gpu-data/color-conversion.js +109 -0
- package/dist/gpu-data/color-conversion.js.map +1 -0
- package/dist/gpu-data/cpu-data.cjs +60 -0
- package/dist/gpu-data/cpu-data.d.ts +28 -0
- package/dist/gpu-data/cpu-data.d.ts.map +1 -0
- package/dist/gpu-data/cpu-data.js +41 -0
- package/dist/gpu-data/cpu-data.js.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
- package/dist/gpu-data/cpu-vector.cjs +42 -0
- package/dist/gpu-data/cpu-vector.d.ts +17 -0
- package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
- package/dist/gpu-data/cpu-vector.js +21 -0
- package/dist/gpu-data/cpu-vector.js.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
- package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
- package/dist/gpu-data/index.cjs +21 -2
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-data/index.d.ts +6 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +5 -0
- package/dist/gpu-data/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +1 -16
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +1 -23
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +91 -2
- package/dist/gpu-dataframe/gpu-expression.d.ts +37 -0
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +106 -0
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +12 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +4 -0
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -0
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +103 -0
- package/dist/gpu-dataframe/portable-expression.d.ts +19 -0
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
- package/dist/gpu-dataframe/portable-expression.js +98 -0
- package/dist/gpu-dataframe/portable-expression.js.map +1 -0
- package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
- package/dist/gpu-dggs/index.cjs.map +1 -1
- package/dist/gpu-geometry/index.cjs.map +1 -1
- package/dist/gpu-graph/index.cjs +8 -0
- package/dist/gpu-graph/index.cjs.map +3 -3
- package/dist/gpu-graph/index.d.ts +4 -0
- package/dist/gpu-graph/index.d.ts.map +1 -1
- package/dist/gpu-graph/index.js +2 -0
- package/dist/gpu-graph/index.js.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
- package/dist/gpu-h3/index.cjs.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +162 -2
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +25 -0
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +181 -2
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs.map +2 -2
- package/dist/gpu-physics/index.d.ts +1 -0
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +24 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +2 -2
- package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.js +2 -2
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
- package/dist/gpu-pointcloud/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
- package/dist/gpu-project/coordinate-projection-graph.js +40 -0
- package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.js +103 -0
- package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.js +37 -0
- package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/geoarrow.cjs +36 -0
- package/dist/gpu-project/geoarrow.cjs.map +6 -0
- package/dist/gpu-project/geoarrow.d.ts +3 -0
- package/dist/gpu-project/geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/geoarrow.js +7 -0
- package/dist/gpu-project/geoarrow.js.map +1 -0
- package/dist/gpu-project/graph.cjs +27 -0
- package/dist/gpu-project/graph.cjs.map +6 -0
- package/dist/gpu-project/graph.d.ts +2 -0
- package/dist/gpu-project/graph.d.ts.map +1 -0
- package/dist/gpu-project/graph.js +6 -0
- package/dist/gpu-project/graph.js.map +1 -0
- package/dist/gpu-project/index.cjs +3 -0
- package/dist/gpu-project/index.cjs.map +3 -3
- package/dist/gpu-project/index.d.ts +1 -0
- package/dist/gpu-project/index.d.ts.map +1 -1
- package/dist/gpu-project/index.js +1 -0
- package/dist/gpu-project/index.js.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +75 -5
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.cjs +126 -10
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
- package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/index.d.ts +1 -1
- package/dist/gpu-simple-graph/index.d.ts.map +1 -1
- package/dist/gpu-simple-graph/index.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +6 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
- package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
- package/dist/gpu-sql/gpu-sql.cjs +157 -280
- package/dist/gpu-sql/gpu-sql.d.ts +1 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +168 -291
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-tables/index.cjs.map +2 -2
- package/dist/gpu-tables/table/gpu-table.cjs +2 -2
- package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
- package/dist/gpu-tables/table/gpu-table.js +2 -2
- package/dist/gpu-tables/table/gpu-table.js.map +1 -1
- package/dist/gpu-timeseries/index.cjs.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +21 -7
- package/src/arrow/arrow-colors.ts +194 -33
- package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
- package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
- package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
- package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
- package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
- package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
- package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
- package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
- package/src/arrow/index.ts +14 -0
- package/src/geospatial/gpu-point-spatial-query.ts +2 -15
- package/src/gpu-core/compiled-gpu-graph.ts +73 -1
- package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
- package/src/gpu-core/gpu-command-graph-types.ts +20 -0
- package/src/gpu-core/gpu-command-graph.ts +48 -11
- package/src/gpu-core/gpu-cpu-execution.ts +345 -0
- package/src/gpu-core/gpu-cpu-operation.ts +65 -0
- package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
- package/src/gpu-core/gpu-expression-operation.ts +1 -1
- package/src/gpu-core/gpu-expression-plan.ts +11 -3
- package/src/gpu-core/gpu-graph-compiler.ts +61 -0
- package/src/gpu-core/gpu-graph.ts +3 -3
- package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
- package/src/gpu-core/gpu-grid-binning.ts +2 -5
- package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
- package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
- package/src/gpu-core/gpu-grid-index-query.ts +2 -16
- package/src/gpu-core/gpu-group-aggregation.ts +38 -50
- package/src/gpu-core/gpu-operation.ts +9 -7
- package/src/gpu-core/gpu-reduction.ts +32 -42
- package/src/gpu-core/gpu-render-operation.ts +42 -0
- package/src/gpu-core/gpu-scan.ts +59 -45
- package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
- package/src/gpu-core/gpu-segmented-scan.ts +82 -17
- package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
- package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
- package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
- package/src/gpu-core/gpu-texture-plan.ts +3 -2
- package/src/gpu-core/index.ts +39 -0
- package/src/gpu-data/color-conversion.ts +158 -0
- package/src/gpu-data/cpu-data.ts +62 -0
- package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
- package/src/gpu-data/cpu-vector.ts +31 -0
- package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
- package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
- package/src/gpu-data/index.ts +15 -0
- package/src/gpu-dataframe/gpu-data-frame-query.ts +6 -26
- package/src/gpu-dataframe/gpu-expression.ts +135 -0
- package/src/gpu-dataframe/index.ts +11 -0
- package/src/gpu-dataframe/portable-expression.ts +117 -0
- package/src/gpu-graph/index.ts +17 -0
- package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
- package/src/gpu-physics/gpu-rigid-body-world.ts +227 -2
- package/src/gpu-physics/index.ts +1 -0
- package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
- package/src/gpu-physics/rigid-body-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
- package/src/gpu-project/coordinate-projection-graph.ts +59 -0
- package/src/gpu-project/cpu-geoarrow.ts +135 -0
- package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
- package/src/gpu-project/cpu-projection-operation.ts +49 -0
- package/src/gpu-project/geoarrow.ts +11 -0
- package/src/gpu-project/graph.ts +10 -0
- package/src/gpu-project/index.ts +2 -0
- package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +97 -6
- package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -0
- package/src/gpu-simple-graph/gpu-simple-graph.ts +163 -19
- package/src/gpu-simple-graph/index.ts +1 -0
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +24 -0
- package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
- package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
- package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
- package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
- package/src/gpu-sql/gpu-sql.ts +179 -293
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +21 -0
|
@@ -33,6 +33,7 @@ var import_gpu_simple_graph_operation = require("./gpu-simple-graph-operation.cj
|
|
|
33
33
|
var import_gpu_simple_graph_transfer = require("./gpu-simple-graph-transfer.cjs");
|
|
34
34
|
var import_gpu_simple_graph_value = require("./gpu-simple-graph-value.cjs");
|
|
35
35
|
var import_gpu_simple_graph_lowering = require("./gpu-simple-graph-lowering.cjs");
|
|
36
|
+
var import_gpu_command_graph = require("../gpu-core/gpu-command-graph.cjs");
|
|
36
37
|
class GPUSimpleGraph {
|
|
37
38
|
declarations = new import_gpu_graph.GPUGraph();
|
|
38
39
|
device;
|
|
@@ -41,6 +42,7 @@ class GPUSimpleGraph {
|
|
|
41
42
|
evaluatorIds = /* @__PURE__ */ new Set();
|
|
42
43
|
programOperations = [];
|
|
43
44
|
compiled = false;
|
|
45
|
+
renderOperations = [];
|
|
44
46
|
/** Execution capabilities; evaluators retain control of backend submission. */
|
|
45
47
|
capabilities;
|
|
46
48
|
constructor(deviceOrProps, props = {}) {
|
|
@@ -49,8 +51,8 @@ class GPUSimpleGraph {
|
|
|
49
51
|
this.id = (device ? props.id : deviceOrProps == null ? void 0 : deviceOrProps.id) ?? "simple-graph";
|
|
50
52
|
this.capabilities = Object.freeze({
|
|
51
53
|
callerControlledSubmission: (device == null ? void 0 : device.type) === "webgpu",
|
|
52
|
-
dynamicBindings:
|
|
53
|
-
transientAllocation:
|
|
54
|
+
dynamicBindings: true,
|
|
55
|
+
transientAllocation: Boolean(device)
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
addInput(id, descriptor) {
|
|
@@ -73,12 +75,16 @@ class GPUSimpleGraph {
|
|
|
73
75
|
}
|
|
74
76
|
/** Accepts evaluator operations, semantic composites, and recursively nested arrays. */
|
|
75
77
|
add(operation) {
|
|
78
|
+
return this.addOperations(operation);
|
|
79
|
+
}
|
|
80
|
+
addOperations(operation) {
|
|
76
81
|
(0, import_core.assert)(!this.compiled);
|
|
77
82
|
if (!this.device || operation instanceof import_gpu_expression_operation.GPUExpressionOperation) {
|
|
78
83
|
this.declarations.add(operation);
|
|
79
84
|
return this;
|
|
80
85
|
}
|
|
81
86
|
const pending = [];
|
|
87
|
+
let hasRenderOperation = this.renderOperations.length > 0;
|
|
82
88
|
const pendingEvaluatorIds = /* @__PURE__ */ new Set();
|
|
83
89
|
const operations = [];
|
|
84
90
|
const visit = (value) => {
|
|
@@ -89,7 +95,11 @@ class GPUSimpleGraph {
|
|
|
89
95
|
(0, import_core.assert)(value.type === "composite");
|
|
90
96
|
for (const child of value.operations)
|
|
91
97
|
visit(child);
|
|
98
|
+
} else if (value instanceof import_gpu_core.GPURenderOperation) {
|
|
99
|
+
hasRenderOperation = true;
|
|
100
|
+
pending.push(value);
|
|
92
101
|
} else {
|
|
102
|
+
(0, import_core.assert)(!hasRenderOperation);
|
|
93
103
|
(0, import_core.assert)(value instanceof import_gpu_simple_graph_value.GPUSimpleGraphValueOperation || value instanceof import_gpu_simple_graph_operation.GPUSimpleGraphOperation || value instanceof import_gpu_simple_graph_transfer.GPUSimpleGraphUploadOperation || value instanceof import_gpu_simple_graph_transfer.GPUSimpleGraphCopyOperation || value instanceof import_gpu_core.GPUGraphScalarLiteral || value instanceof import_gpu_core.GPUGraphScalarOperation || value instanceof import_gpu_core.GPUGraphVectorMADD);
|
|
94
104
|
if (value instanceof import_gpu_simple_graph_value.GPUSimpleGraphValueOperation || value instanceof import_gpu_simple_graph_operation.GPUSimpleGraphOperation || value instanceof import_gpu_simple_graph_transfer.GPUSimpleGraphUploadOperation || value instanceof import_gpu_simple_graph_transfer.GPUSimpleGraphCopyOperation) {
|
|
95
105
|
(0, import_core.assert)(value.id && !this.evaluatorIds.has(value.id) && !pendingEvaluatorIds.has(value.id));
|
|
@@ -108,7 +118,12 @@ class GPUSimpleGraph {
|
|
|
108
118
|
};
|
|
109
119
|
visit(operation);
|
|
110
120
|
collect(operation);
|
|
111
|
-
|
|
121
|
+
for (const value of pending) {
|
|
122
|
+
if (value instanceof import_gpu_core.GPURenderOperation)
|
|
123
|
+
this.renderOperations.push(value);
|
|
124
|
+
else
|
|
125
|
+
this.leafOperations.push(value);
|
|
126
|
+
}
|
|
112
127
|
for (const identifier of pendingEvaluatorIds)
|
|
113
128
|
this.evaluatorIds.add(identifier);
|
|
114
129
|
this.programOperations.push(...operations);
|
|
@@ -116,20 +131,24 @@ class GPUSimpleGraph {
|
|
|
116
131
|
}
|
|
117
132
|
/** Publish a graph value; compilation owns its internal execution state. */
|
|
118
133
|
addValue(identifier, value) {
|
|
119
|
-
this.
|
|
134
|
+
this.addOperations(new import_gpu_simple_graph_value.GPUSimpleGraphValueOperation({ id: identifier, value }));
|
|
120
135
|
return value;
|
|
121
136
|
}
|
|
122
137
|
/** Compatibility adapter for existing evaluator-based callers. Prefer addValue() for new code. */
|
|
123
138
|
addEvaluator(identifier, evaluator) {
|
|
124
|
-
this.
|
|
139
|
+
this.addOperations(new import_gpu_simple_graph_operation.GPUSimpleGraphOperation({ id: identifier, evaluator }));
|
|
125
140
|
return evaluator;
|
|
126
141
|
}
|
|
142
|
+
/** Appends shared render passes after the evaluator phase. Use the same operation in GPUGraph. */
|
|
143
|
+
addRenderOperation(operation) {
|
|
144
|
+
return this.addOperations(operation);
|
|
145
|
+
}
|
|
127
146
|
get operationTree() {
|
|
128
147
|
return Object.freeze([...this.programOperations, ...this.declarations.operations].map(import_gpu_core.getGPUOperationTree));
|
|
129
148
|
}
|
|
130
149
|
compile(deviceOrOptions = {}, expressionOptions = {}) {
|
|
131
150
|
if ("type" in deviceOrOptions) {
|
|
132
|
-
(0, import_core.assert)(!this.compiled && this.leafOperations.length === 0);
|
|
151
|
+
(0, import_core.assert)(!this.compiled && this.leafOperations.length === 0 && this.renderOperations.length === 0);
|
|
133
152
|
this.compiled = true;
|
|
134
153
|
return new import_compiled_gpu_expression_graph.CompiledGPUSimpleExpressionGraph(deviceOrOptions, this.declarations, expressionOptions);
|
|
135
154
|
}
|
|
@@ -144,6 +163,7 @@ class GPUSimpleGraph {
|
|
|
144
163
|
(0, import_core.assert)(!this.compiled);
|
|
145
164
|
this.compiled = true;
|
|
146
165
|
const lowering = new import_gpu_simple_graph_lowering.SimpleGraphLowering(options.bindings ?? {});
|
|
166
|
+
let renderGraph;
|
|
147
167
|
try {
|
|
148
168
|
for (const operation of this.leafOperations)
|
|
149
169
|
lowering.lower(operation);
|
|
@@ -217,8 +237,17 @@ class GPUSimpleGraph {
|
|
|
217
237
|
});
|
|
218
238
|
}
|
|
219
239
|
}
|
|
220
|
-
|
|
240
|
+
if (this.renderOperations.length) {
|
|
241
|
+
const renderBuilder = new import_gpu_command_graph.GPUCommandGraphBuilder(this.device, {
|
|
242
|
+
id: `${this.id}-render`
|
|
243
|
+
});
|
|
244
|
+
for (const operation of this.renderOperations)
|
|
245
|
+
renderBuilder.add(operation);
|
|
246
|
+
renderGraph = renderBuilder.compile();
|
|
247
|
+
}
|
|
248
|
+
return new CompiledGPUSimpleGraph(this.device, nodes, roots, this.operationTree, lowering.owned, Object.fromEntries(roots.map(({ id, evaluator }) => [id, getIdentifier(evaluator)])), renderGraph, lowering.inputs);
|
|
221
249
|
} catch (error) {
|
|
250
|
+
renderGraph == null ? void 0 : renderGraph.destroy();
|
|
222
251
|
lowering.destroy();
|
|
223
252
|
throw error;
|
|
224
253
|
}
|
|
@@ -226,6 +255,8 @@ class GPUSimpleGraph {
|
|
|
226
255
|
}
|
|
227
256
|
class CompiledGPUSimpleGraph {
|
|
228
257
|
ownedEvaluators;
|
|
258
|
+
renderGraph;
|
|
259
|
+
inputs;
|
|
229
260
|
nodes;
|
|
230
261
|
outputs;
|
|
231
262
|
/** Maps every selected output ID, including aliases, to its dependency inspection node. */
|
|
@@ -236,8 +267,10 @@ class CompiledGPUSimpleGraph {
|
|
|
236
267
|
running = false;
|
|
237
268
|
destroyed = false;
|
|
238
269
|
pendingScope;
|
|
239
|
-
constructor(device, nodes, roots, operationTree, ownedEvaluators = /* @__PURE__ */ new Set(), outputNodes = {}) {
|
|
270
|
+
constructor(device, nodes, roots, operationTree, ownedEvaluators = /* @__PURE__ */ new Set(), outputNodes = {}, renderGraph, inputs = /* @__PURE__ */ new Map()) {
|
|
240
271
|
this.ownedEvaluators = ownedEvaluators;
|
|
272
|
+
this.renderGraph = renderGraph;
|
|
273
|
+
this.inputs = inputs;
|
|
241
274
|
this.device = device;
|
|
242
275
|
this.nodes = Object.freeze(nodes.map((node) => Object.freeze({ ...node, dependencies: Object.freeze([...node.dependencies]) })));
|
|
243
276
|
this.executionPlan = Object.freeze([...roots]);
|
|
@@ -245,17 +278,99 @@ class CompiledGPUSimpleGraph {
|
|
|
245
278
|
this.outputNodes = Object.freeze({ ...outputNodes });
|
|
246
279
|
this.outputs = Object.freeze(Object.fromEntries(roots.map(({ id, evaluator }) => [id, evaluator])));
|
|
247
280
|
}
|
|
281
|
+
/** Invalidates changed named inputs and their reachable consumers, preserving other channels. */
|
|
282
|
+
invalidate(inputIds) {
|
|
283
|
+
(0, import_core.assert)(!this.running && !this.destroyed && !this.pendingScope);
|
|
284
|
+
const changed = /* @__PURE__ */ new Set();
|
|
285
|
+
for (const identifier of inputIds) {
|
|
286
|
+
const input = this.inputs.get(identifier);
|
|
287
|
+
(0, import_core.assert)(input && this.ownedEvaluators.has(input));
|
|
288
|
+
changed.add(input);
|
|
289
|
+
if (input instanceof import_gpu_vector_evaluator.GPUVectorEvaluator) {
|
|
290
|
+
for (const chunk of input.gpuDataEvaluators)
|
|
291
|
+
changed.add(chunk);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const affected = /* @__PURE__ */ new Map();
|
|
295
|
+
const visit = (evaluator) => {
|
|
296
|
+
const existing = affected.get(evaluator);
|
|
297
|
+
if (existing !== void 0)
|
|
298
|
+
return existing;
|
|
299
|
+
const dependencies = getDependencies(evaluator).map(visit);
|
|
300
|
+
const dirty = changed.has(evaluator) || dependencies.some(Boolean);
|
|
301
|
+
affected.set(evaluator, dirty);
|
|
302
|
+
return dirty;
|
|
303
|
+
};
|
|
304
|
+
for (const input of changed)
|
|
305
|
+
visit(input);
|
|
306
|
+
for (const { evaluator } of this.executionPlan)
|
|
307
|
+
visit(evaluator);
|
|
308
|
+
for (const [evaluator, dirty] of affected) {
|
|
309
|
+
if (dirty)
|
|
310
|
+
(0, import_core.assert)(this.ownedEvaluators.has(evaluator));
|
|
311
|
+
}
|
|
312
|
+
for (const [evaluator, dirty] of affected) {
|
|
313
|
+
if (dirty)
|
|
314
|
+
evaluator.invalidate();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
248
317
|
/** Releases semantic evaluator results, preserving borrowed inputs and wrappers. */
|
|
249
318
|
destroy() {
|
|
319
|
+
var _a;
|
|
250
320
|
(0, import_core.assert)(!this.running && !this.pendingScope);
|
|
251
321
|
if (this.destroyed)
|
|
252
322
|
return;
|
|
323
|
+
(_a = this.renderGraph) == null ? void 0 : _a.destroy();
|
|
253
324
|
for (const evaluator of this.ownedEvaluators)
|
|
254
325
|
evaluator.destroy();
|
|
255
326
|
this.destroyed = true;
|
|
256
327
|
}
|
|
257
|
-
|
|
258
|
-
|
|
328
|
+
runSync(options) {
|
|
329
|
+
(0, import_core.assert)(this.device.type === "webgl" && !(options == null ? void 0 : options.scope));
|
|
330
|
+
(0, import_core.assert)(!this.running && !this.destroyed && !this.pendingScope);
|
|
331
|
+
this.running = true;
|
|
332
|
+
try {
|
|
333
|
+
const results = {};
|
|
334
|
+
const evaluated = /* @__PURE__ */ new Set();
|
|
335
|
+
const evaluate = (evaluator) => {
|
|
336
|
+
if (evaluated.has(evaluator))
|
|
337
|
+
return;
|
|
338
|
+
for (const dependency of getDependencies(evaluator))
|
|
339
|
+
evaluate(dependency);
|
|
340
|
+
evaluator.evaluateSync(this.device);
|
|
341
|
+
evaluated.add(evaluator);
|
|
342
|
+
};
|
|
343
|
+
for (const { id, evaluator } of this.executionPlan) {
|
|
344
|
+
evaluate(evaluator);
|
|
345
|
+
results[id] = evaluator.gpuVector;
|
|
346
|
+
}
|
|
347
|
+
this.encodeRenderPasses(options);
|
|
348
|
+
return results;
|
|
349
|
+
} finally {
|
|
350
|
+
this.running = false;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
encodeRenderPasses(options) {
|
|
354
|
+
const scope = options == null ? void 0 : options.scope;
|
|
355
|
+
if (!this.renderGraph)
|
|
356
|
+
return;
|
|
357
|
+
const commandEncoder = (scope == null ? void 0 : scope.commandEncoder) ?? this.device.createCommandEncoder();
|
|
358
|
+
try {
|
|
359
|
+
this.renderGraph.encode(commandEncoder, {
|
|
360
|
+
buffers: options == null ? void 0 : options.buffers,
|
|
361
|
+
textures: options == null ? void 0 : options.textures,
|
|
362
|
+
// The public overload requires parameters unless Parameters is void.
|
|
363
|
+
parameters: options == null ? void 0 : options.parameters
|
|
364
|
+
});
|
|
365
|
+
if (!scope)
|
|
366
|
+
this.device.submit(commandEncoder.finish());
|
|
367
|
+
} finally {
|
|
368
|
+
if (!scope)
|
|
369
|
+
commandEncoder.destroy();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
async run(options) {
|
|
373
|
+
const scope = options == null ? void 0 : options.scope;
|
|
259
374
|
(0, import_core.assert)(!this.running && !this.destroyed && !this.pendingScope);
|
|
260
375
|
if (scope) {
|
|
261
376
|
(0, import_core.assert)(scope.device === this.device);
|
|
@@ -285,6 +400,7 @@ class CompiledGPUSimpleGraph {
|
|
|
285
400
|
await evaluateDependencies(evaluator);
|
|
286
401
|
results.push([id, evaluator.gpuVector]);
|
|
287
402
|
}
|
|
403
|
+
this.encodeRenderPasses(options);
|
|
288
404
|
return Object.fromEntries(results);
|
|
289
405
|
} catch (error) {
|
|
290
406
|
scope == null ? void 0 : scope.cancel();
|
|
@@ -8,9 +8,10 @@ import { type Device } from '@luma.gl/core';
|
|
|
8
8
|
import { type GPUDataEvaluatorTargetBuffer } from "./operation/gpu-data-evaluator.js";
|
|
9
9
|
import { type GPUEvaluationScope } from "./operation/gpu-evaluation-scope.js";
|
|
10
10
|
import type { GPUVector, GPUVectorFormat } from '@luma.gl/graph/gpu-data';
|
|
11
|
-
import { type GPUGraphBindings, type GPUOperationLike, type GPUOperationTree } from '@luma.gl/graph/gpu-core';
|
|
11
|
+
import { GPURenderOperation, type GPUCommandGraphEncodeOptions, GPUCompositeOperation, type GPUGraphBindings, type GPUOperationLike, type GPUOperationTree } from '@luma.gl/graph/gpu-core';
|
|
12
12
|
import { GPUSimpleGraphOperation, type GPUSimpleGraphEvaluator } from "./gpu-simple-graph-operation.js";
|
|
13
13
|
import { GPUSimpleGraphValue } from "./gpu-simple-graph-value.js";
|
|
14
|
+
import { type CompiledGPUCommandGraph } from "../gpu-core/gpu-command-graph.js";
|
|
14
15
|
/** Inspection record for one evaluator in dependency order. */
|
|
15
16
|
export type GPUSimpleGraphNode = {
|
|
16
17
|
readonly id: string;
|
|
@@ -30,16 +31,20 @@ export type GPUSimpleGraphCompileOptions = {
|
|
|
30
31
|
outputTargets?: Readonly<Record<string, GPUDataEvaluatorTargetBuffer | readonly GPUDataEvaluatorTargetBuffer[]>>;
|
|
31
32
|
};
|
|
32
33
|
/** Run options; scopes defer submission until the caller submits or cancels. */
|
|
33
|
-
export type GPUSimpleGraphRunOptions = {
|
|
34
|
+
export type GPUSimpleGraphRunOptions<Parameters = void> = {
|
|
34
35
|
scope?: GPUEvaluationScope;
|
|
35
|
-
}
|
|
36
|
+
} & Pick<GPUCommandGraphEncodeOptions<Parameters>, 'buffers' | 'textures'> & ([Parameters] extends [void] ? {
|
|
37
|
+
parameters?: Parameters;
|
|
38
|
+
} : {
|
|
39
|
+
parameters: Parameters;
|
|
40
|
+
});
|
|
36
41
|
/**
|
|
37
42
|
* Prototype graph-shaped interface to the existing lazy GPGPU evaluator.
|
|
38
43
|
*
|
|
39
44
|
* Operations, backend selection, fusion, caching, and storage ownership remain with
|
|
40
45
|
* the evaluators. Explicit evaluator inputs are borrowed; semantic lowering owns its adapters.
|
|
41
46
|
*/
|
|
42
|
-
export declare class GPUSimpleGraph {
|
|
47
|
+
export declare class GPUSimpleGraph<Parameters = void> {
|
|
43
48
|
private readonly declarations;
|
|
44
49
|
readonly device?: Device;
|
|
45
50
|
readonly id: string;
|
|
@@ -47,11 +52,13 @@ export declare class GPUSimpleGraph {
|
|
|
47
52
|
private readonly evaluatorIds;
|
|
48
53
|
private readonly programOperations;
|
|
49
54
|
private compiled;
|
|
55
|
+
private readonly renderOperations;
|
|
50
56
|
/** Execution capabilities; evaluators retain control of backend submission. */
|
|
51
57
|
readonly capabilities: Readonly<{
|
|
52
58
|
callerControlledSubmission: boolean;
|
|
53
|
-
dynamicBindings:
|
|
54
|
-
|
|
59
|
+
dynamicBindings: true;
|
|
60
|
+
/** Evaluator render mode uses graph-managed transient resources. */
|
|
61
|
+
transientAllocation: boolean;
|
|
55
62
|
}>;
|
|
56
63
|
constructor(deviceOrProps?: Device | {
|
|
57
64
|
id?: string;
|
|
@@ -72,19 +79,25 @@ export declare class GPUSimpleGraph {
|
|
|
72
79
|
chunkLengths?: readonly number[];
|
|
73
80
|
}): GPUGraphVector<T>;
|
|
74
81
|
/** Accepts evaluator operations, semantic composites, and recursively nested arrays. */
|
|
75
|
-
add(operation:
|
|
82
|
+
add<Operation extends GPUOperationLike>(operation: Operation & (true extends HasIncompatibleRenderParameters<NoInfer<Operation>, Parameters> ? never : unknown)): this;
|
|
83
|
+
private addOperations;
|
|
76
84
|
/** Publish a graph value; compilation owns its internal execution state. */
|
|
77
85
|
addValue<Value extends GPUSimpleGraphValue | readonly GPUSimpleGraphValue[]>(identifier: string, value: Value): Value;
|
|
78
86
|
/** Compatibility adapter for existing evaluator-based callers. Prefer addValue() for new code. */
|
|
79
87
|
addEvaluator<Evaluator extends GPUSimpleGraphEvaluator>(identifier: string, evaluator: Evaluator): Evaluator;
|
|
88
|
+
/** Appends shared render passes after the evaluator phase. Use the same operation in GPUGraph. */
|
|
89
|
+
addRenderOperation(operation: GPURenderOperation<Parameters>): this;
|
|
80
90
|
get operationTree(): readonly GPUOperationTree[];
|
|
81
91
|
/** Captures selected roots and an inspectable dependency plan without executing work. */
|
|
82
92
|
compile<Outputs extends GPUGraphOutputs = Record<string, GPUVector>>(device: Device, options?: GPUGraphCompileOptions): CompiledGPUSimpleExpressionGraph<Outputs>;
|
|
83
|
-
compile(options?: GPUSimpleGraphCompileOptions): CompiledGPUSimpleGraph
|
|
93
|
+
compile(options?: GPUSimpleGraphCompileOptions): CompiledGPUSimpleGraph<Parameters>;
|
|
84
94
|
}
|
|
85
95
|
/** Snapshot of named evaluator outputs and their reachable dependency plan. */
|
|
86
|
-
export declare class CompiledGPUSimpleGraph {
|
|
96
|
+
export declare class CompiledGPUSimpleGraph<Parameters = void> {
|
|
87
97
|
private readonly ownedEvaluators;
|
|
98
|
+
/** Shared render executor, including buffer/texture inspection and ownership. */
|
|
99
|
+
readonly renderGraph?: CompiledGPUCommandGraph<Parameters> | undefined;
|
|
100
|
+
private readonly inputs;
|
|
88
101
|
readonly nodes: readonly GPUSimpleGraphNode[];
|
|
89
102
|
readonly outputs: Readonly<Record<string, GPUSimpleGraphEvaluator>>;
|
|
90
103
|
/** Maps every selected output ID, including aliases, to its dependency inspection node. */
|
|
@@ -95,10 +108,22 @@ export declare class CompiledGPUSimpleGraph {
|
|
|
95
108
|
private running;
|
|
96
109
|
private destroyed;
|
|
97
110
|
private pendingScope?;
|
|
98
|
-
constructor(device: Device, nodes: readonly GPUSimpleGraphNode[], roots: readonly GPUSimpleGraphOperation[], operationTree: readonly GPUOperationTree[], ownedEvaluators?: ReadonlySet<GPUSimpleGraphEvaluator>, outputNodes?: Readonly<Record<string, string
|
|
111
|
+
constructor(device: Device, nodes: readonly GPUSimpleGraphNode[], roots: readonly GPUSimpleGraphOperation[], operationTree: readonly GPUOperationTree[], ownedEvaluators?: ReadonlySet<GPUSimpleGraphEvaluator>, outputNodes?: Readonly<Record<string, string>>,
|
|
112
|
+
/** Shared render executor, including buffer/texture inspection and ownership. */
|
|
113
|
+
renderGraph?: CompiledGPUCommandGraph<Parameters> | undefined, inputs?: ReadonlyMap<string, GPUSimpleGraphEvaluator>);
|
|
114
|
+
/** Invalidates changed named inputs and their reachable consumers, preserving other channels. */
|
|
115
|
+
invalidate(inputIds: readonly string[]): void;
|
|
99
116
|
/** Releases semantic evaluator results, preserving borrowed inputs and wrappers. */
|
|
100
117
|
destroy(): void;
|
|
118
|
+
/** Executes supported synchronous evaluators and render passes on WebGL, without readback. */
|
|
119
|
+
runSync(this: CompiledGPUSimpleGraph<void>): Record<string, GPUVector>;
|
|
120
|
+
runSync(options: GPUSimpleGraphRunOptions<Parameters>): Record<string, GPUVector>;
|
|
121
|
+
private encodeRenderPasses;
|
|
101
122
|
/** Materializes selected outputs without CPU readback. Semantic results live until destroy(). */
|
|
102
|
-
run(
|
|
123
|
+
run(this: CompiledGPUSimpleGraph<void>): Promise<Record<string, GPUVector>>;
|
|
124
|
+
run(options: GPUSimpleGraphRunOptions<Parameters>): Promise<Record<string, GPUVector>>;
|
|
103
125
|
}
|
|
126
|
+
/** Preserve render parameter requirements without expanding the recursive GPUOperationLike type. */
|
|
127
|
+
type HasIncompatibleRenderParameters<Operation, Parameters> = GPUOperationLike extends Operation ? false : Operation extends GPURenderOperation<infer RequiredParameters> ? [Parameters] extends [RequiredParameters] ? false : true : Operation extends GPUCompositeOperation<infer Child> ? HasIncompatibleRenderParameters<Child, Parameters> : Operation extends readonly (infer Child)[] ? HasIncompatibleRenderParameters<Child, Parameters> : false;
|
|
128
|
+
export {};
|
|
104
129
|
//# sourceMappingURL=gpu-simple-graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-simple-graph.d.ts","sourceRoot":"","sources":["../../src/gpu-simple-graph/gpu-simple-graph.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAC,eAAe,EAAC,wCAAqC;AAClE,OAAO,EAAC,eAAe,EAAE,KAAK,yBAAyB,EAAC,uCAAoC;AAE5F,OAAO,KAAK,EAAC,sBAAsB,EAAC,2CAAwC;AAC5E,OAAO,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AA8F;IAC9F,OAAO,CAAC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;IACtE,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;IAyBjF,OAAO,CAAC,kBAAkB;IAiB1B,iGAAiG;IACjG,GAAG,CAAC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3E,GAAG,CAAC,OAAO,EAAE,wBAAwB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAyCvF;AAQD,oGAAoG;AACpG,KAAK,+BAA+B,CAAC,SAAS,EAAE,UAAU,IAAI,gBAAgB,SAAS,SAAS,GAC5F,KAAK,GACL,SAAS,SAAS,kBAAkB,CAAC,MAAM,kBAAkB,CAAC,GAC5D,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,GACvC,KAAK,GACL,IAAI,GACN,SAAS,SAAS,qBAAqB,CAAC,MAAM,KAAK,CAAC,GAClD,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,GAClD,SAAS,SAAS,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,GACxC,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,GAClD,KAAK,CAAC"}
|
|
@@ -8,11 +8,12 @@ import { assert } from '@luma.gl/core';
|
|
|
8
8
|
import { GPUDataEvaluator } from "./operation/gpu-data-evaluator.js";
|
|
9
9
|
import { GPUVectorEvaluator } from "./operation/gpu-vector-evaluator.js";
|
|
10
10
|
import { inspectEvaluators as getGPUDataEvaluatorInspection } from "./operation/gpu-evaluator-inspection.js";
|
|
11
|
-
import { GPUCompositeOperation, GPUGraphScalarLiteral, GPUGraphScalarOperation, GPUGraphVectorMADD, getGPUOperationTree } from '@luma.gl/graph/gpu-core';
|
|
11
|
+
import { GPURenderOperation, GPUCompositeOperation, GPUGraphScalarLiteral, GPUGraphScalarOperation, GPUGraphVectorMADD, getGPUOperationTree } from '@luma.gl/graph/gpu-core';
|
|
12
12
|
import { GPUSimpleGraphOperation, getSimpleGraphEvaluatorFormat } from "./gpu-simple-graph-operation.js";
|
|
13
13
|
import { GPUSimpleGraphUploadOperation, GPUSimpleGraphCopyOperation, makeCopyEvaluator } from "./gpu-simple-graph-transfer.js";
|
|
14
14
|
import { GPUSimpleGraphValueOperation } from "./gpu-simple-graph-value.js";
|
|
15
15
|
import { SimpleGraphLowering } from "./gpu-simple-graph-lowering.js";
|
|
16
|
+
import { GPUCommandGraphBuilder } from "../gpu-core/gpu-command-graph.js";
|
|
16
17
|
/**
|
|
17
18
|
* Prototype graph-shaped interface to the existing lazy GPGPU evaluator.
|
|
18
19
|
*
|
|
@@ -27,6 +28,7 @@ export class GPUSimpleGraph {
|
|
|
27
28
|
evaluatorIds = new Set();
|
|
28
29
|
programOperations = [];
|
|
29
30
|
compiled = false;
|
|
31
|
+
renderOperations = [];
|
|
30
32
|
/** Execution capabilities; evaluators retain control of backend submission. */
|
|
31
33
|
capabilities;
|
|
32
34
|
constructor(deviceOrProps, props = {}) {
|
|
@@ -35,8 +37,8 @@ export class GPUSimpleGraph {
|
|
|
35
37
|
this.id = (device ? props.id : deviceOrProps?.id) ?? 'simple-graph';
|
|
36
38
|
this.capabilities = Object.freeze({
|
|
37
39
|
callerControlledSubmission: device?.type === 'webgpu',
|
|
38
|
-
dynamicBindings:
|
|
39
|
-
transientAllocation:
|
|
40
|
+
dynamicBindings: true,
|
|
41
|
+
transientAllocation: Boolean(device)
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
44
|
addInput(id, descriptor) {
|
|
@@ -61,6 +63,9 @@ export class GPUSimpleGraph {
|
|
|
61
63
|
}
|
|
62
64
|
/** Accepts evaluator operations, semantic composites, and recursively nested arrays. */
|
|
63
65
|
add(operation) {
|
|
66
|
+
return this.addOperations(operation);
|
|
67
|
+
}
|
|
68
|
+
addOperations(operation) {
|
|
64
69
|
// Compilation freezes the builder, as it does for GPUCommandGraph.
|
|
65
70
|
assert(!this.compiled);
|
|
66
71
|
if (!this.device || operation instanceof GPUExpressionOperation) {
|
|
@@ -68,6 +73,7 @@ export class GPUSimpleGraph {
|
|
|
68
73
|
return this;
|
|
69
74
|
}
|
|
70
75
|
const pending = [];
|
|
76
|
+
let hasRenderOperation = this.renderOperations.length > 0;
|
|
71
77
|
const pendingEvaluatorIds = new Set();
|
|
72
78
|
const operations = [];
|
|
73
79
|
const visit = (value) => {
|
|
@@ -81,7 +87,13 @@ export class GPUSimpleGraph {
|
|
|
81
87
|
for (const child of value.operations)
|
|
82
88
|
visit(child);
|
|
83
89
|
}
|
|
90
|
+
else if (value instanceof GPURenderOperation) {
|
|
91
|
+
hasRenderOperation = true;
|
|
92
|
+
pending.push(value);
|
|
93
|
+
}
|
|
84
94
|
else {
|
|
95
|
+
// Evaluator work precedes render work; never silently reorder the authored graph.
|
|
96
|
+
assert(!hasRenderOperation);
|
|
85
97
|
// Only the initial portable semantic subset and explicit evaluator adapters are supported.
|
|
86
98
|
assert(value instanceof GPUSimpleGraphValueOperation ||
|
|
87
99
|
value instanceof GPUSimpleGraphOperation ||
|
|
@@ -114,7 +126,12 @@ export class GPUSimpleGraph {
|
|
|
114
126
|
};
|
|
115
127
|
visit(operation);
|
|
116
128
|
collect(operation);
|
|
117
|
-
|
|
129
|
+
for (const value of pending) {
|
|
130
|
+
if (value instanceof GPURenderOperation)
|
|
131
|
+
this.renderOperations.push(value);
|
|
132
|
+
else
|
|
133
|
+
this.leafOperations.push(value);
|
|
134
|
+
}
|
|
118
135
|
for (const identifier of pendingEvaluatorIds)
|
|
119
136
|
this.evaluatorIds.add(identifier);
|
|
120
137
|
this.programOperations.push(...operations);
|
|
@@ -122,24 +139,29 @@ export class GPUSimpleGraph {
|
|
|
122
139
|
}
|
|
123
140
|
/** Publish a graph value; compilation owns its internal execution state. */
|
|
124
141
|
addValue(identifier, value) {
|
|
125
|
-
this.
|
|
142
|
+
this.addOperations(new GPUSimpleGraphValueOperation({ id: identifier, value }));
|
|
126
143
|
return value;
|
|
127
144
|
}
|
|
128
145
|
/** Compatibility adapter for existing evaluator-based callers. Prefer addValue() for new code. */
|
|
129
146
|
addEvaluator(identifier, evaluator) {
|
|
130
|
-
this.
|
|
147
|
+
this.addOperations(new GPUSimpleGraphOperation({ id: identifier, evaluator }));
|
|
131
148
|
return evaluator;
|
|
132
149
|
}
|
|
150
|
+
/** Appends shared render passes after the evaluator phase. Use the same operation in GPUGraph. */
|
|
151
|
+
addRenderOperation(operation) {
|
|
152
|
+
return this.addOperations(operation);
|
|
153
|
+
}
|
|
133
154
|
get operationTree() {
|
|
134
155
|
return Object.freeze([...this.programOperations, ...this.declarations.operations].map(getGPUOperationTree));
|
|
135
156
|
}
|
|
136
157
|
compile(deviceOrOptions = {}, expressionOptions = {}) {
|
|
137
158
|
if ('type' in deviceOrOptions) {
|
|
138
|
-
|
|
159
|
+
// Reusable expression compilation cannot silently discard evaluator/render recipes.
|
|
160
|
+
assert(!this.compiled && this.leafOperations.length === 0 && this.renderOperations.length === 0);
|
|
139
161
|
this.compiled = true;
|
|
140
162
|
return new CompiledGPUSimpleExpressionGraph(deviceOrOptions, this.declarations, expressionOptions);
|
|
141
163
|
}
|
|
142
|
-
//
|
|
164
|
+
// Evaluator recipes bind their device in the constructor.
|
|
143
165
|
assert(this.device && this.declarations.operations.length === 0);
|
|
144
166
|
if ([
|
|
145
167
|
...this.declarations.scalars,
|
|
@@ -152,6 +174,7 @@ export class GPUSimpleGraph {
|
|
|
152
174
|
assert(!this.compiled);
|
|
153
175
|
this.compiled = true;
|
|
154
176
|
const lowering = new SimpleGraphLowering(options.bindings ?? {});
|
|
177
|
+
let renderGraph;
|
|
155
178
|
try {
|
|
156
179
|
for (const operation of this.leafOperations)
|
|
157
180
|
lowering.lower(operation);
|
|
@@ -230,9 +253,18 @@ export class GPUSimpleGraph {
|
|
|
230
253
|
});
|
|
231
254
|
}
|
|
232
255
|
}
|
|
233
|
-
|
|
256
|
+
if (this.renderOperations.length) {
|
|
257
|
+
const renderBuilder = new GPUCommandGraphBuilder(this.device, {
|
|
258
|
+
id: `${this.id}-render`
|
|
259
|
+
});
|
|
260
|
+
for (const operation of this.renderOperations)
|
|
261
|
+
renderBuilder.add(operation);
|
|
262
|
+
renderGraph = renderBuilder.compile();
|
|
263
|
+
}
|
|
264
|
+
return new CompiledGPUSimpleGraph(this.device, nodes, roots, this.operationTree, lowering.owned, Object.fromEntries(roots.map(({ id, evaluator }) => [id, getIdentifier(evaluator)])), renderGraph, lowering.inputs);
|
|
234
265
|
}
|
|
235
266
|
catch (error) {
|
|
267
|
+
renderGraph?.destroy();
|
|
236
268
|
lowering.destroy();
|
|
237
269
|
throw error;
|
|
238
270
|
}
|
|
@@ -241,6 +273,8 @@ export class GPUSimpleGraph {
|
|
|
241
273
|
/** Snapshot of named evaluator outputs and their reachable dependency plan. */
|
|
242
274
|
export class CompiledGPUSimpleGraph {
|
|
243
275
|
ownedEvaluators;
|
|
276
|
+
renderGraph;
|
|
277
|
+
inputs;
|
|
244
278
|
nodes;
|
|
245
279
|
outputs;
|
|
246
280
|
/** Maps every selected output ID, including aliases, to its dependency inspection node. */
|
|
@@ -251,8 +285,12 @@ export class CompiledGPUSimpleGraph {
|
|
|
251
285
|
running = false;
|
|
252
286
|
destroyed = false;
|
|
253
287
|
pendingScope;
|
|
254
|
-
constructor(device, nodes, roots, operationTree, ownedEvaluators = new Set(), outputNodes = {}
|
|
288
|
+
constructor(device, nodes, roots, operationTree, ownedEvaluators = new Set(), outputNodes = {},
|
|
289
|
+
/** Shared render executor, including buffer/texture inspection and ownership. */
|
|
290
|
+
renderGraph, inputs = new Map()) {
|
|
255
291
|
this.ownedEvaluators = ownedEvaluators;
|
|
292
|
+
this.renderGraph = renderGraph;
|
|
293
|
+
this.inputs = inputs;
|
|
256
294
|
this.device = device;
|
|
257
295
|
this.nodes = Object.freeze(nodes.map(node => Object.freeze({ ...node, dependencies: Object.freeze([...node.dependencies]) })));
|
|
258
296
|
this.executionPlan = Object.freeze([...roots]);
|
|
@@ -260,18 +298,104 @@ export class CompiledGPUSimpleGraph {
|
|
|
260
298
|
this.outputNodes = Object.freeze({ ...outputNodes });
|
|
261
299
|
this.outputs = Object.freeze(Object.fromEntries(roots.map(({ id, evaluator }) => [id, evaluator])));
|
|
262
300
|
}
|
|
301
|
+
/** Invalidates changed named inputs and their reachable consumers, preserving other channels. */
|
|
302
|
+
invalidate(inputIds) {
|
|
303
|
+
assert(!this.running && !this.destroyed && !this.pendingScope);
|
|
304
|
+
const changed = new Set();
|
|
305
|
+
for (const identifier of inputIds) {
|
|
306
|
+
const input = this.inputs.get(identifier);
|
|
307
|
+
// Only graph-owned, named leaf inputs can be invalidated through this API.
|
|
308
|
+
assert(input && this.ownedEvaluators.has(input));
|
|
309
|
+
changed.add(input);
|
|
310
|
+
if (input instanceof GPUVectorEvaluator) {
|
|
311
|
+
for (const chunk of input.gpuDataEvaluators)
|
|
312
|
+
changed.add(chunk);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const affected = new Map();
|
|
316
|
+
const visit = (evaluator) => {
|
|
317
|
+
const existing = affected.get(evaluator);
|
|
318
|
+
if (existing !== undefined)
|
|
319
|
+
return existing;
|
|
320
|
+
// Visit every dependency, even if an earlier dependency is already dirty.
|
|
321
|
+
const dependencies = getDependencies(evaluator).map(visit);
|
|
322
|
+
const dirty = changed.has(evaluator) || dependencies.some(Boolean);
|
|
323
|
+
affected.set(evaluator, dirty);
|
|
324
|
+
return dirty;
|
|
325
|
+
};
|
|
326
|
+
for (const input of changed)
|
|
327
|
+
visit(input);
|
|
328
|
+
for (const { evaluator } of this.executionPlan)
|
|
329
|
+
visit(evaluator);
|
|
330
|
+
// Validate the whole change before clearing anything; borrowed evaluator caches stay untouched.
|
|
331
|
+
for (const [evaluator, dirty] of affected) {
|
|
332
|
+
if (dirty)
|
|
333
|
+
assert(this.ownedEvaluators.has(evaluator));
|
|
334
|
+
}
|
|
335
|
+
for (const [evaluator, dirty] of affected) {
|
|
336
|
+
if (dirty)
|
|
337
|
+
evaluator.invalidate();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
263
340
|
/** Releases semantic evaluator results, preserving borrowed inputs and wrappers. */
|
|
264
341
|
destroy() {
|
|
265
342
|
// Results must no longer be in use; borrowed evaluators and input buffers remain caller-owned.
|
|
266
343
|
assert(!this.running && !this.pendingScope);
|
|
267
344
|
if (this.destroyed)
|
|
268
345
|
return;
|
|
346
|
+
this.renderGraph?.destroy();
|
|
269
347
|
for (const evaluator of this.ownedEvaluators)
|
|
270
348
|
evaluator.destroy();
|
|
271
349
|
this.destroyed = true;
|
|
272
350
|
}
|
|
273
|
-
|
|
274
|
-
|
|
351
|
+
runSync(options) {
|
|
352
|
+
assert(this.device.type === 'webgl' && !options?.scope);
|
|
353
|
+
assert(!this.running && !this.destroyed && !this.pendingScope);
|
|
354
|
+
this.running = true;
|
|
355
|
+
try {
|
|
356
|
+
const results = {};
|
|
357
|
+
const evaluated = new Set();
|
|
358
|
+
const evaluate = (evaluator) => {
|
|
359
|
+
if (evaluated.has(evaluator))
|
|
360
|
+
return;
|
|
361
|
+
for (const dependency of getDependencies(evaluator))
|
|
362
|
+
evaluate(dependency);
|
|
363
|
+
evaluator.evaluateSync(this.device);
|
|
364
|
+
evaluated.add(evaluator);
|
|
365
|
+
};
|
|
366
|
+
for (const { id, evaluator } of this.executionPlan) {
|
|
367
|
+
evaluate(evaluator);
|
|
368
|
+
results[id] = evaluator.gpuVector;
|
|
369
|
+
}
|
|
370
|
+
this.encodeRenderPasses(options);
|
|
371
|
+
return results;
|
|
372
|
+
}
|
|
373
|
+
finally {
|
|
374
|
+
this.running = false;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
encodeRenderPasses(options) {
|
|
378
|
+
const scope = options?.scope;
|
|
379
|
+
if (!this.renderGraph)
|
|
380
|
+
return;
|
|
381
|
+
const commandEncoder = scope?.commandEncoder ?? this.device.createCommandEncoder();
|
|
382
|
+
try {
|
|
383
|
+
this.renderGraph.encode(commandEncoder, {
|
|
384
|
+
buffers: options?.buffers,
|
|
385
|
+
textures: options?.textures,
|
|
386
|
+
// The public overload requires parameters unless Parameters is void.
|
|
387
|
+
parameters: options?.parameters
|
|
388
|
+
});
|
|
389
|
+
if (!scope)
|
|
390
|
+
this.device.submit(commandEncoder.finish());
|
|
391
|
+
}
|
|
392
|
+
finally {
|
|
393
|
+
if (!scope)
|
|
394
|
+
commandEncoder.destroy();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
async run(options) {
|
|
398
|
+
const scope = options?.scope;
|
|
275
399
|
// The underlying evaluators do not support concurrent evaluation of shared outputs.
|
|
276
400
|
assert(!this.running && !this.destroyed && !this.pendingScope);
|
|
277
401
|
if (scope) {
|
|
@@ -304,6 +428,7 @@ export class CompiledGPUSimpleGraph {
|
|
|
304
428
|
await evaluateDependencies(evaluator);
|
|
305
429
|
results.push([id, evaluator.gpuVector]);
|
|
306
430
|
}
|
|
431
|
+
this.encodeRenderPasses(options);
|
|
307
432
|
return Object.fromEntries(results);
|
|
308
433
|
}
|
|
309
434
|
catch (error) {
|