Introducing a new way to review your PRs.

Read the announcement

visgl / luma.gl

High-performance Toolkit for WebGL-based Data Visualization

View on GitHub

30 documents · Updated Nov 20, 2026

docs / gpu-graph-workflows

GPU graph and analytical workflows

The graph package provides a WebGPU command-graph runtime for combining GPU work with graph analysis and analytical workflows. It keeps source data, intermediate state, and results on the GPU when possible. It can also run supported numeric stages through CPU callbacks when a workflow needs them. See GPU graph systems for the wider system map. Related pages cover GPU Simple Graph, GPU geospatial workflows, GPU physics, GPU Project, experimental GPU workflows, and GPU data tables.

Command graph runtime

Semantic graph programs

modules/…/gpu-graph.ts defines a backend-independent program made of named scalar, vector, and texture values plus ordered operations. The program describes data flow without binding it to device storage or command submission. Inputs are supplied by the caller, state vectors can persist across runs, and result values can be shaped from their inputs.

Each operation declares its logical reads, writes, and output shape through an operation contract. This lets the program planner check value order and shape rules before a backend lowers the operation to device work. Composite operations group semantic work for inspection and control flow without becoming a separate command graph.

References: modules/…/gpu-graph.ts• L36-157 modules/…/gpu-operation.ts• L30-53 modules/…/gpu-expression-plan.ts• L82-165

Command graph execution

The command graph is a declarative schedule for GPU work. A workflow names its resources and work nodes. The runtime derives their order and compiles an execution plan that can serve interactive frames, batch work, or staged processing.

The runtime supports three node kinds:

Node kindRole
ComputeRuns analysis or updates GPU state.
RenderProduces visual output from graph resources.
CopyMoves data or records pass-independent commands.

Nodes can declare dependencies, conditions, workload bounds, and publication points. CPU conditions can skip a node before encoding. GPU conditions can suppress one compute dispatch through an indirect command written by earlier GPU work. A publication point marks a coherent partial or complete result for progressive execution. The graph also records preflight information about resources, kernels, and work limits before submission.

Compilation creates reusable node executables and plans graph-owned transient storage. Synchronous compilation remains available, while asynchronous compilation starts independent pipeline work together before it waits. The compiled graph retains resource and workload statistics for inspection and for later bounded scheduling.

Reusable render operations contribute render nodes to their containing graph. A shader-pass operation provides a graph-aware fullscreen draw that samples declared 2D color textures and writes a color texture. Both forms preserve the graph's resource and dependency rules rather than submitting work themselves.

References: modules/…/gpu-command-graph.ts• L144-240 modules/…/gpu-command-graph.ts• L917-1039 modules/…/gpu-command-graph-types.ts• L517-716 modules/…/gpu-command-graph-compiler.ts• L120-275 modules/…/gpu-render-operation.ts• L8-40 modules/…/gpu-shader-pass-operation.ts• L10-101

Compiled graph invocations

CompiledGPUGraph turns a validated graph program into a reusable invocation service. A normal run binds inputs, creates and submits device commands, and returns caller-owned output vectors or textures. prepare separates binding from encoding so a caller can append one GPU-only execution to its own encoder.

When a program includes a CPU-backed operation, requests a CPU output, or supplies CPU vector input, the runtime runs ordered stages asynchronously. It reads required GPU values to the CPU, calls the operation, and uploads its result for later GPU stages. This bridge supports numeric values without textures or persistent state. Shape and chunk rules remain part of the graph contract.

The prepared invocation is single-use. It appends commands but never finishes or submits the caller's encoder. The caller releases the invocation after submission or after abandoning the work.

References: modules/…/compiled-gpu-graph.ts• L31-91 modules/…/compiled-gpu-graph.ts• L93-151 modules/…/compiled-gpu-graph.ts• L260-302 modules/…/gpu-cpu-execution.ts• L21-39 modules/…/gpu-cpu-execution.ts• L96-255

Operation contracts

An operation contract states which named values an operation reads, writes, or creates. Shape rules connect output capacity to an input or to a known result, so the planner can resolve storage before execution. This contract is the link between a domain operation and the scheduler's dependency model.

The core operations include numeric expressions, vector transfers, stable selection, reductions, grouped statistics, and render work. Expressions use the math.gl SQL expression parser and provide a typed numeric language for scalar and one-to-four-component vector values. They support arithmetic, component selection, vector construction, selected math functions, comparisons, conditional selection, and explicit casts among 32-bit float, signed integer, and unsigned integer formats. Float-to-integer casts truncate by default or round ties away from zero when the operation requests nearest rounding. Expressions cannot read textures, and arithmetic requires explicit float32 casts for integer inputs.

Reductions produce scalar summaries, while grouped statistics produce dense results for unsigned group keys. Shader passes connect sampled textures and scalar parameters to a color attachment. Upload and copy operations move data while preserving declared formats and chunk layout. Compaction writes selected rows to input-sized storage and publishes a separate logical count for consumers. CPU-backed operations add read-only numeric inputs and declared vector outputs to the same dependency model.

References: modules/…/gpu-operation.ts• L30-53 modules/…/gpu-semantic-aggregation-operation.ts• L14-149 modules/…/gpu-expression-operation.ts• L11-67 modules/…/gpu-expression-operation.ts• L107-116 modules/…/gpu-expression-operation.ts• L119-327 modules/…/gpu-expression-cast.ts• L10-44 modules/…/gpu-shader-pass-operation.ts• L25-101 modules/…/gpu-render-operation.ts• L14-40 modules/…/gpu-transfer-operation.ts• L23-109 modules/…/gpu-compaction-operation.ts• L10-47 modules/…/gpu-cpu-operation.ts• L9-64

Resource scheduling

Resource declarations connect each operation to the scheduler. Read and write access tells the compiler which work must wait, while graph-owned temporary resources can be reused after their last use. Imported resources remain under application ownership. This model lets many operations share one plan while keeping data hazards visible.

Buffer hazards are tracked conservatively at the logical-buffer level. Texture hazards account for overlapping mip levels, array layers, and depth or stencil aspects. The compiler rejects writable storage bindings that overlap at the binding range, even when two typed views describe different logical rows. It then creates a stable topological order and reuses compatible transient allocations whose lifetimes do not overlap.

The runtime can split a compiled plan into bounded steps. Each step contains dependency-ordered work that fits the caller's node, command, byte, or work budget. The application encodes and submits each step when its scheduler permits more work. Publication points identify results that are safe to use before the full plan finishes. A node remains atomic when one operation is larger than the requested budget, so the plan can still make progress.

References: modules/…/gpu-command-graph-types.ts• L31-60 modules/…/gpu-command-graph-compiler.ts• L547-755 modules/…/gpu-command-graph-compiler.ts• L818-1008 modules/…/gpu-command-graph.ts• L334-476

GPU-resident graph data

Graph source data

The graph model is a view over caller-owned GPU columns. Source and target vertex columns describe edges, while optional weights, stable edge IDs, and vertex or edge properties stay aligned with that data. The model supports directed and undirected relationships as well as isolated vertices.

This design keeps original edge data available for source-aware results and later domain work. Derived topology supports repeated neighborhood operations without replacing the original columns.

References: modules/…/gpu-graph.ts• L13-140

Compressed graph topology

The topology stage converts source edges into GPU-resident compressed adjacency. It provides offsets and neighbor IDs, with optional weights and stable edge IDs, for later graph operations. Forward adjacency supports outgoing work. Reverse adjacency supports incoming or bidirectional work on directed graphs.

Topology capacity and endpoint validity are part of the workflow contract. The stage reports invalid endpoints and overflow instead of presenting a partial topology as complete. Dependent operations can then stop or publish a safe result.

