Repository navigation
chore: tidy up a few compile-time assertions - #9158
Merged
Merged
Conversation
Three small cleanups, no behavior change:
- Use `const { assert!(..) }` for the fn-body assertion in `build_views`, so it
matches the existing const-block sites in `optimizer::rules` and the AVX2 take
kernel. Const blocks are the right form in expression position; item-scope
assertions have no equivalent spelling.
- Drop the redundant block around the single `assert!` in `vortex-error`.
- Fix a stale doc comment: it claimed `DType` is 16 bytes while the assertion
below it checked for 24.
Deliberately left alone: the `assert_eq_size!`/`assert_eq_align!` uses in
`varbinview::view` and the `[(); size_of::<T>()]` size checks in `dtype_impl`.
Both report the *actual* size when they fail ("found one with a size of 32",
"source type: `BinaryView` (256 bits)"), which is the useful part of a
struct-grew-unexpectedly guard. A const `assert!` can only report that the
condition was false, since const eval cannot format values into a panic
message. Likewise `assert_impl_all!` in `vortex-duckdb`, which asserts trait
implementations that `assert!` cannot express.
Signed-off-by: Connor <connor@spiraldb.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JVLiXup87rwTYbMxtrnkCv
Merging this PR will improve performance by 12.27%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
connortsui20
enabled auto-merge (squash)
August 3, 2026 20:25
robert3005
approved these changes
Aug 3, 2026
connortsui20
disabled auto-merge
August 3, 2026 21:02
connortsui20
enabled auto-merge (squash)
August 3, 2026 21:02
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.
Uses
const { assert!(..) }for the function-body assertion inbuild_viewsto match the existing const-block sites, removes a redundant block around the singleassert!invortex-error, and corrects a doc comment that claimedDTypeis 16 bytes while the assertion below it checked for 24.