Introducing a new way to review your PRs.

Read the announcement

visgl / deck.gl

WebGL2 powered visualization framework

View on GitHub

23 documents · Updated Nov 20, 2026

docs / testing-and-validation

Testing and validation

The testing and validation system checks that deck.gl renders the right scene, responds to host input, and keeps its public behavior stable across packages. It combines fast module checks with browser, GPU, smoke, and image tests so a change can fail as a logic error, an integration error, a device error, or a visible rendering change. See Distribution and quality for the wider release and quality flow.

Test suite model

Vitest groups checks by the environment and risk they cover. The suite gives direct coverage to WebGL and WebGPU layer behavior, browser interaction, host adapters, data conversion, tile sharing, coordinate systems, and approved images (test/…/standard-layers-gpu.spec.ts• L103-171, test/…/webgpu-grid.spec.ts• L27-139, test/…/shared-tile-2d-layer.spec.ts• L78-105, test/…/custom-projection.spec.ts• L349-365, test/…/globe-occlusion.spec.ts• L334-343). New aggregation checks also compare common-space behavior across custom, map, globe, and Cartesian views (test/…/common-space-aggregation.spec.ts• L108-154, test/…/common-space-aggregation.spec.ts• L313-463). Core Deck checks extend this model to canvas ownership, event routing, resizing, and synchronous or asynchronous picking (test/…/deck.spec.ts• L552-855, test/…/deck.spec.ts• L952-1187).

SuiteMain questionTypical environment
Node and moduleDo package contracts, layer lifecycles, and source boundaries remain valid without a real browser?Node with a small DOM shim
Browser interactionDo browser events produce the right deck, view, pick, and host state?Headless or headed Chromium
GPU moduleDo layers and effects create valid resources and bindings on the selected graphics device?WebGL or optional WebGPU
RenderDoes the settled scene match its approved image?Chromium with WebGL or WebGPU
Smoke and regressionDo legacy entry points, sample apps, shared tile consumers, and broad package behavior remain usable?Node and representative harnesses

Module and lifecycle validation

Module tests give early feedback on package contracts before a full browser or image run. They check layer state across updates, composite sublayers, deferred data, resource cleanup, coordinate conversion, tile input, and data formats such as Arrow and binary geometry (test/…/arrow-converter.node.spec.ts• L20-34, test/…/arrow-converter.node.spec.ts• L36-92, test/…/tile-3d-layer.spec.ts• L15-91, test/…/vector-tile-layer.spec.ts• L15-88). Current checks also protect prop validation, async value replacement, stale-load handling, tile priority, cache limits, late tile cleanup, and deferred work until a viewport is available (test/…/layer.spec.ts• L157-188, test/…/component-state.spec.ts• L122-241, test/…/layer-manager.spec.ts• L270-327, test/…/tileset-2d.spec.ts• L58-145).

The layer manager tests connect these contracts to the active view set. They verify that views can be removed or renamed, that a fallback viewport is used when no deck owns the manager, and that layer initialization and rendering wait until a viewport exists (test/…/layer-manager.spec.ts• L59-97, test/…/layer-manager.spec.ts• L270-327). Deck lifecycle checks add the same guard at the public surface: asynchronous views must become ready before layers initialize or update, and finalization must release the view, renderer, and event resources (test/…/deck.spec.ts• L133-196, test/…/deck.spec.ts• L1551-1615). Render-pass checks add a device-independent guard: a layer or extension may change draw parameters, but the surrounding pass must return to its prior state after success or failure (test/…/layer-render-pass.node.spec.ts• L14-59). The pass suite also checks nested ordering, visibility, view-specific drawing, device-pixel viewport conversion, repeated worlds, and picking on both graphics backends (test/…/layers-pass.spec.ts• L56-287, test/…/layers-pass.spec.ts• L370-498, test/…/layers-pass.spec.ts• L500-618).

The shared layer helpers model the normal update lifecycle. They wait for data and queued updates, inspect the resulting layer or sublayers, and reject failures after cleanup. This makes asynchronous behavior part of the contract instead of treating a layer as ready after its first synchronous update (test/…/lifecycle-test.spec.ts• L21-43, test/…/lifecycle-test.spec.ts• L67-108, test/…/lifecycle-test.spec.ts• L127-142, test/…/utils.ts• L8-91).

Module checks also cover column-backed product paths. Cell layers must preserve feature styles and picking when data comes from Arrow list or dictionary columns. They must keep 64-bit cell identifiers intact, restore accessor geometry when column input is removed, and avoid rebuilding descendant geometry for style-only changes (test/…/cell-columns.node.spec.ts• L35-77, test/…/cell-columns.node.spec.ts• L107-125, test/…/cell-columns.spec.ts• L25-105, test/…/cell-columns.spec.ts• L133-163). Column selection tests also ensure declared inputs are borrowed without exposing internal fields, while later preparation retains responsibility for validation (test/…/resolve-columns.node.spec.ts• L10-53).

