Skip to content

Rename validity slots to validity_child instead of renaming their accessor - #11423

Merged
robert3005 merged 1 commit into
developfrom
claude/inspiring-ritchie-cwpkl4
Nov 12, 2026
Merged

robert3005 merged 1 commit into
developfrom
claude/inspiring-ritchie-cwpkl4

Conversation

@robert3005

@robert3005 robert3005 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #11418. The #[array_slots] accessors now take ArrayView by value, so a slot field named validity would generate an accessor that hides ArrayView::validity. #11418 worked around this with a #[slot(N, accessor = name)] option that renamed only the accessor. That left 15 slot structs with a field called validity but an accessor called validity_slot.

This drops the accessor option and renames the fields instead. The field, view field, accessor and index constant now share one name, matching Delta and BitPacked, which already use validity_child.

…essor

The #[array_slots] accessors take ArrayView by value, so a slot field named
validity would generate an accessor that hides ArrayView::validity. #11418
worked around this with a #[slot(N, accessor = name)] option that renamed
only the accessor, leaving the validity slots with a field called validity
but an accessor called validity_slot.

Drop the accessor option and rename the 15 validity slot fields to
validity_child instead, matching Delta and BitPacked, so the field, view
field, accessor, and index constant (now VALIDITY_CHILD) share one name.
The macro still rejects slot field names that clash with ArrayView methods,
now with an error that suggests renaming the field.

The slot name shown in display trees changes from validity to
validity_child; the display test, the display_tree docstring, and the
vortex-btrblocks golden snapshots are updated to match.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018SWbErpV8gppbsHrfq7fJD
@robert3005
robert3005 enabled auto-merge (squash) November 12, 2026 16:37
@robert3005 robert3005 added the changelog/chore A trivial change label Nov 12, 2026
/// Slot field names that are rejected because their generated accessors would shadow the inherent
/// methods of `ArrayView` (which the by-value accessors take precedence over) or the ext trait's
/// own methods.
const RESERVED_FIELD_NAMES: &[&str] = &[

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so validity_child is not a reserved field name? why not have the macro detect that field and auto-generate stuff for it?

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.

validity is the reserved name of a method that the ArrayView provides. We want to avoid mismatch between field and accessor

@robert3005
robert3005 merged commit 94babf7 into develop Nov 12, 2026
112 of 113 checks passed
@robert3005
robert3005 deleted the claude/inspiring-ritchie-cwpkl4 branch November 12, 2026 16:47
@codspeed

codspeed Bot commented Nov 12, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.6%

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 1 improved benchmark
✅ 1920 untouched benchmarks
⏩ 50 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation encode_primitives[f32, (2000, 512)] 270.9 µs 245 µs +10.6%

Tip

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


Comparing claude/inspiring-ritchie-cwpkl4 (457c8b7) with develop (605e4dd)

Open in CodSpeed

Footnotes

  1. 50 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 added a commit that referenced this pull request Nov 19, 2026
)

## Summary

Follow-up to #11418 and #11423. The `#[array_slots]` accessors now
return references borrowed for the array, or for the `ArrayView`'s
lifetime `'a`. So there's no longer a reason to index `slots()` by
`XSlots` constants and unwrap by hand, or to keep hand-written accessors
that duplicate the generated ones.

## API Changes

- Removed `PrimitiveArrayExt::validity_child`,
`DecimalArrayExt::validity_child`, `InterleaveArrayExt::array_indices`,
`InterleaveArrayExt::row_indices` and
`ChunkedArrayExt::chunk_offsets_array`. The generated accessors replace
them, so callers need the encoding's `…ArraySlotsExt` trait in scope.
Use `chunk_offsets()` in place of `chunk_offsets_array()`.
- Newly public: `InterleaveSlots`, `InterleaveSlotsView` and
`InterleaveArraySlotsExt` from `arrays::interleave`, and
`ChunkedArraySlotsExt` from `arrays::chunked`.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
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.

3 participants