Skip to content

feat(layers): use typed GPU attributes in ScatterplotLayer - #10882

Merged
ibgreen merged 11 commits into
masterfrom
codex/scatterplot-gpu-attributes
Oct 23, 2026
Merged

ibgreen merged 11 commits into
masterfrom
codex/scatterplot-gpu-attributes

Conversation

@ibgreen

@ibgreen ibgreen commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Background

Attributes currently expose buffers and raw constants separately. Introduce typed GPU outputs and migrate ScatterplotLayer as the first consumer, borrowing buffers without copying or transferring ownership.

Change List

  • Add Attribute.getGPUVector() and AttributeManager.getGPUVectors()
  • Adapt GPUVectorModel under lib/luma-upstream
  • Bind typed columns and packed buffers through the model
  • Separate mixed WebGPU vector and constant bindings
  • Synchronize raw constants across both attribute setters
  • Preserve fp64 inputs, normalization, grouping, and transition storage
  • Unit tests for layouts, updates, ownership, and cleanup
  • Render regression using existing Scatterplot golden images
  • Documentation for typed outputs and their lifetimes

CI passes: coverage, WebGPU, website, and Python. Local lint, core types, new regressions, and WebGPU Scatterplot renders pass.


Note

Medium Risk
Changes core attribute-to-GPU binding and adds a parallel model path used by ScatterplotLayer; buffer borrowing and WebGPU constant-buffer splitting increase the chance of subtle rendering or lifetime bugs, though legacy layers keep the existing binding flow.

Overview
Introduces borrowed GPUVector / GPUConstant views from attributes via Attribute.getGPUVector() and AttributeManager.getGPUVectors(), including transition overrides and fp64 / normalized-constant layout details. Constant handling is refactored so raw vertex-format bytes stay available for WebGPU buffer grouping while shader-facing values stay in sync.

ScatterplotLayer is the first layer on the new path: it builds a GPUVectorModel instead of Model, and Layer routes attribute updates through typed columns plus existing packed buffer groups (with separate WebGPU bindings when vectors and constants mix in one layout). Internal GPUVectorModel uploads WebGPU-only constant vertex buffers and cleans them up on layout changes.

Docs, unit/integration tests, and a scatterplot render case with strided external position buffers cover lifetimes, grouping, and regressions. Supplying GPU vectors via data.attributes is explicitly out of scope for this integration.

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

@coveralls

coveralls commented Oct 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 84.064% (+0.3%) from 83.717% — codex/scatterplot-gpu-attributes into master

@ibgreen
ibgreen requested a review from Pessimistress October 21, 2026 03:25
@ibgreen
ibgreen marked this pull request as ready for review October 21, 2026 03:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T03:28:48.621112Z 01009fb Draft marked ready
ℹ️ 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: 01009fbbdf

ℹ️ 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 Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the earlier build-breaking damage is fixed.

Summary

Adds borrowed typed GPU attributes and makes ScatterplotLayer their first consumer.

  • Attributes expose typed GPU views that borrow their existing storage.
  • ScatterplotLayer binds typed columns through backend-specific GPU buffers.

No new actionable issues were found in the changes since the previous review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[AttributeManager] --> B[GPUVector and GPUConstant views]
  A --> C[Packed buffer bindings]
  B --> D[GPUVectorModel]
  C --> D
  D --> E[ScatterplotLayer draw]
Loading

Reviews (5) · Last reviewed commit: "fix(core): restore complete layer source" · Reviewed by Greptile

Comment thread modules/core/src/lib/layer.ts Resolved
Comment thread modules/core/src/lib/layer.ts Resolved
@ibgreen
ibgreen merged commit abad7af into master Oct 23, 2026
8 checks passed
@ibgreen
ibgreen deleted the codex/scatterplot-gpu-attributes branch October 23, 2026 07:57
@chrisgervang chrisgervang mentioned this pull request Oct 26, 2026
53 of 66 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.

3 participants