References: modules/…/gpu-graph-topology.ts• L16-105 modules/…/gpu-graph-topology.ts• L107-207

GPU data views

GPU data views connect existing vectors and buffers to scheduled nodes without taking ownership of their storage. A view identifies a typed range, while a vector view preserves the ordered chunks of a fixed-width vector. The command graph tracks the physical resource even when an operation uses only part of it.

Imported buffers and textures remain owned by the application. Transient buffers and textures belong to the compiled plan and can share storage when their lifetimes do not overlap. Frame-scoped textures and external images are borrowed for the encoding that supplies them. This lets one workflow combine persistent application data with temporary working space and per-frame inputs.

Texture bindings also carry the selected mip levels, array layers, dimensions, and usage needed for one execution. Produced textures can derive their size from another texture, while writable values use a conservative no-alias rule. Texture copies preserve data across matching mip and layer ranges; they do not sample or convert formats.

References: modules/…/gpu-command-graph-types.ts• L62-143 modules/…/gpu-command-graph-types.ts• L145-452 modules/…/gpu-command-graph.ts• L697-915 modules/…/gpu-command-graph.ts• L1316-1393

Data transfer and compaction

Transfer operations connect host data and existing GPU values to the same scheduled workflow. Uploads snapshot their input data when the operation is created. Copies preserve vector format, row layout, and chunk boundaries, which allows large values to remain split across storage limits without an implicit repartition step.

Compaction turns a per-row selection mask into a dense prefix of selected values. The output keeps input-sized capacity, while a GPU scalar reports how many rows are valid. Downstream work must use that count rather than treat the full output capacity as live data.

References: modules/…/gpu-transfer-operation.ts• L11-69 modules/…/gpu-transfer-operation.ts• L71-109 modules/…/gpu-transfer-lowering.ts• L10-101 modules/…/gpu-compaction-operation.ts• L20-47

Graph analytical operations

Graph traversal and structure

Graph operations add analysis nodes to a caller-owned command graph. They read shared topology and write caller-owned result vectors, so one topology can support several analyses in the same workflow. The public set covers traversal, components, communities, local structure, ranking, and partition quality.

Analysis groupWorkflow question
TraversalWhich vertices are reachable, and what hop count or route cost separates them?
Components and communitiesWhich vertices form connected regions or likely groups?
Local and global structureHow dense is a neighborhood, how durable is a vertex's core, or how important is a vertex?
Partition qualityHow well do labels match relationship weight, and can local moves improve them?

These operations are bounded GPU work. A fixed iteration limit does not always prove a complete answer, so operations expose limits, status values, or convergence results when those values affect result quality.

References: modules/…/index.ts• L13-50 modules/…/README.md• L23-54

Scalar and grouped aggregation

Aggregation operations turn GPU-resident rows into summaries that later graph or analytical stages can consume. A scalar reduction produces a sum, minimum, maximum, or minimum-and-maximum extent. Grouped aggregation produces one count or floating-point statistic for each dense unsigned group key.

Both forms accept an optional GPU selection mask. The mask stays aligned with the logical input rows even when the physical data uses different chunks. Grouped results use a caller-sized dense output, while reductions use one output row except for an extent, which uses two. The graph owns temporary work space and schedules the passes with the surrounding workflow.

Empty groups and masked-out rows have defined summary results. Floating-point grouped statistics ignore non-finite contributions, and an empty minimum, maximum, or mean is represented as NaN. An empty reduction writes the zero value for its format. Callers must therefore treat the result shape and empty-result rules as part of the analytical contract.

References: modules/…/gpu-semantic-aggregation-operation.ts• L14-149 modules/…/gpu-group-aggregation.ts• L42-160 modules/…/gpu-group-aggregation.ts• L162-253 modules/…/gpu-reduction.ts• L42-156 modules/…/gpu-reduction.ts• L167-259

Prefix and segmented operations

Prefix operations turn row values into cumulative values or group summaries. GPUScan supports exclusive and inclusive prefix sums over one or more ordered chunks. Optional flags restart the sum at selected rows without treating a physical chunk boundary as a logical segment boundary.

Segmented scans and reductions use CSR-style offsets to process each segment independently. They provide the core building blocks for adjacency ranges, grouped rows, and other variable-length records while keeping input, offsets, and outputs in GPU storage. Arithmetic and empty-segment behavior are part of each operation's result contract.

References: modules/…/gpu-scan.ts• L24-129 modules/…/gpu-scan.ts• L131-165 modules/…/gpu-segmented-scan.ts• L18-130 modules/…/gpu-segmented-reduction.ts• L21-129

Spatial indexing and grid analysis

Grid operations map finite positions into bounded two- or three-dimensional cells. The shared coordinate rule includes the maximum boundary in the final cell and handles large signed ranges without unsafe intermediate subtraction. This gives binning, aggregation, indexing, and query operations one spatial contract.

Grid binning writes row-major cell counts. Weighted grid aggregation writes a sum, minimum, maximum, or mean for each cell. GPUGridIndex builds cell offsets and object IDs for candidate lookup, while GPUGridIndexQuery collects candidates for point, bounds, or radius requests. Queries are coarse: exact geometry checks remain a later stage, and candidate order is not defined.

The index and query path publishes count and overflow values because output capacity can be smaller than the candidate set. Invalid or out-of-range positions do not contribute to bins or indexes. These rules make grid structures useful as broad-phase filters for spatial workflows and as GPU-resident inputs to later analysis.

References: modules/…/gpu-grid-coordinate.ts• L5-24 modules/…/gpu-grid-binning.ts• L32-60 modules/…/gpu-grid-aggregation.ts• L28-63 modules/…/gpu-grid-index-internals.ts• L26-217 modules/…/gpu-grid-index-query.ts• L25-65

Ranking and route analysis

Route and rank operations produce results aligned with vertices. Breadth-first search finds shortest unweighted paths from selected seeds. Weighted single-source shortest paths use nonnegative edge weights when route cost matters. PageRank scores vertices from incoming relationships and redistributes rank from vertices with no outgoing links.

The direction of the analysis selects the needed topology. Incoming or bidirectional work on a directed graph needs reverse adjacency, so a workflow may retain forward and reverse views beside the original edge columns.

References: modules/…/gpu-graph-breadth-first-search.ts• L20-133 modules/…/gpu-graph-page-rank.ts• L18-93

Graph layout

Force layout turns graph structure into positions for visual output. It updates positions and velocities over repeated bounded steps, supports pinned vertices, and preserves state between encodes so an interactive view can settle over time.

The spatial variant approximates far-away forces with a uniform grid and keeps nearby interactions exact. It is suited to visual exploration of larger views rather than exact all-pairs analysis.

References: modules/…/gpu-graph-force-layout.ts• L17-157 modules/…/gpu-graph-spatial-force-layout.ts• L1-80

Domain workflow building blocks

Tabular and vector workflows

GPU tables and data frames provide the row-and-column path for analytical data. Tables preserve schemas, record batches, and columns for computation or rendering. Data frames add expressions, filters, derived columns, grouping, aggregation, sorting, joins, lookups, and histograms. Vector search adds embedding import, similarity search, clustering, and an inverted-file index.

These workflows use the same command-graph and GPU-data foundation as graph analysis. A workflow can keep source columns resident, add several operations, and publish only the results needed by a later stage or the user interface. See GPU data tables for the table-focused view.

References: modules/…/index.ts• L5-94 modules/…/index.ts• L6-65 modules/…/index.ts• L6-26

Trace and time-series workflows

Trace and time-series workflows organize event data for visual exploration and summary analysis. Trace work covers scene data, interaction, picking, time buckets, temporal and lane indexes, aggregation, critical paths, anomaly scores, and comparisons. Time-series work provides GPU-resident series and envelope views for reduced-range display.

