Skip to content

Implement RowFn batch execution - #9450

Merged
connortsui20 merged 3 commits into
developfrom
ct/row-fn-batch
Aug 20, 2026
Merged

Implement RowFn batch execution#9450
connortsui20 merged 3 commits into
developfrom
ct/row-fn-batch

Conversation

@connortsui20

@connortsui20 connortsui20 commented Aug 17, 2026

Copy link
Copy Markdown
Member

Rationale for this change

Connects the row execution layer to the scalar-function adapter.

What changes are included in this PR?

Adds constant handling, strict validity propagation, dense execution, direct valid-row execution for supporting sinks, and output validation. A partially valid signature that cannot execute directly on valid rows panics in this layer.

Encoding-aware reductions remain in #9347. Filter-and-scatter remains in #9349. Owned valid-row execution and its Default bound are in #9500. Nullary execution is in #9469.

What APIs are changed? Are there any user-facing changes?

Adds execution internals within the existing unstable_row_fns boundary. There are no stable API changes.

@codspeed-hq

codspeed-hq Bot commented Aug 17, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 3 improved benchmarks
❌ 1 regressed benchmark
✅ 1952 untouched benchmarks
⏩ 442 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_opt_into_canonical[(10, 100)] 591.9 µs 660.2 µs -10.34%
WallTime words_gather_scalar[65536] 9.4 µs 8.3 µs +13.58%
Simulation compress_fsst[(500, 64, 8)] 582.1 µs 524.5 µs +10.98%
Simulation compress_fsst[(500, 64, 4)] 517.1 µs 468.3 µs +10.42%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/row-fn-batch (dae66b7) with develop (27e6b40)2

Open in CodSpeed

Footnotes

  1. 442 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on develop (2322a97) during the generation of this report, so 27e6b40 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@connortsui20
connortsui20 force-pushed the ct/row-fn-batch branch 3 times, most recently from f1cdfed to a80d07c Compare August 17, 2026 20:12
@connortsui20
connortsui20 force-pushed the ct/row-fn-batch branch 2 times, most recently from 170a3c4 to 685de49 Compare August 17, 2026 21:11
Base automatically changed from ct/row-fn-framework to develop August 18, 2026 15:31
connortsui20 added a commit that referenced this pull request Aug 18, 2026
## Rationale for this change

- Tracking issue: #9130
- API tracking: #9129
- Epic: #9128

Implements typed row execution for the contracts in #9386. Batch
planning and orchestration are split into #9450.

## What changes are included in this PR?

Adds owned-output and sink-writing row loops, prepared and deferred
execution, the `ViewLen` contract, and decoding validation. This layer
does not yet connect the row loops to `execute_rows`.

## What APIs are changed? Are there any user-facing changes?

Extends the existing `unstable_row_fns` API. There are no stable API
changes.

---------

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/row-fn-batch branch 3 times, most recently from e22370d to 9476082 Compare August 18, 2026 19:09
Comment thread vortex-array/src/scalar_fn/unstable/row/visitor/plan.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/visitor/execute.rs Outdated
@connortsui20
connortsui20 force-pushed the ct/row-fn-batch branch 2 times, most recently from a547c07 to 4abc1cd Compare August 18, 2026 19:58
@connortsui20 connortsui20 added the changelog/feature A new feature label Aug 18, 2026
@connortsui20
connortsui20 force-pushed the ct/row-fn-batch branch 2 times, most recently from ec091a4 to f2c1dc8 Compare August 18, 2026 20:34
@connortsui20 connortsui20 changed the title Implement RowFn batch execution Implement RowFn batch execution Aug 18, 2026
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/constant.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/execute/sink.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/visitor/plan.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/mod.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/mod.rs
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/constant.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/output.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/output.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/valid_only.rs Outdated
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/valid_only.rs
Comment thread vortex-array/src/scalar_fn/unstable/row/batch/execute/constant.rs Outdated
@connortsui20
connortsui20 marked this pull request as ready for review August 19, 2026 18:44
Comment thread vortex-array/src/scalar_fn/unstable/row/execute/sink.rs
@connortsui20
connortsui20 marked this pull request as draft August 19, 2026 19:18
@connortsui20

Copy link
Copy Markdown
Member Author

actually Im going to split out a bunch of the cleanup changes

@connortsui20
connortsui20 changed the base branch from develop to ct/row-fn-cleanup August 19, 2026 19:57
@connortsui20
connortsui20 marked this pull request as ready for review August 19, 2026 19:59
Base automatically changed from ct/row-fn-cleanup to develop August 20, 2026 11:43
connortsui20 added a commit that referenced this pull request Aug 20, 2026
## Rationale for this change

- Progress towards #9130
- API tracking: #9129
- Epic: #9128

Separates the mechanical `RowFn` cleanup from batch execution in #9450.

## What changes are included in this PR?

Renames the fallibility constants to the positive `INFALLIBLE` contract,
removes `RowExecution` and `DenseWithRetry`, and returns arrays directly
from the executors. The tuple guard checks every decoded view length
before unchecked row access because `ViewLen::len` returns one member
length after its debug assertion.

## What APIs are changed? Are there any user-facing changes?

Renames the unstable `RowFn::FALLIBLE` and `SinkResult::FALLIBLE`
associated constants to `INFALLIBLE`. There are no stable API changes.

---------

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
pub(super) use super::visitor::RowPolicy;

/// The same-length input columns and metadata for one row-function execution.
pub(crate) struct Batch {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is function args? No

Rename `Batch` to `RowFnExecutionArgs` and `BorrowedExecutionArgs` to
`BorrowedRowFnArgs` so both names say which layer owns them.

Signed-off-by: Connor Tsui <connor@spiraldb.com>
@connortsui20
connortsui20 merged commit cb77d9a into develop Aug 20, 2026
77 of 79 checks passed
@connortsui20
connortsui20 deleted the ct/row-fn-batch branch August 20, 2026 13:58
connortsui20 added a commit that referenced this pull request Aug 20, 2026
## Rationale for this change

- Stacked on: #9450
- Tracking issue: #9130
- Epic: #9128

Adds direct valid-row execution for owned `RowFn` outputs before the
first nullable deferred owned consumer.

## What changes are included in this PR?

Adds `Default` to `OutputElement` and uses it only to initialize skipped
output positions. Batch execution masks those positions before returning
the array.

Owned infallible and deferred visits execute directly over null-tolerant
decoded inputs. Unsupported encodings continue to decline this path;
#9349 adds the later filter-and-scatter fallback.

## What APIs are changed? Are there any user-facing changes?

Extends the unstable `OutputElement` contract with `Default`. There are
no stable API changes.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants