Skip to content

Move scalar functions out of vortex-array into vortex-functions - #10762

Draft
robert3005 wants to merge 1 commit into
developfrom
rk/split-array-06-scalar-fns
Draft

robert3005 wants to merge 1 commit into
developfrom
rk/split-array-06-scalar-fns

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

vortex-array keeps the scalar function machinery (the ScalarFnVTable trait, binding, reduction, execution, the session registry and kernel registry) and the few functions its own arrays, validity and expressions are built on: literal, get_item and pack, is_null, is_not_null, not and the binary operators, and cast, mask and fill_null, which canonical arrays apply to their own children. That module is renamed from scalar_fn::fns to scalar_fn::builtin, matching ArrayBuiltins. Every other scalar function moves to the new vortex-functions crate:

  • byte_length, case_when, ext_storage, list_length, list_sum, merge, replace_time_zone, select, dynamic, stat, between, like, list_contains, variant_get, is_nan and zip, with their expression constructors in vortex_functions::expr (and expr::bound)
  • the kernels and parent-reduce rules for vortex-array's encodings, which vortex_functions::initialize now registers with a session's kernel registry instead of the encodings' static rule sets
  • the ArrayBuiltins/ExprBuiltins methods for the moved functions, which become the ArrayFunctions/ExprFunctions extension traits

apply_reduce_parent_rule lets a crate register a typed parent-reduce rule for an encoding it does not own. ArrayHaystack, LazyBitBufferBuilder, DeduplicatedBuffers::{extend_from_iter, finish}, ListScalar::element_values, is_not_null_node, build_row_comparator and merge_typed_scalar_as_variant become public for the moved kernels.

@robert3005 robert3005 added the changelog/break A breaking API change label Oct 23, 2026
@robert3005
robert3005 marked this pull request as draft October 23, 2026 22:47
vortex-array keeps the scalar function machinery (the `ScalarFnVTable` trait,
binding, reduction, execution, the session registry and kernel registry) and
the few functions its own arrays, validity and expressions are built on:
literal, get_item and pack, is_null, is_not_null, not and the binary
operators, and cast, mask and fill_null, which canonical arrays apply to their
own children. That module is renamed from `scalar_fn::fns` to
`scalar_fn::builtin`, matching `ArrayBuiltins`. Every other scalar function
moves to the new `vortex-functions` crate:

- byte_length, case_when, ext_storage, list_length, list_sum, merge,
  replace_time_zone, select, dynamic, stat, between, like, list_contains,
  variant_get, is_nan and zip, with their expression constructors in
  `vortex_functions::expr` (and `expr::bound`)
- the kernels and parent-reduce rules for vortex-array's encodings, which
  `vortex_functions::initialize` now registers with a session's kernel
  registry instead of the encodings' static rule sets
- the `ArrayBuiltins`/`ExprBuiltins` methods for the moved functions, which
  become the `ArrayFunctions`/`ExprFunctions` extension traits

`apply_reduce_parent_rule` lets a crate register a typed parent-reduce rule for
an encoding it does not own. `ArrayHaystack`, `LazyBitBufferBuilder`,
`DeduplicatedBuffers::{extend_from_iter, finish}`, `ListScalar::element_values`,
`is_not_null_node`, `build_row_comparator` and `merge_typed_scalar_as_variant`
become public for the moved kernels.

The umbrella crate re-exports the moved constructors under `vortex::expr` and
the crate as `vortex::functions`.

The CodSpeed workflow builds `vortex-functions` in the main-library shard, so
the moved benchmarks stay measured, and picks up `vortex-onpair` and
`vortex-arrow`, whose benchmarks no shard built.

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-06-scalar-fns branch from 714ed9d to fd2bbf1 Compare October 23, 2026 22:57
@codspeed

codspeed Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 7 benchmarks

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

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

⚡ 2 improved benchmarks
❌ 7 regressed benchmarks
✅ 2335 untouched benchmarks
🆕 199 new benchmarks
⏩ 76 skipped benchmarks1
🗄️ 43 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation decompress[u32, (1000, 256)] 31.2 µs 51.9 µs -39.95%
❌ Walltime starts_with_avx512[8, VarBin] 40.5 µs 46.2 µs -12.32%
❌ CPU Simulation filter_powerlaw_by_mostly_false[250000] 138.7 µs 158 µs -12.18%
❌ CPU Simulation density_sweep_dense_runs[0.001] 53.5 µs 60.4 µs -11.49%
❌ CPU Simulation filter_random_by_mostly_false[250000] 163.1 µs 183.1 µs -10.9%
❌ CPU Simulation filter_powerlaw_by_power_law[250000] 166.1 µs 184.8 µs -10.07%
❌ CPU Simulation filter_random_by_power_law[250000] 166 µs 184.5 µs -10.04%
⚡ CPU Simulation filter_random_by_mostly_false[10000] 31.1 µs 3.7 µs ×8.4
⚡ CPU Simulation test_repeated_scan_scalar_at[int] 318.8 µs 244.9 µs +30.16%
🆕 CPU Simulation append_to_varbin_builder[fsst/chunked/nonnull] N/A 21.6 ms N/A
🆕 CPU Simulation append_to_varbin_builder[fsst/chunked/nullable] N/A 18.3 ms N/A
🆕 CPU Simulation append_to_varbin_builder[fsst/dict/nonnull] N/A 15.3 ms N/A
🆕 CPU Simulation append_to_varbin_builder[fsst/dict/nullable] N/A 14.8 ms N/A
🆕 CPU Simulation append_to_varbin_builder[fsst/flat/nonnull] N/A 16.5 ms N/A
🆕 CPU Simulation append_to_varbin_builder[fsst/flat/nullable] N/A 11.7 ms N/A
🆕 CPU Simulation append_to_varbin_builder[offset/chunked/nonnull] N/A 16.7 ms N/A
🆕 CPU Simulation append_to_varbin_builder[offset/chunked/nullable] N/A 26.9 ms N/A
🆕 CPU Simulation append_to_varbin_builder[offset/dict/nonnull] N/A 18.2 ms N/A
🆕 CPU Simulation append_to_varbin_builder[offset/dict/nullable] N/A 17.9 ms N/A
🆕 CPU Simulation append_to_varbin_builder[offset/flat/nonnull] N/A 11.9 ms N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

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-06-scalar-fns (fd2bbf1) with develop (91b38f4)

Open in CodSpeed

Footnotes

  1. 76 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. 43 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 has not been deployed

No deployments
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