@luma.gl/graph 10.0.0-beta.2 → 10.0.0-beta.4

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 (317) hide show
  1. package/dist/arrow/gpu/arrow-gpu-analytics-adapters.cjs +22 -9
  2. package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts +11 -2
  3. package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts.map +1 -1
  4. package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js +27 -10
  5. package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js.map +1 -1
  6. package/dist/arrow/gpu/arrow-gpu-analytics-readback.cjs +24 -13
  7. package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts +9 -1
  8. package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts.map +1 -1
  9. package/dist/arrow/gpu/arrow-gpu-analytics-readback.js +41 -14
  10. package/dist/arrow/gpu/arrow-gpu-analytics-readback.js.map +1 -1
  11. package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +82 -23
  12. package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +16 -1
  13. package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
  14. package/dist/arrow/gpu/arrow-gpu-table-conversion.js +98 -24
  15. package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
  16. package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +7 -0
  17. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +2 -0
  18. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
  19. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +14 -0
  20. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
  21. package/dist/arrow/index.cjs +2 -0
  22. package/dist/arrow/index.cjs.map +3 -3
  23. package/dist/arrow/index.d.ts +1 -1
  24. package/dist/arrow/index.d.ts.map +1 -1
  25. package/dist/arrow/index.js +1 -1
  26. package/dist/arrow/index.js.map +1 -1
  27. package/dist/arrow/vectors/arrow-temporal-gpu-vector.cjs +1 -2
  28. package/dist/arrow/vectors/arrow-temporal-gpu-vector.js +2 -2
  29. package/dist/arrow/vectors/arrow-temporal-gpu-vector.js.map +1 -1
  30. package/dist/dist.dev.js +62 -27
  31. package/dist/dist.min.js +48 -47
  32. package/dist/gpu-core/gpu-bvh-bounds.cjs +63 -0
  33. package/dist/gpu-core/gpu-bvh-bounds.d.ts +32 -0
  34. package/dist/gpu-core/gpu-bvh-bounds.d.ts.map +1 -0
  35. package/dist/gpu-core/gpu-bvh-bounds.js +56 -0
  36. package/dist/gpu-core/gpu-bvh-bounds.js.map +1 -0
  37. package/dist/gpu-core/gpu-command-graph-budget-controller.cjs +10 -2
  38. package/dist/gpu-core/gpu-command-graph-budget-controller.d.ts +4 -0
  39. package/dist/gpu-core/gpu-command-graph-budget-controller.d.ts.map +1 -1
  40. package/dist/gpu-core/gpu-command-graph-budget-controller.js +10 -2
  41. package/dist/gpu-core/gpu-command-graph-budget-controller.js.map +1 -1
  42. package/dist/gpu-core/gpu-command-graph-submission-pacer.cjs +92 -0
  43. package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts +41 -0
  44. package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts.map +1 -0
  45. package/dist/gpu-core/gpu-command-graph-submission-pacer.js +85 -0
  46. package/dist/gpu-core/gpu-command-graph-submission-pacer.js.map +1 -0
  47. package/dist/gpu-core/gpu-group-aggregation.cjs +45 -21
  48. package/dist/gpu-core/gpu-group-aggregation.d.ts +4 -0
  49. package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
  50. package/dist/gpu-core/gpu-group-aggregation.js +58 -24
  51. package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
  52. package/dist/gpu-core/index.cjs +6 -0
  53. package/dist/gpu-core/index.cjs.map +3 -3
  54. package/dist/gpu-core/index.d.ts +4 -0
  55. package/dist/gpu-core/index.d.ts.map +1 -1
  56. package/dist/gpu-core/index.js +2 -0
  57. package/dist/gpu-core/index.js.map +1 -1
  58. package/dist/gpu-dataframe/gpu-analytics-compiler-utils.cjs +6 -6
  59. package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts +1 -1
  60. package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts.map +1 -1
  61. package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js +6 -6
  62. package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js.map +1 -1
  63. package/dist/gpu-dataframe/gpu-data-frame-query.cjs +55 -14
  64. package/dist/gpu-dataframe/gpu-data-frame-query.d.ts +13 -2
  65. package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
  66. package/dist/gpu-dataframe/gpu-data-frame-query.js +58 -17
  67. package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
  68. package/dist/gpu-dataframe/gpu-data-frame.cjs +1 -3
  69. package/dist/gpu-dataframe/gpu-data-frame.d.ts +10 -0
  70. package/dist/gpu-dataframe/gpu-data-frame.d.ts.map +1 -1
  71. package/dist/gpu-dataframe/gpu-data-frame.js +1 -3
  72. package/dist/gpu-dataframe/gpu-data-frame.js.map +1 -1
  73. package/dist/gpu-dataframe/gpu-expression-shader.cjs +94 -44
  74. package/dist/gpu-dataframe/gpu-expression-shader.d.ts +8 -5
  75. package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
  76. package/dist/gpu-dataframe/gpu-expression-shader.js +110 -47
  77. package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
  78. package/dist/gpu-dataframe/gpu-expression.cjs +14 -8
  79. package/dist/gpu-dataframe/gpu-expression.d.ts +12 -1
  80. package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
  81. package/dist/gpu-dataframe/gpu-expression.js +11 -6
  82. package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
  83. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +8 -4
  84. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts +2 -1
  85. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
  86. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +10 -4
  87. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
  88. package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +2 -2
  89. package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts +5 -1
  90. package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
  91. package/dist/gpu-dataframe/gpu-global-aggregation-query.js +6 -2
  92. package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
  93. package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +156 -124
  94. package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +12 -2
  95. package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
  96. package/dist/gpu-dataframe/gpu-global-sort-compiler.js +160 -128
  97. package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
  98. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +366 -53
  99. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts +26 -4
  100. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
  101. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +378 -47
  102. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
  103. package/dist/gpu-dataframe/gpu-group-by-query.cjs +20 -9
  104. package/dist/gpu-dataframe/gpu-group-by-query.d.ts +15 -2
  105. package/dist/gpu-dataframe/gpu-group-by-query.d.ts.map +1 -1
  106. package/dist/gpu-dataframe/gpu-group-by-query.js +22 -8
  107. package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
  108. package/dist/gpu-dataframe/gpu-join-compiler.cjs +61 -8
  109. package/dist/gpu-dataframe/gpu-join-compiler.d.ts +10 -2
  110. package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
  111. package/dist/gpu-dataframe/gpu-join-compiler.js +60 -7
  112. package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
  113. package/dist/gpu-dataframe/gpu-query-compiler.cjs +61 -11
  114. package/dist/gpu-dataframe/gpu-query-compiler.d.ts +5 -1
  115. package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
  116. package/dist/gpu-dataframe/gpu-query-compiler.js +61 -10
  117. package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
  118. package/dist/gpu-dataframe/index.cjs +4 -2
  119. package/dist/gpu-dataframe/index.cjs.map +3 -3
  120. package/dist/gpu-dataframe/index.d.ts +1 -1
  121. package/dist/gpu-dataframe/index.d.ts.map +1 -1
  122. package/dist/gpu-dataframe/index.js +1 -1
  123. package/dist/gpu-dataframe/index.js.map +1 -1
  124. package/dist/gpu-graph/index.cjs.map +1 -1
  125. package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
  126. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.cjs +182 -62
  127. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.d.ts +29 -2
  128. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.d.ts.map +1 -1
  129. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.js +200 -64
  130. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.js.map +1 -1
  131. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.cjs +135 -9
  132. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.d.ts +55 -8
  133. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.d.ts.map +1 -1
  134. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.js +145 -14
  135. package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.js.map +1 -1
  136. package/dist/gpu-graph-algorithms/index.cjs.map +3 -3
  137. package/dist/gpu-physics/articulation-tree-shader.cjs +177 -0
  138. package/dist/gpu-physics/articulation-tree-shader.d.ts +3 -0
  139. package/dist/gpu-physics/articulation-tree-shader.d.ts.map +1 -0
  140. package/dist/gpu-physics/articulation-tree-shader.js +159 -0
  141. package/dist/gpu-physics/articulation-tree-shader.js.map +1 -0
  142. package/dist/gpu-physics/gpu-articulation-tree.cjs +203 -0
  143. package/dist/gpu-physics/gpu-articulation-tree.d.ts +81 -0
  144. package/dist/gpu-physics/gpu-articulation-tree.d.ts.map +1 -0
  145. package/dist/gpu-physics/gpu-articulation-tree.js +205 -0
  146. package/dist/gpu-physics/gpu-articulation-tree.js.map +1 -0
  147. package/dist/gpu-physics/gpu-physics-batch.cjs +11 -10
  148. package/dist/gpu-physics/gpu-physics-batch.d.ts +1 -0
  149. package/dist/gpu-physics/gpu-physics-batch.d.ts.map +1 -1
  150. package/dist/gpu-physics/gpu-physics-batch.js +14 -10
  151. package/dist/gpu-physics/gpu-physics-batch.js.map +1 -1
  152. package/dist/gpu-physics/gpu-physics-ensemble.cjs +9 -4
  153. package/dist/gpu-physics/gpu-physics-ensemble.d.ts +10 -1
  154. package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
  155. package/dist/gpu-physics/gpu-physics-ensemble.js +11 -4
  156. package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
  157. package/dist/gpu-physics/gpu-rigid-body-world.cjs +323 -68
  158. package/dist/gpu-physics/gpu-rigid-body-world.d.ts +59 -2
  159. package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
  160. package/dist/gpu-physics/gpu-rigid-body-world.js +400 -75
  161. package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
  162. package/dist/gpu-physics/index.cjs +3 -0
  163. package/dist/gpu-physics/index.cjs.map +3 -3
  164. package/dist/gpu-physics/index.d.ts +3 -1
  165. package/dist/gpu-physics/index.d.ts.map +1 -1
  166. package/dist/gpu-physics/index.js +1 -0
  167. package/dist/gpu-physics/index.js.map +1 -1
  168. package/dist/gpu-physics/rigid-body-cache-shaders.cjs +10 -6
  169. package/dist/gpu-physics/rigid-body-cache-shaders.d.ts +2 -1
  170. package/dist/gpu-physics/rigid-body-cache-shaders.d.ts.map +1 -1
  171. package/dist/gpu-physics/rigid-body-cache-shaders.js +15 -6
  172. package/dist/gpu-physics/rigid-body-cache-shaders.js.map +1 -1
  173. package/dist/gpu-physics/rigid-body-capacity.cjs +15 -2
  174. package/dist/gpu-physics/rigid-body-capacity.d.ts +3 -1
  175. package/dist/gpu-physics/rigid-body-capacity.d.ts.map +1 -1
  176. package/dist/gpu-physics/rigid-body-capacity.js +21 -2
  177. package/dist/gpu-physics/rigid-body-capacity.js.map +1 -1
  178. package/dist/gpu-physics/rigid-body-cast-index.cjs +192 -0
  179. package/dist/gpu-physics/rigid-body-cast-index.d.ts +44 -0
  180. package/dist/gpu-physics/rigid-body-cast-index.d.ts.map +1 -0
  181. package/dist/gpu-physics/rigid-body-cast-index.js +194 -0
  182. package/dist/gpu-physics/rigid-body-cast-index.js.map +1 -0
  183. package/dist/gpu-physics/rigid-body-ensemble-layout.cjs +4 -2
  184. package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts +2 -1
  185. package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts.map +1 -1
  186. package/dist/gpu-physics/rigid-body-ensemble-layout.js +5 -2
  187. package/dist/gpu-physics/rigid-body-ensemble-layout.js.map +1 -1
  188. package/dist/gpu-physics/rigid-body-ensemble-reset.cjs +11 -9
  189. package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts +1 -1
  190. package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts.map +1 -1
  191. package/dist/gpu-physics/rigid-body-ensemble-reset.js +13 -9
  192. package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
  193. package/dist/gpu-physics/rigid-body-ensemble-shaders.cjs +14 -7
  194. package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts +5 -0
  195. package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts.map +1 -1
  196. package/dist/gpu-physics/rigid-body-ensemble-shaders.js +17 -7
  197. package/dist/gpu-physics/rigid-body-ensemble-shaders.js.map +1 -1
  198. package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +21 -11
  199. package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +2 -2
  200. package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
  201. package/dist/gpu-physics/rigid-body-ensemble-transaction.js +28 -12
  202. package/dist/gpu-physics/rigid-body-ensemble-transaction.js.map +1 -1
  203. package/dist/gpu-physics/rigid-body-event-compaction.cjs +184 -0
  204. package/dist/gpu-physics/rigid-body-event-compaction.d.ts +35 -0
  205. package/dist/gpu-physics/rigid-body-event-compaction.d.ts.map +1 -0
  206. package/dist/gpu-physics/rigid-body-event-compaction.js +168 -0
  207. package/dist/gpu-physics/rigid-body-event-compaction.js.map +1 -0
  208. package/dist/gpu-physics/rigid-body-event-snapshot.cjs +51 -0
  209. package/dist/gpu-physics/rigid-body-event-snapshot.d.ts +33 -0
  210. package/dist/gpu-physics/rigid-body-event-snapshot.d.ts.map +1 -0
  211. package/dist/gpu-physics/rigid-body-event-snapshot.js +34 -0
  212. package/dist/gpu-physics/rigid-body-event-snapshot.js.map +1 -0
  213. package/dist/gpu-physics/rigid-body-events.cjs +57 -25
  214. package/dist/gpu-physics/rigid-body-events.d.ts +2 -1
  215. package/dist/gpu-physics/rigid-body-events.d.ts.map +1 -1
  216. package/dist/gpu-physics/rigid-body-events.js +60 -25
  217. package/dist/gpu-physics/rigid-body-events.js.map +1 -1
  218. package/dist/gpu-physics/rigid-body-joints.cjs +8 -3
  219. package/dist/gpu-physics/rigid-body-joints.d.ts +2 -0
  220. package/dist/gpu-physics/rigid-body-joints.d.ts.map +1 -1
  221. package/dist/gpu-physics/rigid-body-joints.js +10 -6
  222. package/dist/gpu-physics/rigid-body-joints.js.map +1 -1
  223. package/dist/gpu-physics/rigid-body-queries.cjs +159 -16
  224. package/dist/gpu-physics/rigid-body-queries.d.ts +24 -1
  225. package/dist/gpu-physics/rigid-body-queries.d.ts.map +1 -1
  226. package/dist/gpu-physics/rigid-body-queries.js +166 -14
  227. package/dist/gpu-physics/rigid-body-queries.js.map +1 -1
  228. package/dist/gpu-physics/rigid-body-shaders.cjs +3 -3
  229. package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
  230. package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
  231. package/dist/gpu-physics/rigid-body-shaders.js +3 -3
  232. package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
  233. package/dist/gpu-physics/rigid-body-triggers.cjs +53 -15
  234. package/dist/gpu-physics/rigid-body-triggers.d.ts +1 -0
  235. package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
  236. package/dist/gpu-physics/rigid-body-triggers.js +55 -15
  237. package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
  238. package/dist/gpu-physics/sphere-world-shaders.cjs +48 -20
  239. package/dist/gpu-physics/sphere-world-shaders.d.ts.map +1 -1
  240. package/dist/gpu-physics/sphere-world-shaders.js +51 -21
  241. package/dist/gpu-physics/sphere-world-shaders.js.map +1 -1
  242. package/dist/gpu-project/benchmarks.cjs.map +2 -2
  243. package/dist/gpu-project/crs.cjs.map +2 -2
  244. package/dist/gpu-project/graph.cjs.map +2 -2
  245. package/dist/gpu-project/index.cjs.map +2 -2
  246. package/dist/gpu-project/projection-program.cjs +2 -9
  247. package/dist/gpu-project/projection-program.d.ts.map +1 -1
  248. package/dist/gpu-project/projection-program.js +1 -8
  249. package/dist/gpu-project/projection-program.js.map +1 -1
  250. package/dist/gpu-simple-graph/index.cjs.map +2 -2
  251. package/dist/gpu-sql/gpu-sql.cjs +345 -81
  252. package/dist/gpu-sql/gpu-sql.d.ts +42 -2
  253. package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
  254. package/dist/gpu-sql/gpu-sql.js +393 -90
  255. package/dist/gpu-sql/gpu-sql.js.map +1 -1
  256. package/dist/gpu-sql/index.cjs.map +3 -3
  257. package/dist/gpu-sql/index.d.ts +1 -1
  258. package/dist/gpu-sql/index.d.ts.map +1 -1
  259. package/dist/index.cjs.map +1 -1
  260. package/dist/utils/float32.cjs +35 -0
  261. package/dist/utils/float32.d.ts +3 -0
  262. package/dist/utils/float32.d.ts.map +1 -0
  263. package/dist/utils/float32.js +16 -0
  264. package/dist/utils/float32.js.map +1 -0
  265. package/package.json +8 -8
  266. package/src/arrow/gpu/arrow-gpu-analytics-adapters.ts +77 -25
  267. package/src/arrow/gpu/arrow-gpu-analytics-readback.ts +52 -16
  268. package/src/arrow/gpu/arrow-gpu-table-conversion.ts +130 -31
  269. package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +19 -0
  270. package/src/arrow/index.ts +1 -0
  271. package/src/arrow/vectors/arrow-temporal-gpu-vector.ts +2 -2
  272. package/src/gpu-core/gpu-bvh-bounds.ts +84 -0
  273. package/src/gpu-core/gpu-command-graph-budget-controller.ts +22 -2
  274. package/src/gpu-core/gpu-command-graph-submission-pacer.ts +102 -0
  275. package/src/gpu-core/gpu-group-aggregation.ts +68 -30
  276. package/src/gpu-core/index.ts +5 -0
  277. package/src/gpu-dataframe/gpu-analytics-compiler-utils.ts +7 -10
  278. package/src/gpu-dataframe/gpu-data-frame-query.ts +106 -25
  279. package/src/gpu-dataframe/gpu-data-frame.ts +35 -2
  280. package/src/gpu-dataframe/gpu-expression-shader.ts +172 -58
  281. package/src/gpu-dataframe/gpu-expression.ts +62 -9
  282. package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +15 -4
  283. package/src/gpu-dataframe/gpu-global-aggregation-query.ts +12 -3
  284. package/src/gpu-dataframe/gpu-global-sort-compiler.ts +231 -156
  285. package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +645 -61
  286. package/src/gpu-dataframe/gpu-group-by-query.ts +51 -14
  287. package/src/gpu-dataframe/gpu-join-compiler.ts +87 -6
  288. package/src/gpu-dataframe/gpu-query-compiler.ts +100 -18
  289. package/src/gpu-dataframe/index.ts +1 -1
  290. package/src/gpu-graph-algorithms/README.md +4 -2
  291. package/src/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.ts +248 -66
  292. package/src/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.ts +218 -20
  293. package/src/gpu-physics/articulation-tree-shader.ts +169 -0
  294. package/src/gpu-physics/gpu-articulation-tree.ts +279 -0
  295. package/src/gpu-physics/gpu-physics-batch.ts +19 -13
  296. package/src/gpu-physics/gpu-physics-ensemble.ts +20 -4
  297. package/src/gpu-physics/gpu-rigid-body-world.ts +510 -93
  298. package/src/gpu-physics/index.ts +16 -0
  299. package/src/gpu-physics/rigid-body-cache-shaders.ts +18 -6
  300. package/src/gpu-physics/rigid-body-capacity.ts +25 -4
  301. package/src/gpu-physics/rigid-body-cast-index.ts +277 -0
  302. package/src/gpu-physics/rigid-body-ensemble-layout.ts +6 -2
  303. package/src/gpu-physics/rigid-body-ensemble-reset.ts +21 -9
  304. package/src/gpu-physics/rigid-body-ensemble-shaders.ts +18 -7
  305. package/src/gpu-physics/rigid-body-ensemble-transaction.ts +31 -13
  306. package/src/gpu-physics/rigid-body-event-compaction.ts +252 -0
  307. package/src/gpu-physics/rigid-body-event-snapshot.ts +76 -0
  308. package/src/gpu-physics/rigid-body-events.ts +63 -25
  309. package/src/gpu-physics/rigid-body-joints.ts +11 -11
  310. package/src/gpu-physics/rigid-body-queries.ts +202 -14
  311. package/src/gpu-physics/rigid-body-shaders.ts +4 -3
  312. package/src/gpu-physics/rigid-body-triggers.ts +64 -20
  313. package/src/gpu-physics/sphere-world-shaders.ts +53 -21
  314. package/src/gpu-project/projection-program.ts +1 -9
  315. package/src/gpu-sql/gpu-sql.ts +629 -124
  316. package/src/gpu-sql/index.ts +1 -1
  317. package/src/utils/float32.ts +16 -0
@@ -37,7 +37,12 @@ export type GPUDataFrameColumnNamesOfFormat<
37
37
  }[SelectedColumns];
38
38
 
39
39
  /** Optional dense key-domain size when source categorical labels cannot establish it. */
40
- export type GPUDataFrameGroupByOptions = Readonly<{groupCount?: number}>;
40
+ export type GPUDataFrameGroupByOptions = Readonly<{
41
+ /** Dense category count when no dictionary supplies it. */
42
+ groupCount?: number;
43
+ /** Maximum temporary bytes for a partition of AVG accumulators. */
44
+ maxMeanScratchBytes?: number;
45
+ }>;
41
46
 
42
47
  /** One named count or a float32 statistic referencing a selected numerical column. */
43
48
  export type GPUDataFrameAggregationValue<
@@ -45,6 +50,7 @@ export type GPUDataFrameAggregationValue<
45
50
  SelectedColumns extends keyof T & string
46
51
  > =
47
52
  | 'count'
53
+ | Readonly<{count: SelectedColumns}>
48
54
  | Readonly<{sum: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
49
55
  | Readonly<{min: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
50
56
  | Readonly<{max: GPUDataFrameColumnNamesOfFormat<T, SelectedColumns, 'float32'>}>
@@ -61,7 +67,9 @@ export type GPUDataFrameGroupedAggregationResult<
61
67
  Key extends string,
62
68
  Definitions extends Readonly<Record<string, unknown>>
63
69
  > = Record<Key, 'uint32'> & {
64
- [Name in keyof Definitions & string]: Definitions[Name] extends 'count' ? 'uint32' : 'float32';
70
+ [Name in keyof Definitions & string]: Definitions[Name] extends 'count' | {count: string}
71
+ ? 'uint32'
72
+ : 'float32';
65
73
  };
66
74
 
67
75
  /**
@@ -82,6 +90,8 @@ export class GPUDataFrameGroupByQuery<
82
90
  readonly key: Key;
83
91
  /** Number of output groups inferred from labels or supplied explicitly by the caller. */
84
92
  readonly groupCount: number;
93
+ /** Optional temporary AVG count budget. */
94
+ readonly maxMeanScratchBytes?: number;
85
95
 
86
96
  /** Validates grouping metadata entirely on the CPU. @internal */
87
97
  constructor(
@@ -113,6 +123,13 @@ export class GPUDataFrameGroupByQuery<
113
123
  throw new Error('GPUDataFrame grouping requires a positive uint32 group count');
114
124
  }
115
125
 
126
+ if (
127
+ options.maxMeanScratchBytes !== undefined &&
128
+ (!Number.isSafeInteger(options.maxMeanScratchBytes) || options.maxMeanScratchBytes < 4)
129
+ ) {
130
+ throw new Error('GPUDataFrame mean scratch budget requires at least four bytes');
131
+ }
132
+ this.maxMeanScratchBytes = options.maxMeanScratchBytes;
116
133
  this.query = query;
117
134
  this.key = key;
118
135
  this.groupCount = groupCount;
@@ -129,7 +146,7 @@ export class GPUDataFrameGroupByQuery<
129
146
  Key,
130
147
  Definitions,
131
148
  Source
132
- >(this.query, this.key, this.groupCount, definitions);
149
+ >(this.query, this.key, this.groupCount, definitions, this.maxMeanScratchBytes);
133
150
  }
134
151
  }
