diff --git a/.github/workflows/bench-pr.yml b/.github/workflows/bench-pr.yml index 48c1d2c01..5bb42716d 100644 --- a/.github/workflows/bench-pr.yml +++ b/.github/workflows/bench-pr.yml @@ -181,6 +181,7 @@ jobs: BENCH_VORTEX_RATIOS: '.*' RUSTFLAGS: '-C target-cpu=native' HOME: /home/ci-runner + RUST_BACKTRACE: full run: | cargo run --bin clickbench --release -- -d gh-json | tee clickbench.json - name: Setup AWS CLI diff --git a/bench-vortex/src/bin/clickbench.rs b/bench-vortex/src/bin/clickbench.rs index 3bc8ddb06..c9f702508 100644 --- a/bench-vortex/src/bin/clickbench.rs +++ b/bench-vortex/src/bin/clickbench.rs @@ -165,7 +165,7 @@ fn main() { let start = Instant::now(); execute_query(&context, &query) .await - .expect(&format!("executing query {query_idx}")); + .unwrap_or_else(|e| panic!("executing query {query_idx}: {e}")); start.elapsed() }); diff --git a/encodings/fastlanes/src/bitpacking/compress.rs b/encodings/fastlanes/src/bitpacking/compress.rs index 346019042..715b51d2a 100644 --- a/encodings/fastlanes/src/bitpacking/compress.rs +++ b/encodings/fastlanes/src/bitpacking/compress.rs @@ -194,7 +194,7 @@ pub fn unpack(array: BitPackedArray) -> VortexResult { let length = array.len(); let offset = array.offset() as usize; let ptype = array.ptype(); - let mut unpacked = match_each_unsigned_integer_ptype!(array.ptype().to_unsigned(), |$P| { + let mut unpacked = match_each_unsigned_integer_ptype!(ptype.to_unsigned(), |$P| { PrimitiveArray::from_vec( unpack_primitive::<$P>(array.packed_slice::<$P>(), bit_width, offset, length), array.validity(), diff --git a/encodings/fastlanes/src/bitpacking/compute/filter.rs b/encodings/fastlanes/src/bitpacking/compute/filter.rs index 91dfbee79..8325f76d2 100644 --- a/encodings/fastlanes/src/bitpacking/compute/filter.rs +++ b/encodings/fastlanes/src/bitpacking/compute/filter.rs @@ -3,7 +3,7 @@ use fastlanes::BitPacking; use vortex_array::array::PrimitiveArray; use vortex_array::compute::{filter, FilterFn, FilterIter, FilterMask}; use vortex_array::variants::PrimitiveArrayTrait; -use vortex_array::{ArrayData, IntoArrayData, IntoArrayVariant}; +use vortex_array::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; use vortex_dtype::{match_each_unsigned_integer_ptype, NativePType}; use vortex_error::VortexResult; @@ -12,11 +12,14 @@ use crate::bitpacking::compute::take::UNPACK_CHUNK_THRESHOLD; use crate::{BitPackedArray, BitPackedEncoding}; impl FilterFn for BitPackedEncoding { + #[allow(clippy::panic_in_result_fn)] fn filter(&self, array: &BitPackedArray, mask: FilterMask) -> VortexResult { let primitive = match_each_unsigned_integer_ptype!(array.ptype().to_unsigned(), |$I| { filter_primitive::<$I>(array, mask) }); - Ok(primitive?.into_array()) + let prim = primitive?; + assert_eq!(prim.dtype(), array.dtype(), "BPA dtype changed in filter!"); + Ok(prim.into_array()) } } diff --git a/encodings/fastlanes/src/bitpacking/compute/slice.rs b/encodings/fastlanes/src/bitpacking/compute/slice.rs index 26f8ef89e..249c6cb7e 100644 --- a/encodings/fastlanes/src/bitpacking/compute/slice.rs +++ b/encodings/fastlanes/src/bitpacking/compute/slice.rs @@ -2,12 +2,13 @@ use std::cmp::max; use vortex_array::compute::SliceFn; use vortex_array::variants::PrimitiveArrayTrait; -use vortex_array::{ArrayData, IntoArrayData}; +use vortex_array::{ArrayDType, ArrayData, IntoArrayData}; use vortex_error::VortexResult; use crate::{BitPackedArray, BitPackedEncoding}; impl SliceFn for BitPackedEncoding { + #[allow(clippy::panic_in_result_fn)] fn slice(&self, array: &BitPackedArray, start: usize, stop: usize) -> VortexResult { let offset_start = start + array.offset() as usize; let offset_stop = stop + array.offset() as usize; @@ -20,7 +21,7 @@ impl SliceFn for BitPackedEncoding { // slice the buffer using the encoded start/stop values // SAFETY: the invariants of the original BitPackedArray are preserved when slicing. - unsafe { + let sliced = unsafe { BitPackedArray::new_unchecked_with_offset( array.packed().slice(encoded_start..encoded_stop), array.ptype(), @@ -35,7 +36,11 @@ impl SliceFn for BitPackedEncoding { offset as u16, ) } - .map(|a| a.into_array()) + .map(|a| a.into_array())?; + + assert_eq!(sliced.dtype(), array.dtype(), "BPA slice changed type"); + + Ok(sliced) } }