Skip to content

Commit 1c32958

Browse files
committed
Merge remote-tracking branch 'origin/develop' into ji/checked-expr
# Conflicts: # vortex-array/src/expr/analysis/labeling.rs # vortex-array/src/expr/expression.rs # vortex-array/src/expr/exprs/get_item/mod.rs # vortex-array/src/expr/exprs/is_null.rs # vortex-array/src/expr/exprs/literal.rs # vortex-array/src/expr/exprs/not.rs # vortex-array/src/expr/exprs/pack.rs # vortex-array/src/expr/exprs/root.rs # vortex-array/src/expr/vtable.rs # vortex-layout/src/layouts/dict/reader.rs
2 parents 5906197 + fe4c81b commit 1c32958

File tree

69 files changed

+356
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+356
-266
lines changed

encodings/alp/benches/alp_compress.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,11 @@ fn compress_alp<T: ALPFloat + NativePType>(bencher: Bencher, args: (usize, f64,
6464
Validity::NonNullable
6565
};
6666
let values = values.freeze();
67+
let array = PrimitiveArray::new(values, validity);
6768

6869
bencher
69-
.with_inputs(|| (values.clone(), validity.clone()))
70-
.bench_values(|(values, validity)| {
71-
alp_encode(&PrimitiveArray::new(values, validity), None).unwrap()
72-
})
70+
.with_inputs(|| &array)
71+
.bench_values(|array| alp_encode(array, None).unwrap())
7372
}
7473

7574
#[divan::bench(types = [f32, f64], args = BENCH_ARGS)]
@@ -105,7 +104,10 @@ fn decompress_alp<T: ALPFloat + NativePType>(bencher: Bencher, args: (usize, f64
105104
fn compress_rd<T: ALPRDFloat>(bencher: Bencher, n: usize) {
106105
let primitive = PrimitiveArray::new(buffer![T::from(1.23).unwrap(); n], Validity::NonNullable);
107106
let encoder = RDEncoder::new(&[T::from(1.23).unwrap()]);
108-
bencher.bench(|| encoder.encode(&primitive));
107+
108+
bencher
109+
.with_inputs(|| (&primitive, &encoder))
110+
.bench_refs(|(primitive, encoder)| encoder.encode(primitive))
109111
}
110112

111113
#[divan::bench(types = [f32, f64], args = [10_000, 100_000])]
@@ -115,6 +117,6 @@ fn decompress_rd<T: ALPRDFloat>(bencher: Bencher, n: usize) {
115117
let encoded = encoder.encode(&primitive);
116118

117119
bencher
118-
.with_inputs(move || encoded.clone())
119-
.bench_values(|encoded| encoded.to_canonical());
120+
.with_inputs(|| &encoded)
121+
.bench_refs(|encoded| encoded.to_canonical());
120122
}

encodings/alp/src/alp/compress.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ pub fn decompress(array: ALPArray) -> PrimitiveArray {
161161
/// # Returns
162162
///
163163
/// A `PrimitiveArray` containing the decompressed values with all patches applied.
164-
#[allow(clippy::cognitive_complexity)]
164+
#[expect(
165+
clippy::cognitive_complexity,
166+
reason = "complexity is from nested match_each_* macros"
167+
)]
165168
pub fn decompress_chunked(
166169
array: ALPArray,
167170
patches: &Patches,

encodings/alp/src/alp/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ pub trait ALPFloat: private::Sealed + Float + Display + NativePType {
154154
encoded_bytes + patch_bytes
155155
}
156156

157-
#[allow(clippy::type_complexity)]
157+
#[expect(
158+
clippy::type_complexity,
159+
reason = "tuple return type is appropriate for multiple encoding outputs"
160+
)]
158161
fn encode(
159162
values: &[Self],
160163
exponents: Option<Exponents>,

encodings/fastlanes/benches/compute_between.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ mod primitive {
9393
let mut rng = StdRng::seed_from_u64(0);
9494
let arr = generate_primitive_array::<T>(&mut rng, len);
9595

96-
bencher.with_inputs(|| arr.clone()).bench_refs(|arr| {
96+
bencher.with_inputs(|| &arr).bench_refs(|arr| {
9797
boolean(
9898
&compare(
9999
arr.as_ref(),
@@ -127,7 +127,7 @@ mod primitive {
127127
let mut rng = StdRng::seed_from_u64(0);
128128
let arr = generate_primitive_array::<T>(&mut rng, len);
129129

130-
bencher.with_inputs(|| arr.clone()).bench_refs(|arr| {
130+
bencher.with_inputs(|| &arr).bench_refs(|arr| {
131131
between(
132132
arr.as_ref(),
133133
ConstantArray::new(min, arr.len()).as_ref(),
@@ -175,7 +175,7 @@ mod bitpack {
175175
let mut rng = StdRng::seed_from_u64(0);
176176
let arr = generate_bit_pack_primitive_array::<T>(&mut rng, len);
177177

178-
bencher.with_inputs(|| arr.clone()).bench_refs(|arr| {
178+
bencher.with_inputs(|| &arr).bench_refs(|arr| {
179179
boolean(
180180
&compare(
181181
arr.as_ref(),
@@ -208,7 +208,7 @@ mod bitpack {
208208
let mut rng = StdRng::seed_from_u64(0);
209209
let arr = generate_bit_pack_primitive_array::<T>(&mut rng, len);
210210

211-
bencher.with_inputs(|| arr.clone()).bench_refs(|arr| {
211+
bencher.with_inputs(|| &arr).bench_refs(|arr| {
212212
between(
213213
arr.as_ref(),
214214
ConstantArray::new(min, arr.len()).as_ref(),

encodings/fastlanes/benches/pipeline_bitpacking_compare_scalar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ pub fn eval<T: NativePType + Into<Scalar>>(bencher: Bencher, fraction_kept: f64)
7272

7373
bencher
7474
// Be sure to reconstruct the mask to avoid cached set_indices
75-
.with_inputs(|| (Mask::from_buffer(mask.clone()), array.clone()))
76-
.bench_refs(|(mask, array)| {
75+
.with_inputs(|| (&array, Mask::from_buffer(mask.clone())))
76+
.bench_refs(|(array, mask)| {
7777
// We run the filter first, then compare.
7878
let array = filter(array.as_ref(), mask).unwrap();
7979
expr.evaluate(&array).unwrap().to_canonical()

encodings/fastlanes/benches/pipeline_rle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn compress(bencher: Bencher, (length, run_step): (usize, usize)) {
4848
);
4949

5050
bencher
51-
.with_inputs(|| values.clone())
51+
.with_inputs(|| &values)
5252
.bench_refs(|values| RLEArray::encode(values).unwrap());
5353
}
5454

encodings/fastlanes/benches/pipeline_v2_bitpacking_basic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ fn bitpack_pipeline_unpack(bencher: Bencher, (num_elements, validity_pct): (usiz
4444

4545
// Encode with 10-bit width (supports values up to 1023).
4646
let bitpacked = BitPackedArray::encode(&primitive, 10).unwrap();
47+
let array = bitpacked.to_array();
4748

4849
bencher
49-
.with_inputs(|| bitpacked.to_array())
50+
.with_inputs(|| &array)
5051
.bench_refs(|array| array.execute().unwrap());
5152
}
5253

encodings/fastlanes/src/rle/array/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ impl RLEArray {
127127
/// - The `indices` array contains valid indices into chunks of the `values` array
128128
/// - The `values_idx_offsets` array contains valid chunk start offsets
129129
/// - The `validity` array has the same length as `length`
130-
#[allow(clippy::too_many_arguments)]
131130
pub unsafe fn new_unchecked(
132131
values: ArrayRef,
133132
indices: ArrayRef,
@@ -182,7 +181,10 @@ impl RLEArray {
182181
/// Offsets in `values_idx_offsets` are absolute and need to be shifted
183182
/// by the offset of the first chunk, respective the current slice, in
184183
/// order to make them relative.
185-
#[allow(clippy::expect_used)]
184+
#[expect(
185+
clippy::expect_used,
186+
reason = "expect is safe here as scalar_at returns a valid primitive"
187+
)]
186188
pub(crate) fn values_idx_offset(&self, chunk_idx: usize) -> usize {
187189
self.values_idx_offsets
188190
.scalar_at(chunk_idx)

encodings/fastlanes/src/rle/array/rle_decompress.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ use crate::FL_CHUNK_SIZE;
1919
use crate::RLEArray;
2020

2121
/// Decompresses an RLE array back into a primitive array.
22-
#[allow(clippy::cognitive_complexity)]
22+
#[expect(
23+
clippy::cognitive_complexity,
24+
reason = "complexity is from nested match_each_* macros"
25+
)]
2326
pub fn rle_decompress(array: &RLEArray) -> PrimitiveArray {
2427
match_each_native_ptype!(array.values().dtype().as_ptype(), |V| {
2528
match_each_unsigned_integer_ptype!(array.values_idx_offsets().dtype().as_ptype(), |O| {
@@ -37,7 +40,6 @@ pub fn rle_decompress(array: &RLEArray) -> PrimitiveArray {
3740
}
3841

3942
/// Decompresses an `RLEArray` into to a primitive array of unsigned integers.
40-
#[allow(clippy::cognitive_complexity)]
4143
fn rle_decode_typed<V, I, O>(array: &RLEArray) -> PrimitiveArray
4244
where
4345
V: NativePType + RLE + Clone + Copy,

encodings/fsst/benches/chunked_dict_fsst_builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn chunked_dict_fsst_canonical_into(
4343
) {
4444
let chunk = make_dict_fsst_chunks::<u16>(len, unique_values, chunk_count);
4545

46-
bencher.with_inputs(|| chunk.clone()).bench_values(|chunk| {
46+
bencher.with_inputs(|| &chunk).bench_refs(|chunk| {
4747
let mut builder = builder_with_capacity(chunk.dtype(), len * chunk_count);
4848
chunk.append_to_builder(builder.as_mut());
4949
builder.finish()
@@ -58,6 +58,6 @@ fn chunked_dict_fsst_into_canonical(
5858
let chunk = make_dict_fsst_chunks::<u16>(len, unique_values, chunk_count);
5959

6060
bencher
61-
.with_inputs(|| chunk.clone())
62-
.bench_values(|chunk| chunk.to_canonical())
61+
.with_inputs(|| &chunk)
62+
.bench_refs(|chunk| chunk.to_canonical())
6363
}

0 commit comments

Comments
 (0)