Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion encodings/alp/src/alp/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl OperationsVTable<ALP> for ALP {
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar> {
if let Some(patches) = array.patches()
&& let Some(patch) = patches.get_patched(index)?
&& let Some(patch) = patches.get_patched(index, ctx)?
{
return patch.cast(array.dtype());
}
Expand Down
2 changes: 1 addition & 1 deletion encodings/alp/src/alp_rd/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl OperationsVTable<ALPRD> for ALPRD {
// The left value can either be a direct value, or an exception.
// The exceptions array represents exception positions with non-null values.
let maybe_patched_value = match array.left_parts_patches() {
Some(patches) => patches.get_patched(index)?,
Some(patches) => patches.get_patched(index, ctx)?,
None => None,
};
let left = match maybe_patched_value {
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/bitpacking/vtable/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ impl OperationsVTable<BitPacked> for BitPacked {
fn scalar_at(
array: ArrayView<'_, BitPacked>,
index: usize,
_ctx: &mut ExecutionCtx,
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar> {
Ok(
if let Some(patches) = array.patches()
&& let Some(patch) = patches.get_patched(index)?
&& let Some(patch) = patches.get_patched(index, ctx)?
{
patch
} else {
Expand Down
4 changes: 2 additions & 2 deletions encodings/sparse/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ impl OperationsVTable<Sparse> for Sparse {
fn scalar_at(
array: ArrayView<'_, Sparse>,
index: usize,
_ctx: &mut ExecutionCtx,
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar> {
Ok(array
.patches()
.get_patched(index)?
.get_patched(index, ctx)?
.unwrap_or_else(|| array.fill_scalar().clone()))
}
}
Expand Down
6 changes: 4 additions & 2 deletions fuzz/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ use vortex_array::scalar_fn::fns::operators::CompareOperator;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::search_sorted::SearchResult;
use vortex_array::search_sorted::SearchSorted;
use vortex_array::search_sorted::SearchSortedArray;
use vortex_array::search_sorted::SearchSortedSide;
use vortex_btrblocks::BtrBlocksCompressor;
#[cfg(feature = "zstd")]
Expand Down Expand Up @@ -636,7 +637,7 @@ pub fn run_fuzz_action(fuzz_action: FuzzArrayAction) -> VortexFuzzResult<bool> {
if !current_array.is_canonical() {
sorted = compress_array(&sorted, CompressorStrategy::Default, &mut ctx);
}
assert_search_sorted(sorted, s, side, expected.search(), i)?;
assert_search_sorted(sorted, s, side, expected.search(), i, &mut ctx)?;
}
Action::Filter(mask_val) => {
current_array = current_array
Expand Down Expand Up @@ -715,8 +716,9 @@ fn assert_search_sorted(
side: SearchSortedSide,
expected: SearchResult,
step: usize,
ctx: &mut ExecutionCtx,
) -> VortexFuzzResult<()> {
let search_result = array
let search_result = SearchSortedArray::new(&array, ctx)
.search_sorted(&s, side)
.map_err(|e| VortexFuzzError::VortexError(e, Backtrace::capture()))?;
if search_result != expected {
Expand Down
8 changes: 5 additions & 3 deletions vortex-array/benches/patches_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use rand::RngExt;
use rand::SeedableRng;
use rand::rngs::StdRng;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::patches::PATCH_CHUNK_SIZE;
use vortex_array::patches::Patches;
use vortex_buffer::Buffer;
Expand Down Expand Up @@ -100,10 +102,10 @@ fn queries_full_range() -> Vec<usize> {

fn bench_search_index(bencher: Bencher, patches: Patches, queries: Vec<usize>) {
bencher
.with_inputs(|| (&patches, &queries))
.bench_refs(|(patches, queries)| {
.with_inputs(|| (&patches, &queries, array_session().create_execution_ctx()))
.bench_refs(|(patches, queries, ctx)| {
for &q in queries.iter() {
divan::black_box(patches.search_index(q).unwrap());
divan::black_box(patches.search_index(q, ctx).unwrap());
}
});
}
Expand Down
Loading
Loading