Skip to content
Merged
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/developer-guide/internals/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ For tests or specialized use-cases, sessions can be assembled from individual co
the `.with::<T>()` builder:

```rust
let session = VortexSession::empty()
let session = VortexSession::builder()
.with::<ArraySession>()
.with::<LayoutSession>()
.with::<ScalarFnSession>()
.with::<RuntimeSession>();
.with::<RuntimeSession>()
.build();
```
4 changes: 1 addition & 3 deletions encodings/alp/benches/alp_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::dtype::NativePType;
use vortex_array::session::ArraySession;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_buffer::buffer;
Expand Down Expand Up @@ -51,8 +50,7 @@ const BENCH_ARGS: &[(usize, f64, f64)] = &[
(10_000, 0.1, 1.0),
];

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[divan::bench(types = [f32, f64], args = BENCH_ARGS)]
fn compress_alp<T: ALPFloat + NativePType>(bencher: Bencher, args: (usize, f64, f64)) {
Expand Down
4 changes: 1 addition & 3 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,14 @@ mod tests {
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::assert_arrays_eq;
use vortex_array::session::ArraySession;
use vortex_error::VortexExpect;
use vortex_session::VortexSession;

use super::*;
use crate::alp_encode;
use crate::decompress_into_array;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[rstest]
#[case(0)]
Expand Down
3 changes: 1 addition & 2 deletions encodings/alp/src/alp/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ mod tests {
use vortex_array::arrays::PrimitiveArray;
use vortex_array::arrays::patched::PatchedArraySlotsExt;
use vortex_array::buffer::BufferHandle;
use vortex_array::session::ArraySession;
use vortex_array::session::ArraySessionExt;
use vortex_error::VortexResult;
use vortex_error::vortex_err;
Expand All @@ -111,7 +110,7 @@ mod tests {
use crate::alp_encode;

static SESSION: LazyLock<VortexSession> = LazyLock::new(|| {
let session = VortexSession::empty().with::<ArraySession>();
let session = vortex_array::array_session();
session.arrays().register(ALPPatchedPlugin);
session
});
Expand Down
4 changes: 1 addition & 3 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,8 @@ mod tests {
use vortex_array::assert_arrays_eq;
use vortex_array::serde::SerializeOptions;
use vortex_array::serde::SerializedArray;
use vortex_array::session::ArraySession;
use vortex_array::session::ArraySessionExt;
use vortex_buffer::ByteBufferMut;
use vortex_session::VortexSession;
use vortex_session::registry::ReadContext;

use super::*;
Expand Down Expand Up @@ -367,7 +365,7 @@ mod tests {
let array = ByteBool::from_option_vec(vec![Some(true), None, Some(false), None]);
let dtype = array.dtype().clone();
let len = array.len();
let session = VortexSession::empty().with::<ArraySession>();
let session = vortex_array::array_session();
session.arrays().register(ByteBool);

let ctx = ArrayContext::empty();
Expand Down
3 changes: 1 addition & 2 deletions encodings/datetime-parts/src/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ mod test {
use vortex_array::validity::Validity;
use vortex_buffer::buffer;
use vortex_error::VortexResult;
use vortex_session::VortexSession;

use crate::DateTimeParts;
use crate::array::DateTimePartsArraySlotsExt;
Expand All @@ -133,7 +132,7 @@ mod test {
],
validity.clone(),
);
let mut ctx = ExecutionCtx::new(VortexSession::empty());
let mut ctx = ExecutionCtx::new(vortex_array::array_session());
let date_times = DateTimeParts::try_from_temporal(
TemporalArray::new_timestamp(
milliseconds.clone().into_array(),
Expand Down
4 changes: 1 addition & 3 deletions encodings/experimental/onpair/benches/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ use vortex_array::builtins::ArrayBuiltins;
use vortex_array::dtype::DType;
use vortex_array::dtype::NativePType;
use vortex_array::dtype::Nullability;
use vortex_array::session::ArraySession;
use vortex_buffer::Buffer;
use vortex_buffer::ByteBuffer;
use vortex_mask::Mask;
Expand Down Expand Up @@ -80,8 +79,7 @@ impl DecodeInputs {
use vortex_onpair::onpair_compress;
use vortex_session::VortexSession;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[derive(Copy, Clone, Debug)]
enum Shape {
Expand Down
4 changes: 1 addition & 3 deletions encodings/experimental/onpair/src/compute/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ mod tests {
use vortex_array::dtype::Nullability;
use vortex_array::scalar::Scalar;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_error::VortexResult;
use vortex_session::VortexSession;

use crate::compress::DEFAULT_DICT12_CONFIG;
use crate::compress::onpair_compress;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[cfg_attr(miri, ignore)]
#[rstest]
Expand Down
4 changes: 1 addition & 3 deletions encodings/experimental/onpair/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::match_each_integer_ptype;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::check_metadata;
use vortex_array::validity::Validity;
use vortex_buffer::BufferMut;
Expand All @@ -28,8 +27,7 @@ use crate::OnPairMetadata;
use crate::compress::DEFAULT_DICT12_CONFIG;
use crate::compress::onpair_compress;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

fn sample_input() -> VarBinArray {
VarBinArray::from_iter(
Expand Down
4 changes: 1 addition & 3 deletions encodings/experimental/onpair/tests/big_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ use vortex_array::builtins::ArrayBuiltins;
use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_onpair::DEFAULT_DICT12_CONFIG;
use vortex_onpair::onpair_compress;
use vortex_session::VortexSession;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

fn corpus(n: usize) -> Vec<String> {
let templates: &[&str] = &[
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/benches/bitpack_compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use vortex_array::arrays::ConstantArray;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_array::validity::Validity;
use vortex_buffer::Alignment;
use vortex_buffer::BufferMut;
Expand All @@ -36,8 +35,7 @@ fn main() {
divan::main();
}

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

const LENS: &[usize] = &[1024, 64 * 1024];
const BIT_WIDTHS: &[u8] = &[4, 16];
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/benches/bitpack_compare_sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use vortex_array::builtins::ArrayBuiltins;
use vortex_array::dtype::NativePType;
use vortex_array::scalar::Scalar;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_array::validity::Validity;
use vortex_buffer::Alignment;
use vortex_buffer::BufferMut;
Expand All @@ -40,8 +39,7 @@ fn main() {
divan::main();
}

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

/// Number of elements per benchmarked array (64 full FastLanes blocks).
const LEN: usize = 64 * 1024;
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/benches/bitpacking_take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use vortex_array::IntoArray as _;
use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::session::ArraySession;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_buffer::buffer;
Expand All @@ -27,8 +26,7 @@ fn main() {
divan::main();
}

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[divan::bench]
fn take_10_stratified(bencher: Bencher) {
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/benches/canonicalize_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::ChunkedArray;
use vortex_array::builders::ArrayBuilder;
use vortex_array::builders::PrimitiveBuilder;
use vortex_array::session::ArraySession;
use vortex_error::VortexExpect;
use vortex_fastlanes::bitpack_compress::test_harness::make_array;
use vortex_session::VortexSession;
Expand All @@ -35,8 +34,7 @@ const BENCH_ARGS: &[(usize, usize, f64)] = &[
(10000, 1000, 0.00),
];

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[cfg(not(codspeed))]
#[divan::bench(args = BENCH_ARGS)]
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/benches/cast_bitpacked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use vortex_array::builtins::ArrayBuiltins;
use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::session::ArraySession;
use vortex_array::validity::Validity;
use vortex_buffer::BufferMut;
use vortex_error::VortexExpect;
Expand All @@ -39,8 +38,7 @@ fn main() {
divan::main();
}

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

const U32: DType = DType::Primitive(PType::U32, Nullability::NonNullable);

Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/benches/compute_between.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::dtype::NativePType;
use vortex_array::session::ArraySession;
use vortex_error::VortexExpect;
use vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width;
use vortex_session::VortexSession;
Expand All @@ -25,8 +24,7 @@ fn main() {
divan::main();
}

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

fn generate_primitive_array<T: NativePType + NumCast>(
rng: &mut StdRng,
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ mod test {
use vortex_array::assert_arrays_eq;
use vortex_array::builders::ArrayBuilder;
use vortex_array::builders::PrimitiveBuilder;
use vortex_array::session::ArraySession;
use vortex_buffer::Buffer;
use vortex_error::VortexError;
use vortex_error::vortex_err;
Expand All @@ -448,8 +447,7 @@ mod test {
use crate::bitpack_compress::test_harness::make_array;
use crate::bitpacking::array::BitPackedArrayExt;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[test]
fn test_best_bit_width() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ mod tests {
use vortex_array::VortexSessionExecute;
use vortex_array::assert_arrays_eq;
use vortex_array::dtype::Nullability;
use vortex_array::session::ArraySession;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_buffer::BufferMut;
Expand All @@ -226,8 +225,7 @@ mod tests {
bitpack_encode(array, bit_width, None, &mut SESSION.create_execution_ctx()).unwrap()
}

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

fn unpack(bitpacked: &BitPackedArray) -> VortexResult<PrimitiveArray> {
unpack_array(bitpacked.as_view(), &mut SESSION.create_execution_ctx())
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/src/bitpacking/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,13 @@ mod test {
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::assert_arrays_eq;
use vortex_array::session::ArraySession;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

use crate::BitPackedData;
use crate::bitpacking::array::BitPackedArrayExt;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[test]
fn test_encode() {
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/src/bitpacking/compute/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,14 @@ mod tests {
use vortex_array::scalar_fn::fns::binary::CompareKernel;
use vortex_array::scalar_fn::fns::operators::CompareOperator;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_error::VortexResult;
use vortex_session::VortexSession;

use crate::BitPacked;
use crate::BitPackedArrayExt;
use crate::BitPackedData;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

/// All six operators on a small in-range input.
#[rstest]
Expand Down
3 changes: 1 addition & 2 deletions encodings/fastlanes/src/bitpacking/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ mod tests {
use vortex_array::arrays::PrimitiveArray;
use vortex_array::arrays::patched::PatchedArraySlotsExt;
use vortex_array::buffer::BufferHandle;
use vortex_array::session::ArraySession;
use vortex_array::session::ArraySessionExt;
use vortex_buffer::Buffer;
use vortex_error::VortexResult;
Expand All @@ -114,7 +113,7 @@ mod tests {
use crate::BitPackedData;

static SESSION: LazyLock<VortexSession> = LazyLock::new(|| {
let session = VortexSession::empty().with::<ArraySession>();
let session = vortex_array::array_session();
session.arrays().register(BitPackedPatchedPlugin);
session
});
Expand Down
4 changes: 1 addition & 3 deletions encodings/fastlanes/src/delta/array/delta_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ mod tests {
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::assert_arrays_eq;
use vortex_array::session::ArraySession;
use vortex_error::VortexExpect;
use vortex_error::VortexResult;
use vortex_session::VortexSession;
Expand All @@ -116,8 +115,7 @@ mod tests {
use crate::delta::array::delta_decompress::delta_decompress;
use crate::delta_compress;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);

#[rstest]
#[case::u32((0u32..10_000).collect())]
Expand Down
Loading
Loading