Skip to content

Commit b1cfc72

Browse files
committed
move flag
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
1 parent ba8c05d commit b1cfc72

6 files changed

Lines changed: 20 additions & 17 deletions

File tree

encodings/alp/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pub use alp_rd::*;
2121
use vortex_array::aggregate_fn::AggregateFnVTable;
2222
use vortex_array::aggregate_fn::fns::nan_count::NanCount;
2323
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
24+
use vortex_array::arrays::patched::USE_EXPERIMENTAL_PATCHES;
2425
use vortex_array::session::ArraySessionExt;
25-
use vortex_fastlanes::USE_EXPERIMENTAL_PATCHES;
2626
use vortex_session::VortexSession;
2727

2828
mod alp;

encodings/fastlanes/src/lib.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
#![allow(clippy::cast_possible_truncation)]
55

6-
use std::env;
7-
use std::sync::LazyLock;
8-
96
pub use bitpacking::*;
107
pub use delta::*;
118
pub use r#for::*;
@@ -31,19 +28,10 @@ use vortex_array::aggregate_fn::AggregateFnVTable;
3128
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
3229
use vortex_array::aggregate_fn::fns::is_sorted::IsSorted;
3330
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
31+
use vortex_array::arrays::patched::USE_EXPERIMENTAL_PATCHES;
3432
use vortex_array::session::ArraySessionExt;
3533
use vortex_session::VortexSession;
3634

37-
/// Flag indicating if experimental patched array support is enabled.
38-
///
39-
/// This is set using the environment variable `VORTEX_EXPERIMENTAL_PATCHED_ARRAY`.
40-
///
41-
/// When this is true, any BitPacked array with interior patches will be read as a `Patched`
42-
/// array, and the builtin compressor will use Patched array with BitPacked instead of
43-
/// BitPacked array with interior patches.
44-
pub static USE_EXPERIMENTAL_PATCHES: LazyLock<bool> =
45-
LazyLock::new(|| env::var("VORTEX_EXPERIMENTAL_PATCHED_ARRAY").is_ok());
46-
4735
/// Initialize fastlanes encodings in the given session.
4836
pub fn initialize(session: &VortexSession) {
4937
// If we're using the experimental Patched encoding, register a shim

vortex-array/src/arrays/patched/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ mod array;
7171
mod compute;
7272
mod vtable;
7373

74+
use std::env;
75+
use std::sync::LazyLock;
76+
7477
pub use array::*;
7578
use vortex_buffer::ByteBuffer;
7679
pub use vtable::*;
@@ -96,3 +99,14 @@ const fn patch_lanes<V: Sized>() -> usize {
9699
// from shared to global memory.
97100
if size_of::<V>() < 8 { 32 } else { 16 }
98101
}
102+
103+
/// Flag indicating if experimental patched array support is enabled.
104+
///
105+
/// This is set using the environment variable `VORTEX_EXPERIMENTAL_PATCHED_ARRAY`.
106+
///
107+
/// When this is true, any arrays with interior `Patches` will be read as a `Patched`
108+
/// array, and eliminate the interior patches.
109+
///
110+
/// The builtin compressor will also generate Patched arrays.
111+
pub static USE_EXPERIMENTAL_PATCHES: LazyLock<bool> =
112+
LazyLock::new(|| env::var("VORTEX_EXPERIMENTAL_PATCHED_ARRAY").is_ok());

vortex-btrblocks/src/schemes/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ use vortex_array::LEGACY_SESSION;
1717
use vortex_array::ToCanonical;
1818
use vortex_array::VortexSessionExecute;
1919
use vortex_array::arrays::Patched;
20+
use vortex_array::arrays::patched::USE_EXPERIMENTAL_PATCHES;
2021
use vortex_array::arrays::primitive::PrimitiveArrayExt;
2122
use vortex_array::dtype::PType;
2223
use vortex_compressor::estimate::CompressionEstimate;
2324
use vortex_compressor::scheme::ChildSelection;
2425
use vortex_compressor::scheme::DescendantExclusion;
2526
use vortex_error::VortexResult;
2627
use vortex_error::vortex_panic;
27-
use vortex_fastlanes::USE_EXPERIMENTAL_PATCHES;
2828
use vortex_sparse::Sparse;
2929

3030
use super::integer::SparseScheme as IntSparseScheme;

vortex-btrblocks/src/schemes/integer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use vortex_array::ToCanonical;
1111
use vortex_array::VortexSessionExecute;
1212
use vortex_array::arrays::ConstantArray;
1313
use vortex_array::arrays::Patched;
14+
use vortex_array::arrays::patched::USE_EXPERIMENTAL_PATCHES;
1415
use vortex_array::arrays::primitive::PrimitiveArrayExt;
1516
use vortex_array::scalar::Scalar;
1617
use vortex_compressor::builtins::FloatDictScheme;
@@ -32,7 +33,6 @@ use vortex_fastlanes::FoR;
3233
use vortex_fastlanes::FoRArrayExt;
3334
use vortex_fastlanes::RLE;
3435
use vortex_fastlanes::RLEArrayExt;
35-
use vortex_fastlanes::USE_EXPERIMENTAL_PATCHES;
3636
use vortex_fastlanes::bitpack_compress::bit_width_histogram;
3737
use vortex_fastlanes::bitpack_compress::bitpack_encode;
3838
use vortex_fastlanes::bitpack_compress::find_best_bit_width;

vortex-file/src/strategy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use vortex_array::arrays::Primitive;
2626
use vortex_array::arrays::Struct;
2727
use vortex_array::arrays::VarBin;
2828
use vortex_array::arrays::VarBinView;
29+
use vortex_array::arrays::patched::USE_EXPERIMENTAL_PATCHES;
2930
use vortex_array::dtype::FieldPath;
3031
use vortex_btrblocks::BtrBlocksCompressorBuilder;
3132
use vortex_btrblocks::SchemeExt;
@@ -91,7 +92,7 @@ pub static ALLOWED_ENCODINGS: LazyLock<HashSet<ArrayId>> = LazyLock::new(|| {
9192
allowed.insert(Masked.id());
9293
allowed.insert(Dict.id());
9394

94-
if *vortex_fastlanes::USE_EXPERIMENTAL_PATCHES {
95+
if *USE_EXPERIMENTAL_PATCHES {
9596
allowed.insert(Patched.id());
9697
}
9798

0 commit comments

Comments
 (0)