vortex-row: RowEncode ScalarFn#7992
Closed
joseph-isaacs wants to merge 1 commit into
Closed
Conversation
Add the RowEncode variadic scalar function: encode N input columns into
a single ListView<u8> in a five-phase pipeline.
Phase 1: size pass via `compute_sizes`.
Phase 2: allocate a zero-initialized output buffer sized to fit every
row's encoded bytes; bail if the total exceeds u32::MAX.
Phase 3: build per-row `listview_offsets`: i * fixed_per_row for the
pure-fixed case, or i * fixed_per_row + exclusive cumsum of
varlen lengths otherwise. Uses the simple `Vec::push` +
`checked_add` loop.
Phase 4: walk columns left-to-right and call `dispatch_encode` for
every column (cursor path for all). Each call writes its
per-row bytes at `offsets[i] + cursors[i]` and advances the
cursor.
Phase 5: build the ListView<u8> via the validating `try_new`
constructor.
`dispatch_encode` is the canonicalize-then-`codec::field_encode`
fallback; in-crate kernel arms and the inventory registry land in PR 3.
The `RowEncodeKernel` trait is defined but unused. PR 2 will iterate
on this pipeline (skip zero-init, skip ListView validation, auto-
vectorize the offsets loop, etc.).
Signed-off-by: Claude <noreply@anthropic.com>
This was referenced May 18, 2026
This was referenced May 18, 2026
Closed
Merging this PR will improve performance by 14.29%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | new_alp_prim_test_between[f32, 16384] |
118.3 µs | 103.8 µs | +13.96% |
| ⚡ | Simulation | new_bp_prim_test_between[i16, 32768] |
132.3 µs | 120.1 µs | +10.23% |
| ⚡ | Simulation | new_alp_prim_test_between[f32, 32768] |
182.1 µs | 153.2 µs | +18.85% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/row-c07-rowencode-scalarfn (40783a6) with claude/row-c06-rowsize-scalarfn (5374f3b)
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.
Part 7 of 25 in the stacked PR series adding
vortex-row.This PR contains exactly one commit; review just that diff in isolation.
What this commit does
Adds the RowEncode variadic scalar function: encode N input columns into a single ListView in a five-phase pipeline.
compute_sizes.listview_offsetsviai * fixed_per_row(pure-fixed) ori * fixed_per_row + exclusive cumsum of varlen lengths. Uses the simpleVec::push+checked_addloop.dispatch_encodefor every column. Each call writes its per-row bytes atoffsets[i] + cursors[i]and advances the cursor.try_newconstructor.dispatch_encodeis the canonicalize-then-codec::field_encodefallback; in-crate kernel arms and the inventory registry land in PR 3. PR 2 iterates on this pipeline (skip zero-init, skip ListView validation, auto-vectorize the offsets loop, etc.).Stack
claude/row-c01-crate-scaffoldingclaude/row-c02-sortfield-optionsclaude/row-c03-codec-fixed-widthclaude/row-c04-codec-varlenclaude/row-c05-codec-nestedclaude/row-c06-rowsize-scalarfnclaude/row-c07-rowencode-scalarfnclaude/row-c08-convert-columns-tests-benchclaude/row-c09-skip-listview-validationclaude/row-c10-validity-fast-pathclaude/row-c11-skip-zero-initclaude/row-c12-vectorize-pure-fixed-offsetsclaude/row-c13-vectorize-mixed-offsetsclaude/row-c14-varlen-block-copy-nonoverlappingclaude/row-c15-walk-varbinview-directlyclaude/row-c16-arith-write-fast-pathclaude/row-c17-specialize-constant-arithclaude/row-c18-kernel-dispatch-helpersclaude/row-c19-inventory-registryclaude/row-c20-constant-kernelclaude/row-c21-dict-kernelclaude/row-c22-patched-kernelclaude/row-c23-runend-kernelclaude/row-c24-bitpacked-kernelclaude/row-pr3-kernelsBase of this PR: #7991 (
claude/row-c06-rowsize-scalarfn)Next in stack: #7993 (
claude/row-c08-convert-columns-tests-bench)Combined context
For the full design + rationale, see PR #7985 (top of stack).