Skip to content

Optimize list_contains with prepared constant sets - #10052

Open
robert3005 wants to merge 10 commits into
rk/list-contains-benchmarksfrom
claude/friendly-knuth-dj6ed1-list-contains
Open

robert3005 wants to merge 10 commits into
rk/list-contains-benchmarksfrom
claude/friendly-knuth-dj6ed1-list-contains

Conversation

@robert3005

@robert3005 robert3005 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Replace constant-set membership comparison/OR chains with prepared, single-pass probes

@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 7 benchmarks

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

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
❌ 7 regressed benchmarks
✅ 2055 untouched benchmarks
⏩ 503 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime dict_canonicalize_gt_u8_avx512[1000000] 422.7 µs 836.6 µs -49.47%
❌ Simulation optimize_lookup_predicate[ids=192, shape=in_list] 49.9 µs 75.9 µs -34.2%
❌ Simulation optimize_lookup_predicate[ids=128, shape=in_list] 50.6 µs 73.2 µs -30.92%
❌ Simulation optimize_lookup_predicate[ids=64, shape=in_list] 50.4 µs 70.6 µs -28.6%
❌ Simulation optimize_lookup_predicate[ids=16, shape=in_list] 51.2 µs 69.5 µs -26.23%
❌ Simulation optimize_lookup_predicate[ids=256, shape=in_list] 79.1 µs 105.3 µs -24.9%
❌ Simulation optimize_lookup_predicate[ids=1, shape=in_list] 74.4 µs 89.9 µs -17.25%
⚡ Simulation i64_random_chunked[256] 20,802.2 µs 232 µs ×90
⚡ Simulation i64_random[256] 5,685.6 µs 134.9 µs ×42
⚡ Simulation utf8_random[256] 14,403.7 µs 371.7 µs ×39
⚡ Simulation nested_list_random[32] 7.4 ms 1 ms ×7.2

Tip

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


Comparing claude/friendly-knuth-dj6ed1-list-contains (77467d3) with rk/list-contains-benchmarks (27f94c1)

Open in CodSpeed

Footnotes

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

@robert3005
robert3005 removed this pull request from stack #10055 September 25, 2026 14:05
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from f1eea0e to ef75b12 Compare September 25, 2026 14:06
@robert3005
robert3005 changed the base branch from develop to rk/list-contains-sql-null-semantics September 25, 2026 14:06
@robert3005
robert3005 added this pull request to stack #10058 September 25, 2026 14:06
@robert3005 robert3005 changed the title Optimise list_contains to avoid chained ORs and add option to follow sql null semantics Optimize list_contains with prepared constant sets Sep 25, 2026
@robert3005
robert3005 removed this pull request from stack #10058 September 25, 2026 14:09
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from ef75b12 to f350f7b Compare September 25, 2026 14:09
@robert3005
robert3005 changed the base branch from rk/list-contains-sql-null-semantics to rk/list-contains-benchmarks September 25, 2026 14:09
@robert3005
robert3005 added this pull request to stack #10061 September 25, 2026 14:09
@joseph-isaacs

joseph-isaacs commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

How do i extend this to work for new custom kernels?

I really think we want to make probe an array to allow reduce/execute rules?

@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch 2 times, most recently from 3e6c3cb to 12f4b8f Compare September 25, 2026 16:28
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from 12f4b8f to 4b5ce4a Compare September 25, 2026 17:10
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from 4b5ce4a to 74eda6a Compare September 25, 2026 17:26
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch 2 times, most recently from ab3ce3b to fd2586b Compare September 28, 2026 20:43
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch 3 times, most recently from cfed2d7 to b888b1b Compare September 28, 2026 22:28
Comment thread vortex-array/src/arrays/constant/vtable/canonical.rs Outdated
Comment thread vortex-array/src/arrays/constant/vtable/canonical.rs Outdated
Comment thread vortex-array/src/arrays/constant/vtable/canonical.rs
Comment thread vortex-array/src/scalar_fn/fns/list_contains/prepared/array.rs Outdated
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from 5bea57b to 6207abb Compare September 29, 2026 19:12
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from 6207abb to 159aaff Compare September 29, 2026 19:13
Replace comparison/OR chains with prepared membership probes, normalize
constant sets, and evaluate list and needle columns together. Include
canonicalization support and probe regressions.

Build on the separate SQL null-semantics and benchmark changes.

Signed-off-by: Robert Kruszewski <github@robertk.io>
Import the execution-context trait, remove trailing macro commas, and
construct the struct fixture outside the generated fallible test wrapper.

Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from 159aaff to 77f114d Compare September 29, 2026 21:09
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
parent: ArrayView<'_, ScalarFn>,
child_idx: usize,
) -> VortexResult<Option<ArrayRef>> {
if parent.scalar_fn().is::<ListContains>() {

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 is a hack, we essentially have common setup we would like to share across chunks, if we just dispatch over each chunk there's no place to store the shared state

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/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants