Skip to content

feat(aggregation-layers): clip Heatmap points during WebGPU accumulation - #11218

Merged
ibgreen merged 2 commits into
masterfrom
codex/heatmap-webgpu-clip
Nov 19, 2026
Merged

ibgreen merged 2 commits into
masterfrom
codex/heatmap-webgpu-clip

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

For #10712

Background

Heatmap's WebGPU weight pass runs shader extension hooks but does not receive ClipExtension's bounds. Supply those bounds so excluded source points contribute no density.

Change List

  • Forward ClipExtension bounds to Heatmap weight accumulation
  • Allow ClipExtension with borrowed Heatmap GPUVectors
  • Unit tests compare density textures for both input paths
  • Documentation for source clipping and display clipping

Verified with lint, package build, and two Chromium WebGPU regression tests.


Note

Low Risk
Adds WebGPU clipping support to HeatmapLayer and ClipExtension with no impact on existing WebGL accumulation logic.

Overview
Adds support for ClipExtension to filter HeatmapLayer source points during WebGPU weight accumulation, including when using borrowed GPUVector inputs.

ClipExtension now implements getAggregationShaderProps so aggregation passes can consume the same clip bounds as standard draw passes. In HeatmapLayer, clip uniform changes immediately invalidate the weight map and pass the clip parameters to the weight accumulation transform. When source points are clipped (clipByInstance !== false), ClipExtension is omitted from the display TriangleLayer; setting clipByInstance: false routes clipping to the rendered display quad instead.

TriangleLayer now also rebuilds its model on extension changes to update shader plugins when toggling clip modes.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T23:26:28.842125Z b1c46a3 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 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The follow-up changes appear safe to merge.

Summary

Adds WebGPU heatmap source clipping for accessor data and borrowed GPU vectors, while keeping display-only clipping available.

  • WebGPU heatmaps can clip source points before density is accumulated.

No new actionable issues found in the follow-up changes.

Reviews (2) · Last reviewed commit: "Rebuild Heatmap display shaders when cli..." · Reviewed by Greptile

@coveralls

coveralls commented Nov 18, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.473% (-0.04%) from 82.51% — codex/heatmap-webgpu-clip into master

@ibgreen
ibgreen merged commit 782e28e into master Nov 19, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/heatmap-webgpu-clip branch November 19, 2026 12:40

@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 8466418 after merge; follow-ups below. No P1s.

On WebGPU, source clipping tests each raw position against clipBounds with inclusive left and bottom edges, as instanced layers do. Both new WebGPU unit tests pass in CI.

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


Generated by Claude Code

Comment on lines +551 to +553
private _clipsSourcePoints(): boolean {
return this.context.device.type === 'webgpu' && this.props['clipByInstance'] !== false;
}

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: By default WebGPU now drops outside points, so density spreads past the bounds. On WebGL the weight pass gets the clip-geometry plugin but no bounds, so I expect it to discard every splat.

  • No WebGL test covers HeatmapLayer with ClipExtension. I did not run one.

Could the WebGL weight pass get the bounds or drop the plugin, with the docs saying what WebGL does?

Details
  • _clipsSourcePoints() is always false on WebGL, so _updateWeightmap skips getAggregationShaderProps for ClipExtension.
  • The clip-geometry filter at line 573 applies only on WebGPU, and weights-fs.glsl.ts calls DECKGL_FILTER_COLOR.
  • The clip module has no defaultUniforms, so luma.gl starts bounds at zero.

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