These workflows can connect to graph analysis when events have links such as parent spans, service calls, or dependency edges. The graph runtime supplies shared execution order, while the trace or time-series layer gives the result its domain meaning.

References: modules/…/index.ts• L5-149 modules/…/index.ts• L5-8

Geospatial and raster workflows

Projection, raster, and related spatial workflows turn geographic data into GPU-ready coordinates, tiles, bands, and measurements. Projection work plans coordinate transforms for tables. Raster work supports tile sources, cache and halo stages, band math, statistics, histograms, thresholds, edges, morphology, contours, vegetation indexes, and connected components.

The graph runtime supplies common execution and resource rules for these operations. See GPU geospatial workflows for the spatial system in more detail. The projection entry points are also summarized in GPU Project.

References: modules/…/index.ts• L6-86 modules/…/index.ts• L5-222

Physics and simulation workflows

Physics and simulation workflows keep state updates and result publication on the GPU. Physics exposes sphere and rigid-body worlds with queries, events, triggers, joints, diagnostics, recovery, and scene-graph support. Simulation provides volumetric fire and spectral ocean workflows.

These are stateful domain workflows rather than graph analysis algorithms. See GPU physics for the world model and experimental GPU workflows for the wider set of GPU experiments.

References: modules/…/index.ts• L5-103 modules/…/index.ts• L5-31

Workflow composition

Graph lifecycle

The workflow moves from resident source data to scheduled operations and then to GPU results or render output. The application decides when to encode, submit, read back, or pass results into another graph.

This diagram shows how a semantic program becomes scheduled work and then becomes a result or visual output.

flowchart LR
  A[GPU-resident source data] --> B[Declare graph values and resources]
  B --> C[Add analytical or render operations]
  C --> D[Validate contracts and compile dependencies]
  D --> E[Plan full or bounded execution]
  E --> F[Encode into caller-owned command encoder]
  F --> G[Submit on application queue]
  G --> H[GPU-resident results or render output]
  H --> I[Optional readback or next graph stage]

An operation contributes semantic contracts or concrete nodes. It does not submit the queue or decide when the application reads results. The compiler lowers expressions, transfers, selection, reductions, grouped aggregation, shader passes, grid operations, scans, segmented operations, and domain operations into the command graph. The public graph entry point exposes authoring, execution, inspection, lowering, and validation around that schedule.

CompiledGPUGraph.run() provides a higher-level path that binds, encodes, submits, and returns outputs in one asynchronous call. CompiledGPUGraph.prepare() instead returns a one-use execution for a caller-owned encoder. Programs with CPU-backed operations or CPU output locations use the run path because their stages include readback and callback boundaries.

References: modules/…/gpu-command-graph.ts• L987-1039 modules/…/gpu-command-graph.ts• L1396-1538 modules/…/gpu-command-graph-compiler.ts• L120-275 modules/…/gpu-dispatch-utils.ts• L15-76 modules/…/index.ts• L10-22 modules/…/index.ts• L129-191 modules/…/index.ts• L408-431 modules/…/index.ts• L501-507

Ownership boundaries

The workflow separates persistent application data, compiled-plan scratch space, per-invocation outputs, and device submission. This boundary makes it clear which parts of a workflow can persist across frames and which parts exist only for one compiled plan or invocation.

ResourceOwnerWorkflow meaning
Imported buffer or textureApplicationPersistent source, destination, or per-frame input.
Transient buffer or textureCompiled graphScratch storage that the plan can reuse.
Invocation-created outputCaller after successful completionResult storage returned by a graph run.
Command encoder and queue submissionApplicationThe point where encoded work becomes device work.

Graph algorithms use caller-owned source columns and result vectors. Adding an operation schedules work against them; it does not create a hidden graph, submit commands, or read GPU memory back to JavaScript.

References: modules/…/gpu-command-graph.ts• L700-915 modules/…/gpu-command-graph.ts• L1396-1538 modules/…/gpu-command-graph-compiler.ts• L818-953 modules/…/gpu-graph.ts• L54-59

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to graph resource access must preserve inferred dependencies and imported-resource alias checks.
  • Changes to texture views must keep mip, layer, aspect, and usage ranges aligned with hazard inference and render attachments.
  • Changes to transient allocation must preserve lifetime reuse rules, usage compatibility, and compiled resource statistics.
  • Changes to conditional nodes or publication points must keep preflight metadata and bounded execution plans consistent.
  • Changes to dispatch planning must preserve the three-dimensional limit and the linear invocation mapping for every GPU primitive.
  • Changes to topology outputs must keep offsets, neighbors, edge IDs, optional weights, counts, and overflow aligned for every consumer.
  • Changes to grid coordinate rules must keep binning, aggregation, indexing, and query cell selection consistent at bounds and large numeric ranges.
  • Changes to grid index or query capacity must preserve count and overflow results so consumers do not read unwritten candidates.
  • Changes to scans or segmented operations must keep chunk alignment, segment offsets, prefix mode, and empty-segment rules consistent.
  • Changes to directed graph analysis must keep reverse-adjacency requirements consistent across traversal, ranking, and layout operations.
  • Changes to bounded algorithms must keep iteration limits and status or convergence outputs visible to callers.
  • Changes to domain exports or package subpaths must keep public workflow entry points aligned with the module package map.
  • Changes to the public graph entry point must keep authoring, execution, lowering, inspection, and validation exports aligned.
  • Changes to operation contracts must keep declared value shapes and access modes aligned with compiler lowerings.
  • Changes to semantic aggregation must keep dense group cardinality, input formats, mask alignment, and reduction output shapes aligned with the GPU operations.
  • Changes to grouped statistics must preserve the empty-group and non-finite-value result rules expected by analytical consumers.
  • Changes to scalar reductions must preserve the one-row result contract and the two-row extent contract across semantic declarations and low-level nodes.
  • Changes to expression parsing or type rules must keep the math.gl SQL parser, supported syntax, row-width checks, explicit cast rules, and generated result formats consistent across GPU expression kernels.
  • Changes to expression integer conversion must keep default truncation, optional nearest rounding, and signed or unsigned saturation consistent across shader code and declared formats.
  • Changes to transfer chunk handling must preserve row layout and chunk topology for both bindings and lowerings.
  • Changes to compiled graph invocation must preserve the distinction between submitted run() calls and caller-encoded prepare() executions.
  • Changes to CPU-backed operations must keep numeric-only support, read-only input snapshots, output shapes, and GPU upload boundaries aligned.
  • Changes to shader-pass operations must keep texture formats, sampler bindings, scalar parameters, and color output descriptors aligned with the generated shader interface.
  • Changes to render operations must keep every buffer and texture access declared so the containing graph can schedule hazards correctly.
  • Changes to the GPU core export surface must keep scans, segmented operations, grid operations, command-graph types, and compiled graph APIs available from the public entry point.

Important failure modes

