@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.
Files changed (480) hide show
  1. package/LICENSE +4 -4
  2. package/THIRD-PARTY-NOTICES.md +19 -0
  3. package/dist/arrow/arrow-colors.cjs +99 -18
  4. package/dist/arrow/arrow-colors.d.ts +27 -10
  5. package/dist/arrow/arrow-colors.d.ts.map +1 -1
  6. package/dist/arrow/arrow-colors.js +107 -24
  7. package/dist/arrow/arrow-colors.js.map +1 -1
  8. package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
  9. package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
  10. package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
  11. package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
  12. package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
  13. package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
  14. package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
  15. package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
  16. package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
  17. package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
  18. package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
  19. package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
  20. package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
  21. package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
  22. package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
  23. package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
  24. package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
  25. package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
  26. package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
  27. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
  28. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
  29. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
  30. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
  31. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
  32. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
  33. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
  34. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
  35. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
  36. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
  37. package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
  38. package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
  39. package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
  40. package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
  41. package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
  42. package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
  43. package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
  44. package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
  45. package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
  46. package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
  47. package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
  48. package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
  49. package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
  50. package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
  51. package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
  52. package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
  53. package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
  54. package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
  55. package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
  56. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
  57. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
  58. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
  59. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
  60. package/dist/arrow/index.cjs +19 -2
  61. package/dist/arrow/index.cjs.map +3 -3
  62. package/dist/arrow/index.d.ts +5 -2
  63. package/dist/arrow/index.d.ts.map +1 -1
  64. package/dist/arrow/index.js +4 -1
  65. package/dist/arrow/index.js.map +1 -1
  66. package/dist/arrow/internal.cjs.map +2 -2
  67. package/dist/dist.dev.js +3820 -1646
  68. package/dist/dist.min.js +450 -136
  69. package/dist/experimental/index.cjs.map +1 -1
  70. package/dist/experimental/simulation/index.cjs.map +1 -1
  71. package/dist/geospatial/gpu-point-spatial-query.cjs +2 -15
  72. package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
  73. package/dist/geospatial/gpu-point-spatial-query.js +2 -15
  74. package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
  75. package/dist/geospatial/index.cjs.map +2 -2
  76. package/dist/gpu-a5/index.cjs.map +1 -1
  77. package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
  78. package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
  79. package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
  80. package/dist/gpu-core/compiled-gpu-graph.js +54 -1
  81. package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
  82. package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
  83. package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
  84. package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
  85. package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
  86. package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
  87. package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
  88. package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
  89. package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
  90. package/dist/gpu-core/gpu-command-graph.cjs +34 -11
  91. package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
  92. package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
  93. package/dist/gpu-core/gpu-command-graph.js +39 -11
  94. package/dist/gpu-core/gpu-command-graph.js.map +1 -1
  95. package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
  96. package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
  97. package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
  98. package/dist/gpu-core/gpu-cpu-execution.js +294 -0
  99. package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
  100. package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
  101. package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
  102. package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
  103. package/dist/gpu-core/gpu-cpu-operation.js +35 -0
  104. package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
  105. package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
  106. package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
  107. package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
  108. package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
  109. package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
  110. package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
  111. package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
  112. package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
  113. package/dist/gpu-core/gpu-expression-operation.js +1 -1
  114. package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
  115. package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
  116. package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
  117. package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
  118. package/dist/gpu-core/gpu-expression-plan.js +7 -1
  119. package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
  120. package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
  121. package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
  122. package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
  123. package/dist/gpu-core/gpu-graph-compiler.js +50 -0
  124. package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
  125. package/dist/gpu-core/gpu-graph.d.ts +2 -2
  126. package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
  127. package/dist/gpu-core/gpu-graph.js.map +1 -1
  128. package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
  129. package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
  130. package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
  131. package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
  132. package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
  133. package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
  134. package/dist/gpu-core/gpu-grid-binning.js +2 -5
  135. package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
  136. package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
  137. package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
  138. package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
  139. package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
  140. package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
  141. package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
  142. package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
  143. package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
  144. package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
  145. package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
  146. package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
  147. package/dist/gpu-core/gpu-grid-index-query.js +2 -16
  148. package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
  149. package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
  150. package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
  151. package/dist/gpu-core/gpu-group-aggregation.js +7 -18
  152. package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
  153. package/dist/gpu-core/gpu-operation.d.ts +4 -4
  154. package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
  155. package/dist/gpu-core/gpu-operation.js.map +1 -1
  156. package/dist/gpu-core/gpu-reduction.cjs +6 -14
  157. package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
  158. package/dist/gpu-core/gpu-reduction.js +6 -15
  159. package/dist/gpu-core/gpu-reduction.js.map +1 -1
  160. package/dist/gpu-core/gpu-render-operation.cjs +39 -0
  161. package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
  162. package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
  163. package/dist/gpu-core/gpu-render-operation.js +22 -0
  164. package/dist/gpu-core/gpu-render-operation.js.map +1 -0
  165. package/dist/gpu-core/gpu-scan.cjs +46 -32
  166. package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
  167. package/dist/gpu-core/gpu-scan.js +56 -44
  168. package/dist/gpu-core/gpu-scan.js.map +1 -1
  169. package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
  170. package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
  171. package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
  172. package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
  173. package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
  174. package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
  175. package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
  176. package/dist/gpu-core/gpu-segmented-scan.js +73 -16
  177. package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
  178. package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
  179. package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
  180. package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
  181. package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
  182. package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
  183. package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
  184. package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
  185. package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
  186. package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
  187. package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
  188. package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
  189. package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
  190. package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
  191. package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
  192. package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
  193. package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
  194. package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
  195. package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
  196. package/dist/gpu-core/index.cjs +32 -0
  197. package/dist/gpu-core/index.cjs.map +3 -3
  198. package/dist/gpu-core/index.d.ts +21 -1
  199. package/dist/gpu-core/index.d.ts.map +1 -1
  200. package/dist/gpu-core/index.js +10 -0
  201. package/dist/gpu-core/index.js.map +1 -1
  202. package/dist/gpu-data/color-conversion.cjs +105 -0
  203. package/dist/gpu-data/color-conversion.d.ts +30 -0
  204. package/dist/gpu-data/color-conversion.d.ts.map +1 -0
  205. package/dist/gpu-data/color-conversion.js +109 -0
  206. package/dist/gpu-data/color-conversion.js.map +1 -0
  207. package/dist/gpu-data/cpu-data.cjs +60 -0
  208. package/dist/gpu-data/cpu-data.d.ts +28 -0
  209. package/dist/gpu-data/cpu-data.d.ts.map +1 -0
  210. package/dist/gpu-data/cpu-data.js +41 -0
  211. package/dist/gpu-data/cpu-data.js.map +1 -0
  212. package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
  213. package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
  214. package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
  215. package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
  216. package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
  217. package/dist/gpu-data/cpu-vector.cjs +42 -0
  218. package/dist/gpu-data/cpu-vector.d.ts +17 -0
  219. package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
  220. package/dist/gpu-data/cpu-vector.js +21 -0
  221. package/dist/gpu-data/cpu-vector.js.map +1 -0
  222. package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
  223. package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
  224. package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
  225. package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
  226. package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
  227. package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
  228. package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
  229. package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
  230. package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
  231. package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
  232. package/dist/gpu-data/index.cjs +21 -2
  233. package/dist/gpu-data/index.cjs.map +3 -3
  234. package/dist/gpu-data/index.d.ts +6 -0
  235. package/dist/gpu-data/index.d.ts.map +1 -1
  236. package/dist/gpu-data/index.js +5 -0
  237. package/dist/gpu-data/index.js.map +1 -1
  238. package/dist/gpu-dataframe/gpu-data-frame-query.cjs +1 -16
  239. package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
  240. package/dist/gpu-dataframe/gpu-data-frame-query.js +1 -23
  241. package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
  242. package/dist/gpu-dataframe/gpu-expression.cjs +91 -2
  243. package/dist/gpu-dataframe/gpu-expression.d.ts +37 -0
  244. package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
  245. package/dist/gpu-dataframe/gpu-expression.js +106 -0
  246. package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
  247. package/dist/gpu-dataframe/index.cjs +12 -2
  248. package/dist/gpu-dataframe/index.cjs.map +3 -3
  249. package/dist/gpu-dataframe/index.d.ts +4 -0
  250. package/dist/gpu-dataframe/index.d.ts.map +1 -1
  251. package/dist/gpu-dataframe/index.js +2 -0
  252. package/dist/gpu-dataframe/index.js.map +1 -1
  253. package/dist/gpu-dataframe/portable-expression.cjs +103 -0
  254. package/dist/gpu-dataframe/portable-expression.d.ts +19 -0
  255. package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
  256. package/dist/gpu-dataframe/portable-expression.js +98 -0
  257. package/dist/gpu-dataframe/portable-expression.js.map +1 -0
  258. package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
  259. package/dist/gpu-dggs/index.cjs.map +1 -1
  260. package/dist/gpu-geometry/index.cjs.map +1 -1
  261. package/dist/gpu-graph/index.cjs +8 -0
  262. package/dist/gpu-graph/index.cjs.map +3 -3
  263. package/dist/gpu-graph/index.d.ts +4 -0
  264. package/dist/gpu-graph/index.d.ts.map +1 -1
  265. package/dist/gpu-graph/index.js +2 -0
  266. package/dist/gpu-graph/index.js.map +1 -1
  267. package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
  268. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
  269. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
  270. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
  271. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
  272. package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
  273. package/dist/gpu-h3/index.cjs.map +1 -1
  274. package/dist/gpu-physics/gpu-rigid-body-world.cjs +162 -2
  275. package/dist/gpu-physics/gpu-rigid-body-world.d.ts +25 -0
  276. package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
  277. package/dist/gpu-physics/gpu-rigid-body-world.js +181 -2
  278. package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
  279. package/dist/gpu-physics/index.cjs.map +2 -2
  280. package/dist/gpu-physics/index.d.ts +1 -0
  281. package/dist/gpu-physics/index.d.ts.map +1 -1
  282. package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +24 -9
  283. package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
  284. package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
  285. package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
  286. package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
  287. package/dist/gpu-physics/rigid-body-shaders.cjs +2 -2
  288. package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
  289. package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
  290. package/dist/gpu-physics/rigid-body-shaders.js +2 -2
  291. package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
  292. package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
  293. package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
  294. package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
  295. package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
  296. package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
  297. package/dist/gpu-pointcloud/index.cjs.map +1 -1
  298. package/dist/gpu-project/benchmarks.cjs.map +2 -2
  299. package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
  300. package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
  301. package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
  302. package/dist/gpu-project/coordinate-projection-graph.js +40 -0
  303. package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
  304. package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
  305. package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
  306. package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
  307. package/dist/gpu-project/cpu-geoarrow.js +103 -0
  308. package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
  309. package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
  310. package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
  311. package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
  312. package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
  313. package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
  314. package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
  315. package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
  316. package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
  317. package/dist/gpu-project/cpu-projection-operation.js +37 -0
  318. package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
  319. package/dist/gpu-project/crs.cjs.map +2 -2
  320. package/dist/gpu-project/geoarrow.cjs +36 -0
  321. package/dist/gpu-project/geoarrow.cjs.map +6 -0
  322. package/dist/gpu-project/geoarrow.d.ts +3 -0
  323. package/dist/gpu-project/geoarrow.d.ts.map +1 -0
  324. package/dist/gpu-project/geoarrow.js +7 -0
  325. package/dist/gpu-project/geoarrow.js.map +1 -0
  326. package/dist/gpu-project/graph.cjs +27 -0
  327. package/dist/gpu-project/graph.cjs.map +6 -0
  328. package/dist/gpu-project/graph.d.ts +2 -0
  329. package/dist/gpu-project/graph.d.ts.map +1 -0
  330. package/dist/gpu-project/graph.js +6 -0
  331. package/dist/gpu-project/graph.js.map +1 -0
  332. package/dist/gpu-project/index.cjs +3 -0
  333. package/dist/gpu-project/index.cjs.map +3 -3
  334. package/dist/gpu-project/index.d.ts +1 -0
  335. package/dist/gpu-project/index.d.ts.map +1 -1
  336. package/dist/gpu-project/index.js +1 -0
  337. package/dist/gpu-project/index.js.map +1 -1
  338. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +75 -5
  339. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
  340. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
  341. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
  342. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
  343. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
  344. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
  345. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
  346. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
  347. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
  348. package/dist/gpu-simple-graph/gpu-simple-graph.cjs +126 -10
  349. package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
  350. package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
  351. package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
  352. package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
  353. package/dist/gpu-simple-graph/index.cjs.map +3 -3
  354. package/dist/gpu-simple-graph/index.d.ts +1 -1
  355. package/dist/gpu-simple-graph/index.d.ts.map +1 -1
  356. package/dist/gpu-simple-graph/index.js.map +1 -1
  357. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
  358. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +6 -0
  359. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
  360. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
  361. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
  362. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
  363. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
  364. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
  365. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
  366. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.map +1 -1
  367. package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
  368. package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
  369. package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
  370. package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
  371. package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
  372. package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
  373. package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
  374. package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
  375. package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
  376. package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
  377. package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
  378. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
  379. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
  380. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
  381. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
  382. package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
  383. package/dist/gpu-sql/gpu-sql.cjs +157 -280
  384. package/dist/gpu-sql/gpu-sql.d.ts +1 -1
  385. package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
  386. package/dist/gpu-sql/gpu-sql.js +168 -291
  387. package/dist/gpu-sql/gpu-sql.js.map +1 -1
  388. package/dist/gpu-sql/index.cjs.map +3 -3
  389. package/dist/gpu-tables/index.cjs.map +2 -2
  390. package/dist/gpu-tables/table/gpu-table.cjs +2 -2
  391. package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
  392. package/dist/gpu-tables/table/gpu-table.js +2 -2
  393. package/dist/gpu-tables/table/gpu-table.js.map +1 -1
  394. package/dist/gpu-timeseries/index.cjs.map +1 -1
  395. package/dist/index.cjs +11 -0
  396. package/dist/index.cjs.map +3 -3
  397. package/dist/index.d.ts +7 -1
  398. package/dist/index.d.ts.map +1 -1
  399. package/dist/index.js +3 -0
  400. package/dist/index.js.map +1 -1
  401. package/package.json +21 -7
  402. package/src/arrow/arrow-colors.ts +194 -33
  403. package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
  404. package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
  405. package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
  406. package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
  407. package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
  408. package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
  409. package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
  410. package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
  411. package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
  412. package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
  413. package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
  414. package/src/arrow/index.ts +14 -0
  415. package/src/geospatial/gpu-point-spatial-query.ts +2 -15
  416. package/src/gpu-core/compiled-gpu-graph.ts +73 -1
  417. package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
  418. package/src/gpu-core/gpu-command-graph-types.ts +20 -0
  419. package/src/gpu-core/gpu-command-graph.ts +48 -11
  420. package/src/gpu-core/gpu-cpu-execution.ts +345 -0
  421. package/src/gpu-core/gpu-cpu-operation.ts +65 -0
  422. package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
  423. package/src/gpu-core/gpu-expression-operation.ts +1 -1
  424. package/src/gpu-core/gpu-expression-plan.ts +11 -3
  425. package/src/gpu-core/gpu-graph-compiler.ts +61 -0
  426. package/src/gpu-core/gpu-graph.ts +3 -3
  427. package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
  428. package/src/gpu-core/gpu-grid-binning.ts +2 -5
  429. package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
  430. package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
  431. package/src/gpu-core/gpu-grid-index-query.ts +2 -16
  432. package/src/gpu-core/gpu-group-aggregation.ts +38 -50
  433. package/src/gpu-core/gpu-operation.ts +9 -7
  434. package/src/gpu-core/gpu-reduction.ts +32 -42
  435. package/src/gpu-core/gpu-render-operation.ts +42 -0
  436. package/src/gpu-core/gpu-scan.ts +59 -45
  437. package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
  438. package/src/gpu-core/gpu-segmented-scan.ts +82 -17
  439. package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
  440. package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
  441. package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
  442. package/src/gpu-core/gpu-texture-plan.ts +3 -2
  443. package/src/gpu-core/index.ts +39 -0
  444. package/src/gpu-data/color-conversion.ts +158 -0
  445. package/src/gpu-data/cpu-data.ts +62 -0
  446. package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
  447. package/src/gpu-data/cpu-vector.ts +31 -0
  448. package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
  449. package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
  450. package/src/gpu-data/index.ts +15 -0
  451. package/src/gpu-dataframe/gpu-data-frame-query.ts +6 -26
  452. package/src/gpu-dataframe/gpu-expression.ts +135 -0
  453. package/src/gpu-dataframe/index.ts +11 -0
  454. package/src/gpu-dataframe/portable-expression.ts +117 -0
  455. package/src/gpu-graph/index.ts +17 -0
  456. package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
  457. package/src/gpu-physics/gpu-rigid-body-world.ts +227 -2
  458. package/src/gpu-physics/index.ts +1 -0
  459. package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
  460. package/src/gpu-physics/rigid-body-shaders.ts +3 -2
  461. package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
  462. package/src/gpu-project/coordinate-projection-graph.ts +59 -0
  463. package/src/gpu-project/cpu-geoarrow.ts +135 -0
  464. package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
  465. package/src/gpu-project/cpu-projection-operation.ts +49 -0
  466. package/src/gpu-project/geoarrow.ts +11 -0
  467. package/src/gpu-project/graph.ts +10 -0
  468. package/src/gpu-project/index.ts +2 -0
  469. package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +97 -6
  470. package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -0
  471. package/src/gpu-simple-graph/gpu-simple-graph.ts +163 -19
  472. package/src/gpu-simple-graph/index.ts +1 -0
  473. package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +24 -0
  474. package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
  475. package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
  476. package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
  477. package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
  478. package/src/gpu-sql/gpu-sql.ts +179 -293
  479. package/src/gpu-tables/table/gpu-table.ts +2 -1
  480. package/src/index.ts +21 -0
