Skip to content

Commit 06a86d9

Browse files
committed
Clarify RowFn length validation docs
Signed-off-by: Connor Tsui <[email protected]>
1 parent 56ca4a8 commit 06a86d9

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎vortex-array/src/scalar_fn/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! implementations. Expressions ([`crate::expr::Expression`]) reference scalar functions
88
//! at each node.
99
//!
10-
//! Strict functions with row-at-a-time kernels can implement [`unstable::row::RowFn`]. It handles
10+
//! Strict functions with row-at-a-time kernels can implement `unstable::row::RowFn`. It handles
1111
//! decoding, constants, null propagation, output construction, and validity. This API requires the
1212
//! `unstable_row_fns` feature and has no compatibility guarantees. Implement [`ScalarFnVTable`]
1313
//! directly for columnar kernels and functions that alias an input or can produce null from valid

‎vortex-array/src/scalar_fn/unstable/row/types/element/tuple/element_tuple.rs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,17 @@ pub trait ElementTuple: 'static + private::Sealed {
187187
fn per_row_views(columns: &Self::Columns) -> Option<Self::Views<'_>>;
188188

189189
/// Whether every view contains exactly `row_count` rows.
190+
///
191+
/// The executor calls this once before the all-per-row hot loop. A successful check gives LLVM
192+
/// a dominating equality between the loop bound and every source length, which lets it optimize
193+
/// the tuple access as one fixed-length traversal.
190194
fn view_lens_match(views: &Self::Views<'_>, row_count: usize) -> bool;
191195

192196
/// Whether every per-row argument contains exactly `row_count` rows.
193197
///
194-
/// This provides the same guarantee as [`view_lens_match`](Self::view_lens_match) when
195-
/// [`per_row_views`](Self::per_row_views) declines a mixed per-row and batch-constant tuple. A
196-
/// batch constant is exempt because it was collapsed to one row.
198+
/// This is the mixed-shape equivalent of [`view_lens_match`](Self::view_lens_match) when
199+
/// [`per_row_views`](Self::per_row_views) declines. It runs once before the hot loop for the
200+
/// same LLVM optimization. A batch constant is exempt because decoding collapsed it to one row.
197201
fn decoded_lens_match(columns: &Self::Columns, row_count: usize) -> bool;
198202

199203
/// Read one row from borrowed views.

0 commit comments

Comments
 (0)