TriggerConsequenceGuard
A graph node omits a read or write resource declarationThe schedule can miss a dependency or allow an unsafe overlap.Declare every resource use and explicit dependency.
A writable storage view overlaps another binding at WebGPU binding alignmentGraph construction rejects the node before compilation.Bind the shared range once or use non-overlapping aligned views.
Imported writable handles resolve to the same physical buffer or textureEncoding fails instead of allowing an unsafe alias.Use distinct allocations for active writable handles.
A graph contains a dependency cycle or a reference to a missing nodeCompilation cannot produce a valid schedule.Keep node IDs unique and dependencies acyclic.
A transient texture is reused with a different descriptorThe compiler allocates another physical texture instead of unsafe reuse.Keep format, extent, dimension, depth, mip count, and sample count compatible when reuse is expected.
Adjacency capacity is too small or source endpoints are invalidTopology reports failure and dependent analyses can publish an empty or safe result.Size outputs from the source graph and check count and overflow.
Directed analysis requests incoming or bidirectional work without reverse adjacencyThe operation cannot represent the requested direction.Build and retain reverse topology for those workflows.
A bounded iterative operation reaches its limit before convergenceThe result can remain an approximation or an upper bound.Inspect residual, validity, convergence, or overflow status.
A grid query or index output reaches capacitySome candidates are not written and overflow is reported.Read the published count and overflow flag before using candidates.
A grid position, weight, or bound is non-finite or outside the domainThe row is ignored by the spatial operation.Filter or normalize spatial inputs before relying on counts or aggregates.
A grid output length does not equal the declared cell countGrid construction fails before command nodes are added.Allocate width * height or width * height * depth output rows as required.
A segmented offset array is not ordered or has the wrong terminal lengthSegment results do not describe the intended rows or validation fails.Treat offsets as CSR boundaries and provide one terminal offset per output segment.
A scan or segmented operation exceeds the device dispatch limitCommand-node creation fails instead of silently dropping rows.Use the bounded dispatch helpers and keep workloads within device limits.
A compiled graph is encoded after destruction or with a different device encoderEncoding fails and produces no valid submission.Keep the compiled graph and command encoder on the same live WebGPU device.
A prepared graph execution is encoded more than onceThe single-use invocation rejects the second encoding.Destroy each prepared execution after its one encoding and submission decision.
An expression uses unsupported syntax or mixes integer operands with float arithmeticCompilation fails before a command graph is produced.Use the supported math.gl SQL numeric expression forms and explicit float32 casts.
An expression output or input uses a non-32-bit numeric row or a width outside one to four componentsExpression planning fails before shader work is created.Declare 32-bit scalar or vector formats and match the expression result format.
A float-to-integer expression relies on implicit nearest roundingThe result truncates by default and can differ at half values.Set integerRounding: 'nearest' when ties-away-from-zero rounding is required.
A shader pass uses a non-filterable or non-color texture formatThe shader-pass pipeline cannot be created.Use single-sampled 2D filterable color inputs and a renderable color output.
A compaction consumer ignores the GPU countIt can read unwritten rows from the output capacity.Bound downstream work by the published count.
A texture copy uses different format, extent, dimension, mip range, or sample countEncoding rejects the copy before any copy command is issued.Use matching single-sample texture bindings with valid selected ranges.
A CPU-backed program is passed to prepare()Preparation fails because CPU stages need asynchronous readback and callback work.Use CompiledGPUGraph.run() for programs with CPU operations.
A CPU callback returns a vector with a different declared length or chunk layoutThe stage fails before the result is uploaded to the GPU.Return numeric arrays that match each output descriptor.
A CPU-backed graph declares textures or persistent state vectorsGraph construction rejects the unsupported CPU execution shape.Keep CPU-backed programs numeric and free of persistent state.
Group keys, values, or masks have different logical lengthsAggregation construction or encoding rejects the row pairing.Preserve one logical row for each key and optional paired value or mask.
A reduction output has the wrong format or row countThe reduction cannot be added to the graph.Use the input format and one row, or two rows for an extent.
A group key is outside the dense output range or a grouped value is non-finiteThat row does not contribute to a group result.Size the dense output for the expected keys and provide finite values.
A group has no accepted rows for a minimum, maximum, or meanThe result is NaN for that group.Treat empty groups as a defined case in downstream analysis.

Key files