135
152
 
@@ -147,6 +164,8 @@ export class GPUDataFrameGroupedAggregationQuery<
147
164
  readonly key: Key;
148
165
  /** Complete category domain and grouped output row count. */
149
166
  readonly groupCount: number;
167
+ /** Optional temporary AVG count budget. */
168
+ readonly maxMeanScratchBytes?: number;
150
169
  /** Named operations normalized in the caller's original object insertion order. */
151
170
  readonly definitions: readonly GPUDataFrameAggregationDefinition[];
152
171
 
@@ -155,8 +174,10 @@ export class GPUDataFrameGroupedAggregationQuery<
155
174
  query: GPUDataFrameQuery<Logical, SelectedColumns, Source>,
156
175
  key: Key,
157
176
  groupCount: number,
158
- definitions: Definitions
177
+ definitions: Definitions,
178
+ maxMeanScratchBytes?: number
159
179
  ) {
180
+ this.maxMeanScratchBytes = maxMeanScratchBytes;
160
181
  this.query = query;
161
182
  this.key = key;
162
183
  this.groupCount = groupCount;
@@ -182,20 +203,28 @@ export class GPUDataFrameGroupedAggregationQuery<
182
203
  this.key,
183
204
  this.groupCount,
184
205
  this.definitions,
185
- graph
206
+ graph,
207
+ undefined,
208
+ undefined,
209
+ undefined,
210
+ undefined,
211
+ this.maxMeanScratchBytes
186
212
  );
