Skip to content

Generate ContourLayer isolines on WebGPU - #11230

Merged
ibgreen merged 5 commits into
masterfrom
codex/contour-webgpu-geometry
Nov 19, 2026
Merged

ibgreen merged 5 commits into
masterfrom
codex/contour-webgpu-geometry

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Background

ContourLayer reads back its bins to generate paths. This PR adds an opt-in isoline path that passes GPU-generated endpoints directly to LineLayer.

Change List

  • Add the experimental gpuGeometry prop for non-pickable isolines
  • Keep rendering-only extensions out of the binning pass
  • Unit tests for GPU segment output and PathStyleExtension
  • Documentation

Core and aggregation package builds, Contour headless tests, and lint passed.

TODO

GPU isobands and segment picking. These use the existing CPU geometry path.


Note

Medium Risk
Introduces a new WebGPU compute shader pipeline for marching squares geometry generation and alters extension handling during aggregation shader assembly.

Overview
Adds an experimental gpuGeometry prop to ContourLayer that generates and renders isolines entirely on WebGPU. When enabled for numeric thresholds, a compute shader performs marching squares directly against the aggregation bin buffer and supplies interleaved line coordinates directly to LineLayer sublayers, eliminating the CPU readback stage.

Additionally refines extension filtering during GPU aggregation. Layer.getShaders() now accepts an optional extensions array, allowing ContourLayer to restrict aggregation compute shaders to input-filtering extensions while applying rendering extensions (such as PathStyleExtension, FillStyleExtension, and MaskExtension) to output geometry without falling back to CPU aggregation.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 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-19T13:40:41.092751Z a9e38cc 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9e38cca58

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no new blocking issues were found.

Summary

Adds optional WebGPU isolines that draw directly from GPU-generated endpoints, while keeping CPU geometry for unsupported configurations.

  • ContourLayer draws numeric isolines from GPU bins.
  • Contour styles can stay on WebGPU with accessor inputs.

No new actionable issues found. The earlier callback and release-note findings remain addressed.

Reviews (5) · Last reviewed commit: "Preserve contour readback and retire rep..." · Reviewed by Greptile

@coveralls

coveralls commented Nov 19, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.383% (-0.1%) from 82.523% — codex/contour-webgpu-geometry into master

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 266d3c8. Configure here.

@ibgreen
ibgreen merged commit 4b39dec into master Nov 19, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/contour-webgpu-geometry branch November 19, 2026 16: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 a984986 after merge; follow-ups below. No P1s.

The WGSL pass uses the same cell corners, >= threshold, missing-value rule, saddle mean and reference vertex as the CPU getCode/getLines path.

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


Generated by Claude Code

Comment on lines +283 to +286
Set the experimental `gpuGeometry` prop to `true` to generate isolines from the bin
buffer and draw them without readback. This path supports numeric thresholds, with
picking disabled and no line sublayer overrides or rendering extensions.
Isobands and other configurations use CPU contour geometry.

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.

P2: gpuGeometry has no prop entry with a default or anchor, so readers only find it in this paragraph. The opening of this section still says contours are generated on the CPU and lag a frame.

Could we add a gpuGeometry (boolean, optional) entry under Aggregation Options with * Default: false, link it from here, and qualify the CPU sentence?

Details
  • Still true on master.
  • Sub Layers lists only lines (PathLayer). GPU isolines render as LineLayer sublayers.

Generated by Claude Code

xRange,
yRange
});
expect(expected.lines).toHaveLength(4);

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: The CPU parity check uses one bin, so it only hits codes 1, 2, 4 and 8. Could a diagonal 2x2 case cover the saddle codes 5 and 10?


Generated by Claude Code

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

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