Skip to content

Add extension claims - #11579

Open
connortsui20 wants to merge 1 commit into
developfrom
ct/ext-claims
Open

connortsui20 wants to merge 1 commit into
developfrom
ct/ext-claims

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Summary

An extension type has no way to say that equality or order on its values matches equality or order on its storage. So each operation decides on its own: comparisons and list_contains use the storage of any extension type, and the aggregates keep their own opt-in list (ExtensionStoragePushdown and register_storage_ordered). A claim is that declaration, made once by the type. With it, each function can check the claim it needs in its own return_dtype and reject a call that no claim covers when the expression is bound. This PR only adds the claims and the helpers that check them. No function reads them yet, so no behavior changes.

Changes

An extension dtype holds only the claims it declares, and DType::holds doesn't look into its storage. Looking through to the storage would make every type over i64 orderable, which is the leak that claims replace. Instead, both ExtDType constructors and the read path check each declared claim against the declared storage once, so a type can't claim Eq over storage that doesn't hold it, such as List<Opaque>.

Claims must not depend on the top-level nullability, so with_nullability doesn't check them again. Union and Variant hold no claims, and a struct, list, or map holds a claim when all of its children do. DivisibleInt now claims Ord, and the new Opaque test type claims nothing, so later PRs can test both acceptance and rejection. The claims of the extension types in the repository come in the next PR. The new tests cover the built-in dtypes, nested and nullable dtypes, both construction paths, and the exact error text of require_claim.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@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 improve performance by 13.45%

1 warning

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

⚡ 4 improved benchmarks
✅ 1971 untouched benchmarks
⏩ 53 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation split[(8192, Milliseconds)] 337.3 µs 279.8 µs +20.55%
⚡ Walltime decode_chunked_neon[i64, 524288] 15.2 µs 13.6 µs +11.95%
⚡ CPU Simulation split_extreme[(8192, Milliseconds)] 576.7 µs 518.9 µs +11.14%
⚡ Walltime decode_blocked_bitpacked_chunked_neon[u32, 524288] 29.9 µs 27.1 µs +10.45%

Tip

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


Comparing ct/ext-claims (2fbac1e) with develop (3ebf68d)

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

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.

1 participant