@luma.gl/graph 10.0.0-alpha.11 → 10.0.0-alpha.13

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.
Files changed (131) hide show
  1. package/LICENSE +4 -4
  2. package/THIRD-PARTY-NOTICES.md +19 -0
  3. package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +6 -6
  4. package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
  5. package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +16 -6
  6. package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
  7. package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +3 -2
  8. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
  9. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +3 -2
  10. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
  11. package/dist/arrow/index.cjs.map +2 -2
  12. package/dist/arrow/internal.cjs.map +2 -2
  13. package/dist/dist.dev.js +2148 -454
  14. package/dist/dist.min.js +437 -123
  15. package/dist/experimental/index.cjs.map +1 -1
  16. package/dist/experimental/simulation/index.cjs.map +1 -1
  17. package/dist/gpu-core/compiled-gpu-graph.cjs +15 -0
  18. package/dist/gpu-core/compiled-gpu-graph.d.ts +1 -0
  19. package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
  20. package/dist/gpu-core/compiled-gpu-graph.js +15 -0
  21. package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
  22. package/dist/gpu-core/gpu-command-graph.cjs +9 -0
  23. package/dist/gpu-core/gpu-command-graph.d.ts +2 -0
  24. package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
  25. package/dist/gpu-core/gpu-command-graph.js +9 -0
  26. package/dist/gpu-core/gpu-command-graph.js.map +1 -1
  27. package/dist/gpu-core/gpu-expression-plan.cjs +4 -0
  28. package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
  29. package/dist/gpu-core/gpu-expression-plan.js +5 -0
  30. package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
  31. package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
  32. package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
  33. package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
  34. package/dist/gpu-core/gpu-graph-compiler.js +50 -0
  35. package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
  36. package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
  37. package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
  38. package/dist/gpu-core/gpu-group-aggregation.js +7 -18
  39. package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
  40. package/dist/gpu-core/gpu-reduction.cjs +6 -14
  41. package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
  42. package/dist/gpu-core/gpu-reduction.js +6 -15
  43. package/dist/gpu-core/gpu-reduction.js.map +1 -1
  44. package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
  45. package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
  46. package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
  47. package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
  48. package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
  49. package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
  50. package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
  51. package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
  52. package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
  53. package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
  54. package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
  55. package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
  56. package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
  57. package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
  58. package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
  59. package/dist/gpu-core/index.cjs +8 -0
  60. package/dist/gpu-core/index.cjs.map +3 -3
  61. package/dist/gpu-core/index.d.ts +4 -0
  62. package/dist/gpu-core/index.d.ts.map +1 -1
  63. package/dist/gpu-core/index.js +2 -0
  64. package/dist/gpu-core/index.js.map +1 -1
  65. package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +7 -2
  66. package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -1
  67. package/dist/gpu-data/cpu-gpu-vector-transfer.js +9 -6
  68. package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -1
  69. package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
  70. package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
  71. package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
  72. package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
  73. package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
  74. package/dist/gpu-data/index.cjs.map +3 -3
  75. package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
  76. package/dist/gpu-graph/index.cjs +5 -0
  77. package/dist/gpu-graph/index.cjs.map +3 -3
  78. package/dist/gpu-graph/index.d.ts +2 -0
  79. package/dist/gpu-graph/index.d.ts.map +1 -1
  80. package/dist/gpu-graph/index.js +1 -0
  81. package/dist/gpu-graph/index.js.map +1 -1
  82. package/dist/gpu-graph-algorithms/benchmarks.cjs.map +1 -1
  83. package/dist/gpu-graph-algorithms/index.cjs.map +1 -1
  84. package/dist/gpu-physics/index.cjs.map +1 -1
  85. package/dist/gpu-project/benchmarks.cjs.map +2 -2
  86. package/dist/gpu-project/crs.cjs.map +2 -2
  87. package/dist/gpu-project/graph.cjs.map +3 -3
  88. package/dist/gpu-project/index.cjs.map +2 -2
  89. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +53 -5
  90. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +3 -1
  91. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
  92. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +58 -5
  93. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
  94. package/dist/gpu-simple-graph/index.cjs.map +3 -3
  95. package/dist/gpu-sql/gpu-sql.cjs +112 -100
  96. package/dist/gpu-sql/gpu-sql.d.ts +1 -1
  97. package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
  98. package/dist/gpu-sql/gpu-sql.js +120 -102
  99. package/dist/gpu-sql/gpu-sql.js.map +1 -1
  100. package/dist/gpu-sql/index.cjs.map +2 -2
  101. package/dist/gpu-tables/index.cjs.map +2 -2
  102. package/dist/gpu-tables/table/gpu-table.cjs +2 -2
  103. package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
  104. package/dist/gpu-tables/table/gpu-table.js +2 -2
  105. package/dist/gpu-tables/table/gpu-table.js.map +1 -1
  106. package/dist/index.cjs +8 -0
  107. package/dist/index.cjs.map +3 -3
  108. package/dist/index.d.ts +4 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +2 -0
  111. package/dist/index.js.map +1 -1
  112. package/package.json +10 -8
  113. package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +17 -6
  114. package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +3 -2
  115. package/src/gpu-core/compiled-gpu-graph.ts +18 -0
  116. package/src/gpu-core/gpu-command-graph.ts +10 -0
  117. package/src/gpu-core/gpu-expression-plan.ts +6 -0
  118. package/src/gpu-core/gpu-graph-compiler.ts +61 -0
  119. package/src/gpu-core/gpu-group-aggregation.ts +38 -50
  120. package/src/gpu-core/gpu-reduction.ts +32 -42
  121. package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
  122. package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
  123. package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
  124. package/src/gpu-core/index.ts +8 -0
  125. package/src/gpu-data/cpu-gpu-vector-transfer.ts +10 -7
  126. package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
  127. package/src/gpu-graph/index.ts +9 -0
  128. package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +59 -5
  129. package/src/gpu-sql/gpu-sql.ts +130 -103
  130. package/src/gpu-tables/table/gpu-table.ts +2 -1
  131. package/src/index.ts +11 -0
