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

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 (327) hide show
  1. package/dist/experimental-models.cjs +21 -0
  2. package/dist/experimental-models.d.ts +2 -0
  3. package/dist/experimental-models.d.ts.map +1 -0
  4. package/dist/experimental-models.js +5 -0
  5. package/dist/experimental-models.js.map +1 -0
  6. package/dist/experimental-simulation.cjs +21 -0
  7. package/dist/experimental-simulation.d.ts +2 -0
  8. package/dist/experimental-simulation.d.ts.map +1 -0
  9. package/dist/experimental-simulation.js +5 -0
  10. package/dist/experimental-simulation.js.map +1 -0
  11. package/dist/gpu-dataframe/gpu-data-frame-query.cjs +7 -3
  12. package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
  13. package/dist/gpu-dataframe/gpu-data-frame-query.js +14 -4
  14. package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
  15. package/dist/gpu-dataframe/gpu-expression-shader.cjs +87 -5
  16. package/dist/gpu-dataframe/gpu-expression-shader.d.ts +2 -1
  17. package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
  18. package/dist/gpu-dataframe/gpu-expression-shader.js +101 -5
  19. package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
  20. package/dist/gpu-dataframe/gpu-expression.cjs +86 -0
  21. package/dist/gpu-dataframe/gpu-expression.d.ts +23 -2
  22. package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
  23. package/dist/gpu-dataframe/gpu-expression.js +81 -0
  24. package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
  25. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +0 -1
  26. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
  27. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +0 -1
  28. package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
  29. package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +2 -2
  30. package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
  31. package/dist/gpu-dataframe/gpu-global-aggregation-query.js +5 -3
  32. package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
  33. package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +23 -11
  34. package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +1 -1
  35. package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
  36. package/dist/gpu-dataframe/gpu-global-sort-compiler.js +24 -12
  37. package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
  38. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +0 -1
  39. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
  40. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +0 -1
  41. package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
  42. package/dist/gpu-dataframe/gpu-group-by-query.cjs +2 -2
  43. package/dist/gpu-dataframe/gpu-group-by-query.js +5 -3
  44. package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
  45. package/dist/gpu-dataframe/gpu-histogram-compiler.cjs +0 -1
  46. package/dist/gpu-dataframe/gpu-histogram-compiler.d.ts.map +1 -1
  47. package/dist/gpu-dataframe/gpu-histogram-compiler.js +0 -1
  48. package/dist/gpu-dataframe/gpu-histogram-compiler.js.map +1 -1
  49. package/dist/gpu-dataframe/gpu-join-compiler.cjs +0 -2
  50. package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
  51. package/dist/gpu-dataframe/gpu-join-compiler.js +0 -2
  52. package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
  53. package/dist/gpu-dataframe/gpu-query-compiler.cjs +3 -1
  54. package/dist/gpu-dataframe/gpu-query-compiler.d.ts +0 -1
  55. package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
  56. package/dist/gpu-dataframe/gpu-query-compiler.js +3 -1
  57. package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
  58. package/dist/gpu-dataframe/gpu-sort-compiler.cjs +0 -1
  59. package/dist/gpu-dataframe/gpu-sort-compiler.d.ts.map +1 -1
  60. package/dist/gpu-dataframe/gpu-sort-compiler.js +0 -1
  61. package/dist/gpu-dataframe/gpu-sort-compiler.js.map +1 -1
  62. package/dist/gpu-dataframe/gpu-sort-query.cjs +13 -5
  63. package/dist/gpu-dataframe/gpu-sort-query.d.ts +4 -1
  64. package/dist/gpu-dataframe/gpu-sort-query.d.ts.map +1 -1
  65. package/dist/gpu-dataframe/gpu-sort-query.js +14 -5
  66. package/dist/gpu-dataframe/gpu-sort-query.js.map +1 -1
  67. package/dist/gpu-dataframe/index.cjs +8 -0
  68. package/dist/gpu-dataframe/index.cjs.map +2 -2
  69. package/dist/gpu-dataframe/index.d.ts +2 -2
  70. package/dist/gpu-dataframe/index.d.ts.map +1 -1
  71. package/dist/gpu-dataframe/index.js +1 -1
  72. package/dist/gpu-dataframe/index.js.map +1 -1
  73. package/dist/gpu-dataframe/portable-expression.cjs +68 -4
  74. package/dist/gpu-dataframe/portable-expression.d.ts +3 -1
  75. package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -1
  76. package/dist/gpu-dataframe/portable-expression.js +69 -5
  77. package/dist/gpu-dataframe/portable-expression.js.map +1 -1
  78. package/dist/gpu-dggs-benchmarks.cjs +21 -0
  79. package/dist/gpu-dggs-benchmarks.d.ts +2 -0
  80. package/dist/gpu-dggs-benchmarks.d.ts.map +1 -0
  81. package/dist/gpu-dggs-benchmarks.js +5 -0
  82. package/dist/gpu-dggs-benchmarks.js.map +1 -0
  83. package/dist/gpu-graph-algorithms-benchmarks.cjs +21 -0
  84. package/dist/gpu-graph-algorithms-benchmarks.d.ts +2 -0
  85. package/dist/gpu-graph-algorithms-benchmarks.d.ts.map +1 -0
  86. package/dist/gpu-graph-algorithms-benchmarks.js +5 -0
  87. package/dist/gpu-graph-algorithms-benchmarks.js.map +1 -0
  88. package/dist/gpu-physics/gpu-physics-ensemble-terrain.cjs +116 -0
  89. package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts +42 -0
  90. package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts.map +1 -0
  91. package/dist/gpu-physics/gpu-physics-ensemble-terrain.js +90 -0
  92. package/dist/gpu-physics/gpu-physics-ensemble-terrain.js.map +1 -0
  93. package/dist/gpu-physics/gpu-physics-ensemble.cjs +97 -5
  94. package/dist/gpu-physics/gpu-physics-ensemble.d.ts +31 -2
  95. package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
  96. package/dist/gpu-physics/gpu-physics-ensemble.js +99 -3
  97. package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
  98. package/dist/gpu-physics/gpu-rigid-body-world.cjs +483 -152
  99. package/dist/gpu-physics/gpu-rigid-body-world.d.ts +64 -3
  100. package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
  101. package/dist/gpu-physics/gpu-rigid-body-world.js +523 -161
  102. package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
  103. package/dist/gpu-physics/index.cjs +23 -2
  104. package/dist/gpu-physics/index.cjs.map +3 -3
  105. package/dist/gpu-physics/index.d.ts +8 -2
  106. package/dist/gpu-physics/index.d.ts.map +1 -1
  107. package/dist/gpu-physics/index.js +6 -1
  108. package/dist/gpu-physics/index.js.map +1 -1
  109. package/dist/gpu-physics/rigid-body-bounds-shaders.cjs +21 -8
  110. package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts +2 -1
  111. package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts.map +1 -1
  112. package/dist/gpu-physics/rigid-body-bounds-shaders.js +15 -1
  113. package/dist/gpu-physics/rigid-body-bounds-shaders.js.map +1 -1
  114. package/dist/gpu-physics/rigid-body-convex-shaders.cjs +3 -2
  115. package/dist/gpu-physics/rigid-body-convex-shaders.d.ts +1 -1
  116. package/dist/gpu-physics/rigid-body-convex-shaders.d.ts.map +1 -1
  117. package/dist/gpu-physics/rigid-body-convex-shaders.js +3 -2
  118. package/dist/gpu-physics/rigid-body-convex-shaders.js.map +1 -1
  119. package/dist/gpu-physics/rigid-body-ensemble-reset.cjs +36 -7
  120. package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts +1 -1
  121. package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts.map +1 -1
  122. package/dist/gpu-physics/rigid-body-ensemble-reset.js +42 -7
  123. package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
  124. package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +23 -1
  125. package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +4 -1
  126. package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
  127. package/dist/gpu-physics/rigid-body-ensemble-transaction.js +25 -1
  128. package/dist/gpu-physics/rigid-body-ensemble-transaction.js.map +1 -1
  129. package/dist/gpu-physics/rigid-body-geometry.cjs +41 -4
  130. package/dist/gpu-physics/rigid-body-geometry.d.ts +10 -1
  131. package/dist/gpu-physics/rigid-body-geometry.d.ts.map +1 -1
  132. package/dist/gpu-physics/rigid-body-geometry.js +44 -3
  133. package/dist/gpu-physics/rigid-body-geometry.js.map +1 -1
  134. package/dist/gpu-physics/rigid-body-height-field-shader.cjs +80 -0
  135. package/dist/gpu-physics/rigid-body-height-field-shader.d.ts +3 -0
  136. package/dist/gpu-physics/rigid-body-height-field-shader.d.ts.map +1 -0
  137. package/dist/gpu-physics/rigid-body-height-field-shader.js +56 -0
  138. package/dist/gpu-physics/rigid-body-height-field-shader.js.map +1 -0
  139. package/dist/gpu-physics/rigid-body-height-field.cjs +166 -0
  140. package/dist/gpu-physics/rigid-body-height-field.d.ts +55 -0
  141. package/dist/gpu-physics/rigid-body-height-field.d.ts.map +1 -0
  142. package/dist/gpu-physics/rigid-body-height-field.js +184 -0
  143. package/dist/gpu-physics/rigid-body-height-field.js.map +1 -0
  144. package/dist/gpu-physics/rigid-body-mesh-query-shaders.cjs +4 -2
  145. package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts +1 -1
  146. package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts.map +1 -1
  147. package/dist/gpu-physics/rigid-body-mesh-query-shaders.js +4 -2
  148. package/dist/gpu-physics/rigid-body-mesh-query-shaders.js.map +1 -1
  149. package/dist/gpu-physics/rigid-body-mesh.cjs +72 -17
  150. package/dist/gpu-physics/rigid-body-mesh.d.ts +3 -0
  151. package/dist/gpu-physics/rigid-body-mesh.d.ts.map +1 -1
  152. package/dist/gpu-physics/rigid-body-mesh.js +76 -20
  153. package/dist/gpu-physics/rigid-body-mesh.js.map +1 -1
  154. package/dist/gpu-physics/rigid-body-properties.cjs +4 -4
  155. package/dist/gpu-physics/rigid-body-properties.d.ts +6 -0
  156. package/dist/gpu-physics/rigid-body-properties.d.ts.map +1 -1
  157. package/dist/gpu-physics/rigid-body-properties.js +1 -1
  158. package/dist/gpu-physics/rigid-body-properties.js.map +1 -1
  159. package/dist/gpu-physics/rigid-body-publication.cjs +2 -2
  160. package/dist/gpu-physics/rigid-body-publication.js +1 -1
  161. package/dist/gpu-physics/rigid-body-publication.js.map +1 -1
  162. package/dist/gpu-physics/rigid-body-query-geometry.cjs +22 -4
  163. package/dist/gpu-physics/rigid-body-query-geometry.d.ts +1 -1
  164. package/dist/gpu-physics/rigid-body-query-geometry.d.ts.map +1 -1
  165. package/dist/gpu-physics/rigid-body-query-geometry.js +22 -4
  166. package/dist/gpu-physics/rigid-body-query-geometry.js.map +1 -1
  167. package/dist/gpu-physics/rigid-body-shaders.cjs +11 -5
  168. package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
  169. package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
  170. package/dist/gpu-physics/rigid-body-shaders.js +14 -6
  171. package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
  172. package/dist/gpu-physics/rigid-body-shape-properties.cjs +2 -0
  173. package/dist/gpu-physics/rigid-body-shape-properties.d.ts.map +1 -1
  174. package/dist/gpu-physics/rigid-body-shape-properties.js +2 -0
  175. package/dist/gpu-physics/rigid-body-shape-properties.js.map +1 -1
  176. package/dist/gpu-physics/rigid-body-terrain-atlas.cjs +287 -0
  177. package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts +87 -0
  178. package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts.map +1 -0
  179. package/dist/gpu-physics/rigid-body-terrain-atlas.js +275 -0
  180. package/dist/gpu-physics/rigid-body-terrain-atlas.js.map +1 -0
  181. package/dist/gpu-physics/rigid-body-terrain-lod.cjs +240 -0
  182. package/dist/gpu-physics/rigid-body-terrain-lod.d.ts +76 -0
  183. package/dist/gpu-physics/rigid-body-terrain-lod.d.ts.map +1 -0
  184. package/dist/gpu-physics/rigid-body-terrain-lod.js +247 -0
  185. package/dist/gpu-physics/rigid-body-terrain-lod.js.map +1 -0
  186. package/dist/gpu-physics/rigid-body-terrain-stitch.cjs +215 -0
  187. package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts +25 -0
  188. package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts.map +1 -0
  189. package/dist/gpu-physics/rigid-body-terrain-stitch.js +218 -0
  190. package/dist/gpu-physics/rigid-body-terrain-stitch.js.map +1 -0
  191. package/dist/gpu-physics/rigid-body-terrain-stream.cjs +263 -0
  192. package/dist/gpu-physics/rigid-body-terrain-stream.d.ts +97 -0
  193. package/dist/gpu-physics/rigid-body-terrain-stream.d.ts.map +1 -0
  194. package/dist/gpu-physics/rigid-body-terrain-stream.js +250 -0
  195. package/dist/gpu-physics/rigid-body-terrain-stream.js.map +1 -0
  196. package/dist/gpu-physics/rigid-body-triggers.cjs +1 -0
  197. package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
  198. package/dist/gpu-physics/rigid-body-triggers.js +1 -0
  199. package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
  200. package/dist/gpu-physics/rigid-body-vehicle.cjs +99 -44
  201. package/dist/gpu-physics/rigid-body-vehicle.d.ts +15 -3
  202. package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -1
  203. package/dist/gpu-physics/rigid-body-vehicle.js +93 -40
  204. package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -1
  205. package/dist/gpu-project/cpu-geometry-pipelines.d.ts +1 -1
  206. package/dist/gpu-project/cpu-projection-operation.d.ts +1 -1
  207. package/dist/gpu-project/crs.cjs.map +2 -2
  208. package/dist/gpu-project/crs.d.ts +1 -1
  209. package/dist/gpu-project/projection-crs-benchmark.cjs +2 -2
  210. package/dist/gpu-project/projection-crs-benchmark.d.ts +1 -1
  211. package/dist/gpu-project/projection-crs-benchmark.js +1 -1
  212. package/dist/gpu-project/projection-crs-input.cjs +7 -7
  213. package/dist/gpu-project/projection-crs-input.d.ts +1 -1
  214. package/dist/gpu-project/projection-crs-input.js +4 -4
  215. package/dist/gpu-project/projection-engine.d.ts +2 -2
  216. package/dist/gpu-project-benchmarks.cjs +21 -0
  217. package/dist/gpu-project-benchmarks.d.ts +2 -0
  218. package/dist/gpu-project-benchmarks.d.ts.map +1 -0
  219. package/dist/gpu-project-benchmarks.js +5 -0
  220. package/dist/gpu-project-benchmarks.js.map +1 -0
  221. package/dist/gpu-project-crs.cjs +21 -0
  222. package/dist/gpu-project-crs.d.ts +2 -0
  223. package/dist/gpu-project-crs.d.ts.map +1 -0
  224. package/dist/gpu-project-crs.js +5 -0
  225. package/dist/gpu-project-crs.js.map +1 -0
  226. package/dist/gpu-project-geoarrow.cjs +21 -0
  227. package/dist/gpu-project-geoarrow.d.ts +2 -0
  228. package/dist/gpu-project-geoarrow.d.ts.map +1 -0
  229. package/dist/gpu-project-geoarrow.js +5 -0
  230. package/dist/gpu-project-geoarrow.js.map +1 -0
  231. package/dist/gpu-project-graph.cjs +21 -0
  232. package/dist/gpu-project-graph.d.ts +2 -0
  233. package/dist/gpu-project-graph.d.ts.map +1 -0
  234. package/dist/gpu-project-graph.js +5 -0
  235. package/dist/gpu-project-graph.js.map +1 -0
  236. package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts +1 -1
  237. package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts.map +1 -1
  238. package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts +1 -1
  239. package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts.map +1 -1
  240. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +1 -1
  241. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
  242. package/dist/gpu-simple-graph/operation/operation.d.ts +1 -1
  243. package/dist/gpu-simple-graph/operation/operation.d.ts.map +1 -1
  244. package/dist/gpu-simple-graph-cpu.cjs +21 -0
  245. package/dist/gpu-simple-graph-cpu.d.ts +2 -0
  246. package/dist/gpu-simple-graph-cpu.d.ts.map +1 -0
  247. package/dist/gpu-simple-graph-cpu.js +5 -0
  248. package/dist/gpu-simple-graph-cpu.js.map +1 -0
  249. package/dist/gpu-simple-graph-webgl.cjs +21 -0
  250. package/dist/gpu-simple-graph-webgl.d.ts +2 -0
  251. package/dist/gpu-simple-graph-webgl.d.ts.map +1 -0
  252. package/dist/gpu-simple-graph-webgl.js +5 -0
  253. package/dist/gpu-simple-graph-webgl.js.map +1 -0
  254. package/dist/gpu-simple-graph-webgpu.cjs +21 -0
  255. package/dist/gpu-simple-graph-webgpu.d.ts +2 -0
  256. package/dist/gpu-simple-graph-webgpu.d.ts.map +1 -0
  257. package/dist/gpu-simple-graph-webgpu.js +5 -0
  258. package/dist/gpu-simple-graph-webgpu.js.map +1 -0
  259. package/dist/gpu-sql/gpu-sql.cjs +76 -122
  260. package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
  261. package/dist/gpu-sql/gpu-sql.js +99 -130
  262. package/dist/gpu-sql/gpu-sql.js.map +1 -1
  263. package/dist/gpu-sql/index.cjs.map +2 -2
  264. package/package.json +19 -19
  265. package/src/experimental-models.ts +5 -0
  266. package/src/experimental-simulation.ts +5 -0
  267. package/src/gpu-dataframe/gpu-data-frame-query.ts +18 -5
  268. package/src/gpu-dataframe/gpu-expression-shader.ts +128 -7
  269. package/src/gpu-dataframe/gpu-expression.ts +124 -1
  270. package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +0 -1
  271. package/src/gpu-dataframe/gpu-global-aggregation-query.ts +5 -3
  272. package/src/gpu-dataframe/gpu-global-sort-compiler.ts +26 -12
  273. package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +0 -1
  274. package/src/gpu-dataframe/gpu-group-by-query.ts +5 -3
  275. package/src/gpu-dataframe/gpu-histogram-compiler.ts +0 -1
  276. package/src/gpu-dataframe/gpu-join-compiler.ts +0 -2
  277. package/src/gpu-dataframe/gpu-query-compiler.ts +3 -3
  278. package/src/gpu-dataframe/gpu-sort-compiler.ts +0 -1
  279. package/src/gpu-dataframe/gpu-sort-query.ts +31 -5
  280. package/src/gpu-dataframe/index.ts +15 -2
  281. package/src/gpu-dataframe/portable-expression.ts +81 -4
  282. package/src/gpu-dggs-benchmarks.ts +5 -0
  283. package/src/gpu-graph-algorithms-benchmarks.ts +5 -0
  284. package/src/gpu-physics/gpu-physics-ensemble-terrain.ts +114 -0
  285. package/src/gpu-physics/gpu-physics-ensemble.ts +147 -4
  286. package/src/gpu-physics/gpu-rigid-body-world.ts +668 -198
  287. package/src/gpu-physics/index.ts +37 -0
  288. package/src/gpu-physics/rigid-body-bounds-shaders.ts +16 -1
  289. package/src/gpu-physics/rigid-body-convex-shaders.ts +3 -2
  290. package/src/gpu-physics/rigid-body-ensemble-reset.ts +48 -8
  291. package/src/gpu-physics/rigid-body-ensemble-transaction.ts +34 -1
  292. package/src/gpu-physics/rigid-body-geometry.ts +49 -4
  293. package/src/gpu-physics/rigid-body-height-field-shader.ts +56 -0
  294. package/src/gpu-physics/rigid-body-height-field.ts +257 -0
  295. package/src/gpu-physics/rigid-body-mesh-query-shaders.ts +4 -2
  296. package/src/gpu-physics/rigid-body-mesh.ts +97 -26
  297. package/src/gpu-physics/rigid-body-properties.ts +5 -2
  298. package/src/gpu-physics/rigid-body-publication.ts +1 -1
  299. package/src/gpu-physics/rigid-body-query-geometry.ts +22 -4
  300. package/src/gpu-physics/rigid-body-shaders.ts +17 -6
  301. package/src/gpu-physics/rigid-body-shape-properties.ts +2 -0
  302. package/src/gpu-physics/rigid-body-terrain-atlas.ts +378 -0
  303. package/src/gpu-physics/rigid-body-terrain-lod.ts +332 -0
  304. package/src/gpu-physics/rigid-body-terrain-stitch.ts +286 -0
  305. package/src/gpu-physics/rigid-body-terrain-stream.ts +323 -0
  306. package/src/gpu-physics/rigid-body-triggers.ts +1 -0
  307. package/src/gpu-physics/rigid-body-vehicle.ts +108 -41
  308. package/src/gpu-project/README.md +2 -2
  309. package/src/gpu-project/cpu-geometry-pipelines.ts +1 -1
  310. package/src/gpu-project/cpu-projection-operation.ts +1 -1
  311. package/src/gpu-project/crs.ts +2 -2
  312. package/src/gpu-project/projection-crs-benchmark.ts +2 -2
  313. package/src/gpu-project/projection-crs-input.ts +4 -4
  314. package/src/gpu-project/projection-engine.ts +2 -2
  315. package/src/gpu-project-benchmarks.ts +5 -0
  316. package/src/gpu-project-crs.ts +5 -0
  317. package/src/gpu-project-geoarrow.ts +5 -0
  318. package/src/gpu-project-graph.ts +5 -0
  319. package/src/gpu-simple-graph/gpu-simple-graph-transfer.ts +1 -1
  320. package/src/gpu-simple-graph/gpu-simple-graph-value.ts +1 -1
  321. package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +1 -1
  322. package/src/gpu-simple-graph/operation/operation.ts +1 -1
  323. package/src/gpu-simple-graph/operations/swizzle.ts +1 -1
  324. package/src/gpu-simple-graph-cpu.ts +5 -0
  325. package/src/gpu-simple-graph-webgl.ts +5 -0
  326. package/src/gpu-simple-graph-webgpu.ts +5 -0
  327. package/src/gpu-sql/gpu-sql.ts +150 -152
@@ -56,7 +56,7 @@ export class CompiledGPUDataFrameGlobalSort<
56
56
  > extends CompiledGPUDataFrameSort<T> {
57
57
  /** One dense globally ordered source-row permutation; only the selected prefix is meaningful. */
58
58
  readonly globalRowIndices: GPUVector<'uint32'>;
59
- /** One GPU-resident count of selected rows after applying the optional global top-K limit. */
59
+ /** One GPU-resident count of selected rows after applying the optional global page. */
60
60
  readonly globalSelectedCount: GPUVector<'uint32'>;
61
61
 
62
62
  /** @internal */
@@ -94,7 +94,6 @@ export function compileGPUDataFrameGlobalSort<
94
94
  Selection,
95
95
  CompiledGPUDataFrameGlobalSort<Selection>
96
96
  >(source, predicates, selectedColumns, graph, derivedColumns, {
97
- allowEmptyPredicates: true,
98
97
  prepare: context => addGPUGlobalSortToGraph(context, column, options)
99
98
  });
100
99
  }
@@ -222,10 +221,11 @@ function addGPUGlobalSortToGraph<Selection extends GPUTypeMap>(
222
221
  scratch,
223
222
  output: globalRows,
224
223
  count: selectedCount,
224
+ offset: options.offset ?? 0,
225
225
  limit: options.limit ?? MAXIMUM_UINT32
226
226
  });
227
227
 
228
- if (options.limit !== undefined) {
228
+ if (options.offset || options.limit !== undefined) {
229
229
  let globalOffset = 0;
230
230
  let fallbackOffset = 0;
231
231
  for (const [batchIndex, batch] of context.table.batches.entries()) {
@@ -235,7 +235,8 @@ function addGPUGlobalSortToGraph<Selection extends GPUTypeMap>(
235
235
  ranks: scratch.sourceClasses,
236
236
  selection,
237
237
  globalOffset,
238
- limit: options.limit
238
+ offset: options.offset ?? 0,
239
+ limit: options.limit ?? MAXIMUM_UINT32
239
240
  });
240
241
  graph.add(
241
242
  new GPUVisibilityWorkflow({
@@ -460,6 +461,7 @@ function addGPUGlobalSortPublishPass(
460
461
  scratch: GPUGlobalSortScratch;
461
462
  output: GraphDataView<'uint32'>;
462
463
  count: GraphDataView<'uint32'>;
464
+ offset: number;
463
465
  limit: number;
464
466
  }
465
467
  ): void {
@@ -471,6 +473,7 @@ const SOURCE_ROW_OFFSET: u32 = ${getViewElementOffset(props.scratch.sourceRows)}
471
473
  const RANK_OFFSET: u32 = ${getViewElementOffset(props.scratch.sourceClasses)}u;
472
474
  const OUTPUT_OFFSET: u32 = ${getViewElementOffset(props.output)}u;
473
475
  const COUNT_OFFSET: u32 = ${getViewElementOffset(props.count)}u;
476
+ const ROW_OFFSET: u32 = ${props.offset}u;
474
477
  const ROW_LIMIT: u32 = ${props.limit}u;
475
478
  @group(0) @binding(0) var<storage, read> sortedClasses: array<u32>;
476
479
  @group(0) @binding(1) var<storage, read> sortedOrdinals: array<u32>;
@@ -489,13 +492,21 @@ fn main(
489
492
  let ordinal = sortedOrdinals[ORDINAL_OFFSET + index];
490
493
  let accepted = sortedClasses[CLASS_OFFSET + index] != 3u;
491
494
  sourceRanks[RANK_OFFSET + ordinal] = select(0xffffffffu, index, accepted);
492
- outputRows[OUTPUT_OFFSET + index] = select(
493
- 0u,
494
- sourceRows[SOURCE_ROW_OFFSET + ordinal],
495
- accepted && index < ROW_LIMIT
496
- );
495
+ let skipped = min(ROW_OFFSET, ELEMENT_COUNT);
496
+ if (index >= ELEMENT_COUNT - skipped) {
497
+ outputRows[OUTPUT_OFFSET + index] = 0u;
498
+ }
499
+ if (index >= skipped) {
500
+ let pageIndex = index - skipped;
501
+ outputRows[OUTPUT_OFFSET + pageIndex] = select(
502
+ 0u,
503
+ sourceRows[SOURCE_ROW_OFFSET + ordinal],
504
+ accepted && pageIndex < ROW_LIMIT
505
+ );
506
+ }
497
507
  if (index == 0u) {
498
- selectedCounts[COUNT_OFFSET] = min(selectedCounts[COUNT_OFFSET], ROW_LIMIT);
508
+ let total = selectedCounts[COUNT_OFFSET];
509
+ selectedCounts[COUNT_OFFSET] = min(total - min(total, ROW_OFFSET), ROW_LIMIT);
499
510
  }
500
511
  }`;
501
512
  addGPUAnalyticsComputePass(graph, {
@@ -521,7 +532,7 @@ fn main(
521
532
  });
522
533
  }
523
534
 
524
- /** Applies a global rank limit back to one original source-aligned selection-mask chunk. */
535
+ /** Applies a global rank window back to one original source-aligned selection-mask chunk. */
525
536
  function addGPUGlobalTopKSelectionPass(
526
537
  graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
527
538
  id: string,
@@ -529,6 +540,7 @@ function addGPUGlobalTopKSelectionPass(
529
540
  ranks: GraphDataView<'uint32'>;
530
541
  selection: GraphDataView<'uint32'>;
531
542
  globalOffset: number;
543
+ offset: number;
532
544
  limit: number;
533
545
  }
534
546
  ): void {
@@ -536,6 +548,7 @@ function addGPUGlobalTopKSelectionPass(
536
548
  const ELEMENT_COUNT: u32 = ${props.selection.length}u;
537
549
  const RANK_OFFSET: u32 = ${getViewElementOffset(props.ranks) + props.globalOffset}u;
538
550
  const SELECTION_OFFSET: u32 = ${getViewElementOffset(props.selection)}u;
551
+ const ROW_OFFSET: u32 = ${props.offset}u;
539
552
  const ROW_LIMIT: u32 = ${props.limit}u;
540
553
  @group(0) @binding(0) var<storage, read> sourceRanks: array<u32>;
541
554
  @group(0) @binding(1) var<storage, read_write> selectionMask: array<u32>;
@@ -547,8 +560,9 @@ fn main(
547
560
  ) {
548
561
  ${getGPUAnalyticsInvocationIndexSource(graph, props.selection.length)}
549
562
  if (index < ELEMENT_COUNT) {
563
+ let rank = sourceRanks[RANK_OFFSET + index];
550
564
  selectionMask[SELECTION_OFFSET + index] =
551
- select(0u, 1u, sourceRanks[RANK_OFFSET + index] < ROW_LIMIT);
565
+ select(0u, 1u, rank != 0xffffffffu && rank >= ROW_OFFSET && rank - ROW_OFFSET < ROW_LIMIT);
552
566
  }
553
567
  }`;
554
568
  addGPUAnalyticsComputePass(graph, {
@@ -75,7 +75,6 @@ export function compileGPUDataFrameGroupedAggregation<
75
75
  Result,
76
76
  CompiledGPUDataFrameGroupedAggregation<Result>
77
77
  >(source, predicates, selectedColumns, graph, derivedColumns, {
78
- allowEmptyPredicates: true,
79
78
  prepare: context =>
80
79
  addGPUGroupedAggregationToGraph<Selection, Result>(context, key, groupCount, definitions)
81
80
  });
@@ -7,7 +7,7 @@ import type {GPUTypeMap} from '@luma.gl/graph/gpu-tables';
7
7
  import type {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
8
8
  import type {GPUDataFrameDictionary} from './gpu-data-frame';
9
9
  import type {GPUDataFrameQuery} from './gpu-data-frame-query';
10
- import {getGPUExpressionColumnNames} from './gpu-expression';
10
+ import {getGPUExpressionResultFormats} from './gpu-expression';
11
11
  import {
12
12
  compileGPUDataFrameGroupedAggregation,
13
13
  type CompiledGPUDataFrameGroupedAggregation
@@ -249,8 +249,10 @@ function getGPUDataFrameQueryColumnFormats<
249
249
  );
250
250
 
251
251
  for (const definition of query.derivedColumns) {
252
- const firstReference = getGPUExpressionColumnNames(definition.expression)[0];
253
- formats.set(definition.name, definition.format ?? formats.get(firstReference) ?? 'float32');
252
+ const inferred = getGPUExpressionResultFormats(definition.expression.node, formats)
253
+ .values()
254
+ .next().value;
255
+ formats.set(definition.name, definition.format ?? inferred ?? 'float32');
254
256
  }
255
257
 
256
258
  return formats;
@@ -84,7 +84,6 @@ export function compileGPUDataFrameHistogram<
84
84
  GPUHistogramResult,
85
85
  CompiledGPUDataFrameHistogram
86
86
  >(source, predicates, selectedColumns, graph, derivedColumns, {
87
- allowEmptyPredicates: true,
88
87
  prepare: context => addGPUHistogramToGraph(context, column, options)
89
88
  });
90
89
  }
@@ -181,7 +181,6 @@ export function compileGPUDataFrameJoin<
181
181
  Selection,
182
182
  CompiledGPUDataFrameJoin<Selection, Right>
183
183
  >(source, predicates, selectedColumns, graph, derivedColumns, {
184
- allowEmptyPredicates: true,
185
184
  prepare: context => addGPUJoinToGraph(context, retainedRight, options, joinType)
186
185
  });
187
186
  } catch (error) {
@@ -213,7 +212,6 @@ export function compileGPUDataFrameLookup<
213
212
  Selection,
214
213
  CompiledGPUDataFrameLookup<Selection, Right>
215
214
  >(source, predicates, selectedColumns, graph, derivedColumns, {
216
- allowEmptyPredicates: true,
217
215
  prepare: context => addGPULookupToGraph(context, retainedRight, options)
218
216
  });
219
217
  } catch (error) {
@@ -3,6 +3,7 @@
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';
6
7
  import {
7
8
  Buffer,
8
9
  type Binding,
@@ -104,7 +105,6 @@ export type GPUDataFrameQueryCompilationExtension<
104
105
  Result extends GPUTypeMap,
105
106
  Compiled extends CompiledGPUDataFrameQuery<Result> = CompiledGPUDataFrameQuery<Result>
106
107
  > = {
107
- allowEmptyPredicates?: boolean;
108
108
  prepare: (
109
109
  context: GPUDataFrameQueryExtensionContext<Row>
110
110
  ) => GPUDataFrameQueryExtensionResult<Result, Compiled>;
@@ -216,8 +216,7 @@ export function compileGPUDataFrameQuery<
216
216
  retainedSource,
217
217
  predicates,
218
218
  derivedColumns,
219
- selectedColumns,
220
- predicates.length === 0 || extension?.allowEmptyPredicates === true
219
+ selectedColumns
221
220
  );
222
221
  validateGPUQueryBatchCapacity(retainedSource, graph);
223
222
  validateGPUQueryBindingCapacity(plan, graph);
@@ -774,6 +773,7 @@ function addGPUQueryPredicatePass(
774
773
  const source = /* wgsl */ `
775
774
  const ELEMENT_COUNT: u32 = ${props.output.length}u;
776
775
  ${declarations.join('\n')}
776
+ ${props.plan.usesCasts ? GPU_EXPRESSION_CAST_WGSL : ''}
777
777
 
778
778
  @compute @workgroup_size(${LU_QUERY_WORKGROUP_SIZE})
779
779
  fn main(
@@ -96,7 +96,6 @@ export function compileGPUDataFrameSort<Source extends GPUTypeMap, Selection ext
96
96
  Selection,
97
97
  CompiledGPUDataFrameSort<Selection>
98
98
  >(source, predicates, selectedColumns, graph, derivedColumns, {
99
- allowEmptyPredicates: true,
100
99
  prepare: context => addGPUBatchSortToGraph(context, column, options)
101
100
  });
102
101
  }
@@ -38,6 +38,7 @@ export type GPUDataFrameNormalizedSortOptions = Readonly<{
38
38
  nans: 'first' | 'last';
39
39
  algorithm: 'auto' | 'bitonic' | 'radix';
40
40
  limit?: number;
41
+ offset?: number;
41
42
  }>;
42
43
 
43
44
  /**
@@ -66,7 +67,8 @@ export class GPUDataFrameSortQuery<
66
67
  column: Column,
67
68
  options: GPUDataFrameSortOptions = {},
68
69
  limit?: number,
69
- defaultDirection: 'ascending' | 'descending' = 'ascending'
70
+ defaultDirection: 'ascending' | 'descending' = 'ascending',
71
+ offset?: number
70
72
  ) {
71
73
  if (!query.selectedColumns.includes(column)) {
72
74
  throw new Error(`GPUDataFrame sort column "${column}" is not selected`);
@@ -80,7 +82,7 @@ export class GPUDataFrameSortQuery<
80
82
 
81
83
  this.query = query;
82
84
  this.column = column;
83
- this.options = normalizeGPUDataFrameSortOptions(options, limit, defaultDirection);
85
+ this.options = normalizeGPUDataFrameSortOptions(options, limit, defaultDirection, offset);
84
86
  Object.freeze(this);
85
87
  }
86
88
 
@@ -121,7 +123,22 @@ export class GPUDataFrameGlobalSortQuery<
121
123
  override topK(
122
124
  limit: number
123
125
  ): GPUDataFrameGlobalSortQuery<Logical, SelectedColumns, Column, Source> {
124
- return new GPUDataFrameGlobalSortQuery(this.query, this.column, this.options, limit);
126
+ return this.page(this.options.offset ?? 0, limit);
127
+ }
128
+
129
+ /** Selects a page from the globally sorted rows after filtering. */
130
+ page(
131
+ offset: number,
132
+ limit?: number
133
+ ): GPUDataFrameGlobalSortQuery<Logical, SelectedColumns, Column, Source> {
134
+ return new GPUDataFrameGlobalSortQuery(
135
+ this.query,
136
+ this.column,
137
+ this.options,
138
+ limit,
139
+ 'ascending',
140
+ offset
141
+ );
125
142
  }
126
143
 
127
144
  /** Adds one cross-batch GPU permutation and global selected count to a reusable command graph. */
@@ -144,7 +161,8 @@ export class GPUDataFrameGlobalSortQuery<
144
161
  function normalizeGPUDataFrameSortOptions(
145
162
  options: GPUDataFrameSortOptions,
146
163
  limit: number | undefined,
147
- defaultDirection: 'ascending' | 'descending'
164
+ defaultDirection: 'ascending' | 'descending',
165
+ offset?: number
148
166
  ): GPUDataFrameNormalizedSortOptions {
149
167
  if (!options || typeof options !== 'object') {
150
168
  throw new Error('GPUDataFrame sorting options must be an object');
@@ -173,11 +191,19 @@ function normalizeGPUDataFrameSortOptions(
173
191
  throw new Error('GPUDataFrame top-K limits require a nonnegative uint32 count');
174
192
  }
175
193
 
194
+ if (
195
+ offset !== undefined &&
196
+ (!Number.isSafeInteger(offset) || offset < 0 || offset > MAXIMUM_UINT32)
197
+ ) {
198
+ throw new Error('GPUDataFrame page offsets require a nonnegative uint32 count');
199
+ }
200
+
176
201
  return Object.freeze({
177
202
  direction,
178
203
  nulls,
179
204
  nans,
180
205
  algorithm,
181
- ...(limit === undefined ? {} : {limit})
206
+ ...(limit === undefined ? {} : {limit}),
207
+ ...(offset ? {offset} : {})
182
208
  });
183
209
  }
@@ -48,12 +48,25 @@ export type {
48
48
  GPUDataFrameJoinType,
49
49
  GPUDataFrameLookupOptions
50
50
  } from './gpu-join-query';
51
- export {and, column, literal, GPUExpression, not, or, parameter} from './gpu-expression';
51
+ export {
52
+ and,
53
+ caseWhen,
54
+ coalesce,
55
+ column,
56
+ literal,
57
+ GPUExpression,
58
+ not,
59
+ nullIf,
60
+ or,
61
+ parameter,
62
+ scalarFunction
63
+ } from './gpu-expression';
52
64
  export type {
53
65
  GPUExpressionBinaryOperator,
54
66
  GPUExpressionNode,
55
67
  GPUExpressionUnaryOperator,
56
- GPUExpressionValue
68
+ GPUExpressionValue,
69
+ GPUScalarFunction
57
70
  } from './gpu-expression';
58
71
  export {CompiledGPUDataFrameQuery} from './gpu-query-compiler';
59
72
  export type {GPUDataFrameQueryParameters} from './gpu-query-compiler';
@@ -7,6 +7,7 @@ import {validateExpressionAST, type Expression} from '@math.gl/sql/expressions';
7
7
  import {
8
8
  GPUExpression,
9
9
  isBooleanExpressionNode,
10
+ isGPUScalarFunction,
10
11
  makeGPUCastNode,
11
12
  type GPUExpressionNode,
12
13
  type GPUExpressionBinaryOperator,
@@ -43,7 +44,7 @@ export function makeGPUPredicateFromPortableAST(expression: Expression): GPUExpr
43
44
 
44
45
  function convertPortableExpression(expression: Expression): GPUExpressionNode {
45
46
  validateExpressionAST(expression);
46
- return convert(expression);
47
+ return lowerPortableExpression(expression);
47
48
  }
48
49
 
49
50
  const binaryOperators: Readonly<Record<string, GPUExpressionBinaryOperator>> = {
@@ -64,7 +65,13 @@ const binaryOperators: Readonly<Record<string, GPUExpressionBinaryOperator>> = {
64
65
  };
65
66
 
66
67
  /** Lowers one validated portable node and rejects unsupported operations. */
67
- function convert(expression: Expression): GPUExpressionNode {
68
+ export function lowerPortableExpression(
69
+ expression: Expression,
70
+ resolveLeaf?: (expression: Expression) => GPUExpressionNode | undefined
71
+ ): GPUExpressionNode {
72
+ const resolved = resolveLeaf?.(expression);
73
+ if (resolved) return resolved;
74
+ const convert = (child: Expression) => lowerPortableExpression(child, resolveLeaf);
68
75
  // math.gl's public parser type includes nonportable nodes; validation above narrows at runtime.
69
76
  const node = expression as any;
70
77
  switch (node.type) {
@@ -93,8 +100,61 @@ function convert(expression: Expression): GPUExpressionNode {
93
100
  return {kind: 'binary', operator, left: convert(node.left), right: convert(node.right)};
94
101
  break;
95
102
  }
103
+ case 'ConditionalExpression':
104
+ return {
105
+ kind: 'conditional',
106
+ condition: convert(node.test),
107
+ whenTrue: convert(node.consequent),
108
+ otherwise: convert(node.alternate)
109
+ };
96
110
  case 'CallExpression': {
97
111
  const name = node.callee.name;
112
+ const functionName = node.sqlFunction === true ? name.toLowerCase() : name;
113
+ if (functionName === 'coalesce' || functionName === 'nullif') {
114
+ const count = node.arguments.length;
115
+ if (functionName === 'nullif' ? count !== 2 : count < 2 || count > 64) {
116
+ throw new Error(
117
+ 'GPU DataFrame NULLIF requires two arguments and COALESCE requires 2–64 arguments'
118
+ );
119
+ }
120
+ const arguments_: GPUExpressionNode[] = node.arguments.map(convert);
121
+ return arguments_.reduceRight((right, left) => ({
122
+ kind: 'binary',
123
+ operator: functionName,
124
+ left,
125
+ right
126
+ }));
127
+ }
128
+ if (isGPUScalarFunction(functionName)) {
129
+ if (node.arguments.length !== 1) {
130
+ throw new Error(`GPU DataFrame ${name} requires one argument`);
131
+ }
132
+ return {kind: 'unary', operator: functionName, operand: convert(node.arguments[0])};
133
+ }
134
+ if ((name === 'isNull' || name === 'isNotNull') && node.arguments.length === 1) {
135
+ return {
136
+ kind: 'unary',
137
+ operator: name === 'isNull' ? 'is-null' : 'is-valid',
138
+ operand: convert(node.arguments[0])
139
+ };
140
+ }
141
+ if (name === 'in') {
142
+ const [subject, ...arguments_] = node.arguments as Expression[];
143
+ if (arguments_.length === 0 || arguments_.length > 64) {
144
+ throw new Error('GPU dataframe IN requires between 1 and 64 candidates');
145
+ }
146
+ const value = convert(subject);
147
+ const candidates = arguments_.map(convert);
148
+ if (
149
+ value.kind !== 'column' ||
150
+ candidates.some(
151
+ candidate => candidate.kind !== 'literal' && candidate.kind !== 'parameter'
152
+ )
153
+ ) {
154
+ throw new Error('GPU dataframe IN requires a column and literal or parameter candidates');
155
+ }
156
+ return makeMembershipPredicate(value, candidates);
157
+ }
98
158
  if (name === 'array_float32' && [2, 3, 4].includes(node.arguments.length)) {
99
159
  return {
100
160
  kind: 'vector',
@@ -104,10 +164,10 @@ function convert(expression: Expression): GPUExpressionNode {
104
164
  }
105
165
  if (name === 'cast' && node.arguments.length === 2 && node.arguments[1].type === 'Literal') {
106
166
  const target = node.arguments[1].value;
107
- if (target === 'float32' || target === 'int32')
167
+ if (target === 'float32' || target === 'int32' || target === 'uint32')
108
168
  return makeGPUCastNode(
109
169
  convert(node.arguments[0]),
110
- target === 'int32' ? 'sint32' : 'float32'
170
+ target === 'int32' ? 'sint32' : target
111
171
  );
112
172
  }
113
173
  break;
@@ -115,3 +175,20 @@ function convert(expression: Expression): GPUExpressionNode {
115
175
  }
116
176
  throw new Error('Unsupported portable GPU dataframe expression');
117
177
  }
178
+
179
+ /** Balanced OR preserves three-valued comparisons and bounds tree depth. */
180
+ function makeMembershipPredicate(
181
+ value: GPUExpressionNode,
182
+ candidates: readonly GPUExpressionNode[]
183
+ ): GPUExpressionNode {
184
+ if (candidates.length === 1) {
185
+ return {kind: 'binary', operator: 'equal', left: value, right: candidates[0]};
186
+ }
187
+ const middle = Math.floor(candidates.length / 2);
188
+ return {
189
+ kind: 'binary',
190
+ operator: 'or',
191
+ left: makeMembershipPredicate(value, candidates.slice(0, middle)),
192
+ right: makeMembershipPredicate(value, candidates.slice(middle))
193
+ };
194
+ }
@@ -0,0 +1,5 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ export * from './gpu-dggs/benchmarks';
@@ -0,0 +1,5 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ export * from './gpu-graph-algorithms/benchmarks';
@@ -0,0 +1,114 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import {
6
+ GPURigidBodyTerrainStream,
7
+ RigidBodyTerrainLoadQueue,
8
+ type GPURigidBodyTerrainStreamProps,
9
+ type GPURigidBodyTerrainWindow
10
+ } from './rigid-body-terrain-stream';
11
+ import type {GPURigidBodyHeightFieldEdit} from './gpu-rigid-body-world';
12
+ import type {GPURigidBodyTerrainTile} from './rigid-body-terrain-stitch';
13
+
14
+ /** A prepared instance window to publish using template-local indices. */
15
+ type TerrainPublication = {
16
+ /** Ensemble instance that owns the edited colliders. */
17
+ instance: number;
18
+ /** Changes required to replace the committed window. */
19
+ edits: readonly GPURigidBodyHeightFieldEdit[];
20
+ };
21
+
22
+ /** Independent local terrain windows with one provider queue for a fused ensemble. */
23
+ export class GPUPhysicsEnsembleTerrain {
24
+ private readonly streams = new Map<number, GPURigidBodyTerrainStream>();
25
+ private readonly slots: ReadonlySet<number>;
26
+ private readonly loads: RigidBodyTerrainLoadQueue;
27
+
28
+ /** @internal Create with GPUPhysicsEnsemble.createTerrainStreamer(). */
29
+ constructor(
30
+ private readonly props: GPURigidBodyTerrainStreamProps,
31
+ slots: readonly number[],
32
+ private readonly validateInstance: (instance: number) => void,
33
+ private readonly publish: (windows: readonly TerrainPublication[]) => void
34
+ ) {
35
+ this.slots = new Set(slots);
36
+ this.loads = new RigidBodyTerrainLoadQueue(props);
37
+ }
38
+
39
+ /** Stage an instance's complete window using template-local collider indices. */
40
+ async prepare(instance: number, window: GPURigidBodyTerrainWindow): Promise<boolean> {
41
+ this.validateInstance(instance);
42
+ if (window.tiles.some(({collider}) => !this.slots.has(collider)))
43
+ throw new Error('Invalid ensemble terrain slot');
44
+ let stream = this.streams.get(instance);
45
+ if (!stream) {
46
+ stream = new GPURigidBodyTerrainStream(
47
+ {setHeightFieldTiles: edits => this.publish([{instance, edits}])},
48
+ this.props,
49
+ this.loads
50
+ );
51
+ this.streams.set(instance, stream);
52
+ }
53
+ return stream.prepare(window);
54
+ }
55
+
56
+ /** Apply only this instance's staged window between fused graph submissions. */
57
+ apply(instance: number): boolean {
58
+ this.validateInstance(instance);
59
+ return this.streams.get(instance)?.apply() ?? false;
60
+ }
61
+
62
+ /**
63
+ * Publish all ready windows in one transaction. Instances without a ready window are skipped.
64
+ * Use this for a shared-atlas handoff when the last users of an old page move together.
65
+ */
66
+ applyMany(instances: readonly number[]): number {
67
+ const windows: TerrainPublication[] = [];
68
+ const streams: GPURigidBodyTerrainStream[] = [];
69
+ for (const instance of new Set(instances)) {
70
+ this.validateInstance(instance);
71
+ const stream = this.streams.get(instance);
72
+ const edits = stream?.getPreparedEdits();
73
+ if (stream && edits) {
74
+ windows.push({instance, edits});
75
+ streams.push(stream);
76
+ }
77
+ }
78
+ if (windows.some(({edits}) => edits.length)) this.publish(windows);
79
+ for (const stream of streams) stream.commitPreparedWindow();
80
+ return streams.length;
81
+ }
82
+
83
+ /** Get the number of committed tiles in the selected instance. */
84
+ getResidentTileCount(instance: number): number {
85
+ this.validateInstance(instance);
86
+ return this.streams.get(instance)?.residentTileCount ?? 0;
87
+ }
88
+
89
+ /** Read a detached stitched surface from a template-local collider slot. */
90
+ getTile(instance: number, collider: number): GPURigidBodyTerrainTile | null {
91
+ this.validateInstance(instance);
92
+ if (!this.slots.has(collider)) throw new Error('Invalid ensemble terrain slot');
93
+ return this.streams.get(instance)?.getTile(collider) ?? null;
94
+ }
95
+
96
+ /** Drop staged and pending requests for this instance, keeping its committed surfaces. */
97
+ cancel(instance: number): void {
98
+ this.validateInstance(instance);
99
+ this.streams.get(instance)?.cancel();
100
+ }
101
+
102
+ /** Evict every stream-owned tile in this instance between submissions. */
103
+ clear(instance: number): void {
104
+ this.validateInstance(instance);
105
+ this.streams.get(instance)?.clear();
106
+ this.streams.delete(instance);
107
+ }
108
+
109
+ /** @internal Cancel outstanding provider demand when the parent ensemble is destroyed. */
110
+ release(): void {
111
+ for (const stream of this.streams.values()) stream.release();
112
+ this.streams.clear();
113
+ }
114
+ }