• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 28177788537

25 Jun 2026 02:33PM UTC coverage: 70.237% (-0.2%) from 70.408%
28177788537

Pull #2693

github

web-flow
Merge 7a40eab51 into b23218729
Pull Request #2693: [codex] clean up GPU table inputs and constructors

9607 of 15509 branches covered (61.94%)

Branch coverage included in aggregate %.

81 of 157 new or added lines in 9 files covered. (51.59%)

9 existing lines in 2 files now uncovered.

19235 of 25555 relevant lines covered (75.27%)

4233.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.21
/modules/tables/src/engine/gpu-input-schema.ts
1
// luma.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
import type {GPUVector} from '../table/gpu-vector';
6
import type {GPUVectorFormat} from '../table/gpu-vector-format';
7

8
/** Semantic role consumed by one GPU input. */
9
export type GPUInputKind = 'positions' | 'colors' | 'scalars' | 'text' | 'time';
10

11
/** Runtime declaration for one prepared GPUVector consumed by a model or renderer. */
12
export type GPUInputDeclaration<
13
  ColumnName extends string = string,
14
  Format extends GPUVectorFormat = GPUVectorFormat
15
> = {
16
  /** Prepared GPUTable column and GPUVector map key. */
17
  columnName: ColumnName;
18
  /** Optional shader attribute supplied by this column. */
19
  attributeName?: string;
20
  /** Optional shader storage binding supplied by this column. */
21
  bindingName?: string;
22
  /** Semantic role consumed by the model or renderer. */
23
  kind: GPUInputKind;
24
  /** Whether callers must provide this prepared GPU input. */
25
  required: boolean;
26
  /** Accepted canonical GPUVector memory formats. */
27
  formats: readonly Format[];
28
  /**
29
   * Whether this input is generated during conversion or model preparation.
30
   * Omit for inputs that source mapping may resolve directly.
31
   */
32
  internal?: boolean;
33
};
34

35
/** Runtime prepared GPU input contract declared by one model or renderer. */
36
export type GPUInputSchema = readonly GPUInputDeclaration[];
37

38
/** Prepared GPU vectors keyed by declared GPU input column name. */
39
export type GPUInputVectors = Record<string, GPUVector | undefined>;
40

41
/** Validates prepared GPU vectors against one runtime GPU input schema. */
42
export function validateGPUInputVectors(
43
  ownerName: string,
44
  schema: GPUInputSchema,
45
  vectors: GPUInputVectors
46
): void {
47
  for (const input of schema) {
67✔
48
    const vector = vectors[input.columnName];
438✔
49
    if (!vector) {
438✔
50
      if (input.required) {
277!
NEW
51
        throw new Error(`${ownerName} requires GPU input "${input.columnName}"`);
×
52
      }
53
      continue;
277✔
54
    }
55

56
    const format = vector.format;
161✔
57
    if (!format || !(input.formats as readonly GPUVectorFormat[]).includes(format)) {
161✔
58
      throw new Error(
3✔
59
        `${ownerName} ${input.columnName} GPUVector.format "${format ?? 'undefined'}" must be one of ${input.formats.join(', ')}`
3!
60
      );
61
    }
62
  }
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc