Skip to content

Add Validity::definitely_all_invalid and use it for AllInvalid fast paths#8335

Closed
joseph-isaacs wants to merge 2 commits into
claude/cool-bardeen-l8jlsy-2-mask-eqfrom
claude/cool-bardeen-l8jlsy-3-definitely-all-invalid
Closed

Add Validity::definitely_all_invalid and use it for AllInvalid fast paths#8335
joseph-isaacs wants to merge 2 commits into
claude/cool-bardeen-l8jlsy-2-mask-eqfrom
claude/cool-bardeen-l8jlsy-3-definitely-all-invalid

Conversation

@joseph-isaacs

Copy link
Copy Markdown
Contributor

Summary

PR 3 of a 4-PR stack (stacked on #8334) preparing Validity for lazy validity arrays.

Replaces the ~18 scattered matches!(.., Validity::AllInvalid) fast-path checks with a named helper, symmetric with definitely_no_nulls() from #8333. The name makes the conservative semantics explicit: a Validity::Array may still resolve to all-invalid once executed, so false means "unknown without compute", not "definitely has valid values".

Converted sites: the 8 DuckDB exporters, CUDA kernels (fsst, runend, datetime-parts, dynamic dispatch), list_contains, fill_null kernel, primitive top_value, dict codes, masked vtable, and varbin. The three assert!(matches!(...)) sites in tests keep the raw matches!, since they intentionally assert the exact variant.

No behavior change — purely a naming/readability refactor.

Checks

  • cargo nextest run -p vortex-array (2962 passed)
  • cargo nextest run -p vortex-duckdb (196 passed; test_geometry/over_http excluded — they need network access unavailable in this sandbox)
  • cargo clippy -p vortex-array -p vortex-duckdb --all-targets, cargo +nightly fmt --all
  • Could not build/test vortex-cuda locally (CUDA toolkit unavailable in this environment).

https://claude.ai/code/session_01VPQ7dfZtijfrsjAipwXvEj


Generated by Claude Code

@codspeed-hq

codspeed-hq Bot commented Jun 10, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 24.19%

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

⚡ 5 improved benchmarks
✅ 1527 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 35.4 µs 20.5 µs +72.8%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 213.1 µs 176.8 µs +20.53%
Simulation bitwise_not_vortex_buffer_mut[128] 244.4 ns 215.3 ns +13.55%
Simulation chunked_varbinview_canonical_into[(100, 100)] 308.4 µs 273.1 µs +12.94%
Simulation bitwise_not_vortex_buffer_mut[1024] 304.7 ns 275.6 ns +10.58%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/cool-bardeen-l8jlsy-3-definitely-all-invalid (a13f0ab) with claude/cool-bardeen-l8jlsy-2-mask-eq (3542eaf)

Open in CodSpeed

@joseph-isaacs joseph-isaacs force-pushed the claude/cool-bardeen-l8jlsy-3-definitely-all-invalid branch 2 times, most recently from 5d2c247 to e515a28 Compare June 11, 2026 10:19
@joseph-isaacs joseph-isaacs force-pushed the claude/cool-bardeen-l8jlsy-2-mask-eq branch from 72a9118 to 897128e Compare June 11, 2026 10:34
@joseph-isaacs joseph-isaacs force-pushed the claude/cool-bardeen-l8jlsy-3-definitely-all-invalid branch 2 times, most recently from e507aa3 to 2d2498f Compare June 11, 2026 10:58
@joseph-isaacs joseph-isaacs force-pushed the claude/cool-bardeen-l8jlsy-2-mask-eq branch from fdfc3b6 to afb8906 Compare June 11, 2026 11:00
…aths

Replace scattered matches!(.., Validity::AllInvalid) checks with a
named helper, symmetric with definitely_no_nulls(). The name makes the
conservative semantics explicit: a Validity::Array may still resolve to
all-invalid once executed, so a false result means "unknown without
compute", not "definitely has valid values".

Call sites that assert an exact variant in tests keep the raw matches!.

https://claude.ai/code/session_01VPQ7dfZtijfrsjAipwXvEj
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
The non-test code now uses definitely_all_invalid() and no longer
references the Validity type directly; the test module has its own
import.

https://claude.ai/code/session_01VPQ7dfZtijfrsjAipwXvEj
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs force-pushed the claude/cool-bardeen-l8jlsy-3-definitely-all-invalid branch from 2d2498f to a13f0ab Compare June 11, 2026 11:01
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.

1 participant