Skip to content

Add an async readback adapter for CPU aggregation comparisons - #11077

Merged
ibgreen merged 5 commits into
masterfrom
codex/aggregation-readback-adapter
Nov 10, 2026
Merged

ibgreen merged 5 commits into
masterfrom
codex/aggregation-readback-adapter

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

For #10712.

Background

GPUVector inputs cannot use CPU aggregation without a readback. Add an opt-in adapter so applications can compare CPU and GPU aggregation with the same buffers, including copy latency.

Change List

  • Add ReadbackAggregator with CPU bin/value callbacks
  • Preserve strided inputs, prefixes, and borrowed buffer ownership
  • Ignore stale copies and report asynchronous failures
  • Document a Cartesian GridLayer A/B example
  • Unit tests
  • Documentation

Verified the focused WebGPU/readback and GridLayer integration regression, yarn lint, and all 119 Node tests after review fixes. CPU copies allocate no GPU buffers. Failed CPU callbacks stay unloaded; transient buffer-copy failures retry once automatically, then remain retryable on a later update. Initial inputs are single-chunk float32 columns with COPY_SRC buffers. The comparison example explicitly selects a WebGPU device and Cartesian view. Package compilation and final Lerna builds pass (Nx workspace state directed to writable temporary storage). All current-head CI jobs and patch coverage pass. Greptile and Bugbot reviews pass, and all five review threads are answered and resolved.


Note

Low Risk
Low risk as this adds an opt-in aggregator adapter along with tests and documentation, leaving existing layer workflows and core aggregation logic unaffected.

Overview
Adds ReadbackAggregator, a specialized CPUAggregator subclass that asynchronously copies borrowed GPU columns (GPUVector positions and weights) back to the CPU. This enables direct benchmarking and output comparisons between WebGPU compute and CPU aggregation on identical buffer inputs.

The adapter extracts strided or interleaved float32 columns into CPU-backed attributes without allocating intermediate GPU buffers. It incorporates revision tracking to ignore obsolete in-flight readbacks, automatically retries transient read failures, and updates layer loading state via isLoaded and onUpdate lifecycle notifications.

Exports the new class and types from @deck.gl/aggregation-layers and deck.gl, and includes documentation with a GridLayer comparison example alongside end-to-end integration tests.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 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-09T18:08:17.242902Z 645265e 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 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no outstanding findings remain.

Summary

Adds ReadbackAggregator to compare CPU and GPU aggregation using the same borrowed GPU buffers.

  • CPU aggregation can now read borrowed GPU columns asynchronously.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Borrowed GPU columns] --> B[Async copy to CPU]
  B --> C{Inputs still current?}
  C -->|No| D[Ignore copy]
  C -->|Yes| E[Run CPU aggregation]
  E -->|Success| F[Mark loaded and notify layer]
  E -->|Failure| G[Report error and remain unloaded]
Loading

Reviews (6) · Last reviewed commit: "List the readback adapter input formats ..." · Reviewed by Greptile

@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 645265e. Configure here.

@coveralls

coveralls commented Nov 9, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.314% (-0.4%) from 83.673% — codex/aggregation-readback-adapter into master

@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 59be55e; recommend approval. No P1s.

On swiftshader WebGPU, 20 readbacks left the active buffer count unchanged. Destroying the adapter mid-copy raised no error and sent no update. The open items are in the docs.

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

Comment thread docs/whats-new.md Resolved
@ibgreen
ibgreen merged commit 26cd58a into master Nov 10, 2026
13 of 14 checks passed
@ibgreen
ibgreen deleted the codex/aggregation-readback-adapter branch November 10, 2026 14:50
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