FileWhy to read it
modules/…/README.mdPackage purpose and public subpath map.
modules/…/gpu-command-graph.tsCommand-graph definition, compilation, encoding, conditions, publication, ownership, bounded execution, and render scheduling.
modules/…/gpu-command-graph-types.tsResource, node, view, condition, publication, preflight, and workload contracts.
modules/…/gpu-command-graph-compiler.tsDependency ordering, asynchronous compilation, transient allocation reuse, preflight, and device-limit checks.
modules/…/gpu-dispatch-utils.tsShared bounded dispatch and linear invocation rules.
modules/…/gpu-graph.tsSemantic program values, operation order, and compile entry point.
modules/…/gpu-operation.tsOperation contracts, semantic grouping, and operation trees.
modules/…/gpu-graph-compiler.tsProgram validation, resource resolution, analytical lowering, and WebGPU lowering.
modules/…/gpu-semantic-aggregation-operation.tsSemantic contracts for grouped statistics and scalar reductions.
modules/…/gpu-group-aggregation.tsGPU grouped counts and floating-point statistics.
modules/…/gpu-reduction.tsGPU scalar reductions and their result rules.
modules/…/gpu-scan.tsGPU prefix sums across packed and chunked data.
modules/…/gpu-segmented-scan.tsIndependent prefix sums over CSR-style segments.
modules/…/gpu-segmented-reduction.tsPer-segment sum, minimum, and maximum operations.
modules/…/gpu-grid-coordinate.tsShared coordinate mapping for bounded spatial cells.
modules/…/gpu-grid-binning.tsGPU cell counts from two-dimensional positions.
modules/…/gpu-grid-aggregation.tsWeighted per-cell statistics and empty-cell behavior.
modules/…/gpu-grid-index-internals.tsGPU grid-index construction, offsets, candidate storage, and overflow.
modules/…/gpu-grid-index-query.tsCoarse point, bounds, and radius candidate queries.
modules/…/gpu-expression-plan.tsGraph planning, value shape resolution, output selection, and per-run storage.
modules/…/gpu-expression-operation.tsTyped numeric expression contract, math.gl SQL parsing, syntax subset, row-shape rules, and cast policy.
modules/…/gpu-expression-kernel.tsGPU expression evaluation and vector lane behavior.
modules/…/gpu-expression-cast.tsCross-type conversion, rounding, and saturation rules for expression shaders.
modules/…/compiled-gpu-graph.tsReusable graph binding, direct submission, caller-owned encoding, and CPU-stage selection.
modules/…/gpu-cpu-operation.tsNumeric CPU callback contract and operation resource declaration.
modules/…/gpu-cpu-execution.tsOrdered GPU and CPU stage execution with readback and upload boundaries.
modules/…/gpu-render-operation.tsReusable render-operation boundary for graph contributors.
modules/…/gpu-shader-pass-operation.tsFullscreen shader-pass contract for texture inputs, parameters, and color output.
modules/…/gpu-shader-pass-kernel.tsShared shader-pass execution model for full graphs and simple graph rendering.
modules/…/gpu-transfer-operation.tsHost upload, vector copy, and texture-copy operation contracts.
modules/…/gpu-transfer-lowering.tsScheduled buffer and texture transfer behavior.
modules/…/gpu-texture-plan.tsTexture binding ranges, per-invocation allocation, usage needs, and ownership.
modules/…/gpu-texture-copy.tsTexture-copy compatibility and selected-range behavior.
modules/…/gpu-compaction-operation.tsSelection output capacity and GPU logical-count contract.
modules/…/index.tsPublic GPU core exports for command graphs, grid operations, scans, segmented operations, analytical operations, and compiled graph APIs.
modules/…/index.tsPublic graph authoring, execution, lowering, inspection, and validation entry points.
modules/…/gpu-graph.tsGPU-resident graph source model.
modules/…/gpu-graph-topology.tsShared compressed adjacency and overflow model.
modules/…/index.tsPublic graph analysis and layout operations.
modules/…/README.mdSupported analyses, result meaning, and limits.
modules/…/index.tsTable and table-to-render workflow building blocks.
modules/…/index.tsGPU row analytics and query workflow building blocks.
modules/…/index.tsTrace scene, index, interaction, and analytics building blocks.
modules/…/index.tsGPU projection and projected-table workflow entry points.
modules/…/index.tsTile, raster analysis, and raster measurement workflow entry points.
modules/…/index.tsGPU physics world and event workflow entry points.