Visitar URL original
HexagonLayer: support shared compute rendering features by ibgreen · Pull Request #11078 · visgl/deck.gl · GitHub
Skip to content

HexagonLayer: support shared compute rendering features - #11078

Open
ibgreen wants to merge 5 commits into
masterfrom
codex/hexagon-webgpu-parity
Open

ibgreen wants to merge 5 commits into
masterfrom
codex/hexagon-webgpu-parity

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

For #10712. Follow up of #11062 and #11063.

Background

Hexagon compute aggregation falls back for picking, scales, and extensions. Connect it to the shared pipeline while keeping completed cells visible during readback. Picking alone no longer delays explicit-domain rendering.

Change List

  • Enable Hexagon domains, callbacks, picking, scales, and percentiles
  • Share Grid/Hexagon compute setup and clipping conversion
  • Retain completed cell geometry while domains/scales update
  • Preserve format, device-limit, and JavaScript callback fallbacks
  • Unit tests
  • Documentation

Verified 106 aggregation tests (one existing skip), scoped typechecking, lint, and 119 node tests. GPU-column extensions remain unsupported.


Note

Medium Risk
Refactors shared aggregation and readback logic between GridLayer and HexagonLayer while expanding the WebGPU compute aggregation rendering pipeline.

Overview
Expands WebGPU compute aggregation in HexagonLayer to support automatic domains, picking metadata, quantile and ordinal scales, percentile filtering, domain callbacks, and accessor-based extensions without falling back to CPU aggregation.

Common compute aggregator setup, scale validation, and cell geometry retention are now consolidated into AggregationLayer and shared between GridLayer and HexagonLayer. Completed cell instances remain visible during asynchronous CPU readback for updated domains or distribution scales, while explicit-domain configurations render immediately without blocking on picking data.

Reviewed by Cursor Bugbot for commit a933d36. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T19:52:23.440534Z b9c71af PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the picking override issue is fixed.

Summary

HexagonLayer gains shared WebGPU support for domains, picking, scales, percentiles, and extensions.

  • HexagonLayer uses WebGPU compute for more configurations.
  • Completed aggregation cells stay visible during metadata readback.
  • GridLayer and HexagonLayer share compute setup and clip projection.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Aggregation changes] --> B[Compute new results]
  B --> C{Rendering needs CPU values?}
  C -->|Yes| D[Keep completed cells visible without picking]
  C -->|No| E[Render GPU results without waiting]
  B --> F[Copy requested metadata to CPU]
  F --> G[Refresh cells and apply merged picking setting]
Loading

Reviews (5) · Last reviewed commit: "Preserve cell picking overrides after me..." · Reviewed by Greptile

@coveralls

coveralls commented Nov 9, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.658% (-0.02%) from 83.673% — codex/hexagon-webgpu-parity into master

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 0c54b13; comments only at this point. One P1: on WebGPU, HexagonLayers with default props or pickable now draw no cells for 1 to 4+ frames after each change.

The one-frame matchesLength gap from #11045 is unchanged. On swiftshader WebGPU, color and elevation domains matched CPU aggregation on the SF bike-parking points.

Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.

Comment thread docs/whats-new.md Resolved
@ibgreen
ibgreen requested a review from chrisgervang November 10, 2026 11:20

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed a933d36; recommend approval. The P1, the shared-code item and both docs items are addressed.

On swiftshader WebGPU with radius 200, 800, 100, cells now draw in every frame after the first load with default props, explicit domains and pickable. The one-frame gap from #11045 is gone too. Two new Non-blocking items below.

Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.

Comment on lines +194 to +199
On a WebGPU device, HexagonLayer aggregates in compute shaders when `gpuAggregation` is true.
Automatic domains, picking, domain callbacks, distribution scales, and percentiles copy results
back to the CPU after each change. Previous cells remain visible while rendering waits for
new domains or scales. Explicit domains with ordinary scales let cells render without waiting
for picking data. Extensions work with accessor data. [GPU column inputs](./aggregator.md#gpu-column-inputs)
also need `dataBounds`. Data over the device buffer limits uses CPU aggregation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: "Distribution scales" and "ordinary scales" are not terms this page uses. Cells also can't be picked while the copy is pending. Could this name the scales and say so?

Suggested change
On a WebGPU device, HexagonLayer aggregates in compute shaders when `gpuAggregation` is true.
Automatic domains, picking, domain callbacks, distribution scales, and percentiles copy results
back to the CPU after each change. Previous cells remain visible while rendering waits for
new domains or scales. Explicit domains with ordinary scales let cells render without waiting
for picking data. Extensions work with accessor data. [GPU column inputs](./aggregator.md#gpu-column-inputs)
also need `dataBounds`. Data over the device buffer limits uses CPU aggregation.
On a WebGPU device, HexagonLayer aggregates in compute shaders when `gpuAggregation` is true.
Automatic domains, picking, domain callbacks, quantile and ordinal scales and percentiles copy
results back to the CPU after each change. Until the copy lands, the previous cells stay visible
and cannot be picked. With `colorDomain`, `elevationDomain`, linear or quantize scales and default
percentiles, new cells draw without waiting. Extensions work with accessor data. [GPU column inputs](./aggregator.md#gpu-column-inputs)
also need `dataBounds`. Data over the device buffer limits uses CPU aggregation.
Details
  • GridLayer now keeps cells the same way, and grid-layer.md#compute-aggregation doesn't mention it. It could link to this section.

Comment on lines +161 to +165
protected retainAggregationLayer(layer: Layer, range: [number, number][]): void {
const aggregator = this.state.aggregator;
const values = [aggregator.getResultValues?.(0), aggregator.getResultValues?.(1)];
if (!values[0] || !values[1]) return;
const bins = new Float32Array(aggregator.binCount * 2);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: This builds a new getBin array and clones the cell layer on every renderLayers(), also when nothing is pending, such as a colorRange change. Could it keep the snapshot and build the retained layer only when a pending frame needs it?

Details
  • With 100k bins that is an 800 KB Float32Array and a layer clone per render.
  • Each readback makes new snapshot arrays with their own range (webgpu-aggregator.ts:443-446), so a reference stays valid.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants