-
Notifications
You must be signed in to change notification settings - Fork 118
feat: build with stable rust #3881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
CodSpeed Performance ReportMerging #3881 will improve performances by 38.39%Comparing Summary
Benchmarks breakdown
|
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
|
|
||
| /// Trait for all types which have a known upper-bound. | ||
| /// | ||
| /// Functions that receive a `TrustedLen` iterator can assume that it's `size_hint` is exact, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is a stricter bound than the std TrustedLen, which just guarantees that the upper bound is either Some(exact) or None if unknown. This is what we want for our extend_trusted though.
The nice part about defining our version of this trait is that we can leave extend_trusted as a safe method on BufferMut, which should never fail at runtime. If we ever wanna add a new case we just add a new impl here. But I don't expect many more if any.
| macro_rules! impl_for_range { | ||
| ($($typ:ty),*) => { | ||
| $( | ||
| unsafe impl TrustedLen for std::ops::Range<$typ> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't just do impl<T> for Range<T> because they introduce a type-bound on another unstable TrustedStep trait...which is really just implemented for the integer types anyway
| const _: () = { | ||
| assert!(size_of::<VortexError>() < 128); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One lint that popped off when I switched to stable was that apparently with all features activated, VortexError was a whopping 140 bytes, which was tripping the large_err check.
I boxed the Backtraces to keep the size down, now it's around ~88B. Still large but better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should aggressively trim it down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but this is not new, the lint is just new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #3892 as a follow up
| // SPDX-License-Identifier: Apache-2.0 | ||
| // SPDX-FileCopyrightText: Copyright the Vortex contributors | ||
|
|
||
| #[rustversion::nightly] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is now superfluous, instead I opted to do what Tokio does when you wanna unlock unstable nightly-only things and just add a new cfg vortex_nightly that gates all of the portable_simd stuff.
To run it, you can use a nigthly compiler and pass the flags, e.g.
RUSTFLAGS="--cfg vortex_nightly" cargo +nightly build -p vortex-array --all-features
| /// Returns an iterator over the buffer of elements of type T. | ||
| pub fn iter(&self) -> impl Iterator<Item = &T> + '_ { | ||
| self.as_slice().iter() | ||
| pub fn iter(&self) -> Iter<'_, T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this technically isn't a breaking change actually, b/c we're going from unnamed -> named type.
But the idea is that we have to impl TrustedLen for this, so you can BufferMut::extend_trusted from another Buffer.
So I just defined a concrete type that wraps std::slice::Iter and delegates the important methods to it.
| } | ||
| } | ||
|
|
||
| impl<T> BufferMut<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change any logic here, this is just moving methods around
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Benchmarks: TPC-H on NVMETable of Results
|
Benchmarks: TPC-H on S3Table of Results
|
Benchmarks: compressTable of Results
|
Benchmarks: Clickbench on NVMETable of Results
|
|
Clickbench/TPC-H seem relatively unchanged, some things got up to 20% faster but I think that could just be noise. One of the compression benchmarks got 18% slower, I retriggered to see if that's real or not |
|
Is this one of the cases where we call extend instead of extendtrusted? |
|
I found that the extend changes didn’t manifest on macOS but would on Linux |
|
Ok, then let’s assume this a flake and move on |
| # vortex-duckdb-ext currently fails linking for cargo test targets. | ||
| run: | | ||
| cargo nextest run --locked --workspace --all-features --no-fail-fast --target x86_64-unknown-linux-gnu | ||
| cargo +nightly nextest run --locked --workspace --all-features --no-fail-fast --target x86_64-unknown-linux-gnu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting that this uses nightly, I thought nextest would be fine on stable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for the Rust testing with ASAN job. That requires unstable -Z sanitizer flag
robert3005
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of me thinks we shouldn't raise MSRV but part of me thinks maybe we can?
|
I think we can probably bump it whenever we want/whenever we need new features |



Fixes #3546
MSRV is 1.87.0.
Stable is far ahead of the February 2025 nightly we've been pegged to, so on top of the regular changes there were a ton of new lints to go whack-a-mole.
I left rustfmt with its unstable options, which means that you'll need to continue to run rustfmt on the nightly channel but the project will be on the stable channel. You can run formatting from CLI like this
For RustRover you can configure rustfmt to execute with nightly in settings:
For VSCode and others you'll need to figure that one out.
Signed-off-by: Andrew Duffy andrew@a10y.dev