Skip to content

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

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

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.

@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
@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 9.1%

2 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

⚠️ 51 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

ℹ️ 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

⚡ 3 improved benchmarks
❌ 2 regressed benchmarks
✅ 2533 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
❌ CPU Simulation take_map[(0.01, 0.05)] 763.6 ns 1,604.4 ns -52.4%
❌ CPU Simulation take_map[(0.01, 0.1)] 6.7 µs 7.8 µs -13.21%
⚡ Walltime filter_neon[8] 1.4 µs 1.2 µs +18.89%
⚡ CPU Simulation stats_compute_is_constant_cached 112.7 µs 99.5 µs +13.34%
⚡ Walltime filter_neon[64] 2.2 µs 2 µs +11.49%
🆕 CPU Simulation pack_return_dtype[200] N/A 347.7 µs N/A
🆕 CPU Simulation pack_return_dtype[350] N/A 585.1 µs N/A
🆕 CPU Simulation optimize_or_chain[200] N/A 737.1 µ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 (123df13) with rk/split-array-06-scalar-fns (e33c436)

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. ↩

@github-actions
github-actions Bot temporarily deployed to docs-preview/pr-10768 October 24, 2026 13:02 Inactive
@robert3005
robert3005 force-pushed the rk/split-array-06-scalar-fns branch 2 times, most recently from 06bffcd to 137c718 Compare October 25, 2026 05:26
@robert3005
robert3005 force-pushed the rk/split-array-07-expr branch from b691d5a to e57d7c2 Compare October 25, 2026 06:49
@github-actions
github-actions Bot temporarily deployed to docs-preview/pr-10768 October 25, 2026 06:58 Inactive
@robert3005
robert3005 marked this pull request as draft October 26, 2026 09:48
@robert3005
robert3005 force-pushed the rk/split-array-06-scalar-fns branch from 137c718 to 0713434 Compare October 26, 2026 10:44
@robert3005
robert3005 force-pushed the rk/split-array-07-expr branch from e57d7c2 to d8a74d2 Compare October 26, 2026 10:44
@github-actions
github-actions Bot temporarily deployed to docs-preview/pr-10768 October 26, 2026 10:54 Inactive
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>
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>

This branch was successfully deployed

1 active deployment
docs-preview/pr-10768 — 123df131 Deployed Oct 26, 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