Arrow validation now covers both the data schema and its conversion contract. Schema checks accept compatible scalar, position, color, and vector shapes while rejecting wrong widths or child types. Converter checks cover lazy batches, cumulative row offsets, null policy, cancellation, stable stream formats, partial-failure rollback, and ownership of uploaded buffers (test/…/arrow-schema.node.spec.ts• L12-44, test/…/arrow-converter.node.spec.ts• L36-110, test/…/arrow-converter.node.spec.ts• L112-163).

Core module checks protect the rules that connect layers to views and drawing passes. They verify nested layer order, visibility, viewport-specific drawing, render parameters, repeated worlds, picking, coordinate projection against GPU results, and attribute transitions that resize, interrupt, rebind, and release transition buffers (test/…/layers-pass.spec.ts• L56-287, test/…/layers-pass.spec.ts• L335-368, test/…/attribute-transition-manager.spec.ts• L58-119, test/…/attribute-transition-manager.spec.ts• L156-199, test/…/project-glsl.spec.ts• L353-379). Picking checks also cover empty results, drawing-buffer size, synchronous and asynchronous paths, and the WebGPU top-left framebuffer origin (test/…/deck-picker.spec.ts• L41-144, test/…/deck-picker.spec.ts• L147-271).

Geo-layer module checks also protect external raster sources and their coordinate contract. WMS checks confirm that a URL source keeps its service parameters and that WGS84 coordinates match the expected pseudo-Mercator projection (test/…/wms-layer.spec.ts• L15-23, test/…/wms-layer.spec.ts• L39-57).

GPU backend validation

GPU module tests check that layer data reaches the graphics pipeline correctly on WebGL and WebGPU. They cover standard, mesh, column, tessellated, aggregation, and geo layers across constant values, changing accessors, caller-owned buffers, index data, alternate geometry modes, and Arrow-backed columns (test/…/standard-layers-gpu.spec.ts• L103-171, test/…/standard-layers-gpu.spec.ts• L174-206, test/…/webgl-aggregator.spec.ts• L99-201, test/…/arc-arrow-columns.spec.ts• L17-87, test/…/column-arrow.spec.ts• L17-117, test/…/line-point-arrow-columns.spec.ts• L17-75, test/…/scatterplot-arrow-columns.spec.ts• L30-197). They also check shader plug-in order and backend-specific inputs for path, trip, and scenegraph layers (test/…/shader.spec.ts• L55-74, test/…/path.spec.ts• L530-715, test/…/trips-layer.spec.ts• L38-69, test/…/scenegraph-layer.spec.ts• L62-71).

Line and point layers add a focused cross-backend check for Arrow input. These tests verify instance limits, date-line picking, binary position and color data, switching between row accessors and columns, and preservation of borrowed buffers (test/…/line-point-arrow-columns.spec.ts• L17-187, test/…/line-point-arrow-columns.spec.ts• L189-294, test/…/line-point-arrow-columns.spec.ts• L297-403).

Aggregation tests now exercise the full CPU and GPU contract. They compare WebGPU grid and hexagon results with CPU bins in screen, geographic, and common spaces. They also verify reductions, domains, clipping, empty-input recovery, stale readback handling, and GPU results that flow to rendered sublayers without accessor calls or unnecessary readback (test/…/webgpu-grid.spec.ts• L27-139, test/…/webgpu-grid.spec.ts• L142-230, test/…/webgpu-hexagon.spec.ts• L27-140, test/…/webgpu-screen-grid.spec.ts• L12-157, test/…/common-space-aggregation.spec.ts• L313-463).

The same checks cover custom aggregators and readback as a controlled fallback. They protect explicit domains, changing instance prefixes, strided and borrowed vectors, retries after copy or callback errors, and safe replacement or finalization of aggregator instances (test/…/aggregation-vectors.spec.ts• L41-225, test/…/readback-aggregator.spec.ts• L13-182). Unsupported data shapes or features that require CPU results must select the CPU path instead of producing an invalid GPU result (test/…/webgpu-grid.spec.ts• L233-390, test/…/webgpu-hexagon.spec.ts• L228-276).

Arrow-column checks treat streamed or borrowed data as a cross-backend contract. They confirm that chunk boundaries preserve row and picking indexes, that layers can switch between column and accessor input, and that failed or superseded conversions do not replace a working upload or destroy caller-owned buffers (test/…/layer-columns.node.spec.ts• L35-127, test/…/scatterplot-arrow-lifecycle.node.spec.ts• L32-119, test/…/scatterplot-arrow-lifecycle.node.spec.ts• L149-220, test/…/arc-arrow-columns.spec.ts• L148-191). Scenegraph and heatmap column tests extend this contract across WebGL and WebGPU by checking model reuse, picking, style updates, typed buffer layouts, and ownership of borrowed storage (test/…/scenegraph-columns.spec.ts• L14-102, test/…/heatmap-layer.spec.ts• L28-91, test/…/heatmap-layer.spec.ts• L410-529).