package/dist/index.d.ts CHANGED
@@ -24,6 +24,8 @@ export type { GPUGraphScalarDescriptor, GPUGraphVectorDescriptor, GPUGraphValueD
24
24
  export type { GPUGraphExecutionBindings } from "./gpu-core/gpu-expression-plan.js";
25
25
  export type { GPUOperationOutputDeclarations, GPUOperationContractContext } from "./gpu-core/gpu-operation-contract.js";
26
26
  export { GPUUploadOperation, GPUCopyOperation } from "./gpu-core/gpu-transfer-operation.js";
27
+ export { GPUShaderPassOperation } from "./gpu-core/gpu-shader-pass-operation.js";
28
+ export type { GPUShaderPassOperationProps } from "./gpu-core/gpu-shader-pass-operation.js";
27
29
  export type { GPUUploadOperationProps, GPUCopyOperationProps } from "./gpu-core/gpu-transfer-operation.js";
28
30
  export { GPUCompactionOperation } from "./gpu-core/gpu-compaction-operation.js";
29
31
  export type { GPUCompactionOperationProps } from "./gpu-core/gpu-compaction-operation.js";
@@ -31,4 +33,6 @@ export type { GPUGraphTextureDescriptor, GPUGraphTextureExtent } from "./gpu-cor
31
33
  export type { GPUGraphTextureBinding, GPUGraphOutput, GPUGraphOutputs } from "./gpu-core/gpu-texture-plan.js";
32
34
  export { GPUCPUOperation } from "./gpu-core/gpu-cpu-operation.js";
33
35
  export type { GPUCPUOperationProps, GPUCPUArray, GPUCPUVector, GPUCPUResult } from "./gpu-core/gpu-cpu-operation.js";
36
+ export { GPUGraphGroupAggregation, GPUGraphReduction } from "./gpu-core/gpu-semantic-aggregation-operation.js";
37
+ export type { GPUGraphGroupAggregationProps, GPUGraphReductionProps } from "./gpu-core/gpu-semantic-aggregation-operation.js";
34
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,0BAA0B,EAC1B,KAAK,0BAA0B,EAC/B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,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AuC;AAC9E,YAAY,EACV,8BAA8B,EAC9B,2BAA2B,EAC5B,6CAA0C;AAE3C,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AACvF,OAAO,EAAC,sBAAsB,EAAC,gDAA6C;AAC5E,YAAY,EAAC,2BAA2B,EAAC,gDAA6C;AACtF,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACtB,6CAA0C;AAC3C,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAC3E,YAAY,EAAC,2BAA2B,EAAC,+CAA4C;AAErF,YAAY,EAAC,yBAAyB,EAAE,qBAAqB,EAAC,sCAAmC;AACjG,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,eAAe,EAChB,uCAAoC;AAErC,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAC7D,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,YAAY,EACb,wCAAqC;AAEtC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,yDAAsD;AACvD,YAAY,EACV,6BAA6B,EAC7B,sBAAsB,EACvB,yDAAsD"}
package/dist/index.js CHANGED
@@ -14,6 +14,8 @@ export { GPUExpressionOperation } from "./gpu-core/gpu-expression-operation.js";
14
14
  export { CompiledGPUGraph, PreparedGPUGraphExecution } from "./gpu-core/compiled-gpu-graph.js";
15
15
  export { gpuGraph } from "./gpu-core/gpu-graph-value.js";
16
16
  export { GPUUploadOperation, GPUCopyOperation } from "./gpu-core/gpu-transfer-operation.js";
17
+ export { GPUShaderPassOperation } from "./gpu-core/gpu-shader-pass-operation.js";
17
18
  export { GPUCompactionOperation } from "./gpu-core/gpu-compaction-operation.js";
18
19
  export { GPUCPUOperation } from "./gpu-core/gpu-cpu-operation.js";
20
+ export { GPUGraphGroupAggregation, GPUGraphReduction } from "./gpu-core/gpu-semantic-aggregation-operation.js";
19
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EAInB,gBAAgB,EAUhB,0BAA0B,EAE1B,gBAAgB,EAqDjB,6BAA0B;AAC3B,OAAO,EACL,iCAAiC,EASjC,wBAAwB,EACzB,kDAA+C;AAChD,OAAO,EAGL,wCAAwC,EACzC,0DAAuD;AACxD,OAAO,EAaL,wBAAwB,EACzB,kDAA+C;AAchD,OAAO,EAAC,cAAc,EAAC,uDAAoD;AAU3E,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,eAAe,EAAC,+CAA4C;AAMpE,OAAO,EAAC,MAAM,EAAC,sCAAmC;AAClD,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAO/D,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAK3E,OAAO,EAAC,gBAAgB,EAAE,yBAAyB,EAAC,yCAAsC;AAe1F,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AAapD,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AAKvF,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAU3E,OAAO,EAAC,eAAe,EAAC,wCAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EAInB,gBAAgB,EAUhB,0BAA0B,EAE1B,gBAAgB,EAqDjB,6BAA0B;AAC3B,OAAO,EACL,iCAAiC,EASjC,wBAAwB,EACzB,kDAA+C;AAChD,OAAO,EAGL,wCAAwC,EACzC,0DAAuD;AACxD,OAAO,EAaL,wBAAwB,EACzB,kDAA+C;AAchD,OAAO,EAAC,cAAc,EAAC,uDAAoD;AAU3E,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,eAAe,EAAC,+CAA4C;AAMpE,OAAO,EAAC,MAAM,EAAC,sCAAmC;AAClD,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAO/D,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAK3E,OAAO,EAAC,gBAAgB,EAAE,yBAAyB,EAAC,yCAAsC;AAe1F,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AAapD,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AACvF,OAAO,EAAC,sBAAsB,EAAC,gDAA6C;AAM5E,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAU3E,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAQ7D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,yDAAsD"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "10.0.0-alpha.11",
6
+ "version": "10.0.0-alpha.13",
7
7
  "type": "module",
8
8
  "license": "MIT",
9
9
  "repository": {
@@ -23,7 +23,9 @@
23
23
  "src",
24
24
  "dist",
25
25
  "dist.min.js",
26
- "README.md"
26
+ "README.md",
27
+ "LICENSE",
28
+ "THIRD-PARTY-NOTICES.md"
27
29
  ],
28
30
  "sideEffects": false,
29
31
  "scripts": {
@@ -240,8 +242,8 @@
240
242
  }
241
243
  },
242
244
  "peerDependencies": {
243
- "@luma.gl/core": "~10.0.0-alpha.11",
244
- "@luma.gl/shaders": "~10.0.0-alpha.11",
245
+ "@luma.gl/core": "~10.0.0-alpha.13",
246
+ "@luma.gl/shaders": "~10.0.0-alpha.13",
245
247
  "apache-arrow": ">=17.0.0"
246
248
  },
247
249
  "peerDependenciesMeta": {
@@ -250,10 +252,10 @@
250
252
  }
251
253
  },
252
254
  "dependencies": {
253
- "@math.gl/arrow": "~5.0.0-beta.5",
254
- "@math.gl/core": "~5.0.0-beta.5",
255
- "@math.gl/geospatial": "~5.0.0-beta.5",
255
+ "@math.gl/arrow": "~5.0.0-beta.7",
256
+ "@math.gl/core": "~5.0.0-beta.7",
257
+ "@math.gl/geospatial": "~5.0.0-beta.7",
256
258
  "probe.gl": "^5.0.0"
257
259
  },
258
- "gitHead": "abf0b44182fb51a73368e71f1166ca1cf4de63d6"
260
+ "gitHead": "0e04045e4ca306793aa2b6f86065b0560e30967e"
259
261
  }
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import {Buffer, Device, type SignedDataType, type VertexFormat} from '@luma.gl/core';
5
+ import {getGPUDataBufferProps} from '../../gpu-data/gpu-data-buffer-props';
6
+ import {Device, type SignedDataType, type VertexFormat} from '@luma.gl/core';
6
7
  import {DynamicBuffer} from '@luma.gl/core/dynamic';
7
8
  import {
8
9
  GPUData,
@@ -210,7 +211,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
210
211
  const byteStride = getArrowTypeByteStride(arrowType.indices);
211
212
  return new GPUData({
212
213
  buffer: new DynamicBuffer(device, {
213
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
214
+ ...(bufferProps.usage === undefined
215
+ ? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
216
+ : {}),
214
217
  ...bufferProps,
215
218
  data: getArrowDictionaryIndexBufferSource(data as unknown as Data<ArrowUtf8Dictionary>)
216
219
  }),
@@ -227,7 +230,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
227
230
  if (DataType.isUtf8(arrowType)) {
228
231
  return new GPUData({
229
232
  buffer: new DynamicBuffer(device, {
230
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
233
+ ...(bufferProps.usage === undefined
234
+ ? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
235
+ : {}),
231
236
  ...bufferProps,
232
237
  data: getArrowUtf8DataBufferSource(data as Data<Utf8>)
233
238
  }),
@@ -254,7 +259,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
254
259
  const byteStride = getArrowTypeByteStride(arrowType);
255
260
  return new GPUData({
256
261
  buffer: new DynamicBuffer(device, {
257
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
262
+ ...(bufferProps.usage === undefined
263
+ ? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
264
+ : {}),
258
265
  ...bufferProps,
259
266
  data: getArrowVariableLengthAttributeDataBufferSource(
260
267
  data as unknown as Data<VariableLengthAttributeArrowType>
@@ -278,7 +285,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
278
285
  const byteStride = getArrowTypeByteStride(arrowType);
279
286
  return new GPUData({
280
287
  buffer: new DynamicBuffer(device, {
281
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
288
+ ...(bufferProps.usage === undefined
289
+ ? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
290
+ : {}),
282
291
  ...bufferProps,
283
292
  data: getArrowDataBufferSource(data as unknown as Data<AttributeArrowType>)
284
293
  }),
@@ -385,7 +394,9 @@ export function makeGPUVectorFromArrow<T extends DataType>(
385
394
  }
386
395
 
387
396
  const buffer = device.createBuffer({
388
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
397
+ ...(bufferProps.usage === undefined
398
+ ? getGPUDataBufferProps(device, vectorFormat === 'uint16' ? 'uint16' : 'uint32')
399
+ : {}),
389
400
  ...bufferProps,
390
401
  data: getArrowVectorBufferSource(vector as unknown as Vector<AttributeArrowType>)
391
402
  });
@@ -3,6 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
5
  import {Buffer, type Device} from '@luma.gl/core';
6
+ import {getGPUDataBufferProps} from '../../gpu-data/gpu-data-buffer-props';
6
7
  import {DynamicBuffer} from '@luma.gl/core/dynamic';
7
8
  import {
8
9
  GPUData,
@@ -707,7 +708,7 @@ async function convertArrowFloat64VectorOnGPU(
707
708
  const outputBuffer = device.createBuffer({
708
709
  ...options.bufferProps,
709
710
  id: `${options.name}-${chunkIndex}`,
710
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
711
+ ...getGPUDataBufferProps(device),
711
712
  byteLength: Math.max(Float32Array.BYTES_PER_ELEMENT, split.byteLength)
712
713
  });
713
714
  outputBuffers.push(outputBuffer);
@@ -846,7 +847,7 @@ async function convertArrowNumericVectorOnGPU(
846
847
  const outputBuffer = device.createBuffer({
847
848
  ...options.bufferProps,
848
849
  id: `${options.name}-${chunkIndex}`,
849
- usage: Buffer.VERTEX | Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC,
850
+ ...getGPUDataBufferProps(device, targetElementFormat === 'uint16' ? 'uint16' : 'uint32'),
850
851
  byteLength: Math.max(4, converted.byteLength)
851
852
  });
852
853
  outputBuffers.push(outputBuffer);
@@ -23,6 +23,8 @@ import {
23
23
  type GPUGraphRunOptions
24
24
  } from './gpu-expression-plan';
25
25
  import {GPUExpressionKernel} from './gpu-expression-kernel';
26
+ import {GPUShaderPassOperation} from './gpu-shader-pass-operation';
27
+ import {GPUShaderPassKernel} from './gpu-shader-pass-kernel';
26
28
  import {GPUCPUOperation} from './gpu-cpu-operation';
27
29
  import {GPUCPUExecution} from './gpu-cpu-execution';
28
30
 
@@ -32,6 +34,7 @@ export class CompiledGPUGraph<Outputs extends GPUGraphOutputs = Record<string, G
32
34
  private readonly stageLowerings: readonly GPUOperationLowering[];
33
35
  private readonly compiler: GPUGraphCompiler;
34
36
  private readonly kernels = new Map<GPUExpressionOperation, GPUExpressionKernel>();
37
+ private readonly shaderPasses = new Map<GPUShaderPassOperation, GPUShaderPassKernel>();
35
38
  private destroyed = false;
36
39
  private runningCPU = false;
37
40
  private cpuExecution?: GPUCPUExecution;
@@ -49,6 +52,11 @@ export class CompiledGPUGraph<Outputs extends GPUGraphOutputs = Record<string, G
49
52
  this.stageLowerings = lowerings ?? options.lowerings ?? [];
50
53
  this.compiler = new GPUGraphCompiler(device, [
51
54
  ...(lowerings ?? options.lowerings ?? []),
55
+ {
56
+ type: 'shader-pass',
57
+ lower: (operation: GPUShaderPassOperation, context) =>
58
+ this.shaderPasses.get(operation)!.lower(context)
59
+ },
52
60
  {
53
61
  type: 'expression',
54
62
  lower: (operation: GPUExpressionOperation, context) =>
@@ -70,6 +78,12 @@ export class CompiledGPUGraph<Outputs extends GPUGraphOutputs = Record<string, G
70
78
  try {
71
79
  for (const plan of this.program.expressions)
72
80
  this.kernels.set(plan.operation, new GPUExpressionKernel(device, this.program, plan));
81
+ for (const operation of this.program.operations)
82
+ if (operation instanceof GPUShaderPassOperation)
83
+ this.shaderPasses.set(
84
+ operation,
85
+ new GPUShaderPassKernel(device, operation, this.program)
86
+ );
73
87
  } catch (error) {
74
88
  this.destroy();
75
89
  throw error;
@@ -140,6 +154,8 @@ export class CompiledGPUGraph<Outputs extends GPUGraphOutputs = Record<string, G
140
154
  const invocation = this.program.prepare(this.device, bindings, options, true);
141
155
  let executable: CompiledGPUCommandGraph | undefined;
142
156
  try {
157
+ for (const kernel of this.shaderPasses.values())
158
+ kernel.validateTextures(invocation.textures!.values);
143
159
  const resolved = new GPUGraph();
144
160
  for (const scalar of this.program.scalars) resolved.scalar(scalar.id, scalar.format);
145
161
  const vectors: Record<string, GPUVector> = Object.create(null);
@@ -233,6 +249,8 @@ export class CompiledGPUGraph<Outputs extends GPUGraphOutputs = Record<string, G
233
249
  // CPU callbacks may still be awaiting input readback or producing output arrays.
234
250
  assert(!this.runningCPU);
235
251
  this.cpuExecution?.destroy();
252
+ for (const kernel of this.shaderPasses.values()) kernel.destroy();
253
+ this.shaderPasses.clear();
236
254
  for (const kernel of this.kernels.values()) kernel.destroy();
237
255
  this.kernels.clear();
238
256
  this.destroyed = true;
@@ -738,6 +738,16 @@ export class GPUCommandGraphBuilder<Parameters = void> {
738
738
  return this.addBuffer(new GraphBufferHandle(this, descriptor, true));
739
739
  }
740
740
 
741
+ /** Choose a compiler-owned resource name without treating diagnostic labels as unique. @internal */
742
+ getUniqueResourceId(label: string): string {
743
+ let id = label;
744
+ let suffix = 1;
745
+ while (this.buffers.has(id) || this.textures.has(id) || this.externalTextures.has(id)) {
746
+ id = `${label}-${suffix++}`;
747
+ }
748
+ return id;
749
+ }
750
+
741
751
  /**
742
752
  * Creates one typed range over a graph buffer.
743
753
  *
@@ -6,6 +6,7 @@ import {Buffer, Texture, TextureView, type Device} from '@luma.gl/core';
6
6
  import {CPUVector, GPUData, GPUVector, getGPUVectorFormatInfo} from '@luma.gl/graph/gpu-data';
7
7
  import type {GPUGraph} from './gpu-graph';
8
8
  import {GPUCopyOperation} from './gpu-transfer-operation';
9
+ import {GPUShaderPassOperation} from './gpu-shader-pass-operation';
9
10
  import {validateTextureCopy} from './gpu-texture-copy';
10
11
  import {
11
12
  GPUTextureInvocation,
@@ -89,6 +90,11 @@ export class GPUExpressionProgram {
89
90
  operation.operations.forEach(flatten);
90
91
  else {
91
92
  if (operation instanceof GPUCompositeOperation) {
93
+ const containsShaderPass = (child: GPUGraphOperation): boolean =>
94
+ child instanceof GPUShaderPassOperation ||
95
+ (child instanceof GPUCompositeOperation && child.operations.some(containsShaderPass));
96
+ if (operation.operations.some(containsShaderPass))
97
+ throw new Error('Shader-pass operations inside control flow are not supported');
92
98
  const containsExpression = (child: GPUGraphOperation): boolean =>
93
99
  child instanceof GPUExpressionOperation ||
94
100
  (child instanceof GPUCompositeOperation && child.operations.some(containsExpression));
@@ -5,6 +5,9 @@
5
5
  import {lowerGPUUpload, lowerGPUCopy, lowerGPUTextureCopy} from './gpu-transfer-lowering';
6
6
  import {GPUUploadOperation, GPUCopyOperation} from './gpu-transfer-operation';
7
7
  import {GPUCompactionOperation} from './gpu-compaction-operation';
8
+ import {GPUGraphGroupAggregation, GPUGraphReduction} from './gpu-semantic-aggregation-operation';
9
+ import {GPUGroupAggregation} from './gpu-group-aggregation';
10
+ import {GPUReduction} from './gpu-reduction';
8
11
  import {GPUCompaction} from './gpu-compaction';
9
12
 
10
13
  import type {TextureFormat} from '@luma.gl/core';
@@ -108,6 +111,7 @@ export class GPUGraphCompiler<Parameters = void> {
108
111
  readonly capabilities: GPUGraphBackendCapabilities;
109
112
  readonly lowerings: readonly GPUOperationLowering<Parameters>[];
110
113
  private compactionIndex = 0;
114
+ private aggregationIndex = 0;
111
115
  constructor(device: Device, lowerings: readonly GPUOperationLowering<Parameters>[] = []) {
112
116
  this.device = device;
113
117
  this.capabilities = Object.freeze({
@@ -131,6 +135,7 @@ export class GPUGraphCompiler<Parameters = void> {
131
135
  }
132
136
  compile(program: GPUGraph, bindings: GPUGraphBindings = {}): GPUGraphCompilation<Parameters> {
133
137
  this.compactionIndex = 0;
138
+ this.aggregationIndex = 0;
134
139
  // Bound external partitions must be available when resolving shape-inheriting results.
135
140
  program = program.clone();
136
141
  for (const vector of program.vectors) {
@@ -336,6 +341,54 @@ export class GPUGraphCompiler<Parameters = void> {
336
341
  return [
337
342
  {type: 'vector-upload', lower: lowerGPUUpload},
338
343
  {type: 'vector-copy', lower: lowerGPUCopy},
344
+ {
345
+ type: 'group-aggregation',
346
+ lower: (operation: GPUGraphGroupAggregation, context) => {
347
+ const {props} = operation;
348
+ const id = `${operation.id}-${this.aggregationIndex++}`;
349
+ const keys = context.resolveVector<'uint32'>(props.keys);
350
+ const mask = props.mask ? context.resolveVector<'uint32'>(props.mask) : undefined;
351
+ if (props.operation === 'count') {
352
+ context.graph.add(
353
+ new GPUGroupAggregation({
354
+ id,
355
+ keys,
356
+ mask,
357
+ operation: 'count',
358
+ output: getAggregationOutput(context.resolveVector<'uint32'>(props.output))
359
+ })
360
+ );
361
+ } else {
362
+ context.graph.add(
363
+ new GPUGroupAggregation({
364
+ id,
365
+ keys,
366
+ mask,
367
+ operation: props.operation,
368
+ values: context.resolveVector<'float32'>(props.values),
369
+ output: getAggregationOutput(context.resolveVector<'float32'>(props.output))
370
+ })
371
+ );
372
+ }
373
+ }
374
+ },
375
+ {
376
+ type: 'reduction',
377
+ lower: (operation: GPUGraphReduction, context) => {
378
+ const {props} = operation;
379
+ context.graph.add(
380
+ new GPUReduction({
381
+ id: `${operation.id}-${this.aggregationIndex++}`,
382
+ input: context.resolveVector<'uint32' | 'sint32' | 'float32'>(props.input),
383
+ mask: props.mask ? context.resolveVector<'uint32'>(props.mask) : undefined,
384
+ operation: props.operation,
385
+ output: getAggregationOutput(
386
+ context.resolveVector<'uint32' | 'sint32' | 'float32'>(props.output)
387
+ )
388
+ })
389
+ );
390
+ }
391
+ },
339
392
  {
340
393
  type: 'compaction',
341
394
  lower: (operation: GPUCompactionOperation, context) => {
@@ -760,3 +813,11 @@ function getTransientChunkLengths(
760
813
  }
761
814
  return lengths;
762
815
  }
816
+
817
+ // These reduction kernels write one packed destination, never just the first of several chunks.
818
+ function getAggregationOutput<Format extends 'uint32' | 'sint32' | 'float32'>(
819
+ output: GraphVectorView<Format>
820
+ ) {
821
+ assert(output.data.length === 1);
822
+ return output.data[0];
823
+ }
@@ -4,6 +4,7 @@
4
4
 
5
5
  import {alignGraphVectorViews} from './graph-vector-view-utils';
6
6
 
7
+ import {setGPUComputeDispatchWorkgroups} from './gpu-command-dispatch-metadata';
7
8
  import {type GPUCommandNode, createGPUComputeCommandNode} from './gpu-command-node';
8
9
  import {type Binding} from '@luma.gl/core';
9
10
  import {Kernel} from '../execution/compute/kernel';
@@ -739,56 +740,43 @@ function addKernelPass<Parameters>(
739
740
  dispatchSize?: GPUGroupAggregationDispatchLayout;
740
741
  }
741
742
  ): readonly GPUCommandNode<Parameters>[] {
742
- const nodes: GPUCommandNode<Parameters>[] = [];
743
- const maximumWorkgroupCount = props.dispatchSize
744
- ? props.dispatchSize.x * props.dispatchSize.y * props.dispatchSize.z
745
- : (props.dispatchCount ?? 1);
746
- nodes.push(
747
- createGPUComputeCommandNode<Parameters>({
748
- id: props.id,
749
- resources: props.resources,
750
- workload: {
751
- operation: 'GPUGroupAggregation',
752
- commandCount: 1,
753
- maximumWorkgroupCount,
754
- maximumInvocationCount: maximumWorkgroupCount * GROUP_AGGREGATION_WORKGROUP_SIZE
755
- },
756
- compile: ({device}) => {
757
- const kernel = new Kernel(device, {
758
- id: props.id,
759
- source: props.source,
760
- shaderLayout: {
761
- bindings: Object.keys(props.bindings).map((name, location) => ({
762
- name,
763
- type: 'storage' as const,
764
- group: 0,
765
- location
766
- }))
743
+ const {x, y, z} = props.dispatchSize ?? {x: props.dispatchCount ?? 1, y: 1, z: 1};
744
+ const maximumWorkgroupCount = x * y * z;
745
+ const node = createGPUComputeCommandNode<Parameters>({
746
+ id: props.id,
747
+ resources: props.resources,
748
+ workload: {
749
+ operation: 'GPUGroupAggregation',
750
+ commandCount: 1,
751
+ maximumWorkgroupCount,
752
+ maximumInvocationCount: maximumWorkgroupCount * GROUP_AGGREGATION_WORKGROUP_SIZE
753
+ },
754
+ compile: ({device}) => {
755
+ const kernel = new Kernel(device, {
756
+ id: props.id,
757
+ source: props.source,
758
+ shaderLayout: {
759
+ bindings: Object.keys(props.bindings).map((name, location) => ({
760
+ name,
761
+ type: 'storage' as const,
762
+ group: 0,
763
+ location
764
+ }))
765
+ }
766
+ });
767
+ return {
768
+ encode: ({computePass, getBuffer}) => {
769
+ const bindings: Record<string, Binding> = {};
770
+ for (const [name, view] of Object.entries(props.bindings)) {
771
+ bindings[name] = getViewBinding(view, getBuffer);
767
772
  }
768
- });
769
- return {
770
- encode: ({computePass, getBuffer}) => {
771
- const bindings: Record<string, Binding> = {};
772
- for (const [name, view] of Object.entries(props.bindings)) {
773
- bindings[name] = getViewBinding(view, getBuffer);
774
- }
775
-
776
- if (props.dispatchSize) {
777
- kernel.dispatch(computePass, {
778
- bindings,
779
- x: props.dispatchSize.x,
780
- y: props.dispatchSize.y,
781
- z: props.dispatchSize.z
782
- });
783
- } else {
784
- kernel.dispatch(computePass, {bindings, x: props.dispatchCount!});
785
- }
786
- },
787
- destroy: () => kernel.destroy()
788
- };
789
- }
790
- })
791
- );
792
773
 
793
- return nodes;
774
+ kernel.dispatch(computePass, {bindings, x, y, z});
775
+ },
776
+ destroy: () => kernel.destroy()
777
+ };
778
+ }
779
+ });
780
+
781
+ return [setGPUComputeDispatchWorkgroups(node, [x, y, z])];
794
782
  }
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
+ import {setGPUComputeDispatchWorkgroups} from './gpu-command-dispatch-metadata';
5
6
  import {type GPUCommandNode, createGPUComputeCommandNode} from './gpu-command-node';
6
7
  import {type Binding, type Device} from '@luma.gl/core';
7
8
  import {Kernel} from '../execution/compute/kernel';
@@ -701,50 +702,39 @@ function addKernelPass<Parameters>(
701
702
  dispatchLayout?: GPUBoundedDispatchLayout;
702
703
  }
703
704
  ): readonly GPUCommandNode<Parameters>[] {
704
- const nodes: GPUCommandNode<Parameters>[] = [];
705
- nodes.push(
706
- createGPUComputeCommandNode<Parameters>({
707
- id: props.id,
708
- resources: props.resources,
709
- compile: ({device}) => {
710
- const bindingNames = Object.keys(props.bindings);
711
- const kernel = new Kernel(device, {
712
- id: props.id,
713
- source: props.source,
714
- shaderLayout: {
715
- bindings: bindingNames.map((name, location) => ({
716
- name,
717
- type: 'storage' as const,
718
- group: 0,
719
- location
720
- }))
705
+ const {x, y, z} = props.dispatchLayout ?? {x: props.dispatchCount ?? 1, y: 1, z: 1};
706
+ const node = createGPUComputeCommandNode<Parameters>({
707
+ id: props.id,
708
+ resources: props.resources,
709
+ compile: ({device}) => {
710
+ const bindingNames = Object.keys(props.bindings);
711
+ const kernel = new Kernel(device, {
712
+ id: props.id,
713
+ source: props.source,
714
+ shaderLayout: {
715
+ bindings: bindingNames.map((name, location) => ({
716
+ name,
717
+ type: 'storage' as const,
718
+ group: 0,
719
+ location
720
+ }))
721
+ }
722
+ });
723
+ return {
724
+ encode: ({computePass, getBuffer}) => {
725
+ const bindings: Record<string, Binding> = {};
726
+ for (const [name, view] of Object.entries(props.bindings)) {
727
+ bindings[name] = getViewBinding(view, getBuffer);
721
728
  }
722
- });
723
- return {
724
- encode: ({computePass, getBuffer}) => {
725
- const bindings: Record<string, Binding> = {};
726
- for (const [name, view] of Object.entries(props.bindings)) {
727
- bindings[name] = getViewBinding(view, getBuffer);
728
- }
729
-
730
- if (props.dispatchLayout) {
731
- kernel.dispatch(computePass, {
732
- bindings,
733
- x: props.dispatchLayout.x,
734
- y: props.dispatchLayout.y,
735
- z: props.dispatchLayout.z
736
- });
737
- } else {
738
- kernel.dispatch(computePass, {bindings, x: props.dispatchCount ?? 1});
739
- }
740
- },
741
- destroy: () => kernel.destroy()
742
- };
743
- }
744
- })
745
- );
746
729
 
747
- return nodes;
730
+ kernel.dispatch(computePass, {bindings, x, y, z});
731
+ },
732
+ destroy: () => kernel.destroy()
733
+ };
734
+ }
735
+ });
736
+
737
+ return [setGPUComputeDispatchWorkgroups(node, [x, y, z])];
748
738
  }
749
739
 
750
740
  /** Returns the WGSL scalar type corresponding to a supported GPU storage format. */