Skip to content

Aggregation (4/4): share compute reduction and port GridLayer - #11053

Merged
ibgreen merged 9 commits into
masterfrom
codex/webgpu-grid
Nov 8, 2026
Merged

ibgreen merged 9 commits into
masterfrom
codex/webgpu-grid

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Follow up of #11052. Part 4 of the aggregation stack.

Background

GridLayer currently falls back to CPU aggregation on WebGPU. This adds independent color and elevation reduction with explicit domains, feeding GPU vectors directly to the cell layer.

Change List

  • Share column preparation and compute reduction with ScreenGrid
  • Add two-channel Grid aggregation with signed bin IDs
  • Preserve CPU fallbacks for unsupported features
  • Avoid recomputation when aggregation inputs are unchanged
  • Unit tests
  • Documentation

Verified 176 browser tests, 51 node tests, aggregation typechecking, and lint. Two existing browser skips. Website check stopped during dependency fetching after network retries.


Note

Medium Risk
Introduces new WebGPU compute shaders and pipeline refactoring for aggregation layers. Risk is mitigated by explicit eligibility checks and automatic runtime fallbacks to CPU aggregation.

Overview
Introduces a shared WebGPUAggregator base class and reusable WGSL compute kernels for dense 2D aggregation, extracting the column preparation and atomic reduction pipeline previously confined to ScreenGridLayer.

Adds WebGPUGridAggregator to support WebGPU compute aggregation in GridLayer with independent two-channel color and elevation reduction. Aggregation outputs remain in GPU storage buffers and are passed directly to GridCellLayer as vectors when explicit color and elevation domains are provided.

Implements automatic fallbacks to CPUAggregator whenever unsupported layer features, non-float32 attributes, or device buffer size limits are encountered. Also updates WGSL shaders for grid and screen-grid cell layers with bitcast-based NaN validation and adds WGSL uniform struct definitions to bin options.

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

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T19:59:52.251025Z
We couldn’t complete this review. Comment @codex review to try again.
e6e7f7a 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue was found.

Summary

GridLayer gains two-channel WebGPU aggregation, sharing column preparation and reduction with ScreenGridLayer.

  • GridLayer aggregates color and elevation on WebGPU.
  • Grid and ScreenGrid use one shared WebGPU reducer.
  • Grid cell shaders check NaN values through float bits.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[GridLayer or ScreenGridLayer] --> B{Compute requirements met?}
  B -->|No, accessor inputs| C[CPU aggregation]
  B -->|Yes| D{Input buffers fit?}
  D -->|No, accessor inputs| C
  D -->|No, GPU-only inputs| E[Report buffer-limit error]
  D -->|Yes| F[Shared WebGPU reduction]
  F --> G[GPU result vectors]
  G --> H[Cell layer]
Loading

Reviews (12) · Last reviewed commit: "Check aggregation input storage binding ..." · Reviewed by Greptile

@coveralls

coveralls commented Nov 6, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 84.3% (-0.4%) from 84.652% — codex/webgpu-grid into master

@ibgreen
ibgreen force-pushed the codex/webgpu-screen-grid branch from 69c129d to ba26bba Compare November 6, 2026 20:35

@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.

Stale Bugbot comment from a previous run.

@ibgreen
ibgreen force-pushed the codex/webgpu-screen-grid branch from 5829a37 to 84ba584 Compare November 7, 2026 18:18
Base automatically changed from codex/webgpu-screen-grid to master November 7, 2026 18:30

@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 1 potential issue.

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 1b67247. Configure here.

@ibgreen
ibgreen merged commit 79e29fc into master Nov 8, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/webgpu-grid branch November 8, 2026 13:28
@ibgreen ibgreen mentioned this pull request Nov 9, 2026
14 of 70 tasks
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.

2 participants