WebGPU cases are skipped when no device is available. When a device exists, tests also check shader compilation, validation scope, submitted work, rendered pixels, and picking. This separates an unsupported local device from a real pipeline, resource, or behavior error (test/…/standard-layers-gpu.spec.ts• L103-109, test/…/brushing-webgpu.spec.ts• L157-231, test/…/clip-webgpu.spec.ts• L182-320, test/…/data-filter-webgpu.spec.ts• L239-378, test/…/webgpu-features.spec.ts• L13-89).

The GPU checks also protect higher-level layer contracts. Aggregation, tile, clip, trip, Arrow, bitmap, mesh, and scenegraph tests confirm that data becomes the expected polygon, path, tile, image, mesh, or indexed instance resources. They also check that repeated-world, date-line, globe, projection, and terrain cases keep drawing and picking correct for each visible copy (test/…/position-transforms.spec.ts• L46-92, test/…/bitmap-layer.spec.ts• L104-184, test/…/simple-mesh-layer.spec.ts• L97-155, test/…/scenegraph-columns.spec.ts• L58-100). Screen-grid checks add a focused GPU contract: reductions stay on the device, recover from empty input, preserve borrowed buffers, and pass GPU vectors to the rendered layer without calling accessors (test/…/graph-screen-grid.spec.ts• L14-173, test/…/graph-screen-grid.spec.ts• L244-320).

Layer module checks also protect the color contract shared by plain arrays and typed byte arrays. They verify that normalized colors reach scatterplot, line, arc, and GeoJSON sublayers with the same visible meaning (test/…/scatterplot-layer.spec.ts• L62-169).

Effect and shader validation

Effect tests protect the link between scene effects and layer rendering. Lighting, mask, collision, brushing, clipping, and data-filter tests check effect setup, viewport changes, resource replacement, channel state, extension composition, and cleanup. Shader tests check that merged modules and plug-ins keep their inputs, order, and backend-specific interfaces (test/…/lighting-effect.spec.ts• L30-216, test/…/mask-effect.spec.ts• L42-261, test/…/collision-filter-effect.spec.ts• L45-227, test/…/brushing.spec.ts• L10-52, test/…/brushing-webgpu.spec.ts• L14-155, test/…/data-filter-webgpu.spec.ts• L151-237, test/…/shader.spec.ts• L55-74). Mask parity tests now compare channel updates, inverted masks, billboard clipping, and picking in map and globe views on WebGL and WebGPU (test/…/mask-parity.spec.ts• L15-151, test/…/mask-parity.spec.ts• L154-268).

Projection shader checks add a direct cross-backend contract for globe orientation and meter offsets. They verify that local east, north, and up directions remain stable at ordinary locations and at the poles, and that the globe-to-Mercator transition keeps screen-space offsets aligned (test/…/globe-orientation.spec.ts• L93-215, test/…/globe-orientation.spec.ts• L260-322).

The extension checks also protect composition. Brushing, clipping, and data filtering must agree when their order changes, when filtering affects picking, and when a live update changes a constant or accessor without rebuilding the model (test/…/brushing-webgpu.spec.ts• L14-155, test/…/clip-webgpu.spec.ts• L19-180, test/…/data-filter-webgpu.spec.ts• L193-237). Path style checks cover dash modes, offsets, antialiasing, globe and date-line geometry, and changes between modes while keeping the rendered path phase stable (test/…/path.spec.ts• L605-715, test/…/path.spec.ts• L851-949, test/…/path.spec.ts• L951-1235, test/…/path-antialiasing.spec.ts• L24-145).

Shadow pass and shader tests check the shadow map size, render parameters, lighting isolation, and coverage of geographic, automatic-offset, Cartesian, and high-pitch views (test/…/shadow-pass.spec.ts• L14-127, test/…/shadow.spec.ts• L127-262). The render cases extend those checks to visible behavior. Approved images cover shadowed columns and meshes, layer ordering, high-pitch views, clipping, masks, collision filtering, fill patterns, post-process effects, animated scenegraph frames, path dashes, and text backgrounds (test/…/effects.spec.ts• L87-412, test/…/clip-extension.spec.ts• L89-186, test/…/collision-filter-extension.spec.ts• L57-98, test/…/path-dash.spec.ts• L465-1096, test/…/text-layer.spec.ts• L567-641). The effect cases now include inverted globe masking and run mask scenes on WebGL and WebGPU (test/…/effects.spec.ts• L287-335, test/…/effects.spec.ts• L416-422, test/…/mask-effect-inverted-globe.png, test/…/mask-effect-inverted-globe.png).

Browser interaction validation

Browser tests validate behavior that needs a canvas, browser events, or layout. They create a live Deck instance, send input through the browser command bridge, and inspect picks, view state, widget placement, or host state (test/…/picking.spec.ts• L31-105, test/…/map-controller.spec.ts• L78-171, test/…/deckgl.spec.ts• L62-95).

The interaction runner gives these flows one common model: prepare the deck, apply input and waits in order, then inspect the resulting state. The browser setup keeps older test utilities connected to Vitest browser commands, so existing input and screenshot probes use the same Playwright-based path (modules/…/interaction-test-runner.ts• L18-65, test/…/vitest-browser-setup.ts• L20-33).

sequenceDiagram
    participant Test as Interaction test
    participant Browser as Chromium page
    participant Deck as Deck instance
    participant Result as Behavior check
    Test->>Browser: Send pointer, keyboard, or wait event
    Browser->>Deck: Deliver browser input
    Deck-->>Browser: Update view, layer, or pick state
    Browser-->>Result: Read state and callbacks
    Result-->>Test: Pass or fail

Rendering regression validation

Render tests compare a settled Deck scene with a golden image. A case defines its views, state, layers, effects, and expected image. The harness waits for every requested view and loaded layer, captures the canvas, and fails when the image difference exceeds the allowed match (test/…/deck-test-utils.ts• L189-268, test/…/deck-test-utils.ts• L270-314).

The visual cases make rendering behavior explicit across view types, data forms, and edge geometry. They cover standard layer shapes, Arrow-backed columns, analytic antialiasing, custom projections, map repeat, globe views, globe occlusion, terrain, tiled data, mesh animation, clipping, filtering, path dashes, polygons, scatterplots, and text (test/…/arc-layer.spec.ts• L18-76, test/…/column-layer.spec.ts• L176-198, test/…/globe-occlusion.spec.ts• L165-344, test/…/custom-projection.spec.ts• L106-130, test/…/path-dash.spec.ts• L465-1096, test/…/views.spec.ts• L20-184, test/…/mvt-layer.spec.ts• L12-81). Column cases extend this contract across WebGL and WebGPU by comparing Arrow position columns with the established extruded, wireframe, and stroked output (test/…/column-layer.spec.ts• L176-198).

Extension render cases check both the visible result and related behavior. Clip cases compare geometry and instance clipping in map, globe, orthographic, antimeridian, and antipode views. Data-filter cases compare visible size and color with the count callback. Collision cases compare priority and radius variants across backends. Text cases use fixed font inputs so label and background changes remain meaningful (test/…/clip-extension.spec.ts• L83-186, test/…/data-filter-extension.spec.ts• L25-139, test/…/collision-filter-extension.spec.ts• L18-98, test/…/text-layer.spec.ts• L68-100, test/…/text-layer.spec.ts• L637-641).

The render suite can run the same scene against WebGL and WebGPU when enabled. It supports platform or device-specific golden images and reports graphics-device loss as a test failure instead of an unclear image mismatch (vitest.config.ts• L9-54, test/…/render-test-suite.ts• L59-61, test/…/deck-test-utils.ts• L274-313). Some cases use a persistent Deck so time-based scenes can compare fixed animation frames. Other cases use an offscreen WebGPU target to measure edge coverage rather than only compare pixels (test/…/scenegraph-layer.spec.ts• L5-7, test/…/webgpu-antialiasing-test-utils.ts• L16-92).

flowchart LR
    A[Test case] --> B[Create or update Deck scene]
    B --> C[Wait for views and layers]
    C --> D[Capture canvas]
    D --> E[Find golden image]
    E --> F[Image diff]
    F --> G{Match}
    G -->|yes| H[Pass]
    G -->|no| I[Save diff and fail]

Host integration and compatibility validation

Host integration tests check that deck.gl can share a map or framework lifecycle without taking control of the host. They cover overlay creation and removal, view and render updates, public host APIs, supported version differences, React mount and unmount, globe projection, terrain, marker and label picking, and cleanup after use (test/…/overlay.spec.ts• L164-230, test/…/overlay.spec.ts• L232-319, test/…/mapbox-overlay.spec.ts• L67-142, test/…/deckgl.spec.ts• L62-95).

Compatibility tests turn supported host behavior into a stable contract. They check several MapLibre major versions, public-only map access, interleaved and non-interleaved drawing, rendering modes, host elevation state, globe labels and icons, globe picking, and delayed style updates. Mapbox tests also protect view injection, layer groups, projection choice, context lifecycle, zero-size rendering, and external Deck ownership (test/…/overlay.spec.ts• L141-203, test/…/overlay.spec.ts• L232-319, test/…/overlay.spec.ts• L386-483, test/…/mapbox-overlay.spec.ts• L324-451, test/…/mapbox-overlay.spec.ts• L542-687, test/…/mapbox-overlay.spec.ts• L801-945).

Shared tile tests extend this contract to reusable tile data. A Tileset2D is a shared tile cache and a consumer is a layer or view that selects and draws from it. The tests require one decoded tile to serve multiple consumers, independent view removal and recreation, safe in-flight loads, stable cache and eviction statistics, and the same map-to-globe-to-map result without a second fetch (test/…/shared-tile-2d-layer.spec.ts• L291-387, test/…/shared-mvt-layer.node.spec.ts• L59-169, test/…/shared-mvt-layer-render.spec.ts• L118-323).

MVT compatibility checks keep tile-local data useful for both map and globe views. They verify geographic picking output, highlight identity, binary and GeoJSON parity, tile selection across refinement strategies, local tile clipping, legacy aliases, and recorded behavior from the prior tile manager (test/…/mvt-layer.spec.ts• L240-344, test/…/mvt-layer.spec.ts• L347-400, test/…/mvt-layer.spec.ts• L583-680, test/…/shared-mvt-layer.node.spec.ts• L171-271, test/…/tile-2d-compatibility.node.spec.ts• L94-207, test/…/tile-2d-exports.node.spec.ts• L10-116, test/…/tile-2d-master-parity.node.spec.ts• L10-77). The geo-layer suite index loads the shared tile, MVT, and example checks with the other geo-layer contracts (test/…/index.ts• L25-59).

Smoke and regression coverage

Regression checks protect behavior that may not appear in one focused test. Layer lifecycle checks exercise updates across common layer types, while import checks protect the package surface and cross-package resolution used by downstream applications (test/…/core-layers.node.spec.ts• L32-173, test/…/imports.node.spec.ts• L35-132, test/…/cross-package-imports.node.spec.ts• L25-78). Representative Vite applications provide runnable smoke targets for ArcGIS I3S, custom projections, first-person masking, and multiple viewports (test/…/package.json• L1-13, test/…/package.json• L1-17, test/…/package.json• L1-13, test/…/package.json• L1-17).

The shared tile example is also a product-level smoke check. It mounts the real demo, confirms that several styles and a minimap share loaded data, changes the style and container size, and verifies that unmount and remount leave a usable view (test/…/tile-2d-example.spec.ts• L10-100). This catches failures that isolated tile or layer tests can miss at the React and browser boundary.

The suite also protects data and host paths that cross package boundaries. Arrow tests check lazy batches, row offsets, cancellation, null policy, format changes, and ownership of GPU buffers. CARTO and MVT tests check binary geometry, subdivision, feature picking, and tile rendering. Cell and mesh column checks add parity for indexed geographic cells and instanced scenegraph data (test/…/arrow-converter.node.spec.ts• L36-92, test/…/arrow-converter.node.spec.ts• L112-215, test/…/vector-tile-layer.spec.ts• L15-88, test/…/mvt-layer.spec.ts• L61-82, test/…/cell-columns.node.spec.ts• L25-67, test/…/scenegraph-columns.spec.ts• L14-102). These tests catch incompatibilities that a single layer image may not show.

The Tape smoke suite protects the legacy @deck.gl/test-utils entry point during the move to Vitest. It runs representative layer initialization and lifecycle checks through a Tape harness, so older callers keep a working path while the main suites evolve (test/…/tape-compat.tape.spec.js• L11-54, modules/…/vitest.ts• L5-47).

Test harness boundaries

The shared test runner gives each case a Deck lifecycle, a timeout, and explicit pass or fail reporting. Specialized runners add the contract under test: interaction cases inspect state after input, while render cases wait for readiness and compare a captured image (modules/…/test-runner.ts• L49-121, modules/…/interaction-test-runner.ts• L38-65, modules/…/snapshot-test-runner.ts• L63-149).

Browser setup uses the real DOM and graphics context. Node setup supplies a small JSDOM environment plus animation and observer shims for package checks that need browser globals but do not need a real canvas (test/…/vitest-browser-setup.ts• L5-33, test/…/vitest-node-setup.ts• L10-57). Both setups keep typed-array equality and loader behavior consistent with the compatibility tests.

Change checklist

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

  • When adding a render case, add each required golden image and check view-specific overrides, thresholds, and graphics backend coverage.
  • When changing Deck canvas, event, resize, or picking behavior, check single- and multi-canvas routing, event roots, viewport selection, async result ordering, and resource release.
  • When changing a GPU layer path, check constant and accessor data, caller-owned buffers, WebGL bindings, WebGPU validation, and resource cleanup.
  • When changing color input handling, check plain arrays, typed byte arrays, normalized values, and composite layer accessors.
  • When changing aggregation, check CPU and GPU bin parity, reduction modes, empty input, explicit domains, instance prefixes, borrowed vectors, and fallback rules for picking or unsupported data.
  • When changing graph-based screen-grid aggregation, check reduction results, empty-input recovery, GPU-vector rendering, prefix updates, device support, and custom-view fallback.
  • When changing Arrow or binary-column input, check schema width and semantic mapping, chunk alignment, row and picking indexes, format changes, fallback accessors, borrowed buffers, and both graphics backends.
  • When changing async layer updates, check readiness after resolved data, parent updates from sublayers, timer-driven updates, rejection, stale results, and finalization.
  • When changing scenegraph columns or first-draw readiness, check model reuse, empty columns, transform inputs, picking, style updates, and borrowed storage.
  • When changing an effect or shader contract, check both its module behavior and the matching golden scenes, including high-pitch, globe, inverted-mask, and layer-order cases.
  • When changing projection or geometry preparation, check map, globe, custom CRS, meter offsets, coordinate-system changes, source immutability, and adaptive tessellation.
  • When changing WMS source or projection handling, check service parameters, source creation, WGS84 bounds, pseudo-Mercator output, and raster placement.
  • When changing path, fill, collision, or mask behavior, check the matching layer and extension contracts across map, globe, antimeridian, and alternate coordinate modes.
  • When changing host adapter or package entry behavior, check supported host versions, overlay removal, top-level exports, cross-package imports, sample app startup, and the Tape compatibility path.
  • When changing shared tile selection or cache behavior, check legacy and independent consumers, view removal and recreation, refinement parity, metadata replacement, in-flight loads, and map/globe redraws.
  • When changing a binary or streamed data contract, check row offsets, format stability, cancellation, buffer ownership, and the rendered or picked sublayers that consume the data.
  • When changing render readiness or device setup, check multi-view readiness, persistent animation cases, offscreen readback, context loss, and both browser and Node setup paths.

Important failure modes

TriggerConsequenceGuard
A view or layer never reaches a ready stateThe render case times out instead of producing a valid comparisonRender completion waits for requested views and loaded layers with a bounded timeout (test/…/deck-test-utils.ts• L189-218)
A WebGL or WebGPU device is lost during a caseGPU loss appears as an unrelated render or image-diff errorThe harness reports device loss directly (test/…/deck-test-utils.ts• L111-131, test/…/render-test-suite.ts• L64-75)
A required golden image is missing or no longer matchesVisual regression fails and saves a diff for reviewGolden lookup checks base and platform or device override paths (test/…/deck-test-utils.ts• L274-313)
A WebGPU layer creates an invalid pipeline or bindingA layer can appear initialized while GPU validation fails laterWebGPU tests compile shaders, drain submitted work, and assert an empty validation scope (test/…/brushing-webgpu.spec.ts• L157-231, test/…/clip-webgpu.spec.ts• L287-315, test/…/data-filter-webgpu.spec.ts• L348-374)
A GPU aggregation result uses an unsupported layout or a feature that needs CPU dataA layer can select an invalid fast path or return wrong binsAggregation tests reject bad vector layouts and require CPU fallback for unsupported domains, picking, and scale modes (test/…/aggregation-vectors.spec.ts• L197-225, test/…/webgpu-grid.spec.ts• L233-271, test/…/webgpu-hexagon.spec.ts• L228-276)
A deferred or stale layer update throws or resolves lateThe test can leave stale state or release the current resourceLifecycle, column, and readback tests require rejection, stale-result isolation, retry, and finalization (test/…/component-state.spec.ts• L63-99, test/…/scatterplot-arrow-lifecycle.node.spec.ts• L49-83, test/…/readback-aggregator.spec.ts• L120-181)
Arrow chunks do not describe the same rows or schemaRendered attributes or picking indexes shift between chunksArrow schema and layer tests reject incompatible shapes and compare logical indexes (test/…/arrow-schema.node.spec.ts• L27-44, test/…/arrow-converter.node.spec.ts• L112-148, test/…/scatterplot-arrow-columns.spec.ts• L148-180)
A declared Arrow column has the wrong semantic width or child typeA layer cannot map the input to the requested position, color, or scalar valueSchema tests reject incompatible widths and non-numeric child types before conversion (test/…/arrow-schema.node.spec.ts• L27-44)
A borrowed GPU vector is destroyed as if it owns its bufferA later layer or aggregator reads released storageAggregation, heatmap, and scenegraph tests destroy vector views and confirm that caller-owned buffers remain live (test/…/readback-aggregator.spec.ts• L174-181, test/…/heatmap-layer.spec.ts• L460-529, test/…/scenegraph-columns.spec.ts• L94-100)
A package uses a relative import across module boundariesAn installed package can fail after bundlingThe Node source scan requires package entry-point imports (test/…/cross-package-imports.node.spec.ts• L25-78)
A shared tile consumer detaches during a loadThe remaining consumer loses data or the cache aborts useful workShared tile tests keep in-flight loads alive and detach consumers independently (test/…/shared-mvt-layer.node.spec.ts• L142-169, test/…/shared-tile-2d-layer.spec.ts• L291-357)
An overlay or icon manager keeps using released resourcesA host map, texture, or pending load retains stale Deck stateIntegration and resource tests check removal, finalization, context replacement, and late-load cleanup (test/…/mapbox-overlay.spec.ts• L67-142, test/…/globe-icons-text.spec.ts• L120-189, test/…/tileset-2d.spec.ts• L225-250)
A streamed Arrow batch changes shape or is cancelled without closingGPU buffers or the source iterator can remain live after a rejected readArrow tests require stable formats, iterator closure, cancellation, and destruction of rejected outputs (test/…/arrow-converter.node.spec.ts• L36-92, test/…/arrow-converter.node.spec.ts• L130-148)
A WMS source keeps the wrong service parameters or projection mathThe layer can request the wrong raster or place it at the wrong map locationWMS tests check source parameters and compare WGS84-to-pseudo-Mercator output with the projection engine (test/…/wms-layer.spec.ts• L15-23, test/…/wms-layer.spec.ts• L39-57)
A host overlay reads a private map API or misses a supported host majorAn adapter fails when the host changes or when a supported version is usedMapLibre tests reject private API access and run the overlay against supported major versions (test/…/overlay.spec.ts• L164-203, test/…/overlay.spec.ts• L232-319)
Globe billboard depth or host projection state is wrongFar-side labels or icons leak into the scene, or host picks target the wrong layerGlobe render and MapLibre integration cases compare near-side visibility and picks under both projections (test/…/globe-occlusion.spec.ts• L165-244, test/…/globe-icons-text.spec.ts• L61-189)
A custom projection resolves after its view is removedThe view manager can rebuild a deleted view or report a stale errorCustom projection tests check shared pending resolution, removed-view suppression, and error routing (test/…/custom-projection-view.spec.ts• L152-210)
A scenegraph column is still loading when the first draw startsThe layer reports or performs a draw before its instance data existsScenegraph lifecycle tests block the first draw until columns finish and accept an empty prepared result (test/…/scenegraph-columns.node.spec.ts• L12-27)
A multi-canvas pick or event uses the wrong canvas targetInput reaches the wrong view or returns a result from another canvasDeck tests route event managers, viewports, widgets, and pick requests by canvas (test/…/deck.spec.ts• L552-855)
A plain color array and a typed byte color use different normalization rulesComposite layers render or pick with different color valuesLayer checks compare normalized color attributes for scatterplot, line, arc, and GeoJSON paths (test/…/scatterplot-layer.spec.ts• L62-169)
A GPU screen-grid update receives empty data or a borrowed vectorResults become stale or caller-owned storage is releasedGraph screen-grid checks cover empty recovery, GPU output reuse, buffer ownership, and device validation (test/…/graph-screen-grid.spec.ts• L14-173, test/…/graph-screen-grid.spec.ts• L244-320)
Arrow column geometry changes without matching its visual contractColumn wireframes or strokes differ between data forms or graphics backendsRender cases compare Arrow positions with approved WebGL and WebGPU images (test/…/column-layer.spec.ts• L176-198)

Key files

FileWhy to read it
package.jsonShows the commands that select module, browser, render, smoke, and CI validation.
vitest.config.tsDefines suite boundaries, browser modes, device selection, aliases, and exclusions.
test/…/deck-test-utils.tsExplains render readiness, golden-image lookup, device loss, and image diff behavior.
test/…/render-test-suite.tsShows how render cases share or isolate graphics devices.
modules/…/test-runner.tsDefines the common lifecycle and timeout model.
modules/…/interaction-test-runner.tsShows the shared input-to-state test flow.
modules/…/snapshot-test-runner.tsShows the snapshot and image comparison contract.
test/…/deck.spec.tsDemonstrates Deck lifecycle, canvas routing, resize handling, and sync or async picking.
test/…/lifecycle-test.spec.tsDemonstrates async data, parent updates, timers, failure rejection, and cleanup.
test/…/layer.spec.tsDemonstrates layer prop validation, change detection, projection, transitions, and async readiness.
test/…/layer-manager.spec.tsDemonstrates view retention, viewport activation, lifecycle deferral, and error routing.
test/…/layer-render-pass.node.spec.tsDemonstrates render-pass parameter restoration after layer and extension failures.
test/…/component-state.spec.tsDemonstrates async replacement, stale-load isolation, transforms, resource release, and finalization.
test/…/layers-pass.spec.tsDemonstrates layer ordering, viewport rules, repeated worlds, drawing, coordinate origins, and picking.
test/…/deck-picker.spec.tsDemonstrates synchronous and asynchronous picking, buffer sizing, empty results, and WebGPU origins.
test/…/arrow-schema.node.spec.tsDemonstrates the accepted Arrow shapes and semantic-to-format rules.
test/…/arrow-converter.node.spec.tsDemonstrates streamed data conversion, cancellation, format checks, and resource ownership.
test/…/resolve-columns.node.spec.tsDemonstrates explicit column selection and separation from preparation validation.
test/…/attribute-transition-manager.spec.tsDemonstrates transition creation, interruption, resizing, rebinding, and cleanup.
test/…/standard-layers-gpu.spec.tsDemonstrates cross-backend layer binding, updates, and caller-owned buffers.
test/…/scatterplot-layer.spec.tsDemonstrates color normalization across plain arrays, typed colors, and composite layers.
test/…/line-point-arrow-columns.spec.tsDemonstrates Arrow input, date-line picking, binary attributes, instance limits, and borrowed-buffer behavior for line and point layers.
test/…/wms-layer.spec.tsDemonstrates WMS source creation and coordinate projection validation.
test/…/aggregation-vectors.spec.tsDemonstrates aggregator ownership, GPU column use, explicit domains, prefixes, and borrowed vectors.
test/…/webgpu-grid.spec.tsDemonstrates CPU and WebGPU bin parity, reduction updates, GPU columns, and fallback selection.
test/…/webgpu-hexagon.spec.tsDemonstrates hexagon bin parity, shared GPU output, prefixes, and CPU fallback.
test/…/webgpu-features.spec.tsDemonstrates WebGPU domains, picking, clipping, brushing, and validation behavior.
test/…/readback-aggregator.spec.tsDemonstrates readback retries, strided columns, prefixes, and borrowed-buffer ownership.
test/…/webgpu-screen-grid.spec.tsDemonstrates screen-grid reductions, empty-input recovery, and GPU result rendering.
test/…/graph-screen-grid.spec.tsDemonstrates graph-backed screen-grid reductions, GPU vectors, empty-input recovery, and fallback rules.
test/…/common-space-aggregation.spec.tsDemonstrates aggregation parity across geographic, custom, globe, and Cartesian spaces.
test/…/position-transforms.spec.tsDemonstrates aggregation position transforms across projected, binary, custom-view, and GPU-bound data.
test/…/heatmap-layer.spec.tsDemonstrates heatmap binary input, shader contracts, backend parity, and borrowed GPU columns.
test/…/scatterplot-arrow-columns.spec.tsDemonstrates Arrow input, fallback accessors, picking indexes, pending data, and cross-backend column behavior.
test/…/cell-columns.node.spec.tsDemonstrates Arrow cell columns, feature style mapping, numeric cell precision, and picking.
test/…/cell-columns.spec.tsDemonstrates cell-column updates, style replacement, and restoration of accessor geometry.
test/…/mask-parity.spec.tsDemonstrates mask channel updates, inverted masks, billboard clipping, and picking across backends.
test/…/globe-orientation.spec.tsDemonstrates globe orientation, meter offsets, and projection alignment on WebGL and WebGPU.
test/…/brushing-webgpu.spec.tsDemonstrates WebGPU extension composition, pixel behavior, picking, and validation.
test/…/clip-webgpu.spec.tsDemonstrates clip modes, billboard edges, view projection, WebGPU compilation, and validation checks.
test/…/data-filter-webgpu.spec.tsDemonstrates numeric and categorical filtering, counts, composition, and WebGPU pipeline checks.
test/…/lighting-effect.spec.tsDemonstrates effect resources, light projection, and cleanup contracts.
test/…/mask-effect.spec.tsDemonstrates mask channels, viewport bounds, globe support, and effect cleanup.
test/…/collision-filter-effect.spec.tsDemonstrates collision resources, invalidation triggers, and cleanup.
test/…/path.spec.tsDemonstrates path dash, offset, antialiasing, projection, globe, and mode contracts.
test/…/path-antialiasing.spec.tsDemonstrates shader variants and the default fast path for antialiasing.
test/…/trips-layer.spec.tsDemonstrates timestamp packing and WebGPU path integration.
test/…/scenegraph-layer.spec.tsDemonstrates scenegraph animation, picking, and WebGPU shader behavior.
test/…/scenegraph-columns.node.spec.tsDemonstrates first-draw readiness and transform-column selection.
test/…/scenegraph-columns.spec.tsDemonstrates model reuse, Arrow columns, picking, and borrowed-buffer behavior.
test/…/shared-tile-2d-layer.spec.tsDemonstrates shared tile consumers, cache state, metadata, reloads, and cleanup.
test/…/shared-mvt-layer.node.spec.tsDemonstrates map/globe data views, shared MVT loads, picking, and consumer isolation.
test/…/shared-mvt-layer-render.spec.tsDemonstrates real Deck rendering and picking across map/globe view changes.
test/…/mvt-layer.spec.tsDemonstrates MVT coordinate conversion, binary parity, picking, clipping, and tile metadata.
test/…/tile-2d-compatibility.node.spec.tsDemonstrates compatibility selection, refinement, legacy consumers, and cache behavior.
test/…/tile-2d-master-parity.node.spec.tsRecords expected tile selection against the prior tile manager behavior.
test/…/tile-2d-example.spec.tsDemonstrates the shared tile demo as a mount, resize, style-change, and remount smoke test.
test/…/clip-extension.spec.tsDefines visual clipping cases across map, globe, orthographic, antimeridian, and antipode views.
test/…/data-filter-extension.spec.tsDefines visual filtering and filtered-item count cases across WebGL and WebGPU.
test/…/column-layer.spec.tsDefines column and Arrow-position visual cases across WebGL and WebGPU.
test/…/path-dash.spec.tsDefines visual dash, offset, antialiasing, globe, 3D, and device-pixel cases.
test/…/effects.spec.tsDefines visual effect, shadow, mask, inverted-globe, and post-process cases.
test/…/fill-pattern.spec.tsDefines raster and procedural pattern cases across map, globe, and Cartesian views.
test/…/globe-occlusion.spec.tsDefines globe visibility cases for icons, text, points, altitude, and depth.
test/…/scenegraph-layer.spec.tsDefines persistent render cases for fixed animation frames.
test/…/overlay.spec.tsDemonstrates host-version, public API, terrain, projection, and overlay rendering checks.
test/…/globe-icons-text.spec.tsDemonstrates globe projection, billboard modes, label rendering, and picking in MapLibre.
test/…/mapbox-overlay.spec.tsDemonstrates Mapbox lifecycle, view injection, interleaving, layer groups, and projection checks.
test/…/tape-compat.tape.spec.jsDemonstrates the legacy test utility compatibility guard.