Repository navigation
Conversation
Merging this PR will degrade performance by 21.33%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | filter_neon[8] |
1.1 µs | 2.1 µs | -50.44% |
| ❌ | WallTime | threshold_neon[80] |
4.6 µs | 8.2 µs | -43.8% |
| ❌ | Simulation | decode_primitives[i64, (1000, 32)] |
24.1 µs | 38.3 µs | -37.07% |
| ❌ | WallTime | threshold_neon[64] |
4.2 µs | 6.7 µs | -36.79% |
| ❌ | WallTime | threshold_neon[8] |
2.8 µs | 3.9 µs | -27.82% |
| ❌ | WallTime | filter_neon[80] |
3.1 µs | 3.9 µs | -20.25% |
| ❌ | WallTime | filter_neon[64] |
2.9 µs | 3.6 µs | -19.52% |
| ❌ | WallTime | threshold_avx2[8] |
1.9 µs | 2.4 µs | -17.58% |
| ❌ | WallTime | threshold_avx2[64] |
3 µs | 3.4 µs | -12.74% |
| ❌ | WallTime | bitpack_blocked_compress_avx2 |
6.7 µs | 7.6 µs | -11.59% |
| ❌ | WallTime | threshold_avx2[80] |
3.3 µs | 3.7 µs | -11.48% |
| ❌ | WallTime | scalar_subtract_neon |
10.9 µs | 12.2 µs | -10.47% |
| ⚡ | Simulation | sum_v2_i64 |
225.1 µs | 194.2 µs | +15.92% |
| ⚡ | Simulation | sum_i64 |
225.3 µs | 194.3 µs | +15.92% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mk/lambda-expressions (676b887) with mk/variable-expressions (5625bb8)
|
This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days |
d8e744f to
7929cfb
Compare
Signed-off-by: Matt Katz <[email protected]>
725d553 to
78ce193
Compare
Signed-off-by: Matt Katz <[email protected]>
Summary
Adds lambdas as arguments of higher-order scalar functions, such as
list_transform(list, x -> x + $.a)in the next PR.Lambdais syntax: parameter names and a body. It is not an expression; it only appears inExpression::HigherOrder { scalar_fn, children, lambdas }, a scalar function applied to its children and then to its lambdas.Binding a higher-order node asks the function for each lambda's parameter dtypes (
ScalarFnVTable::lambda_params), binds the body, and turns every outer reference in it ($, a field path such as$.a, or a variable of an enclosing lambda) into an extra input. The outer references become extra children of the node:The result is an ordinary
BoundExpression::Scalar, so field pruning, partitioning and array rules see the outer references as plain children.BoundLambdais the rewritten lambda,(x, a) -> x + awith its dtypes, held in the function's options.BoundLambda::evaluate(inputs)runs the body over arrays.Function hooks
ScalarFnVTablegains two defaulted methods, likereduceorvalidity, that only higher-order functions implement:lambda_params: the parameter dtypes of a lambda, given the dtypes of the value arguments;with_lambdas: the function's options holding the bound lambdas.The defaults reject lambdas, so binding a
HigherOrdernode with an ordinary function fails with "does not take lambda arguments". DuckDB works the same way: a scalar function carries an optional lambda-binding callback and keeps the bound body in its bind data.Details
evaluatecasts such inputs back.ArrayRef::applybinds a higher-order node before applying it.Testing
cargo clippy -p vortex-array --all-targets --all-features -- -D warningscargo nextest run -p vortex-arraycargo test --doc -p vortex-arraycargo +nightly-2026-09-10 fmt -p vortex-array