Skip to content

Commit 8f7f6d3

Browse files
authored
Bump msrv and rust-toolchain to 1.91 (and lance for benchmarks) (#7595)
We're two major version back on our lance comparison (which is about 2 months of changes), but it also seems like more and more dependencies break because we're on 1.90. libs.rs says 68% of crates.io requests ask for this stable version or newer, not sure what was our bar in the past but I figured its worth at least checking it out. I've reviewed the changes and none of them seem substantial, they are all tests and some lints that were improved and don't warn anymore. --------- Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 30042ee commit 8f7f6d3

53 files changed

Lines changed: 841 additions & 1147 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 313 additions & 597 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ keywords = ["vortex"]
8282
license = "Apache-2.0"
8383
readme = "README.md"
8484
repository = "https://github.com/spiraldb/vortex"
85-
rust-version = "1.90.0"
85+
rust-version = "1.91.0"
8686
version = "0.1.0"
8787

8888
[workspace.dependencies]

benchmarks/lance-bench/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ version.workspace = true
1515
publish = false
1616

1717
[dependencies]
18-
lance = { version = "2.0.0", default-features = false }
19-
lance-encoding = { version = "2.0.0" }
18+
lance = { version = "4", default-features = false }
19+
lance-encoding = { version = "4" }
2020

2121
anyhow = { workspace = true }
2222
arrow-cast = { version = "57" }

benchmarks/vector-search-bench/src/ingest.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,13 @@ mod tests {
169169
let chunk =
170170
StructArray::from_fields(&[("id", id_array(&[0, 1])), ("emb", emb)])?.into_array();
171171
let out = transform_chunk(chunk, &mut ctx)?;
172-
let out_struct = out.as_opt::<Struct>().expect("returns Struct");
173-
let out_emb = out_struct.unmasked_field_by_name("emb").unwrap().clone();
172+
let out_struct = out
173+
.as_opt::<Struct>()
174+
.context("transform_chunk should return a Struct array")?;
175+
let out_emb = out_struct
176+
.unmasked_field_by_name("emb")
177+
.context("transform_chunk output should contain an emb field")?
178+
.clone();
174179
let DType::Extension(ext) = out_emb.dtype() else {
175180
panic!("expected extension dtype, got {}", out_emb.dtype());
176181
};

encodings/datetime-parts/src/canonical.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,7 @@ mod test {
158158
.execute::<PrimitiveArray>(&mut ctx)?;
159159

160160
assert_arrays_eq!(primitive_values, milliseconds);
161-
assert!(
162-
primitive_values
163-
.validity()
164-
.unwrap()
165-
.mask_eq(&validity, &mut ctx)?
166-
);
161+
assert!(primitive_values.validity()?.mask_eq(&validity, &mut ctx)?);
167162
Ok(())
168163
}
169164
}

encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ mod test {
442442
use vortex_array::session::ArraySession;
443443
use vortex_buffer::Buffer;
444444
use vortex_error::VortexError;
445+
use vortex_error::vortex_err;
445446
use vortex_session::VortexSession;
446447

447448
use super::*;
@@ -540,13 +541,15 @@ mod test {
540541
.for_each(|&idx| values[idx] = patch_value);
541542

542543
let array = PrimitiveArray::from_iter(values);
543-
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx).unwrap();
544+
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx)?;
544545

545-
let patches = bitpacked.patches().unwrap();
546+
let patches = bitpacked
547+
.patches()
548+
.ok_or_else(|| vortex_err!("expected patches"))?;
546549
let chunk_offsets = patches
547550
.chunk_offsets()
548551
.as_ref()
549-
.unwrap()
552+
.ok_or_else(|| vortex_err!("expected chunk offsets"))?
550553
.clone()
551554
.execute::<PrimitiveArray>(&mut ctx)?;
552555

@@ -570,13 +573,15 @@ mod test {
570573
.for_each(|&idx| values[idx] = patch_value);
571574

572575
let array = PrimitiveArray::from_iter(values);
573-
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx).unwrap();
576+
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx)?;
574577

575-
let patches = bitpacked.patches().unwrap();
578+
let patches = bitpacked
579+
.patches()
580+
.ok_or_else(|| vortex_err!("expected patches"))?;
576581
let chunk_offsets = patches
577582
.chunk_offsets()
578583
.as_ref()
579-
.unwrap()
584+
.ok_or_else(|| vortex_err!("expected chunk offsets"))?
580585
.clone()
581586
.execute::<PrimitiveArray>(&mut ctx)?;
582587

@@ -596,13 +601,15 @@ mod test {
596601
.for_each(|&idx| values[idx] = patch_value);
597602

598603
let array = PrimitiveArray::from_iter(values);
599-
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx).unwrap();
604+
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx)?;
600605

601-
let patches = bitpacked.patches().unwrap();
606+
let patches = bitpacked
607+
.patches()
608+
.ok_or_else(|| vortex_err!("expected patches"))?;
602609
let chunk_offsets = patches
603610
.chunk_offsets()
604611
.as_ref()
605-
.unwrap()
612+
.ok_or_else(|| vortex_err!("expected chunk offsets"))?
606613
.clone()
607614
.execute::<PrimitiveArray>(&mut ctx)?;
608615

@@ -627,13 +634,15 @@ mod test {
627634
.for_each(|&idx| values[idx] = patch_value);
628635

629636
let array = PrimitiveArray::from_iter(values);
630-
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx).unwrap();
637+
let bitpacked = bitpack_encode(&array, 4, None, &mut ctx)?;
631638

632-
let patches = bitpacked.patches().unwrap();
639+
let patches = bitpacked
640+
.patches()
641+
.ok_or_else(|| vortex_err!("expected patches"))?;
633642
let chunk_offsets = patches
634643
.chunk_offsets()
635644
.as_ref()
636-
.unwrap()
645+
.ok_or_else(|| vortex_err!("expected chunk offsets"))?
637646
.clone()
638647
.execute::<PrimitiveArray>(&mut ctx)?;
639648

encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,8 @@ mod tests {
305305
let bitpacked = encode(&zeros, 10);
306306
assert_eq!(bitpacked.len(), 1025);
307307
assert!(bitpacked.patches().is_some());
308-
let slice_ref = bitpacked.into_array().slice(1023..1025).unwrap();
309-
let actual = slice_ref
310-
.execute::<Canonical>(&mut ctx)
311-
.unwrap()
312-
.into_primitive();
308+
let slice_ref = bitpacked.into_array().slice(1023..1025)?;
309+
let actual = slice_ref.execute::<Canonical>(&mut ctx)?.into_primitive();
313310
assert_arrays_eq!(actual, PrimitiveArray::from_iter([1535u16, 1536]));
314311
Ok(())
315312
}
@@ -323,11 +320,8 @@ mod tests {
323320
let bitpacked = encode(&zeros, 10);
324321
assert_eq!(bitpacked.len(), 2229);
325322
assert!(bitpacked.patches().is_some());
326-
let slice_ref = bitpacked.into_array().slice(1023..2049).unwrap();
327-
let actual = slice_ref
328-
.execute::<Canonical>(&mut ctx)
329-
.unwrap()
330-
.into_primitive();
323+
let slice_ref = bitpacked.into_array().slice(1023..2049)?;
324+
let actual = slice_ref.execute::<Canonical>(&mut ctx)?.into_primitive();
331325
assert_arrays_eq!(
332326
actual,
333327
PrimitiveArray::from_iter((1023u16..2049).map(|x| x + 512))
@@ -380,11 +374,11 @@ mod tests {
380374
// Verify the validity mask was correctly applied.
381375
assert_eq!(result.len(), 5);
382376
let mut ctx = SESSION.create_execution_ctx();
383-
assert!(!result.execute_scalar(0, &mut ctx).unwrap().is_null());
384-
assert!(result.execute_scalar(1, &mut ctx).unwrap().is_null());
385-
assert!(!result.execute_scalar(2, &mut ctx).unwrap().is_null());
386-
assert!(!result.execute_scalar(3, &mut ctx).unwrap().is_null());
387-
assert!(result.execute_scalar(4, &mut ctx).unwrap().is_null());
377+
assert!(!result.execute_scalar(0, &mut ctx)?.is_null());
378+
assert!(result.execute_scalar(1, &mut ctx)?.is_null());
379+
assert!(!result.execute_scalar(2, &mut ctx)?.is_null());
380+
assert!(!result.execute_scalar(3, &mut ctx)?.is_null());
381+
assert!(result.execute_scalar(4, &mut ctx)?.is_null());
388382
Ok(())
389383
}
390384

@@ -504,10 +498,7 @@ mod tests {
504498

505499
let executed = {
506500
let mut ctx = SESSION.create_execution_ctx();
507-
bitpacked
508-
.into_array()
509-
.execute::<Canonical>(&mut ctx)
510-
.unwrap()
501+
bitpacked.into_array().execute::<Canonical>(&mut ctx)?
511502
};
512503

513504
assert_eq!(
@@ -530,8 +521,7 @@ mod tests {
530521
let mut ctx = SESSION.create_execution_ctx();
531522
unpacked_array
532523
.into_array()
533-
.execute::<Canonical>(&mut ctx)
534-
.unwrap()
524+
.execute::<Canonical>(&mut ctx)?
535525
.into_primitive()
536526
};
537527
assert_eq!(
@@ -560,13 +550,12 @@ mod tests {
560550
// Test with sliced array (offset > 0).
561551
let values = PrimitiveArray::from_iter(0u32..2048);
562552
let bitpacked = encode(&values, 11);
563-
let slice_ref = bitpacked.into_array().slice(500..1500).unwrap();
553+
let slice_ref = bitpacked.into_array().slice(500..1500)?;
564554
let sliced = {
565555
let mut ctx = SESSION.create_execution_ctx();
566556
slice_ref
567557
.clone()
568-
.execute::<Canonical>(&mut ctx)
569-
.unwrap()
558+
.execute::<Canonical>(&mut ctx)?
570559
.into_primitive()
571560
};
572561

@@ -575,7 +564,7 @@ mod tests {
575564
let unpacked_array = sliced;
576565
let executed = {
577566
let mut ctx = SESSION.create_execution_ctx();
578-
slice_ref.execute::<Canonical>(&mut ctx).unwrap()
567+
slice_ref.execute::<Canonical>(&mut ctx)?
579568
};
580569

581570
assert_eq!(

encodings/fastlanes/src/delta/array/delta_compress.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ mod tests {
135135
let array = PrimitiveArray::from_option_iter(
136136
(0u8..200).map(|i| (!(50..100).contains(&i)).then_some(i)),
137137
);
138-
let (bases, deltas) = delta_compress(&array, &mut ctx).unwrap();
139-
let bitpacked_deltas = bitpack_encode(&deltas, 1, None, &mut ctx).unwrap();
138+
let (bases, deltas) = delta_compress(&array, &mut ctx)?;
139+
let bitpacked_deltas = bitpack_encode(&deltas, 1, None, &mut ctx)?;
140140
let packed_delta = Delta::try_new(
141141
bases.into_array(),
142142
bitpacked_deltas.into_array(),

encodings/fastlanes/src/for/array/for_compress.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ mod test {
143143
// Create a range offset by a million.
144144
let expect = PrimitiveArray::from_iter((0u32..1024).map(|x| x % 7 + 10));
145145
let array = PrimitiveArray::from_iter((0u32..1024).map(|x| x % 7));
146-
let bp = BitPackedData::encode(&array.into_array(), 2, &mut ctx).unwrap();
146+
let bp = BitPackedData::encode(&array.into_array(), 2, &mut ctx)?;
147147
let compressed = FoR::try_new(bp.clone().into_array(), 10u32.into())?;
148148
let decompressed = fused_decompress::<u32>(&compressed, bp.as_view(), &mut ctx)?;
149149
assert_arrays_eq!(decompressed, expect);
@@ -154,7 +154,7 @@ mod test {
154154
fn test_overflow() -> VortexResult<()> {
155155
let mut ctx = SESSION.create_execution_ctx();
156156
let array = PrimitiveArray::from_iter(i8::MIN..=i8::MAX);
157-
let compressed = FoRData::encode(array.clone()).unwrap();
157+
let compressed = FoRData::encode(array.clone())?;
158158
assert_eq!(
159159
i8::MIN,
160160
compressed

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

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ mod tests {
365365
fn test_rle_serialization() -> VortexResult<()> {
366366
let mut exec_ctx = SESSION.create_execution_ctx();
367367
let primitive = PrimitiveArray::from_iter((0..2048).map(|i| (i / 100) as u32));
368-
let rle_array = RLEData::encode(primitive.as_view(), &mut exec_ctx).unwrap();
368+
let rle_array = RLEData::encode(primitive.as_view(), &mut exec_ctx)?;
369369
assert_eq!(rle_array.len(), 2048);
370370

371371
let original_data = rle_array
@@ -374,26 +374,24 @@ mod tests {
374374
.execute::<PrimitiveArray>(&mut exec_ctx)?;
375375

376376
let ctx = ArrayContext::empty();
377-
let serialized = rle_array
378-
.into_array()
379-
.serialize(&ctx, &SESSION, &SerializeOptions::default())
380-
.unwrap();
377+
let serialized =
378+
rle_array
379+
.into_array()
380+
.serialize(&ctx, &SESSION, &SerializeOptions::default())?;
381381

382382
let mut concat = ByteBufferMut::empty();
383383
for buf in serialized {
384384
concat.extend_from_slice(buf.as_ref());
385385
}
386386
let concat = concat.freeze();
387387

388-
let parts = SerializedArray::try_from(concat).unwrap();
389-
let decoded = parts
390-
.decode(
391-
&DType::Primitive(PType::U32, Nullability::NonNullable),
392-
2048,
393-
&ReadContext::new(ctx.to_ids()),
394-
&SESSION,
395-
)
396-
.unwrap();
388+
let parts = SerializedArray::try_from(concat)?;
389+
let decoded = parts.decode(
390+
&DType::Primitive(PType::U32, Nullability::NonNullable),
391+
2048,
392+
&ReadContext::new(ctx.to_ids()),
393+
&SESSION,
394+
)?;
397395

398396
let decoded_data = decoded.execute::<PrimitiveArray>(&mut exec_ctx)?;
399397

@@ -405,7 +403,7 @@ mod tests {
405403
fn test_rle_serialization_slice() -> VortexResult<()> {
406404
let mut exec_ctx = SESSION.create_execution_ctx();
407405
let primitive = PrimitiveArray::from_iter((0..2048).map(|i| (i / 100) as u32));
408-
let rle_array = RLEData::encode(primitive.as_view(), &mut exec_ctx).unwrap();
406+
let rle_array = RLEData::encode(primitive.as_view(), &mut exec_ctx)?;
409407

410408
let sliced = RLE::try_new(
411409
rle_array.values().clone(),
@@ -418,27 +416,25 @@ mod tests {
418416
assert_eq!(sliced.len(), 100);
419417

420418
let ctx = ArrayContext::empty();
421-
let serialized = sliced
422-
.clone()
423-
.into_array()
424-
.serialize(&ctx, &SESSION, &SerializeOptions::default())
425-
.unwrap();
419+
let serialized =
420+
sliced
421+
.clone()
422+
.into_array()
423+
.serialize(&ctx, &SESSION, &SerializeOptions::default())?;
426424

427425
let mut concat = ByteBufferMut::empty();
428426
for buf in serialized {
429427
concat.extend_from_slice(buf.as_ref());
430428
}
431429
let concat = concat.freeze();
432430

433-
let parts = SerializedArray::try_from(concat).unwrap();
434-
let decoded = parts
435-
.decode(
436-
sliced.dtype(),
437-
sliced.len(),
438-
&ReadContext::new(ctx.to_ids()),
439-
&SESSION,
440-
)
441-
.unwrap();
431+
let parts = SerializedArray::try_from(concat)?;
432+
let decoded = parts.decode(
433+
sliced.dtype(),
434+
sliced.len(),
435+
&ReadContext::new(ctx.to_ids()),
436+
&SESSION,
437+
)?;
442438

443439
let original_data = sliced
444440
.as_array()

0 commit comments

Comments
 (0)