187
213
  }
188
214
  }
189
215
 
190
- /** Normalizes a closed set of operation shapes without accepting arbitrary shader expressions. */
191
- function normalizeGPUDataFrameAggregations<
216
+ /** Normalizes a closed set of operation shapes without accepting arbitrary shader expressions. @internal */
217
+ export function normalizeGPUDataFrameAggregations<
192
218
  Logical extends GPUTypeMap,
193
219
  SelectedColumns extends keyof Logical & string,
194
220
  Source extends GPUTypeMap
195
221
  >(
196
- query: GPUDataFrameQuery<Logical, SelectedColumns, Source>,
197
- key: string,
198
- definitions: GPUDataFrameAggregationDefinitions<Logical, SelectedColumns>
222
+ query: Pick<
223
+ GPUDataFrameQuery<Logical, SelectedColumns, Source>,
224
+ 'source' | 'selectedColumns' | 'derivedColumns'
225
+ >,
226
+ outputKey: string | undefined,
227
+ definitions: Readonly<Record<string, unknown>>
199
228
  ): GPUDataFrameAggregationDefinition[] {
200
229
  const entries = Object.entries(definitions);
201
230
  if (entries.length === 0) {
@@ -205,7 +234,7 @@ function normalizeGPUDataFrameAggregations<
205
234
  const formats = getGPUDataFrameQueryColumnFormats(query);
206
235
  const normalized: GPUDataFrameAggregationDefinition[] = [];
207
236
  for (const [name, value] of entries) {
208
- if (name.length === 0 || name === key) {
237
+ if (name.length === 0 || name === outputKey) {
209
238
  throw new Error('GPUDataFrame aggregation names must be distinct from the group key');
210
239
  }
211
240
  if (value === 'count') {
@@ -221,13 +250,19 @@ function normalizeGPUDataFrameAggregations<
221
250
  throw new Error(`GPUDataFrame aggregation "${name}" requires exactly one operation`);
222
251
  }
223
252
  const [operation, column] = operations[0];
224
- if (operation !== 'sum' && operation !== 'min' && operation !== 'max' && operation !== 'mean') {
253
+ if (
254
+ operation !== 'count' &&
255
+ operation !== 'sum' &&
256
+ operation !== 'min' &&
257
+ operation !== 'max' &&
258
+ operation !== 'mean'
259
+ ) {
225
260
  throw new Error(`GPUDataFrame aggregation "${name}" has an unsupported operation`);
226
261
  }
227
262
  if (typeof column !== 'string' || !query.selectedColumns.includes(column as SelectedColumns)) {
228
263
  throw new Error(`GPUDataFrame aggregation "${name}" requires a selected input column`);
229
264
  }
230
- if (formats.get(column) !== 'float32') {
265
+ if (operation !== 'count' && formats.get(column) !== 'float32') {
231
266
  throw new Error(`GPUDataFrame aggregation "${name}" requires a float32 input column`);
232
267
  }
233
268
  normalized.push(Object.freeze({name, operation, column}));
@@ -240,7 +275,9 @@ function normalizeGPUDataFrameAggregations<
240
275
  function getGPUDataFrameQueryColumnFormats<
241
276
  Logical extends GPUTypeMap,
242
277
  SelectedColumns extends keyof Logical & string
243
- >(query: GPUDataFrameQuery<Logical, SelectedColumns, any>): Map<string, string | undefined> {
278
+ >(
279
+ query: Pick<GPUDataFrameQuery<Logical, SelectedColumns, any>, 'source' | 'derivedColumns'>
280
+ ): Map<string, string | undefined> {
244
281
  const formats = new Map<string, string | undefined>(
245
282
  query.source.schema.fields.map(
246
283
  field =>
@@ -39,6 +39,7 @@ import type {GPUDataFrameJoinType, GPUDataFrameNormalizedJoinOptions} from './gp
39
39
  import {
40
40
  CompiledGPUDataFrameQuery,
41
41
  compileGPUDataFrameQuery,
42
+ projectGPUDataFrameQueryResult,
42
43
  type CompiledGPUDataFrameQueryProps,
43
44
  type GPUDataFrameQueryExtensionContext,
44
45
  type GPUDataFrameQueryExtensionResult,
@@ -170,7 +171,8 @@ export function compileGPUDataFrameJoin<
170
171
  right: GPUDataFrame<Right>,
171
172
  options: GPUDataFrameNormalizedJoinOptions,
172
173
  joinType: GPUDataFrameJoinType,
173
- graph: GPUCommandGraph<GPUDataFrameQueryParameters>
174
+ graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
175
+ resultColumns?: readonly (keyof Selection & string)[]
174
176
  ): CompiledGPUDataFrameJoin<Selection, Right> {
175
177
  validateGPUJoinSources(source, right, options, graph);
176
178
  const retainedRight = right.select(right.columnNames);
@@ -181,7 +183,8 @@ export function compileGPUDataFrameJoin<
181
183
  Selection,
182
184
  CompiledGPUDataFrameJoin<Selection, Right>
183
185
  >(source, predicates, selectedColumns, graph, derivedColumns, {
184
- prepare: context => addGPUJoinToGraph(context, retainedRight, options, joinType)
186
+ prepare: context =>
187
+ addGPUJoinToGraph(context, retainedRight, options, joinType, resultColumns)
185
188
  });
186
189
  } catch (error) {
187
190
  retainedRight.destroy();
@@ -261,7 +264,8 @@ function addGPUJoinToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
261
264
  context: GPUDataFrameQueryExtensionContext<Left>,
262
265
  right: GPUDataFrame<Right>,
263
266
  options: GPUDataFrameNormalizedJoinOptions,
264
- joinType: GPUDataFrameJoinType
267
+ joinType: GPUDataFrameJoinType,
268
+ resultColumns?: readonly (keyof Left & string)[]
265
269
  ): GPUDataFrameQueryExtensionResult<Left, CompiledGPUDataFrameJoin<Left, Right>> {
266
270
  const ownedVectors: GPUVector[] = [];
267
271
  const id = `${context.queryId}-${joinType}-join`;
@@ -401,10 +405,12 @@ function addGPUJoinToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
401
405
  indexStatistics: indexState.indexStatistics,
402
406
  contractViolation: indexState.contractViolation
403
407
  };
408
+ const projection = resultColumns && projectGPUDataFrameQueryResult(context, resultColumns);
404
409
  return {
405
- table: context.table,
406
- validity: context.validity,
407
- dictionaries: context.dictionaries,
410
+ table: projection?.table ?? context.table,
411
+ validity: projection?.validity ?? context.validity,
412
+ dictionaries: projection?.dictionaries ?? context.dictionaries,
413
+ ownedTables: projection ? [projection] : [],
408
414
  ownedVectors,
409
415
  createCompiled: props => new CompiledGPUDataFrameJoin(props, resources)
410
416
  };
@@ -484,6 +490,81 @@ function addGPULookupToGraph<Left extends GPUTypeMap, Right extends GPUTypeMap>(
484
490
  }
485
491
  }
486
492
 
493
+ /** Bound unique-right join consumed as a source-aligned mask by aggregation. @internal */
494
+ export type GPUAggregateJoin = Readonly<{
495
+ right: GPUDataFrame;
496
+ options: GPUDataFrameNormalizedJoinOptions;
497
+ type: GPUDataFrameJoinType;
498
+ }>;
499
+
500
+ /** Inserts join matching before an aggregate contribution without compacting the left columns. */
501
+ export function prepareGPUJoinAggregation<
502
+ Source extends GPUTypeMap,
503
+ Selection extends GPUTypeMap,
504
+ Result extends GPUTypeMap,
505
+ Compiled extends CompiledGPUDataFrameQuery<Result>
506
+ >(
507
+ source: GPUDataFrame<Source>,
508
+ context: GPUDataFrameQueryExtensionContext<Selection>,
509
+ join: GPUAggregateJoin,
510
+ prepare: (
511
+ context: GPUDataFrameQueryExtensionContext<Selection>
512
+ ) => GPUDataFrameQueryExtensionResult<Result, Compiled>
513
+ ): GPUDataFrameQueryExtensionResult<Result, Compiled> {
514
+ const {graph} = context;
515
+ validateGPUJoinSources(source, join.right, join.options, graph);
516
+ const right = join.right.select(join.right.columnNames);
517
+ const ownedVectors: GPUVector[] = [];
518
+ const id = context.queryId + '-aggregate-join';
519
+ try {
520
+ const state = buildGPUJoinIndex(context, right, join.options, ownedVectors, id);
521
+ const violation = graph.importGPUVector(id + '-violation', state.contractViolation).data[0];
522
+ const matches = createTransientVectorView(graph, id + '-matches', context.selectionMask);
523
+ const values = createTransientVectorView(graph, id + '-values', context.selectionMask);
524
+ const probes = createTransientVectorView(graph, id + '-probes', context.selectionMask);
525
+ const included = createTransientVectorView(graph, id + '-included', context.selectionMask);
526
+ const statistics = createTransientView(
527
+ graph,
528
+ id + '-statistics',
529
+ 'uint32',
530
+ GPU_HASH_QUERY_STATISTICS_LENGTH
531
+ );
532
+ for (const [batchIndex, keys] of state.maskedLeftKeys.data.entries()) {
533
+ if (!keys.length) continue;
534
+ const batchId = id + '-' + batchIndex;
535
+ graph.add(
536
+ new GPUHashIndexQuery({
537
+ id: batchId,
538
+ index: state.index,
539
+ keys,
540
+ values: values.data[batchIndex],
541
+ found: matches.data[batchIndex],
542
+ probes: probes.data[batchIndex],
543
+ statistics,
544
+ maxProbeCount: join.options.maxProbeCount
545
+ })
546
+ );
547
+ addGPUJoinClassifyPass(graph, batchId + '-classify', {
548
+ matches: matches.data[batchIndex],
549
+ selection: context.selectionMask.data[batchIndex],
550
+ violation,
551
+ included: included.data[batchIndex],
552
+ joinType: join.type
553
+ });
554
+ }
555
+ const result = prepare({...context, selectionMask: included});
556
+ return {
557
+ ...result,
558
+ ownedVectors: [...ownedVectors, ...(result.ownedVectors ?? [])],
559
+ ownedTables: [...(result.ownedTables ?? []), right]
560
+ };
561
+ } catch (error) {
562
+ for (const vector of ownedVectors) vector.destroy();
563
+ right.destroy();
564
+ throw error;
565
+ }
566
+ }
567
+
487
568
  /** Builds one right index without concatenation and sanitizes filtered/nullable left source keys. */
488
569
  function buildGPUJoinIndex<Left extends GPUTypeMap, Right extends GPUTypeMap>(
489
570
  context: GPUDataFrameQueryExtensionContext<Left>,
@@ -3,7 +3,6 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileComment: Independently implemented for WebGPU; inspired by NVIDIA RAPIDS cuDF.
5
5
 
6
- import {GPU_EXPRESSION_CAST_WGSL} from '../gpu-core/gpu-expression-cast';
7
6
  import {
8
7
  Buffer,
9
8
  type Binding,
@@ -11,8 +10,14 @@ import {
11
10
  type CommandEncoder,
12
11
  type Device
13
12
  } from '@luma.gl/core';
13
+ import {
14
+ GPUData,
15
+ GPUVector,
16
+ getGPUVectorWGSLLayout,
17
+ type GPUConstant,
18
+ type GPUVectorWGSLFormat as GPUExpressionNumericFormat
19
+ } from '@luma.gl/graph/gpu-data';
14
20
  import {Kernel} from '../execution/compute/kernel';
15
- import {GPUData, GPUVector, type GPUConstant} from '@luma.gl/graph/gpu-data';
16
21
  import {GPURecordBatch, GPUTable, type GPUField, type GPUTypeMap} from '@luma.gl/graph/gpu-tables';
17
22
  import {
18
23
  type CompiledGPUCommandGraph,
@@ -25,21 +30,43 @@ import {
25
30
  import {getBoundedDispatchLayout, getBoundedInvocationIndexSource} from '@luma.gl/graph/gpu-core';
26
31
  import {GPUVisibilityWorkflow} from '@luma.gl/graph/gpu-core';
27
32
  import {createTransientView, getViewBinding, getViewElementOffset} from '@luma.gl/graph/gpu-core';
28
- import type {GPUDataFrame, GPUDataFrameDictionaries, GPUDataFrameValidity} from './gpu-data-frame';
33
+ import {
34
+ GPUDataFrame,
35
+ type GPUDataFrameDictionaries,
36
+ type GPUDataFrameValidity
37
+ } from './gpu-data-frame';
29
38
  import type {GPUDataFrameDerivedColumn} from './gpu-data-frame-query';
30
39
  import type {GPUExpression} from './gpu-expression';
31
40
  import {
32
41
  encodeGPUQueryExpressionControls,
33
- getGPUQueryShaderType,
34
42
  makeGPUQueryExpressionShaderPlan,
35
43
  type GPUQueryExpressionColumn,
36
44
  type GPUQueryExpressionOutput,
37
- type GPUQueryExpressionShaderPlan,
38
- type GPUQueryScalarFormat
45
+ type GPUQueryExpressionShaderPlan
39
46
  } from './gpu-expression-shader';
40
47
 
41
48
  const LU_QUERY_WORKGROUP_SIZE = 256;
42
- const UINT32_BYTE_LENGTH = Uint32Array.BYTES_PER_ELEMENT;
49
+
50
+ /** Borrows projected columns while the query owns its working table. @internal */
51
+ export function projectGPUDataFrameQueryResult<Selection extends GPUTypeMap>(
52
+ context: Pick<
53
+ GPUDataFrameQueryExtensionContext<Selection>,
54
+ 'table' | 'validity' | 'dictionaries'
55
+ >,
56
+ columns: readonly (keyof Selection & string)[]
57
+ ): GPUDataFrame<Selection> {
58
+ const working = new GPUDataFrame<Selection>({
59
+ table: context.table,
60
+ validity: context.validity,
61
+ dictionaries: context.dictionaries,
62
+ ownership: 'borrowed'
63
+ });
64
+ try {
65
+ return working.select(columns) as GPUDataFrame<Selection>;
66
+ } finally {
67
+ working.destroy();
68
+ }
69
+ }
43
70
 
44
71
  /** Caller-owned scalar values supplied to an already compiled dataframe filter. */
45
72
  export type GPUDataFrameQueryParameters = Readonly<Record<string, number | boolean | null>>;
@@ -51,12 +78,12 @@ type GPUQuerySourceView = {
51
78
 
52
79
  type GPUQueryDerivedOutput = {
53
80
  plan: GPUQueryExpressionOutput;
54
- values: GPUVector<GPUQueryScalarFormat>;
81
+ values: GPUVector<GPUExpressionNumericFormat>;
55
82
  validity?: GPUVector<'uint32'>;
56
83
  };
57
84
 
58
85
  type GPUQueryDerivedView = {
59
- values: GraphVectorView<GPUQueryScalarFormat>;
86
+ values: GraphVectorView<GPUExpressionNumericFormat>;
60
87
  validity?: GraphVectorView<'uint32'>;
61
88
  };
62
89
 
@@ -420,7 +447,7 @@ function validateGPUQueryBindingCapacity(
420
447
  }
421
448
 
422
449
  /** Creates one independently owned fixed-width GPU output chunk for every source batch. */
423
- function createGPUQueryOutputVector<Format extends GPUQueryScalarFormat>(
450
+ function createGPUQueryOutputVector<Format extends GPUExpressionNumericFormat>(
424
451
  device: Device,
425
452
  name: string,
426
453
  lengths: readonly number[],
@@ -433,7 +460,7 @@ function createGPUQueryOutputVector<Format extends GPUQueryScalarFormat>(
433
460
  for (const [batchIndex, length] of lengths.entries()) {
434
461
  const buffer = device.createBuffer({
435
462
  id: `${name}-batch-${batchIndex}`,
436
- byteLength: Math.max(length, 1) * UINT32_BYTE_LENGTH,
463
+ byteLength: Math.max(length, 1) * getGPUVectorWGSLLayout(format).packedByteStride,
437
464
  usage:
438
465
  Buffer.STORAGE |
439
466
  Buffer.COPY_SRC |
@@ -506,7 +533,13 @@ function createGPUQueryDerivedTable<Result extends GPUTypeMap>(
506
533
  const layouts: BufferLayout[] = selectedColumns.flatMap(name => {
507
534
  const output = outputsByName.get(name);
508
535
  if (output) {
509
- return [{name, format: output.plan.format, byteStride: UINT32_BYTE_LENGTH}];
536
+ return [
537
+ {
538
+ name,
539
+ format: output.plan.format,
540
+ byteStride: getGPUVectorWGSLLayout(output.plan.format).packedByteStride
541
+ }
542
+ ];
510
543
  }
511
544
  return selectedSource.bufferLayout
512
545
  .filter(layout => layout.name === name)
@@ -660,6 +693,43 @@ function addGPUQueryControlUpload(
660
693
  });
661
694
  }
662
695
 
696
+ /** Adds a predicate on an already prepared graph table into a caller-supplied mask. @internal */
697
+ export function addGPUDataFrameResultPredicate<T extends GPUTypeMap>(
698
+ graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
699
+ queryId: string,
700
+ source: GPUDataFrame<T>,
701
+ predicate: GPUExpression<boolean, string>,
702
+ output: GraphVectorView<'uint32'>
703
+ ): void {
704
+ const plan = makeGPUQueryExpressionShaderPlan(source, [predicate], [], []);
705
+ validateGPUQueryBindingCapacity(plan, graph);
706
+ const sourceViews = importGPUQuerySourceViews(graph, source, plan, queryId);
707
+ const controls =
708
+ plan.controls.length && output.length
709
+ ? createTransientView(
710
+ graph,
711
+ queryId + '-controls',
712
+ 'uint32',
713
+ plan.controls.length * 2,
714
+ Buffer.STORAGE | Buffer.COPY_DST
715
+ )
716
+ : undefined;
717
+ if (controls) addGPUQueryControlUpload(graph, queryId, controls, plan);
718
+ for (const [batchIndex, chunk] of output.data.entries()) {
719
+ if (!chunk.length) continue;
720
+ addGPUQueryPredicatePass(graph, {
721
+ id: queryId + '-batch-' + batchIndex,
722
+ batchIndex,
723
+ columns: plan.columns,
724
+ sourceViews,
725
+ derivedViews: new Map(),
726
+ controls,
727
+ output: chunk,
728
+ plan
729
+ });
730
+ }
731
+ }
732
+
663
733
  /** Emits one closed-AST expression kernel for one preserved, nonempty source record batch. */
664
734
  function addGPUQueryPredicatePass(
665
735
  graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
@@ -689,7 +759,16 @@ function addGPUQueryPredicatePass(
689
759
  `const INPUT_${column.index}_OFFSET: u32 = ${getViewElementOffset(values)}u;`
690
760
  );
691
761
  declarations.push(
692
- `@group(0) @binding(${bindingIndex++}) var<storage, read> input${column.index}: array<${getGPUQueryShaderType(column.format)}>;`
762
+ `@group(0) @binding(${bindingIndex++}) var<storage, read> input${column.index}: array<${getGPUVectorWGSLLayout(column.format).scalarType}>;`
763
+ );
764
+ const layout = getGPUVectorWGSLLayout(column.format);
765
+ const components = Array.from(
766
+ {length: layout.components},
767
+ (_, component) =>
768
+ `input${column.index}[INPUT_${column.index}_OFFSET + row * ${layout.components}u + ${component}u]`
769
+ );
770
+ declarations.push(
771
+ `fn readInput${column.index}(row: u32) -> ${layout.shaderType} { return ${layout.components === 1 ? components[0] : `${layout.shaderType}(${components.join(', ')})`}; }`
693
772
  );
694
773
  bindings[`input${column.index}`] = values;
695
774
  resources.push({buffer: values, usage: 'storage-read'});
@@ -730,13 +809,16 @@ function addGPUQueryPredicatePass(
730
809
  `const DERIVED_${output.index}_OFFSET: u32 = ${getViewElementOffset(values)}u;`
731
810
  );
732
811
  declarations.push(
733
- `@group(0) @binding(${bindingIndex++}) var<storage, read_write> derived${output.index}: array<${getGPUQueryShaderType(output.format)}>;`
812
+ `@group(0) @binding(${bindingIndex++}) var<storage, read_write> derived${output.index}: array<${getGPUVectorWGSLLayout(output.format).scalarType}>;`
734
813
  );
735
814
  bindings[`derived${output.index}`] = values;
736
815
  resources.push({buffer: values, usage: 'storage-write'});
737
- derivedWrites.push(
738
- `derived${output.index}[DERIVED_${output.index}_OFFSET + index] = ${output.value};`
739
- );
816
+ const layout = getGPUVectorWGSLLayout(output.format);
817
+ for (let component = 0; component < layout.components; component++) {
818
+ derivedWrites.push(
819
+ `derived${output.index}[DERIVED_${output.index}_OFFSET + index * ${layout.components}u + ${component}u] = ${layout.components === 1 ? output.value : `${output.value}[${component}]`};`
820
+ );
821
+ }
740
822
 
741
823
  if (output.nullable) {
742
824
  const validity = views?.validity?.data[props.batchIndex];
@@ -773,7 +855,7 @@ function addGPUQueryPredicatePass(
773
855
  const source = /* wgsl */ `
774
856
  const ELEMENT_COUNT: u32 = ${props.output.length}u;
775
857
  ${declarations.join('\n')}
776
- ${props.plan.usesCasts ? GPU_EXPRESSION_CAST_WGSL : ''}
858
+ ${props.plan.helpers.join('\n')}
777
859
 
778
860
  @compute @workgroup_size(${LU_QUERY_WORKGROUP_SIZE})
779
861
  fn main(
@@ -77,7 +77,7 @@ export {CompiledGPUDataFrameSort} from './gpu-sort-compiler';
77
77
  export {CompiledGPUDataFrameGlobalSort} from './gpu-global-sort-compiler';
78
78
  export {CompiledGPUDataFrameJoin, CompiledGPUDataFrameLookup} from './gpu-join-compiler';
79
79
 
80
- export {vector, cast} from './gpu-expression';
80
+ export {vector, vectorColumn, cast} from './gpu-expression';
81
81
  export type {GPUExpressionNumericValue} from './gpu-expression';
82
82
  export type {
83
83
  GPUVectorWGSLFormat as GPUExpressionNumericFormat,
@@ -81,8 +81,10 @@ extends beyond the standard and does not become a seventh official workload.
81
81
  one chosen vertex. Existing nonnegative `float32` edge weights determine route cost; missing
82
82
  weights mean every relationship costs one. Unreachable vertices receive `+Infinity`, equal-cost
83
83
  routes choose fewer hops and then the lowest stable predecessor, and invalid or negative weights
84
- fail closed. Bounded synchronized relaxation and an optional GPU convergence flag keep the actual
85
- iteration budget visible; they do not imply automatic convergence or support negative weights.
84
+ fail closed. Synchronized relaxation stops on the GPU in the first round that changes nothing;
85
+ `run()` continues in batches past the 1,024 rounds that one command graph encodes and reports
86
+ `converged` and `iterations`. Caller-owned `seeds` let one compiled search serve any source, or
87
+ several sources at once. Negative weights are not supported.
86
88
 
87
89
  `GPUGraphAlgorithmsLocalClusteringCoefficient` asks whether each vertex's distinct incoming-or-outgoing
88
90
  neighbors also connect to one another. Directed graphs count distinct directed links among those