Skip to content

Rename Validity::no_nulls to definitely_no_nulls and add execute_no_nulls#8333

Open
joseph-isaacs wants to merge 1 commit into
developfrom
claude/cool-bardeen-l8jlsy-1-definitely-no-nulls
Open

Rename Validity::no_nulls to definitely_no_nulls and add execute_no_nulls#8333
joseph-isaacs wants to merge 1 commit into
developfrom
claude/cool-bardeen-l8jlsy-1-definitely-no-nulls

Conversation

@joseph-isaacs

Copy link
Copy Markdown
Contributor

Summary

PR 1 of a 4-PR stack preparing Validity for lazy validity arrays, where a Validity::Array may resolve to all-true/all-false once executed.

  • Rename Validity::no_nulls()definitely_no_nulls(). The boolean only proves the absence of nulls for NonNullable/AllValid; for a (lazy) Array variant, false means "unknown without compute", not "has nulls". The new name and doc comment make the conservative semantics explicit.
  • Add Validity::execute_no_nulls(length, ctx), the exact counterpart built on execute_mask(), for call sites that need a definitive answer.
  • All 9 existing call sites are mechanically renamed; they are all conservative fast paths with fallbacks, except the CUDA ListView export vortex_ensure!, where a false answer is a hard error rather than a slow path — that one is switched to execute_no_nulls so a lazy all-valid child validity no longer spuriously fails the export.

Stack

  1. → this PR: no_nulls()definitely_no_nulls() + execute_no_nulls()
  2. mask_eq() semantics fix for mixed variants
  3. definitely_all_invalid() helper
  4. Lazy ScalarFn array validity

Checks

  • cargo build -p vortex-array -p vortex-zstd -p vortex-parquet-variant
  • cargo nextest run -p vortex-array (2962 passed)
  • cargo clippy -p vortex-array -p vortex-zstd -p vortex-parquet-variant --all-targets
  • cargo +nightly fmt --all
  • Could not build/test vortex-cuda locally: its vortex-nvcomp build script requires the CUDA toolkit, which is unavailable in this environment.

https://claude.ai/code/session_01VPQ7dfZtijfrsjAipwXvEj


Generated by Claude Code

…ulls

The boolean returned by no_nulls() only proves the absence of nulls for
the NonNullable and AllValid variants; a Validity::Array may still
resolve to all-valid once executed. As validity arrays become lazy this
distinction matters, so the cheap check is renamed to
definitely_no_nulls() and documented as conservative.

For call sites that need a definitive answer, add execute_no_nulls(),
which executes the validity into a Mask via execute_mask(). The CUDA
ListView export ensure-check is switched to the exact variant since a
false answer there is a hard error rather than a slow path.

https://claude.ai/code/session_01VPQ7dfZtijfrsjAipwXvEj
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
/// resolve to all-valid once executed. Callers must treat `false` as "unknown without
/// compute" and either fall back to a null-handling path or execute the validity.
#[inline]
pub fn no_nulls(&self) -> bool {

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.

has_no_nulls?

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 an approximate function. Do you think has_no_nulls says that?

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.

They all sound vague to me, does it really need to be a function vs allowing callers to just have it explicitly there?

@codspeed-hq

codspeed-hq Bot commented Jun 10, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.73%

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

⚡ 3 improved benchmarks
✅ 1523 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_canonical_into[(100, 100)] 309 µs 274.5 µs +12.59%
Simulation bitwise_not_vortex_buffer_mut[128] 275.3 ns 246.1 ns +11.85%
Simulation chunked_varbinview_into_canonical[(100, 100)] 362.5 µs 327.2 µs +10.76%

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-1-definitely-no-nulls (4906359) with develop (0a41704)

Open in CodSpeed

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