compute: columnar TopK input (C3)#37749
Draft
antiguru wants to merge 1 commit into
Draft
Conversation
Generalize `render_topk` to consume its input as a `CollectionEdge` instead of decoding to `Vec` up front. A new `map_topk_key` helper forms the TopK `(key, value)` arrangement input off the edge: the `Vec` arm maps the collection and reuses the owned row (behaviorally identical to before), and the columnar arm reads the batch via `into_index_iter`, forms the hash and group key from borrowed datums, and materializes the value row inline, so no `ColumnarToVec` decode sits on the input path. The three TopK variants (`build_topk`, `render_top1_monotonic`, and the inline MonotonicTopK path) route their key-forming through the helper. Temporal bucketing keeps its sanctioned leaf decode, and the rare column-limit error path stays byte-identical on the `Vec` edge via `into_vec` (the identity there). The intra-operator `explode_one`/`ensure_monotonic` on `Vec` are unchanged. Producers still emit `Vec` in Wave 1, so the columnar arm is dead in production and this adds no runtime change. Adds `map_topk_key_arms_agree`, a cross-arm unit test feeding the same input as a `Vec` and a columnar edge and asserting identical `(key, value)` updates across several timestamps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
antiguru
force-pushed
the
columnar-c3-topk-input
branch
from
July 20, 2026 14:47
ec81e98 to
f4f4a8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove these sections if your commit already has a good description!
Motivation
Why does this change exist? Link to a GitHub issue, design doc, Slack
thread, or explain the problem in a sentence or two. A reviewer who has
no context should understand why after reading this section.
If this implements or addresses an existing issue, it's enough to link to that:
Closes
Fixes
etc.
Description
What does this PR actually do? Focus on the approach and any non-obvious
decisions. The diff shows the code --- use this space to explain what the
diff can't tell a reviewer.
Verification
How do you know this change is correct? Describe new or existing automated
tests, or manual steps you took.