Skip to content

Add extension claims - #11579

Merged
connortsui20 merged 2 commits into
developfrom
ct/ext-claims
Nov 20, 2026
Merged

connortsui20 merged 2 commits into
developfrom
ct/ext-claims

Conversation

@connortsui20

@connortsui20 connortsui20 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Functions use the storage of any extension type today, so comparing two Json values compares their strings. A type needs a way to promise that its storage answers equality or order correctly before a function can trust it. This PR adds only the declaration, and #11600 makes each function check it.

ExtVTable::claims returns an opaque Claims value. A &'static [Claim] slice was the alternative, but the slice could disagree with DType::holds about Eq, it had several values for the same promise ([Ord] and [Eq, Ord]), and it could only name properties. Private fields leave room for a custom order key later.

AI assisted with this change.

@connortsui20
connortsui20 marked this pull request as ready for review November 18, 2026 02:25
@codspeed

codspeed Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

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

✅ 1975 untouched benchmarks
⏩ 53 skipped benchmarks1


Comparing ct/ext-claims (b27aa23) with develop (c1de7e8)

Open in CodSpeed

Footnotes

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

@joseph-isaacs

Copy link
Copy Markdown
Contributor

what is wrong with derives?

Comment thread vortex-array/src/dtype/claim.rs Resolved
@connortsui20

Copy link
Copy Markdown
Member Author

@joseph-isaacs this is technically a derive but unlike Rust where we derive a specific function, here we need to claim a property on the type (like a trait) such that functions are well defined. So it's slightly different (and maybe the terminology here is overloaded).

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
State the float semantics that claims inherit and what a false claim does, and tell storage-parametric types to derive their claims from storage. List Ord before Eq so a failed check names the declared claim, and test that Claim::ALL covers every variant.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
connortsui20 added a commit that referenced this pull request Nov 18, 2026
The notes still described a `&'static [Claim]` list with `Claim::implies`, which the PR replaced with the opaque `Claims` value.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>

@robert3005 robert3005 left a comment

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.

not sure about the name, rust and haskell both call this derives

@connortsui20
connortsui20 merged commit ecff38f into develop Nov 20, 2026
87 of 92 checks passed
@connortsui20
connortsui20 deleted the ct/ext-claims branch November 20, 2026 14:58
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.

3 participants