Skip to content

Move remaining expressions out of vortex-array to vortex-expr - #10768

Open
robert3005 wants to merge 2 commits into
rk/split-array-06-scalar-fnsfrom
rk/split-array-07-expr
Open

robert3005 wants to merge 2 commits into
rk/split-array-06-scalar-fnsfrom
rk/split-array-07-expr

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

after #10762 we can further split expressions into vortex-expr. We flip dependency order into vortex-array → vortex-expr → vortex-functions.

Expressions are about to move out of vortex-array into vortex-expr, which
means vortex-functions (whose scalar functions construct expressions) has to
sit above vortex-expr rather than below it. This commit flips the dependency
without moving the expression types yet:

- `select` returns to vortex-array's core builtins. The field-path analyses in
  vortex-expr (`referenced_field_paths`, immediate access) narrow through it
  alongside `get_item`, so it is part of the projection machinery those
  analyses are built on, like `get_item` and `pack`.
- `StatFn` moves from vortex-functions into `vortex_expr::stats::stat_fn`,
  registered by the new `vortex_expr::initialize`.
- The stats rewrite rules for `between`, `is_nan`, `like`, `list_contains`
  and `dynamic` move into `vortex_functions::pruning`, registered by
  `vortex_functions::initialize`. The shared pieces they build on (stat
  references, NaN guards, literal and cast stat folding) become the public
  `vortex_expr::stats::rewrite::helpers` module.
- `find_between` moves next to the `between` function it targets.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ps4mp7KF5c4p66aoSoXx5j
Signed-off-by: Claude <noreply@anthropic.com>
@robert3005 robert3005 added the changelog/break A breaking API change label Oct 24, 2026
@github-actions
github-actions Bot temporarily deployed to docs-preview/pr-10768 October 24, 2026 12:42 Inactive
Unbound `Expression`, binding, traversal, lambdas, proto serialization and
the expression constructors now live in `vortex-expr`; `vortex-array`
keeps arrays, the scalar function machinery, the builtins it is built on,
and `BoundExpression` with its reduce node and optimizer. The scalar
function vtable reduces over bound expressions, so keeping them next to it
lets every reduction rule stay monomorphized for expression trees as well
as array trees. `vortex-expr` re-exports `BoundExpression`. The layering is
`vortex-array -> vortex-expr -> vortex-functions`.

- `ScalarFnVTable::simplify` is generic over `ReduceNode`, like `reduce`,
  but stays a separate hook that only the expression optimizer applies: a
  simplification may rewrite a node into one whose nullability differs,
  which the array optimizer cannot accept (it must keep the exact dtype and
  defer constant masks to the kernel rules). `ReduceNode::is_same` lets
  rules such as the COALESCE rewrite compare operands.
- `new_expr`, `try_new_expr` and `try_new_bound_expr` move to
  `vortex_expr::ScalarFnExprExt`, `ArrayRef::apply`/`apply_bound` to
  `vortex_expr::ArrayExprExt`, and the expression half of the builtins to
  `vortex_expr::ExprBuiltins`. `ExprDisplay` moves to
  `vortex_array::scalar_fn::display`, and the tree renderer to
  `vortex_array::expr::display`.
- `ArrayRef::take_slot_unchecked`/`put_slot_unchecked` become public, like
  `with_slots`, so row-count substitution in `vortex-expr` still rewrites
  lazy arrays in place.

`vortex_array::expr` otherwise keeps only `stats`, which moves with the
aggregate split. The core builtins' expression-level tests move to
`vortex-expr`; the few array-level tests that used expressions now go through
`ArrayBuiltins`. The `expr_*` benches move to `vortex-expr`, which joins
the CodSpeed shard that builds `vortex-functions`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ps4mp7KF5c4p66aoSoXx5j
Signed-off-by: Claude <noreply@anthropic.com>
@robert3005
robert3005 force-pushed the rk/split-array-07-expr branch from d195163 to b691d5a Compare October 24, 2026 12:54
@codspeed

codspeed Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 0.54%

4 warnings, 1 note

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ Unable to measure the execution of 2 benchmarks

These benchmarks measured no execution time, so their results are not comparable and count as unchanged. This usually happens when the compiler removes the code under test.

Prevent compiler optimizations

See affected benchmarks

⚠️ 18 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 40 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 9 improved benchmarks
❌ 4 regressed benchmarks
✅ 2525 untouched benchmarks
🆕 3 new benchmarks
⏩ 81 skipped benchmarks1
🗄️ 45 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime mul_u64_nonnull_neon 20.7 µs 39.7 µs -47.88%
❌ CPU Simulation chunked_dict_primitive_canonical_into[f64, (1000, 1000, 10)] 153.7 µs 192.1 µs -20.01%
❌ CPU Simulation filter_random_by_mostly_false[10000] 3.7 µs 4.6 µs -18.63%
❌ Walltime threshold_avx512[80] 2.5 µs 2.8 µs -10.99%
⚡ CPU Simulation missing_stats[16] 85.8 µs 72.3 µs +18.68%
⚡ Walltime starts_with_avx512[8, VarBin] 46.2 µs 39.4 µs +17.04%
⚡ Walltime bitpack_blocked_compress_avx2 7.6 µs 6.6 µs +15.5%
⚡ Walltime add_constant_shapes_neon[(32768, PerRowConstant)] 16.2 µs 14.3 µs +12.94%
⚡ Walltime add_constant_shapes_neon[(32768, ConstantPerRow)] 16.3 µs 14.4 µs +12.77%
⚡ CPU Simulation test_scan_filter[int] 3.4 ms 3.1 ms +12.33%
⚡ CPU Simulation compare[1] 133.9 µs 121 µs +10.64%
⚡ Walltime add_constant_shapes_neon[(32768, PerRowNullableConstant)] 16.6 µs 15 µs +10.51%
⚡ CPU Simulation bench_compare_sliced_dict_primitive[(3333, 10000)] 75.2 µs 68.4 µs +10.05%
🆕 CPU Simulation pack_return_dtype[200] N/A 326 µs N/A
🆕 CPU Simulation pack_return_dtype[350] N/A 574.4 µs N/A
🆕 CPU Simulation optimize_or_chain[200] N/A 731.5 µs N/A

Tip

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


Comparing rk/split-array-07-expr (b691d5a) with rk/split-array-06-scalar-fns (fd2bbf1)

Open in CodSpeed

Footnotes

  1. 81 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. 45 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them. ↩

This branch was successfully deployed

1 active deployment
docs-preview/pr-10768 — b691d5a3 Deployed Oct 24, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants