Skip to content

Replace ToCanonical trait usages with execute#8609

Open
robert3005 wants to merge 2 commits into
developfrom
claude/nice-hypatia-g68zgt
Open

Replace ToCanonical trait usages with execute#8609
robert3005 wants to merge 2 commits into
developfrom
claude/nice-hypatia-g68zgt

Conversation

@robert3005

@robert3005 robert3005 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

This also removes ArrayBuilder::extend_from_array and moves that logic
in to ArrayRef::append_to_builder

Plumb ExecutionCtx through more methods instead of creating fresh one.

Fixes: #3235

Signed-off-by: Robert Kruszewski github@robertk.io

@robert3005 robert3005 requested review from a team, 0ax1, AdamGS and gatesn June 27, 2026 00:25
@robert3005 robert3005 added the changelog/chore A trivial change label Jun 27, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 4 improved benchmarks
❌ 10 regressed benchmarks
✅ 1581 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation extend_from_array_zctl[(1000, 8)] 238.9 µs 402 µs -40.57%
Simulation extend_from_array_non_zctl_overlapping[(1000, 8)] 271.3 µs 432 µs -37.19%
Simulation extend_from_array_non_zctl_overlapping[(1000, 32)] 735.7 µs 894.8 µs -17.79%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 169.1 µs 205.6 µs -17.72%
Simulation slice_empty_vortex 339.4 ns 397.8 ns -14.66%
Simulation extend_from_array_zctl[(1000, 64)] 1 ms 1.2 ms -13.63%
Simulation extend_from_array_zctl[(10000, 8)] 1.9 ms 2.2 ms -10.57%
Simulation compact_sliced[(4096, 90)] 750 ns 838.1 ns -10.51%
Simulation extend_from_array_non_zctl_overlapping[(10000, 8)] 2.2 ms 2.5 ms -10.41%
Simulation i32_small_overlapping 39.9 µs 44.3 µs -10.02%
Simulation chunked_bool_canonical_into[(1000, 10)] 26.3 µs 15.6 µs +68.17%
Simulation bench_many_codes_few_values[1024] 529.7 µs 364.2 µs +45.47%
Simulation chunked_varbinview_canonical_into[(100, 100)] 259.7 µs 224.2 µs +15.85%
Simulation chunked_varbinview_into_canonical[(100, 100)] 306.7 µs 271.1 µs +13.15%

Tip

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


Comparing claude/nice-hypatia-g68zgt (d7c69bd) with develop (88222ac)

Open in CodSpeed

Footnotes

  1. 4 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.

This also removes ArrayBuilder::extend_from_array and moves that logic
in to ArrayRef::append_to_builder

Plumb ExecutionCtx through more methods instead of creating fresh one.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 force-pushed the claude/nice-hypatia-g68zgt branch from 5e975ca to f8f6a90 Compare June 27, 2026 15:12
Signed-off-by: Robert Kruszewski <github@robertk.io>
builder: &mut dyn ArrayBuilder,
ctx: &mut ExecutionCtx,
) -> VortexResult<()> {
let Some(builder) = builder.as_any_mut().downcast_mut::<ListBuilder<u64>>() else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builder_with_capacity(DType::List, ...) returns a ListViewBuilder<u64, u64>, so generic callers that allocate the canonical builder and then append a ListArray now hit this branch and error out instead of appending. For example, zip/case_when build the default list builder and append sliced branches through append_to_builder. This should either append into the canonical ListViewBuilder or fall back through execute::<ListViewArray> before appending.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part needs reworking. Needs to do a different downcast here

)?
.0;

let len = u.int_in_range(0..=2048)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len can now be as high as 2048, but random_strictly_sorted_ends still randomly chooses PType::U8 and later does u8::try_from(e).vortex_expect(...) after forcing the last end toward this target. Ordinary fuzzer input can therefore panic during Arbitrary instead of returning arbitrary::Error. Please choose an end type that can represent the generated max end, cap the target by the chosen type, or return an error instead of vortex_expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move logic into append_to_builder

3 participants