Skip to content

feat(layers): use typed GPU attributes in standard layers - #10907

Merged
ibgreen merged 5 commits into
masterfrom
codex/typed-gpu-standard-layers
Oct 27, 2026
Merged

ibgreen merged 5 commits into
masterfrom
codex/typed-gpu-standard-layers

Conversation

@ibgreen

@ibgreen ibgreen commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Follow up of #10882

Background

Extend typed attribute binding to the next group of standard instanced models. Indexed, multi-model, and specialized layers remain for subsequent migrations; user-provided GPU columns remain deferred.

Change List

  • Use deterministic terrain fixtures for lifecycle tests
  • Extend lifecycle helpers for devices, async updates, and cleanup
  • Migrate ArcLayer, LineLayer, and PointCloudLayer
  • Migrate IconLayer and inherited glyph rendering
  • Migrate TextBackgroundLayer
  • Add cross-backend constant and function update tests
  • Test borrowed buffers and typed text submodels

CI passes on current master: coverage, WebGPU unit/render tests, website, and Python. Async lifecycle and terrain regressions pass locally.

@coveralls

coveralls commented Oct 23, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 84.186% (+0.03%) from 84.16% — codex/typed-gpu-standard-layers into master

@Pessimistress

Copy link
Copy Markdown
Collaborator

The webgpu test step does not run unit tests right now:

"test-webgpu": "RENDER_TEST_DEVICE=webgpu ocular-test render",

@ibgreen
ibgreen force-pushed the codex/typed-gpu-standard-layers branch from 7673115 to 5519942 Compare October 26, 2026 22:43
@ibgreen
ibgreen marked this pull request as ready for review October 27, 2026 00:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T00:14:26.428604Z 48d687d 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.

@ibgreen
ibgreen merged commit 4b439fb into master Oct 27, 2026
8 checks passed
@ibgreen
ibgreen deleted the codex/typed-gpu-standard-layers branch October 27, 2026 00:13
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The PR changes rendering attribute binding for five standard layer types and their text sublayers.

The PR appears safe to merge, with a non-blocking gap in the new color-binding tests.

Findings

  1. P2 Wrong colors can pass tests ▶

Summary

Moves five standard layer models to GPUVectorModel, including inherited text glyph rendering.

  • Five standard layers bind their attributes through typed GPU models.
  • Async layer tests wait for updates and clean up after failures.
  • Terrain lifecycle tests use local mesh and image fixtures.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Layer accessors and binary data] --> B[AttributeManager]
  B --> C[GPUVector and GPUConstant]
  C --> D[GPUVectorModel]
  D --> E[WebGL or WebGPU bindings]
  F[TextLayer] --> G[Glyph and background layers]
  G --> B
Loading

Reviews (1) · Last reviewed commit: "test(utils): yield between deferred laye..." · Reviewed by Greptile

Comment on lines +141 to +149
expect(columns[colorAttribute]).toBeInstanceOf(varying ? GPUVector : GPUConstant);
if (varying) {
expect((columns[colorAttribute] as GPUVector).length).toBe(DATA.length);
const group = attributeManager.getAttributes()[colorAttribute].settings.bufferGroup;
if (backend === 'webgpu' && group) {
expect(model.bufferLayout.some(layout => layout.name === group)).toBe(true);
}
} else {
expect(Array.from((columns[colorAttribute] as GPUConstant).value)).toEqual(COLOR);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Wrong colors can pass tests

The WebGPU checks inspect fresh columns from getGPUVectors(), but never compare the model's bound color bytes. Both rows also use the same COLOR across all updates. With draw: false, a stale binding, wrong offset, or repeated first row could pass.

Use different colors for each row and update, then check the model's bound bytes using the resolved layout. Check the varying color binding on WebGL too.

Knowledge Base Used: Distribution and quality

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@chrisgervang chrisgervang mentioned this pull request Oct 29, 2026
29 of 30 tasks

@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 48d687d after merge; follow-ups below. No P1s. One P2: test-layer.md is missing the new device and draw options and the async onAfterUpdate.

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

Comment on lines +188 to +191
/** Render after each update. Disable for tests that only inspect attribute bindings. */
draw?: boolean;
/** Device used to initialize and render the layer. Defaults to the WebGL test device. */
device?: Device;

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: testLayer and testLayerAsync are public, and docs/api-reference/test-utils/test-layer.md doesn't list these options or say that testLayerAsync awaits a Promise from onAfterUpdate. Master still matches this PR.

Could we add these to its Usage list:

* `device` (`Device`, Optional) - the luma.gl device used to create and draw the layer. Default: the shared WebGL test device, or a `NullDevice` when WebGL is unavailable.
* `draw` (boolean, Optional) - draw the layer after each update. Default: `true`. Set to `false` when a test only inspects layer state or attributes.

and replace "When using TestLayerAsync, onAfterUpdate is called multiple times until all resources are loaded." with:

With `testLayerAsync`, `onAfterUpdate` runs after each update until the layer is loaded and no layer update is pending. It can return a Promise, which is awaited before the next update. `testLayer` does not wait for it.

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.

4 participants