@luma.gl/graph 10.0.0-alpha.16 → 10.0.0-alpha.17

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 (52) hide show
  1. package/dist/arrow/arrow-utils/arrow-paths.cjs +1 -1
  2. package/dist/arrow/arrow-utils/arrow-paths.js +1 -1
  3. package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
  4. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -10
  5. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +3 -4
  6. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
  7. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +2 -3
  8. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
  9. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +10 -10
  10. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +2 -2
  11. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
  12. package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
  13. package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
  14. package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
  15. package/dist/arrow/index.cjs.map +2 -2
  16. package/dist/arrow/internal.cjs.map +2 -2
  17. package/dist/gpu-physics/gpu-rigid-body-world.cjs +159 -1
  18. package/dist/gpu-physics/gpu-rigid-body-world.d.ts +21 -0
  19. package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
  20. package/dist/gpu-physics/gpu-rigid-body-world.js +178 -1
  21. package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
  22. package/dist/gpu-physics/index.cjs.map +2 -2
  23. package/dist/gpu-physics/index.d.ts +1 -0
  24. package/dist/gpu-physics/index.d.ts.map +1 -1
  25. package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
  26. package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
  27. package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
  28. package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
  29. package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
  30. package/dist/gpu-project/cpu-geoarrow.d.ts +1 -1
  31. package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -1
  32. package/dist/gpu-project/cpu-geometry-pipelines.cjs +2 -2
  33. package/dist/gpu-project/cpu-geometry-pipelines.d.ts +2 -1
  34. package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -1
  35. package/dist/gpu-project/cpu-geometry-pipelines.js +1 -1
  36. package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -1
  37. package/dist/gpu-project/geoarrow.cjs.map +1 -1
  38. package/dist/gpu-sql/gpu-sql.cjs +4 -0
  39. package/dist/gpu-sql/gpu-sql.js +4 -0
  40. package/dist/gpu-sql/gpu-sql.js.map +1 -1
  41. package/dist/gpu-sql/index.cjs.map +1 -1
  42. package/package.json +8 -8
  43. package/src/arrow/arrow-utils/arrow-paths.ts +1 -1
  44. package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +4 -6
  45. package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +2 -2
  46. package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
  47. package/src/gpu-physics/gpu-rigid-body-world.ts +219 -1
  48. package/src/gpu-physics/index.ts +1 -0
  49. package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
  50. package/src/gpu-project/cpu-geoarrow.ts +1 -1
  51. package/src/gpu-project/cpu-geometry-pipelines.ts +2 -2
  52. package/src/gpu-sql/gpu-sql.ts +2 -0
@@ -76,6 +76,8 @@ import {
76
76
  import {addRigidBodyPosePublication, type GPURigidBodyBounds} from './rigid-body-publication';
77
77
  import {getRigidBodyShader} from './rigid-body-shaders';
78
78
 
79
+ import {VEHICLE_SHADER, type GPURigidBodyVehicle} from './rigid-body-vehicle';
80
+
79
81
  type Vector3 = readonly [number, number, number];
80
82
  import {
81
83
  decodeRigidBodyContactEvents,
@@ -128,6 +130,8 @@ export type GPURigidBodyWorldProps = {
128
130
  /** Up to 64 joints. Parallel solving supports static-anchored distance joints only. */
129
131
  joints?: readonly GPURigidBodyJoint[];
130
132
  gravity?: Vector3;
133
+ /** Optional four-wheel suspension evaluated against static terrain each fixed step. */
134
+ vehicle?: GPURigidBodyVehicle;
131
135
  timeStep?: number;
132
136
  iterations?: number;
133
137
  contactSlop?: number;
@@ -228,6 +232,7 @@ export class GPURigidBodyWorld {
228
232
  private eventRead: Promise<GPURigidBodyContactBatch> | null = null;
229
233
  private queryComputation: BoundKernel | null = null;
230
234
  private queryReduction: BoundKernel | null = null;
235
+ private vehicleBuffer: Buffer | null = null;
231
236
  private querySettings: Buffer | null = null;
232
237
  private querySelection: Buffer | null = null;
233
238
  private queryOutput: Buffer | null = null;
@@ -505,8 +510,35 @@ export class GPURigidBodyWorld {
505
510
  }
506
511
  // Clone together so collider edits preserve geometry identity in captured body definitions.
507
512
  const definitions = structuredClone({colliders, props});
508
- this.colliders = definitions.colliders;
509
513
  this.props = definitions.props;
514
+ this.colliders = definitions.colliders;
515
+ const vehicle = this.props.vehicle;
516
+ if (vehicle) {
517
+ const terrain = this.colliders[vehicle.terrainCollider];
518
+ const chassis = this.props.bodies[vehicle.chassis];
519
+ const ground = terrain && this.props.bodies[terrain.body];
520
+ if (
521
+ !chassis ||
522
+ !ground ||
523
+ vehicle.chassis === terrain.body ||
524
+ (chassis.mode ?? (chassis.mass === 0 ? 'static' : 'dynamic')) !== 'dynamic' ||
525
+ (ground.mode ?? (ground.mass === 0 ? 'static' : 'dynamic')) !== 'static' ||
526
+ vehicle.wheels.length !== 4 ||
527
+ this.props.failurePolicy === 'rollback' ||
528
+ this.props.ensembleBodiesPerInstance ||
529
+ ![vehicle.radius, vehicle.travel, vehicle.springRate, vehicle.wheelInertia].every(
530
+ value => Number.isFinite(value) && value > 0
531
+ ) ||
532
+ ![vehicle.damping, vehicle.grip, vehicle.motorTorque, vehicle.brakeTorque].every(
533
+ value => Number.isFinite(value) && value >= 0
534
+ ) ||
535
+ vehicle.wheels.some(
536
+ wheel => wheel.mount.length !== 3 || !wheel.mount.every(Number.isFinite)
537
+ )
538
+ )
539
+ throw new Error('Invalid vehicle configuration');
540
+ }
541
+
510
542
  if (props.ensembleBodiesPerInstance)
511
543
  this.initialEnsembleBodies = this.props.bodies.slice(0, props.ensembleBodiesPerInstance);
512
544
  }
@@ -541,6 +573,8 @@ export class GPURigidBodyWorld {
541
573
  this.props.ensembleBodiesPerInstance ? this.count / this.props.ensembleBodiesPerInstance : 0
542
574
  )
543
575
  };
576
+ if (this.props.vehicle)
577
+ storage.buffers.push({name: 'vehicle', byteLength: 512, uniform: false});
544
578
  if (this.props.continuous?.mode === 'convex') {
545
579
  storage.buffers = storage.buffers.filter(buffer => buffer.name !== 'continuous-previous');
546
580
  storage.buffers.push({name: 'continuous-dispatch', byteLength: 16, uniform: false});
@@ -1235,6 +1269,120 @@ export class GPURigidBodyWorld {
1235
1269
  parallelMarkSleep: 'Identify islands whose bodies are quiet enough to sleep.',
1236
1270
  parallelSleep: 'Put quiet constraint islands to sleep.'
1237
1271
  };
1272
+ const vehicle = this.props.vehicle;
1273
+ if (vehicle) {
1274
+ const data = new Float32Array(128);
1275
+ data.set(
1276
+ [
1277
+ vehicle.radius,
1278
+ vehicle.travel,
1279
+ vehicle.springRate,
1280
+ vehicle.damping,
1281
+ vehicle.grip,
1282
+ vehicle.motorTorque,
1283
+ vehicle.brakeTorque,
1284
+ vehicle.wheelInertia
1285
+ ],
1286
+ 4
1287
+ );
1288
+ new Uint32Array(data.buffer).set([vehicle.chassis, vehicle.terrainCollider], 12);
1289
+ vehicle.wheels.forEach((wheel, index) => {
1290
+ const offset = 16 + index * 12;
1291
+ data.set(wheel.mount, offset);
1292
+ data.set([Number(Boolean(wheel.steer)), Number(Boolean(wheel.drive))], offset + 4);
1293
+ data[offset + 10] = vehicle.travel;
1294
+ data.set(
1295
+ [
1296
+ 1,
1297
+ 0,
1298
+ 0,
1299
+ 0,
1300
+ 0,
1301
+ 1,
1302
+ 0,
1303
+ 0,
1304
+ 0,
1305
+ 0,
1306
+ 1,
1307
+ 0,
1308
+ wheel.mount[0],
1309
+ wheel.mount[1],
1310
+ wheel.mount[2] - vehicle.travel,
1311
+ 1
1312
+ ],
1313
+ 64 + 16 * index
1314
+ );
1315
+ });
1316
+ this.vehicleBuffer = allocate('vehicle', data);
1317
+ const vehicleBindings = [
1318
+ ...bindings.filter(binding =>
1319
+ [
1320
+ 'settings',
1321
+ 'positions',
1322
+ 'orientations',
1323
+ 'velocities',
1324
+ 'angularVelocities',
1325
+ 'bodies',
1326
+ 'sleepStates'
1327
+ ].includes(binding.name)
1328
+ ),
1329
+ {
1330
+ name: 'vehicle',
1331
+ location: 12,
1332
+ buffer: this.vehicleBuffer,
1333
+ resource: graph.importBuffer(
1334
+ {id: this.id + '-vehicle', byteLength: data.byteLength, usage: Buffer.STORAGE},
1335
+ this.vehicleBuffer
1336
+ )
1337
+ }
1338
+ ];
1339
+ const properties: BoundKernelProps = {
1340
+ id: this.id + '-suspension',
1341
+ source: source + RIGID_BODY_QUERY_GEOMETRY_SHADER + VEHICLE_SHADER,
1342
+ entryPoint: 'advanceVehicle',
1343
+ shaderLayout: {
1344
+ bindings: vehicleBindings.map(
1345
+ ({name, location}): BindingDeclaration =>
1346
+ name === 'settings'
1347
+ ? {name, location, group: 0, type: 'uniform'}
1348
+ : {
1349
+ name,
1350
+ location,
1351
+ group: 0,
1352
+ type: name === 'bodies' ? 'read-only-storage' : 'storage'
1353
+ }
1354
+ )
1355
+ }
1356
+ };
1357
+ const executable = (
1358
+ computation: BoundKernel
1359
+ ): GPUCommandGraphComputeExecutable<Parameters> => ({
1360
+ encode: ({computePass, getBuffer}) => {
1361
+ Object.assign(
1362
+ computation.bindings,
1363
+ Object.fromEntries(
1364
+ vehicleBindings.map(binding => [binding.name, getBuffer(binding.resource)])
1365
+ )
1366
+ );
1367
+ computation.kernel.dispatch(computePass, {bindings: computation.bindings, x: 1});
1368
+ },
1369
+ destroy: () => computation.kernel.destroy()
1370
+ });
1371
+ graph.addComputePass({
1372
+ id: properties.id!,
1373
+ resources: vehicleBindings.map(binding => ({
1374
+ buffer: binding.resource,
1375
+ usage:
1376
+ binding.name === 'settings'
1377
+ ? 'uniform'
1378
+ : binding.name === 'bodies'
1379
+ ? 'storage-read'
1380
+ : 'storage-read-write'
1381
+ })),
1382
+ compile: () => executable(createBoundKernel(graph.device, properties)),
1383
+ compileAsync: async () => executable(await createBoundKernelAsync(graph.device, properties))
1384
+ });
1385
+ }
1238
1386
  for (const entryPoint of [
1239
1387
  ...(this.ensembleBuffer
1240
1388
  ? ['ensembleClear', 'ensembleMark', 'ensembleCompact', 'ensembleDispatch']
@@ -1988,6 +2136,76 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1988
2136
  : undefined;
1989
2137
  }
1990
2138
 
2139
+ /** Set signed throttle, steering angle in radians and brake fraction for upcoming substeps. */
2140
+ setVehicleControls(throttle: number, steering: number, brake: number): void {
2141
+ if (
2142
+ !this.vehicleBuffer ||
2143
+ this.destroyed ||
2144
+ ![throttle, steering, brake].every(Number.isFinite)
2145
+ )
2146
+ throw new Error('Invalid vehicle controls');
2147
+ this.vehicleBuffer.write(
2148
+ new Float32Array([
2149
+ Math.max(-1, Math.min(1, throttle)),
2150
+ steering,
2151
+ Math.max(0, Math.min(1, brake)),
2152
+ 0
2153
+ ])
2154
+ );
2155
+ }
2156
+
2157
+ /** Borrow four column-major wheel transforms relative to the chassis node, ordered by mount. */
2158
+ get vehicleWheelPoses() {
2159
+ return this.vehicleBuffer && !this.destroyed
2160
+ ? {buffer: this.vehicleBuffer, byteOffset: 256, byteLength: 256}
2161
+ : null;
2162
+ }
2163
+
2164
+ /** Transfer wheel motion between rebuilt worlds for wheels with matching chassis-local mounts. */
2165
+ copyVehicleMotionFrom(previous: GPURigidBodyWorld): void {
2166
+ const sourceBuffer = previous.vehicleBuffer;
2167
+ const destinationBuffer = this.vehicleBuffer;
2168
+ const previousVehicle = previous.props.vehicle;
2169
+ if (!this.device || !sourceBuffer || !destinationBuffer || !previousVehicle) return;
2170
+ const encoder = this.device.createCommandEncoder();
2171
+ this.props.vehicle?.wheels.forEach((wheel, index) => {
2172
+ const sourceIndex = previousVehicle.wheels.findIndex(source =>
2173
+ source.mount.every((coordinate, axis) => coordinate === wheel.mount[axis])
2174
+ );
2175
+ if (sourceIndex < 0) return;
2176
+ encoder.copyBufferToBuffer({
2177
+ sourceBuffer,
2178
+ destinationBuffer,
2179
+ sourceOffset: 96 + sourceIndex * 48,
2180
+ destinationOffset: 96 + index * 48,
2181
+ size: 16
2182
+ });
2183
+ encoder.copyBufferToBuffer({
2184
+ sourceBuffer,
2185
+ destinationBuffer,
2186
+ sourceOffset: 256 + sourceIndex * 64,
2187
+ destinationOffset: 256 + index * 64,
2188
+ size: 64
2189
+ });
2190
+ });
2191
+ this.device.submit(encoder.finish());
2192
+ }
2193
+
2194
+ /** Read wheel spin, angle, suspension length and normal load after submitted steps. */
2195
+ async readVehicleWheels() {
2196
+ if (!this.vehicleBuffer || this.destroyed) throw new Error('Vehicle unavailable');
2197
+ const values = new Float32Array((await this.vehicleBuffer.readAsync(0, 256)).buffer);
2198
+ return Array.from({length: 4}, (_, index) => {
2199
+ const offset = 24 + index * 12;
2200
+ return {
2201
+ speed: values[offset],
2202
+ angle: values[offset + 1],
2203
+ length: values[offset + 2],
2204
+ load: values[offset + 3]
2205
+ };
2206
+ });
2207
+ }
2208
+
1991
2209
  /** Submit an impulse at a world-space point, or the current GPU center of mass when omitted. */
1992
2210
  applyImpulse(body: number, impulse: Vector3, point?: Vector3): void {
1993
2211
  if (
@@ -116,3 +116,4 @@ export type {GPURigidBodyJointLimit, GPURigidBodyJointDrive} from './joint-types
116
116
 
117
117
  export {rotateRigidBodyVector, normalizeRigidBodyRotation} from './rigid-body-properties';
118
118
  export type {GPURigidBodyGeneralConstraint} from './rigid-body-general-joints';
119
+ export type {GPURigidBodyVehicle} from './rigid-body-vehicle';
@@ -0,0 +1,99 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ /** Four independently sprung wheels in a chassis frame with +X forward and +Z up. */
6
+ export type GPURigidBodyVehicle = {
7
+ /** Index of the dynamic chassis body. */
8
+ chassis: number;
9
+ /** Index of the static collider sampled by all wheels. */
10
+ terrainCollider: number;
11
+ /** Four independently suspended wheels, in rendering and telemetry order. */
12
+ wheels: readonly {
13
+ /** At full compression the wheel center is here, in chassis node coordinates (meters). */
14
+ mount: readonly [number, number, number];
15
+ /** Turn this wheel about chassis +Z by the commanded steering angle. */
16
+ steer?: boolean;
17
+ /** Apply the commanded drive torque to this wheel. */
18
+ drive?: boolean;
19
+ }[];
20
+ /** Wheel contact sphere radius in meters. */
21
+ radius: number;
22
+ /** Maximum downward distance of the wheel center from its mount in meters. */
23
+ travel: number;
24
+ /** Per-wheel spring stiffness in newtons per meter. */
25
+ springRate: number;
26
+ /** Per-wheel damping coefficient in newton seconds per meter. */
27
+ damping: number;
28
+ /** Dimensionless tire friction coefficient limiting combined longitudinal and lateral force. */
29
+ grip: number;
30
+ /** Torque per driven wheel in N m. */
31
+ motorTorque: number;
32
+ /** Maximum braking torque per wheel in newton meters. */
33
+ brakeTorque: number;
34
+ /** Rotational inertia of one wheel in kilogram meters squared. */
35
+ wheelInertia: number;
36
+ };
37
+
38
+ /** One invocation owns the chassis. All wheels sample the same pre-step velocity. */
39
+ export const VEHICLE_SHADER = /* wgsl */ `
40
+ struct Wheel { mount:vec4f, flags:vec4f, state:vec4f }
41
+ struct Vehicle { controls:vec4f, geometry:vec4f, tire:vec4f, indices:vec4u, wheels:array<Wheel,4>, poses:array<mat4x4f,4> }
42
+ @group(0) @binding(12) var<storage,read_write> vehicle:Vehicle;
43
+ @compute @workgroup_size(1) fn advanceVehicle() {
44
+ let chassis=vehicle.indices.x;
45
+ let terrain=vehicle.indices.y;
46
+ let rotation=orientations[chassis];
47
+ let center=positions[chassis].xyz;
48
+ let down=rotate(rotation,vec3f(0,0,-1));
49
+ let radius=vehicle.geometry.x;
50
+ let travel=vehicle.geometry.y;
51
+ let timestep=settings.gravity.w;
52
+ var impulse=vec3f(0);
53
+ var torque=vec3f(0);
54
+ for(var index=0u;index<4u;index++){
55
+ let wheel=vehicle.wheels[index];
56
+ let mount=center+rotate(rotation,wheel.mount.xyz-bodyCenter(chassis));
57
+ let hit=sweepSphere(terrain,colliderLocal(terrain,mount-colliderPosition(terrain)),colliderLocal(terrain,down),travel,radius,false);
58
+ var speed=wheel.state.x+vehicle.controls.x*vehicle.tire.y*wheel.flags.y*timestep/vehicle.tire.w;
59
+ speed-=sign(speed)*min(abs(speed),vehicle.controls.z*vehicle.tire.z*timestep/vehicle.tire.w);
60
+ let steering=vehicle.controls.y*wheel.flags.x;
61
+ var lengthNow=travel;
62
+ var load=0.0;
63
+ if(hit.hit!=0u && hit.complete!=0u){
64
+ let normal=rotate(colliderRotation(terrain),hit.normal);
65
+ let support=dot(normal,-down);
66
+ if(support>0.15){
67
+ lengthNow=hit.distance;
68
+ let lever=colliderPosition(terrain)+rotate(colliderRotation(terrain),hit.point)-center;
69
+ let velocity=velocities[chassis].xyz+cross(angularVelocities[chassis].xyz,lever);
70
+ load=max(0.0,(travel-lengthNow)*vehicle.geometry.z-vehicle.geometry.w*dot(velocity,normal)/support);
71
+ let heading=rotate(rotation,vec3f(cos(steering),sin(steering),0));
72
+ let side=normalize(cross(normal,heading));
73
+ let forward=cross(side,normal);
74
+ let slip=vec2f(speed*radius-dot(velocity,forward),-dot(velocity,side));
75
+ let demand=slip*load*vec2f(1.1,1.5);
76
+ var friction=demand*min(1.0,vehicle.tire.x*load/max(length(demand),0.0001));
77
+ // Bound tire feedback so a light wheel cannot overshoot rolling speed in one step.
78
+ let longitudinalLimit=abs(slip.x)*vehicle.tire.w/(radius*radius*timestep);
79
+ friction.x=clamp(friction.x,-longitudinalLimit,longitudinalLimit);
80
+ let change=(normal*load+forward*friction.x+side*friction.y)*timestep;
81
+ impulse+=change;
82
+ torque+=cross(lever,change);
83
+ speed-=friction.x*radius*timestep/vehicle.tire.w;
84
+ }
85
+ }
86
+ let angle=wheel.state.y+speed*timestep;
87
+ vehicle.wheels[index].state=vec4f(speed,angle,lengthNow,load);
88
+ let heading=vec3f(cos(steering),sin(steering),0);
89
+ let axle=vec3f(-sin(steering),cos(steering),0);
90
+ let vertical=vec3f(0,0,1);
91
+ let hub=wheel.mount.xyz-vertical*lengthNow;
92
+ vehicle.poses[index]=mat4x4f(vec4f(heading*cos(angle)-vertical*sin(angle),0),
93
+ vec4f(axle,0),vec4f(heading*sin(angle)+vertical*cos(angle),0),vec4f(hub,1));
94
+ }
95
+ velocities[chassis]=vec4f(velocities[chassis].xyz+impulse*velocities[chassis].w,velocities[chassis].w);
96
+ angularVelocities[chassis]=vec4f(angularVelocities[chassis].xyz+inverseInertia(chassis,torque),0);
97
+ sleepStates[chassis]=vec4f(0);
98
+ }
99
+ `;
@@ -10,7 +10,7 @@ import type {
10
10
  GeoArrowDimension,
11
11
  GeoArrowArray,
12
12
  GeoArrowFixedSizeList
13
- } from '@math.gl/arrow/geoarrow-utils';
13
+ } from '@math.gl/core/arrow';
14
14
 
15
15
  /** Borrow CPU coordinate chunks as native GeoArrow points or single-level coordinate lists. */
16
16
  export function makeGeoArrowColumnFromCPUVector(
@@ -6,11 +6,11 @@
6
6
  import {assert} from '@luma.gl/core';
7
7
  import {CPUData, CPUVector, getGPUVectorFormatInfo} from '@luma.gl/graph/gpu-data';
8
8
  import type {Projection} from '@math.gl/geospatial/projection/types';
9
+ import type {GeoArrowColumn} from '@math.gl/core/arrow';
9
10
  import {
10
11
  tessellateGeoArrowPolygons,
11
- type GeoArrowColumn,
12
12
  type TessellateGeoArrowPolygonsOptions
13
- } from '@math.gl/arrow/geoarrow-utils';
13
+ } from '@math.gl/geometry/arrow';
14
14
  import {makeGeoArrowColumnFromCPUVector, makeCPUVectorFromGeoArrowColumn} from './cpu-geoarrow';
15
15
 
16
16
  /** Project Float32 coordinates while retaining single-level row topology and null rows. */
@@ -366,6 +366,8 @@ function parseGPUSQLStatement(
366
366
  const join = statement.joins[0];
367
367
  let loweredJoin: GPUSQLStatement['join'];
368
368
  if (join) {
369
+ if (join.unnest) throw new Error('GPUSQL does not support JOIN UNNEST');
370
+ if (join.type === 'cross') throw new Error('GPUSQL does not support CROSS JOIN');
369
371
  if (join.on.type !== 'BinaryExpression' || join.on.operator !== '==') {
370
372
  throw new Error('GPUSQL JOIN requires equality between two columns');
371
373
  }