@@ -0,0 +1,103 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {assert, type SamplerProps, type TextureFormatColor} from '@luma.gl/core';
6
+ import {gpuGraph, type GPUGraphTextureDescriptor} from './gpu-graph-value';
7
+ import type {GPUOperation} from './gpu-operation';
8
+ import type {GPUOperationContract} from './gpu-operation-contract';
9
+
10
+ export type GPUShaderPassOperationProps = {
11
+ id?: string;
12
+ /** WGSL defining fn shade(textureCoordinates: vec2<f32>) -> vec4<f32>. */
13
+ fragmentSource: string;
14
+ /** Shader texture binding names mapped to logical graph texture names. */
15
+ inputs: Readonly<Record<string, string>>;
16
+ /** Explicit, immutable color sampler descriptions, keyed by shader binding name. */
17
+ samplers?: Readonly<Record<string, SamplerProps>>;
18
+ /** Fields of the generated parameters uniform, mapped to graph scalar names. */
19
+ parameters?: Readonly<Record<string, string>>;
20
+ output: string;
21
+ /** Single-sampled 2D color result with an explicit fixed or inherited extent. */
22
+ outputDescriptor: GPUGraphTextureDescriptor<TextureFormatColor>;
23
+ };
24
+
25
+ /** One fullscreen WGSL draw, shared by GPUGraph and WebGPU SimpleGraph. */
26
+ export class GPUShaderPassOperation implements GPUOperation {
27
+ readonly type = 'shader-pass';
28
+ readonly id: string;
29
+ readonly fragmentSource: string;
30
+ readonly inputs: Readonly<Record<string, string>>;
31
+ readonly samplers: Readonly<Record<string, Readonly<SamplerProps>>>;
32
+ readonly parameters: Readonly<Record<string, string>>;
33
+ readonly output: string;
34
+ readonly outputDescriptor: GPUGraphTextureDescriptor<TextureFormatColor>;
35
+
36
+ constructor(props: GPUShaderPassOperationProps) {
37
+ this.id = props.id ?? `${props.output}-shader-pass`;
38
+ this.fragmentSource = props.fragmentSource;
39
+ this.inputs = Object.freeze({...props.inputs});
40
+ this.parameters = Object.freeze({...props.parameters});
41
+ this.samplers = Object.freeze(
42
+ Object.fromEntries(
43
+ Object.entries(props.samplers ?? {}).map(([name, sampler]) => [
44
+ name,
45
+ Object.freeze({...sampler})
46
+ ])
47
+ )
48
+ );
49
+ this.output = props.output;
50
+ const descriptor = props.outputDescriptor;
51
+ // This operation writes one complete 2D color attachment, without mip generation or MSAA.
52
+ assert(
53
+ descriptor.extent &&
54
+ (descriptor.dimension ?? '2d') === '2d' &&
55
+ (descriptor.mipLevels ?? 1) === 1 &&
56
+ (descriptor.samples ?? 1) === 1
57
+ );
58
+ this.outputDescriptor = gpuGraph.texture({
59
+ ...descriptor,
60
+ dimension: '2d',
61
+ mipLevels: 1,
62
+ samples: 1
63
+ });
64
+ const bindings = [...Object.keys(this.inputs), ...Object.keys(this.samplers)];
65
+ // Binding names are WGSL identifiers; reserve the generated uniform and entry-point names.
66
+ assert(new Set(bindings).size === bindings.length);
67
+ for (const name of [...bindings, ...Object.keys(this.parameters)])
68
+ assert(
69
+ /^[A-Za-z][A-Za-z0-9_]*$/.test(name) &&
70
+ !['parameters', 'shade', 'vertexMain', 'fragmentMain'].includes(name) &&
71
+ !name.startsWith('GraphShaderPass')
72
+ );
73
+ for (const sampler of Object.values(this.samplers))
74
+ assert((sampler.type ?? 'color-sampler') === 'color-sampler');
75
+ }
76
+
77
+ get contract(): GPUOperationContract {
78
+ return {
79
+ values: [
80
+ ...Object.values(this.inputs).map(value => ({
81
+ value,
82
+ access: 'read' as const,
83
+ textureUsage: 'sampled' as const
84
+ })),
85
+ ...Object.values(this.parameters).map(value => ({value, access: 'read' as const})),
86
+ {value: this.output, access: 'write', textureUsage: 'render-attachment'}
87
+ ],
88
+ outputs: ({getValue}) => {
89
+ for (const name of Object.values(this.inputs)) {
90
+ const input = getValue(name);
91
+ // Texture views may select one layer of an array, but the logical input is 2D.
92
+ assert(
93
+ input.type === 'texture' &&
94
+ (input.dimension ?? '2d') === '2d' &&
95
+ (input.samples ?? 1) === 1
96
+ );
97
+ }
98
+ for (const name of Object.values(this.parameters)) assert(getValue(name).type === 'scalar');
99
+ return {[this.output]: this.outputDescriptor};
100
+ }
101
+ };
102
+ }
103
+ }
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
+ import type {CPUVector} from '../gpu-data/cpu-vector';
5
6
  import {assert, Texture, TextureView, type Device, type TextureViewProps} from '@luma.gl/core';
