feat(array): add scalar probes with lazy child contexts - #9843
feat(array): add scalar probes with lazy child contexts#9843joseph-isaacs wants to merge 1 commit into
Conversation
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | dict_canonicalize_gt_u8_neon[1000000] |
487.1 µs | 541.9 µs | -10.11% |
| ⚡ | WallTime | arrow_checked_add_u32_neon[16384] |
20.4 µs | 13.5 µs | +51.69% |
| ⚡ | WallTime | filtered_sink_i64_avx2[OneNullInEight] |
31.2 µs | 21.9 µs | +42.2% |
| ⚡ | WallTime | mul_u64_nonnull_neon |
21.3 µs | 15.1 µs | +40.77% |
| ⚡ | WallTime | filtered_sink_i64_avx512[OneNullInEight] |
31.2 µs | 22.3 µs | +40.12% |
| ⚡ | WallTime | filtered_sink_i64_avx2[NineNullsInTen] |
16.4 µs | 13.1 µs | +25.3% |
| ⚡ | WallTime | filtered_sink_i64_avx512[NineNullsInTen] |
16.5 µs | 13.5 µs | +22.41% |
| ⚡ | WallTime | dict_canonicalize_gt_u8_avx2[16000000] |
8 ms | 6.8 ms | +17.62% |
| ⚡ | WallTime | multiply_shapes_neon[(16384, PerRowPerRow)] |
20.3 µs | 17.3 µs | +17.56% |
| ⚡ | WallTime | mul_i64_nonnull_neon |
20.2 µs | 17.2 µs | +17.51% |
| ⚡ | WallTime | filtered_owned_i64_avx2[OneNullInEight] |
25.8 µs | 22.3 µs | +15.9% |
| ⚡ | Simulation | allocate_drop_arrow[0] |
456.9 ns | 402.7 ns | +13.45% |
| ⚡ | Simulation | compact_sliced[(1024, 90)] |
1.5 µs | 1.4 µs | +11.92% |
| ⚡ | Simulation | compact_sliced[(2048, 90)] |
1.6 µs | 1.4 µs | +11.42% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ji/array-probe-api (8146a99) with develop (d1fe2dc)
Footnotes
-
218 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. ↩
Summary
Add a borrowed scalar probe API so an encoding can retain preparation across a short series of random reads. This is the first PR in a two-PR stack; all encodings, including primitive, PCO, RLE, and RunEnd, use unit state and the default
execute_scalarpath here.The encoding implementations and paired benchmarks are in #9844, based on this PR’s branch. Merge this API layer first.
Changes
ArrayRef::probe(Once | Repeated)and bounds-checked scalar access including nullness.Option<&mut ProbeCtx<'a, ProbeState<'a>>>through the existing array vtable. The context combines encoding-local state with lazy, reusable child probes indexed by source slot.API Changes
Custom
OperationsVTableimplementations must declaretype ProbeState<'a> = ();unless they need local state. Overridingprobe_scalaris optional; its default preserves existing scalar execution.Validation
cargo nextest run -p vortex-array -p vortex-pco -p vortex-fastlanes -p vortex-runend: 3,886 passed, one skipped.cargo test --doc -p vortex-array: passed.cargo +nightly fmt --all, Python crate formatting check, andgit diff --check: passed.Cargo checks use
RUSTC_WRAPPER=after the sandbox's sccache permission failure. Encoding optimizations, their tests, and paired benchmarks belong in the stacked follow-up.