Skip to content

Commit 3c82c3e

Browse files
joseph-isaacsclaude
andcommitted
fix: plumb ExecutionCtx to remaining callsites, fix clippy, regenerate public-api locks
- Add missing `&mut ctx` arg to BitPacked::encode calls in benches and CUDA code - Add missing VortexSessionExecute import in compat-gen and CUDA test modules - Fix CudaExecutionCtx/ExecutionCtx type mismatches using .execution_ctx() - Fix clippy: redundant clone, too-many-arguments, auto-deref - Regenerate public-api.lock files - Run cargo fmt Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3d10439 commit 3c82c3e

61 files changed

Lines changed: 471 additions & 247 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.

encodings/alp/benches/alp_compress.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ fn decompress_rd<T: ALPRDFloat + NativePType>(bencher: Bencher, args: (usize, f6
152152
let (n, fraction_patch) = args;
153153
let primitive = make_rd_array::<T>(n, fraction_patch);
154154
let encoder = RDEncoder::new(primitive.as_slice::<T>());
155-
let encoded = encoder.encode(primitive.as_view(), &mut LEGACY_SESSION.create_execution_ctx());
155+
let encoded = encoder.encode(
156+
primitive.as_view(),
157+
&mut LEGACY_SESSION.create_execution_ctx(),
158+
);
156159

157160
bencher
158161
.with_inputs(|| (&encoded, LEGACY_SESSION.create_execution_ctx()))

encodings/alp/public-api.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl vortex_alp::ALPRD
146146

147147
pub unsafe fn vortex_alp::ALPRD::new_unchecked(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_alp::ALPRDArray
148148

149-
pub fn vortex_alp::ALPRD::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_error::VortexResult<vortex_alp::ALPRDArray>
149+
pub fn vortex_alp::ALPRD::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option<vortex_array::patches::Patches>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_alp::ALPRDArray>
150150

151151
impl core::clone::Clone for vortex_alp::ALPRD
152152

@@ -380,7 +380,7 @@ pub struct vortex_alp::RDEncoder
380380

381381
impl vortex_alp::RDEncoder
382382

383-
pub fn vortex_alp::RDEncoder::encode(&self, array: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>) -> vortex_alp::ALPRDArray
383+
pub fn vortex_alp::RDEncoder::encode(&self, array: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_alp::ALPRDArray
384384

385385
pub fn vortex_alp::RDEncoder::from_parts(right_bit_width: u8, codes: alloc::vec::Vec<u16>) -> Self
386386

encodings/alp/src/alp/compute/cast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ mod tests {
153153
fn test_cast_alp_conformance(#[case] array: vortex_array::ArrayRef) -> VortexResult<()> {
154154
let mut ctx = LEGACY_SESSION.create_execution_ctx();
155155
let array_primitive = array.execute::<PrimitiveArray>(&mut ctx)?;
156-
let alp = alp_encode(array_primitive.as_view(), None, &mut ctx)
157-
.vortex_expect("cannot fail");
156+
let alp =
157+
alp_encode(array_primitive.as_view(), None, &mut ctx).vortex_expect("cannot fail");
158158
test_cast_conformance(&alp.into_array());
159159

160160
Ok(())

encodings/alp/src/alp_rd/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ impl RDEncoder {
186186
match_each_alp_float_ptype!(array.ptype(), |P| { self.encode_generic::<P>(array, ctx) })
187187
}
188188

189-
fn encode_generic<T>(&self, array: ArrayView<'_, Primitive>, ctx: &mut ExecutionCtx) -> ALPRDArray
189+
fn encode_generic<T>(
190+
&self,
191+
array: ArrayView<'_, Primitive>,
192+
ctx: &mut ExecutionCtx,
193+
) -> ALPRDArray
190194
where
191195
T: ALPRDFloat + NativePType,
192196
T::UINT: NativePType,

encodings/datetime-parts/src/compress.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ pub struct TemporalParts {
2323
///
2424
/// Splitting the components by granularity creates more small values, which enables better
2525
/// cascading compression.
26-
pub fn split_temporal(
27-
array: TemporalArray,
28-
ctx: &mut ExecutionCtx,
29-
) -> VortexResult<TemporalParts> {
26+
pub fn split_temporal(array: TemporalArray, ctx: &mut ExecutionCtx) -> VortexResult<TemporalParts> {
3027
let temporal_values = array
3128
.temporal_values()
3229
.clone()

encodings/datetime-parts/src/compute/rules.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ mod tests {
352352
TimeUnit::Seconds,
353353
None,
354354
);
355-
let dtp = DateTimeParts::try_from_temporal(temporal, &mut LEGACY_SESSION.create_execution_ctx()).unwrap();
355+
let dtp =
356+
DateTimeParts::try_from_temporal(temporal, &mut LEGACY_SESSION.create_execution_ctx())
357+
.unwrap();
356358
let len = dtp.len();
357359

358360
// Compare against midnight constant

encodings/fastlanes/public-api.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ pub fn vortex_fastlanes::bit_transpose::untranspose_validity(validity: &vortex_a
1616

1717
pub mod vortex_fastlanes::bitpack_compress
1818

19-
pub fn vortex_fastlanes::bitpack_compress::bit_width_histogram(array: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>) -> vortex_error::VortexResult<alloc::vec::Vec<usize>>
19+
pub fn vortex_fastlanes::bitpack_compress::bit_width_histogram(array: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<alloc::vec::Vec<usize>>
2020

21-
pub fn vortex_fastlanes::bitpack_compress::bitpack_encode(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8, bit_width_freq: core::option::Option<&[usize]>) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
21+
pub fn vortex_fastlanes::bitpack_compress::bitpack_encode(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8, bit_width_freq: core::option::Option<&[usize]>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
2222

2323
pub unsafe fn vortex_fastlanes::bitpack_compress::bitpack_encode_unchecked(array: vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
2424

2525
pub fn vortex_fastlanes::bitpack_compress::bitpack_primitive<T: vortex_array::dtype::ptype::NativePType + fastlanes::bitpacking::BitPacking>(array: &[T], bit_width: u8) -> vortex_buffer::buffer::Buffer<T>
2626

27-
pub fn vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
27+
pub fn vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
2828

2929
pub unsafe fn vortex_fastlanes::bitpack_compress::bitpack_unchecked(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8) -> vortex_buffer::ByteBuffer
3030

3131
pub fn vortex_fastlanes::bitpack_compress::find_best_bit_width(ptype: vortex_array::dtype::ptype::PType, bit_width_freq: &[usize]) -> vortex_error::VortexResult<u8>
3232

33-
pub fn vortex_fastlanes::bitpack_compress::gather_patches(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8, num_exceptions_hint: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::patches::Patches>>
33+
pub fn vortex_fastlanes::bitpack_compress::gather_patches(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8, num_exceptions_hint: usize, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::patches::Patches>>
3434

3535
pub mod vortex_fastlanes::bitpack_decompress
3636

@@ -120,7 +120,7 @@ pub struct vortex_fastlanes::BitPacked
120120

121121
impl vortex_fastlanes::BitPacked
122122

123-
pub fn vortex_fastlanes::BitPacked::encode(array: &vortex_array::array::erased::ArrayRef, bit_width: u8) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
123+
pub fn vortex_fastlanes::BitPacked::encode(array: &vortex_array::array::erased::ArrayRef, bit_width: u8, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
124124

125125
pub fn vortex_fastlanes::BitPacked::into_parts(array: vortex_fastlanes::BitPackedArray) -> vortex_fastlanes::BitPackedDataParts
126126

@@ -196,7 +196,7 @@ impl vortex_fastlanes::BitPackedData
196196

197197
pub fn vortex_fastlanes::BitPackedData::bit_width(&self) -> u8
198198

199-
pub fn vortex_fastlanes::BitPackedData::encode(array: &vortex_array::array::erased::ArrayRef, bit_width: u8) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
199+
pub fn vortex_fastlanes::BitPackedData::encode(array: &vortex_array::array::erased::ArrayRef, bit_width: u8, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_fastlanes::BitPackedArray>
200200

201201
pub fn vortex_fastlanes::BitPackedData::max_packed_value(&self) -> usize
202202

@@ -522,7 +522,7 @@ pub fn vortex_fastlanes::RLE::validity(array: vortex_array::array::view::ArrayVi
522522

523523
impl vortex_array::arrays::slice::SliceKernel for vortex_fastlanes::RLE
524524

525-
pub fn vortex_fastlanes::RLE::slice(array: vortex_array::array::view::ArrayView<'_, Self>, range: core::ops::range::Range<usize>, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
525+
pub fn vortex_fastlanes::RLE::slice(array: vortex_array::array::view::ArrayView<'_, Self>, range: core::ops::range::Range<usize>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
526526

527527
impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_fastlanes::RLE
528528

@@ -638,7 +638,7 @@ pub fn vortex_fastlanes::RLEArrayExt::offset(&self) -> usize
638638

639639
pub fn vortex_fastlanes::RLEArrayExt::values(&self) -> &vortex_array::array::erased::ArrayRef
640640

641-
pub fn vortex_fastlanes::RLEArrayExt::values_idx_offset(&self, chunk_idx: usize) -> usize
641+
pub fn vortex_fastlanes::RLEArrayExt::values_idx_offset(&self, chunk_idx: usize, ctx: &mut vortex_array::executor::ExecutionCtx) -> usize
642642

643643
pub fn vortex_fastlanes::RLEArrayExt::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef
644644

@@ -650,7 +650,7 @@ pub fn T::offset(&self) -> usize
650650

651651
pub fn T::values(&self) -> &vortex_array::array::erased::ArrayRef
652652

653-
pub fn T::values_idx_offset(&self, chunk_idx: usize) -> usize
653+
pub fn T::values_idx_offset(&self, chunk_idx: usize, ctx: &mut vortex_array::executor::ExecutionCtx) -> usize
654654

655655
pub fn T::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef
656656

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ pub fn bitpack_encode(
5555
// Check array contains no negative values.
5656
if array.ptype().is_signed_int() {
5757
let has_negative_values = match_each_integer_ptype!(array.ptype(), |P| {
58-
array
59-
.statistics()
60-
.compute_min::<P>(ctx)
61-
.unwrap_or_default()
62-
< 0
58+
array.statistics().compute_min::<P>(ctx).unwrap_or_default() < 0
6359
});
6460
if has_negative_values {
6561
vortex_bail!(InvalidArgument: "cannot bitpack_encode array containing negative integers")
@@ -496,8 +492,8 @@ mod test {
496492
let array = PrimitiveArray::new(values, Validity::AllValid);
497493
assert!(array.ptype().is_signed_int());
498494

499-
let err =
500-
BitPackedData::encode(&array.into_array(), 1024u32.ilog2() as u8, &mut ctx).unwrap_err();
495+
let err = BitPackedData::encode(&array.into_array(), 1024u32.ilog2() as u8, &mut ctx)
496+
.unwrap_err();
501497
assert!(matches!(err, VortexError::InvalidArgument(_, _)));
502498
}
503499

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ mod tests {
189189
fn compression_roundtrip(n: usize) {
190190
let mut ctx = SESSION.create_execution_ctx();
191191
let values = PrimitiveArray::from_iter((0..n).map(|i| (i % 2047) as u16));
192-
let compressed =
193-
BitPackedData::encode(&values.clone().into_array(), 11, &mut ctx).unwrap();
192+
let compressed = BitPackedData::encode(&values.clone().into_array(), 11, &mut ctx).unwrap();
194193
assert_arrays_eq!(compressed, values);
195194

196195
values

encodings/fastlanes/src/bitpacking/compute/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ mod tests {
5353
use crate::bitpacking::compute::chunked_indices;
5454

5555
fn bp(array: &PrimitiveArray, bit_width: u8) -> BitPackedArray {
56-
bitpack_encode(array, bit_width, None, &mut LEGACY_SESSION.create_execution_ctx()).unwrap()
56+
bitpack_encode(
57+
array,
58+
bit_width,
59+
None,
60+
&mut LEGACY_SESSION.create_execution_ctx(),
61+
)
62+
.unwrap()
5763
}
5864

5965
#[test]

0 commit comments

Comments
 (0)