6
7
  import type {GPUVector} from '@luma.gl/graph/gpu-data';
7
8
  import type {GPUGraphTexture, GPUGraphTextureDescriptor} from './gpu-graph-value';
@@ -10,7 +11,7 @@ import {getGPUOperationValueName} from './gpu-operation-contract';
10
11
  import type {GraphTextureUsage, GraphTextureViewProps} from './gpu-command-graph';
11
12
 
12
13
  export type GPUGraphTextureBinding = Texture | TextureView;
13
- export type GPUGraphOutput = GPUVector | GPUGraphTextureBinding;
14
+ export type GPUGraphOutput = CPUVector | GPUVector | GPUGraphTextureBinding;
14
15
  export type GPUGraphOutputs = Record<string, GPUGraphOutput>;
15
16
 
16
17
  /** Selected view geometry, without creating another view. @internal */
@@ -109,7 +110,7 @@ export class GPUTextureInvocation {
109
110
  device: Device,
110
111
  declarations: readonly GPUGraphTexture[],
111
112
  contracts: readonly GPUOperationContract[],
112
- bindings: Readonly<Record<string, GPUVector | number | GPUGraphTextureBinding>>,
113
+ bindings: Readonly<Record<string, GPUVector | CPUVector | number | GPUGraphTextureBinding>>,
113
114
  targets: Readonly<Record<string, GPUGraphOutput>>
114
115
  ) {
115
116
  const usages = new Map<string, number>();
@@ -46,6 +46,8 @@ export type {
46
46
  GPUCommandGraphNodeTiming,
47
47
  GPUCommandGraphNodeType,
48
48
  GPUCommandGraphNodePreflight,
49
+ GPUCommandGraphCompileOptions,
50
+ GPUCommandGraphKernelMetadata,
49
51
  GPUCommandGraphResourceSummary,
50
52
  GPUCommandGraphNodePublication,
51
53
  GPUCommandGraphNodeWorkloadEstimate,
@@ -140,6 +142,8 @@ export {GPUByteRangeGather} from './gpu-byte-range-gather';
140
142
  export type {GPUByteRangeGatherProps} from './gpu-byte-range-gather';
141
143
  export {GPUGather} from './gpu-gather';
142
144
  export type {GPUGatherFormat, GPUGatherProps} from './gpu-gather';
145
+ export {GPUScatter} from './gpu-scatter';
146
+ export type {GPUScatterFormat, GPUScatterProps} from './gpu-scatter';
143
147
  export {
144
148
  GPULZByteDecompressor,
145
149
  GPU_LZ_BYTE_DESCRIPTOR_WORDS,
@@ -177,6 +181,15 @@ export type {
177
181
  GPUWorkgroupReductionBenchmarkReport,
178
182
  GPUWorkgroupReductionBenchmarkStrategy
179
183
  } from './gpu-workgroup-reduction-benchmark';
184
+ export {GPUSegmentedScan} from './gpu-segmented-scan';
185
+ export type {GPUSegmentedScanMode, GPUSegmentedScanProps} from './gpu-segmented-scan';
186
+
187
+ export {GPUSegmentedReduction} from './gpu-segmented-reduction';
188
+ export type {
189
+ GPUSegmentedReductionOperation,
190
+ GPUSegmentedReductionProps
191
+ } from './gpu-segmented-reduction';
192
+
180
193
  export {GPUSegmentedSort} from './gpu-segmented-sort';
181
194
  export type {GPUSegmentedSortProps, GPUSortSegment} from './gpu-segmented-sort';
182
195
  export {GPUCompaction} from './gpu-compaction';
@@ -392,6 +405,8 @@ export type {
392
405
  GPUHistogramProps
393
406
  } from './gpu-histogram';
394
407
 
408
+ export {GPU_GRID_COORDINATE_WGSL} from './gpu-grid-coordinate';
409
+
395
410
  export {GPUGridBinning} from './gpu-grid-binning';
396
411
  export type {
397
412
  GPUGridBinningBounds,
@@ -637,6 +652,12 @@ export {GPUGraphDotProduct, GPUGraphVectorMADD} from './gpu-semantic-vector-oper
637
652
  export {GPUGraphCSRMatrix, GPUGraphSpMV} from './gpu-semantic-spmv';
638
653
  export {createGPUConjugateGradientGraph} from './gpu-conjugate-gradient-program';
639
654
 
655
+ export {GPUAdaptiveSpMV} from './gpu-adaptive-spmv';
656
+ export type {GPUAdaptiveSpMVProps} from './gpu-adaptive-spmv';
657
+ export type {GPUSpMVRowStatistics, GPUSpMVStrategyId} from './gpu-spmv-strategy';
658
+ export {GPUJacobiPCG} from './gpu-pcg';
659
+ export type {GPUJacobiPCGProps, GPUJacobiPCGResult} from './gpu-pcg';
660
+
640
661
  export {GPUCOOToCSR} from './gpu-coo-to-csr';
641
662
  export type {GPUCOOToCSRProps} from './gpu-coo-to-csr';
642
663
  export {GPURunLengthEncode, GPUUnique} from './gpu-run-length-encode';
@@ -653,6 +674,8 @@ export type {
653
674
  export type {GPUResourcePreview} from './gpu-resource-preview';
654
675
 
655
676
  export type {GPUIndexPickInfo} from './gpu-index-picking-target';
677
+ export {GPURenderOperation} from './gpu-render-operation';
678
+ export type {GPURenderOperationResources} from './gpu-render-operation';
656
679
 
657
680
  export {GPUExpressionOperation} from './gpu-expression-operation';
658
681
  export type {GPUExpressionOperationProps, GPUExpressionAST} from './gpu-expression-operation';
@@ -684,9 +707,25 @@ export type {
684
707
  } from './gpu-operation-contract';
685
708
 
686
709
  export {GPUUploadOperation, GPUCopyOperation} from './gpu-transfer-operation';
710
+ export {GPUShaderPassOperation} from './gpu-shader-pass-operation';
711
+ export type {GPUShaderPassOperationProps} from './gpu-shader-pass-operation';
687
712
  export type {GPUUploadOperationProps, GPUCopyOperationProps} from './gpu-transfer-operation';
688
713
  export {GPUCompactionOperation} from './gpu-compaction-operation';
689
714
  export type {GPUCompactionOperationProps} from './gpu-compaction-operation';
690
715
 
691
716
  export type {GPUGraphTextureDescriptor, GPUGraphTextureExtent} from './gpu-graph-value';
692
717
  export type {GPUGraphTextureBinding, GPUGraphOutput, GPUGraphOutputs} from './gpu-texture-plan';
718
+
719
+ export {GPUCPUOperation} from './gpu-cpu-operation';
720
+ export type {
721
+ GPUCPUOperationProps,
722
+ GPUCPUArray,
723
+ GPUCPUVector,
724
+ GPUCPUResult
725
+ } from './gpu-cpu-operation';
726
+
727
+ export {GPUGraphGroupAggregation, GPUGraphReduction} from './gpu-semantic-aggregation-operation';
728
+ export type {
729
+ GPUGraphGroupAggregationProps,
730
+ GPUGraphReductionProps
731
+ } from './gpu-semantic-aggregation-operation';
@@ -0,0 +1,158 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {assert} from '@luma.gl/core';
6
+ import {fromHalfFloat} from '@luma.gl/shaders';
7
+ import {CPUData} from './cpu-data';
8
+ import {CPUVector} from './cpu-vector';
9
+ import {getGPUVectorFormatInfo, type GPUVectorFormat} from './gpu-vector-format';
10
+
11
+ export type ColorOutputFormat = 'unorm8x4' | 'float16x4' | 'float32x4';
12
+ export type ColorConversionOptions = {
13
+ /** Default RGBA8; preserve keeps source precision while expanding RGB to RGBA. */
14
+ format?: ColorOutputFormat | 'preserve';
15
+ /** Consumer capabilities; never silently select a lossy fallback. */
16
+ acceptedFormats?: readonly ColorOutputFormat[];
17
+ fallbackFormat?: ColorOutputFormat;
18
+ };
19
+
20
+ /** Resolve color storage independently from the device and conversion backend. */
21
+ export function resolveColorOutputFormat(
22
+ sourceFormat: GPUVectorFormat,
23
+ options: ColorConversionOptions = {}
24
+ ): ColorOutputFormat {
25
+ const info = getGPUVectorFormatInfo(sourceFormat);
26
+ // Only fixed-width byte/IEEE RGB or RGBA rows have color semantics here.
27
+ assert(
28
+ !info.vertexList &&
29
+ !info.valueList &&
30
+ !info.fixedSizeList &&
31
+ (info.components === 3 || info.components === 4) &&
32
+ ['uint8', 'float16', 'float32'].includes(info.signedDataType)
33
+ );
34
+ const preserved =
35
+ info.signedDataType === 'float32'
36
+ ? 'float32x4'
37
+ : info.signedDataType === 'float16'
38
+ ? 'float16x4'
39
+ : 'unorm8x4';
40
+ let format = options.format === 'preserve' ? preserved : (options.format ?? 'unorm8x4');
41
+ if (options.acceptedFormats && !options.acceptedFormats.includes(format)) {
42
+ if (
43
+ options.format === 'preserve' &&
44
+ options.fallbackFormat &&
45
+ options.acceptedFormats.includes(options.fallbackFormat)
46
+ )
47
+ format = options.fallbackFormat;
48
+ else throw new Error('Requested color format is not accepted by the consumer');
49
+ }
50
+ return format;
51
+ }
52
+
53
+ /** CPU storage interpretation, independent of output format negotiation. */
54
+ type CPUColorConversionOptions = ColorConversionOptions & {
55
+ /** Interpret packed Float16 RGB stored using the uint16x3-webgl alias. */
56
+ inputFormat?: 'float16x3';
57
+ };
58
+
59
+ /** Convert CPU color chunks without uploading or combining chunks. Input storage is borrowed. */
60
+ export function convertCPUColors(
61
+ source: CPUVector,
62
+ options?: CPUColorConversionOptions & {format?: 'unorm8x4'}
63
+ ): CPUVector<'unorm8x4'>;
64
+ export function convertCPUColors<T extends ColorOutputFormat>(
65
+ source: CPUVector,
66
+ options: CPUColorConversionOptions & {format: T}
67
+ ): CPUVector<T>;
68
+ export function convertCPUColors(
69
+ source: CPUVector,
70
+ options: CPUColorConversionOptions
71
+ ): CPUVector<ColorOutputFormat>;
72
+ export function convertCPUColors(
73
+ source: CPUVector,
74
+ options: CPUColorConversionOptions = {}
75
+ ): CPUVector<ColorOutputFormat> {
76
+ const format = resolveColorOutputFormat(
77
+ options.inputFormat ? 'float16x4' : source.format,
78
+ options
79
+ );
80
+ if (options.format === 'preserve' && source.format === format)
81
+ return new CPUVector({
82
+ name: source.name,
83
+ format,
84
+ data: source.data as readonly CPUData<ColorOutputFormat>[]
85
+ });
86
+ return new CPUVector({
87
+ name: source.name,
88
+ format,
89
+ data: source.data.map(chunk => convertCPUColorData(chunk, format, options.inputFormat))
90
+ });
91
+ }
92
+
93
+ /** @internal Shared CPU backend implementation, including offsets, strides and validity. */
94
+ export function convertCPUColorData(
95
+ source: CPUData,
96
+ format: ColorOutputFormat,
97
+ inputFormat?: string
98
+ ): CPUData<ColorOutputFormat> {
99
+ const info = getGPUVectorFormatInfo(source.format);
100
+ const type = inputFormat?.startsWith('float16') ? 'float16' : info.signedDataType;
101
+ const components = inputFormat?.endsWith('x3') ? 3 : info.components;
102
+ // Color rows contain only byte channels or IEEE floats and three or four components.
103
+ assert((components === 3 || components === 4) && ['uint8', 'float16', 'float32'].includes(type));
104
+ const bytes = type === 'uint8' ? 1 : type === 'float16' ? 2 : 4;
105
+ const input = new DataView(source.buffer, source.byteOffset);
106
+ const output =
107
+ format === 'unorm8x4'
108
+ ? new Uint8Array(source.length * 4)
109
+ : format === 'float16x4'
110
+ ? new Uint16Array(source.length * 4)
111
+ : new Float32Array(source.length * 4);
112
+ const scratch = new DataView(new ArrayBuffer(4));
113
+ for (let rowIndex = 0; rowIndex < source.length; rowIndex++) {
114
+ for (let componentIndex = 0; componentIndex < 4; componentIndex++) {
115
+ const offset = rowIndex * source.byteStride + componentIndex * bytes;
116
+ const value =
117
+ componentIndex >= components
118
+ ? 1
119
+ : type === 'uint8'
120
+ ? input.getUint8(offset) / 255
121
+ : type === 'float16'
122
+ ? fromHalfFloat(input.getUint16(offset, true))
123
+ : input.getFloat32(offset, true);
124
+ output[rowIndex * 4 + componentIndex] =
125
+ format === 'unorm8x4'
126
+ ? Math.round(Math.min(Math.max(value, 0), 1) * 255)
127
+ : format === 'float16x4'
128
+ ? encodeHalfFloat(value, scratch)
129
+ : value;
130
+ }
131
+ }
132
+ return new CPUData({
133
+ buffer: output,
134
+ format,
135
+ length: source.length,
136
+ nullBitmap: source.nullBitmap && new Uint8Array(source.nullBitmap)
137
+ });
138
+ }
139
+
140
+ /** IEEE binary16 round-to-nearest-even, matching pack2x16float (no display-range clamp). */
141
+ function encodeHalfFloat(value: number, scratch: DataView): number {
142
+ scratch.setFloat32(0, value, true);
143
+ const bits = scratch.getUint32(0, true);
144
+ const sign = (bits >>> 16) & 0x8000;
145
+ const exponent = (bits >>> 23) & 255;
146
+ const mantissa = bits & 0x7fffff;
147
+ if (exponent === 255) return sign | 0x7c00 | (mantissa ? 0x200 : 0);
148
+ if (exponent > 142) return sign | 0x7c00;
149
+ if (exponent < 102) return sign;
150
+ const shift = exponent < 113 ? 126 - exponent : 13;
151
+ const significand = exponent < 113 ? mantissa | 0x800000 : mantissa;
152
+ const divisor = 2 ** shift;
153
+ const quotient = Math.floor(significand / divisor);
154
+ const remainder = significand % divisor;
155
+ const rounded =
156
+ quotient + (remainder > divisor / 2 || (remainder === divisor / 2 && quotient % 2) ? 1 : 0);
157
+ return sign | ((exponent < 113 ? 0 : (exponent - 112) * 1024) + rounded);
158
+ }
@@ -0,0 +1,62 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {assert} from '@luma.gl/core';
6
+ import {getGPUVectorFormatInfo, type GPUVectorFormat} from './gpu-vector-format';
7
+
8
+ export type CPUDataProps<T extends GPUVectorFormat = GPUVectorFormat> = {
9
+ buffer: ArrayBuffer | ArrayBufferView;
10
+ format: T;
11
+ length: number;
12
+ valueLength?: number;
13
+ /** Byte offset relative to the supplied buffer or view. */
14
+ byteOffset?: number;
15
+ byteStride?: number;
16
+ rowByteLength?: number;
17
+ valueOffsets?: Int32Array;
18
+ nullBitmap?: Uint8Array;
19
+ };
20
+
21
+ /** Borrowed CPU storage for fixed rows or one level of list elements. No allocation or copying. */
22
+ export class CPUData<T extends GPUVectorFormat = GPUVectorFormat> {
23
+ readonly buffer: ArrayBufferLike;
24
+ readonly format: T;
25
+ readonly length: number;
26
+ readonly valueLength: number;
27
+ /** Absolute offset into buffer. */
28
+ readonly byteOffset: number;
29
+ readonly byteStride: number;
30
+ readonly rowByteLength: number;
31
+ readonly valueOffsets?: Int32Array;
32
+ readonly nullBitmap?: Uint8Array;
33
+
34
+ constructor(props: CPUDataProps<T>) {
35
+ const info = getGPUVectorFormatInfo(props.format);
36
+ const view = ArrayBuffer.isView(props.buffer) ? props.buffer : undefined;
37
+ this.buffer = view ? view.buffer : (props.buffer as ArrayBuffer);
38
+ this.format = props.format;
39
+ this.length = props.length;
40
+ this.valueLength = props.valueLength ?? props.length * (info.listSize ?? 1);
41
+ const offset = props.byteOffset ?? 0;
42
+ this.byteOffset = (view?.byteOffset ?? 0) + offset;
43
+ this.rowByteLength = props.rowByteLength ?? info.byteLength;
44
+ this.byteStride = props.byteStride ?? this.rowByteLength;
45
+ this.valueOffsets = props.valueOffsets;
46
+ this.nullBitmap = props.nullBitmap;
47
+ const variable = info.vertexList || info.valueList;
48
+ const count = variable ? this.valueLength : this.length;
49
+ // Layouts must describe complete rows within the supplied view, including empty ranges.
50
+ assert(
51
+ [this.length, this.valueLength, offset, this.rowByteLength, this.byteStride].every(
52
+ value => Number.isSafeInteger(value) && value >= 0
53
+ )
54
+ );
55
+ assert(this.rowByteLength >= info.byteLength && this.byteStride >= this.rowByteLength);
56
+ assert(variable || this.valueLength === this.length * (info.listSize ?? 1));
57
+ assert(
58
+ offset + (count ? (count - 1) * this.byteStride + this.rowByteLength : 0) <=
59
+ props.buffer.byteLength
60
+ );
61
+ }
62
+ }
@@ -0,0 +1,110 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {assert, Buffer, type Device, type BufferProps} from '@luma.gl/core';
6
+ import {CPUData} from './cpu-data';
7
+ import {CPUVector} from './cpu-vector';
8
+ import {GPUData} from './gpu-data';
9
+ import {getGPUDataBufferProps, PORTABLE_GPU_DATA_USAGE} from './gpu-data-buffer-props';
10
+ import {GPUVector} from './gpu-vector';
11
+ import {getGPUVectorFormatInfo, type GPUVectorFormat} from './gpu-vector-format';
12
+
13
+ /** Explicit upload preserving chunk-local list offsets and validity metadata. */
14
+ export function makeGPUVectorFromCPUVector<T extends GPUVectorFormat>(
15
+ device: Device,
16
+ vector: CPUVector<T>,
17
+ options: Pick<BufferProps, 'usage' | 'indexType'> = {}
18
+ ): GPUVector<T> {
19
+ const data: GPUData<T>[] = [];
20
+ try {
21
+ for (const chunk of vector.data) {
22
+ const info = getGPUVectorFormatInfo(vector.format);
23
+ const inferredIndexType =
24
+ info.elementFormat === 'uint32'
25
+ ? 'uint32'
26
+ : info.elementFormat === 'uint16'
27
+ ? 'uint16'
28
+ : undefined;
29
+ // Index usage must match stored elements; raw bytes must never trigger device conversion.
30
+ if ((options.usage ?? 0) & Buffer.INDEX)
31
+ assert(
32
+ inferredIndexType && (!options.indexType || options.indexType === inferredIndexType)
33
+ );
34
+ const defaults =
35
+ options.usage === undefined
36
+ ? getGPUDataBufferProps(device, inferredIndexType)
37
+ : {
38
+ usage: PORTABLE_GPU_DATA_USAGE,
39
+ indexType: undefined
40
+ };
41
+ const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
42
+ const bytes = new Uint8Array(count * info.byteLength);
43
+ for (let index = 0; index < count; index++)
44
+ bytes.set(
45
+ new Uint8Array(
46
+ chunk.buffer,
47
+ chunk.byteOffset + index * chunk.byteStride,
48
+ info.byteLength
49
+ ),
50
+ index * info.byteLength
51
+ );
52
+ data.push(
53
+ new GPUData({
54
+ buffer: device.createBuffer({
55
+ data: bytes.length ? bytes : new Uint8Array(4),
56
+ usage: (defaults.usage ?? 0) | (options.usage ?? 0),
57
+ indexType:
58
+ options.indexType ??
59
+ ((options.usage ?? 0) & Buffer.INDEX ? inferredIndexType : defaults.indexType)
60
+ }),
61
+ format: vector.format,
62
+ length: chunk.length,
63
+ valueLength: chunk.valueLength,
64
+ valueOffsets: chunk.valueOffsets?.slice(),
65
+ nullBitmap: chunk.nullBitmap?.slice(),
66
+ ownsBuffer: true
67
+ })
68
+ );
69
+ }
70
+ return new GPUVector({
71
+ type: 'data',
72
+ name: vector.name,
73
+ format: vector.format,
74
+ data,
75
+ ownsData: true
76
+ });
77
+ } catch (error) {
78
+ for (const chunk of data) chunk.destroy();
79
+ throw error;
80
+ }
81
+ }
82
+
83
+ /** Explicit asynchronous readback preserving physical formats, chunks, lists and parent validity. */
84
+ export async function makeCPUVectorFromGPUVector<T extends GPUVectorFormat>(
85
+ vector: GPUVector<T>
86
+ ): Promise<CPUVector<T>> {
87
+ const data: CPUData<T>[] = [];
88
+ for (const chunk of vector.data) {
89
+ const info = getGPUVectorFormatInfo(vector.format!);
90
+ const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
91
+ const bytes = count
92
+ ? await chunk.buffer.readAsync(
93
+ chunk.byteOffset,
94
+ (count - 1) * chunk.byteStride + info.byteLength
95
+ )
96
+ : new Uint8Array(0);
97
+ data.push(
98
+ new CPUData({
99
+ buffer: bytes,
100
+ format: vector.format!,
101
+ length: chunk.length,
102
+ valueLength: chunk.valueLength,
103
+ byteStride: chunk.byteStride,
104
+ valueOffsets: chunk.valueOffsets?.slice(),
105
+ nullBitmap: chunk.nullBitmap?.slice()
106
+ })
107
+ );
108
+ }
109
+ return new CPUVector({name: vector.name, format: vector.format!, data});
110
+ }
@@ -0,0 +1,31 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {assert} from '@luma.gl/core';
6
+ import {CPUData} from './cpu-data';
7
+ import type {GPUVectorFormat} from './gpu-vector-format';
8
+
9
+ export type CPUVectorProps<T extends GPUVectorFormat = GPUVectorFormat> = {
10
+ name?: string;
11
+ format: T;
12
+ data: readonly CPUData<T>[];
13
+ };
14
+
15
+ /** Ordered borrowed CPU chunks. Construction preserves buffers and chunk boundaries. */
16
+ export class CPUVector<T extends GPUVectorFormat = GPUVectorFormat> {
17
+ readonly name: string;
18
+ readonly format: T;
19
+ readonly data: readonly CPUData<T>[];
20
+ readonly length: number;
21
+ readonly valueLength: number;
22
+
23
+ constructor(props: CPUVectorProps<T>) {
24
+ assert(props.data.every(chunk => chunk.format === props.format));
25
+ this.name = props.name ?? '';
26
+ this.format = props.format;
27
+ this.data = Object.freeze([...props.data]);
28
+ this.length = this.data.reduce((total, chunk) => total + chunk.length, 0);
29
+ this.valueLength = this.data.reduce((total, chunk) => total + chunk.valueLength, 0);
30
+ }
31
+ }
@@ -0,0 +1,25 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {Buffer, type BufferProps, type Device} from '@luma.gl/core';
6
+
7
+ export const PORTABLE_GPU_DATA_USAGE =
8
+ Buffer.STORAGE | Buffer.VERTEX | Buffer.COPY_SRC | Buffer.COPY_DST;
9
+
10
+ /** Usage defaults for general-purpose GPUData backing storage. */
11
+ export function getGPUDataBufferProps(
12
+ device: Device,
13
+ indexType: BufferProps['indexType'] = 'uint32'
14
+ ): Pick<BufferProps, 'usage' | 'indexType'> {
15
+ const usage = PORTABLE_GPU_DATA_USAGE;
16
+ if (device.type !== 'webgpu') {
17
+ // WebGL fixes the buffer target on first bind, so INDEX would prevent vertex use.
18
+ return {usage};
19
+ }
20
+ return {
21
+ usage: usage | Buffer.INDEX | Buffer.UNIFORM | Buffer.INDIRECT | Buffer.QUERY_RESOLVE,
22
+ // Explicit index metadata prevents Device from widening raw Uint8Array uploads.
23
+ indexType
24
+ };
25
+ }