Repository navigation
Add extension claims - #11579
Open
connortsui20 wants to merge 1 commit into
Open
Add extension claims#11579connortsui20 wants to merge 1 commit into
connortsui20 wants to merge 1 commit into
Conversation
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
16 tasks
connortsui20
marked this pull request as ready for review
November 18, 2026 02:25
Merging this PR will improve performance by 13.45%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_containsuse the storage of any extension type, and the aggregates keep their own opt-in list (ExtensionStoragePushdownandregister_storage_ordered). A claim is that declaration, made once by the type. With it, each function can check the claim it needs in its ownreturn_dtypeand 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::holdsdoesn't look into its storage. Looking through to the storage would make every type overi64orderable, which is the leak that claims replace. Instead, bothExtDTypeconstructors and the read path check each declared claim against the declared storage once, so a type can't claimEqover storage that doesn't hold it, such asList<Opaque>.Claims must not depend on the top-level nullability, so
with_nullabilitydoesn't check them again.UnionandVarianthold no claims, and a struct, list, or map holds a claim when all of its children do.DivisibleIntnow claimsOrd, and the newOpaquetest 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 ofrequire_claim.