Repository navigation
Add an async readback adapter for CPU aggregation comparisons - #11077
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no outstanding findings remain. SummaryAdds
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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.
chrisgervang
left a comment
There was a problem hiding this comment.
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.

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
ReadbackAggregatorwith CPU bin/value callbacksVerified 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 specializedCPUAggregatorsubclass that asynchronously copies borrowed GPU columns (GPUVectorpositions 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
float32columns 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 viaisLoadedandonUpdatelifecycle notifications.Exports the new class and types from
@deck.gl/aggregation-layersanddeck.gl, and includes documentation with aGridLayercomparison 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.