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
2 changes: 0 additions & 2 deletions benches/bp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(long_running_const_eval)]

use criterion::{black_box, criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion};
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
Expand Down
2 changes: 1 addition & 1 deletion src/trees/bp/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const LOOKUP_MAX_VALUE: u32 = u8::MAX as u32;
///
/// The rest of the bits are zero.
#[allow(long_running_const_eval)]
const PAREN_BLOCK_LOOKUP: [EncodedTableType; 1 << LOOKUP_BLOCK_SIZE] = calculate_lookup_table();
static PAREN_BLOCK_LOOKUP: [EncodedTableType; 1 << LOOKUP_BLOCK_SIZE] = calculate_lookup_table();

/// Offset to add to encoded excess values, so negative numbers are stored as positive integers, reducing
/// encoding complexity
Expand Down
4 changes: 2 additions & 2 deletions src/trees/bp/lookup_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ const LOOKUP_MAX_VALUE: u32 = u8::MAX as u32;
/// to dual-encode negative excess), and another 51 bits for all 17 queries that may end in this block
/// (-8 to 8 relative excess).
#[allow(long_running_const_eval)]
const PAREN_BLOCK_LOOKUP_FWD: [u64; 1 << LOOKUP_BLOCK_SIZE] = calculate_lookup_table(true);
static PAREN_BLOCK_LOOKUP_FWD: [u64; 1 << LOOKUP_BLOCK_SIZE] = calculate_lookup_table(true);

/// Encoded bwd query results for all possible 8-bit blocks.
/// The encoding reserves 10 bits for minimum and maximum excess (shifted by 8 bits so we don't have
/// to dual-encode negative excess), and another 51 bits for all 17 queries that may end in this block
/// (-8 to 8 relative excess).
#[allow(long_running_const_eval)]
const PAREN_BLOCK_LOOKUP_BWD: [u64; 1 << LOOKUP_BLOCK_SIZE] = calculate_lookup_table(false);
static PAREN_BLOCK_LOOKUP_BWD: [u64; 1 << LOOKUP_BLOCK_SIZE] = calculate_lookup_table(false);

/// Bitmask for one of the lookup values.
const ENCODING_MASK: u64 = 0b11111;
Expand Down
2 changes: 0 additions & 2 deletions src/trees/bp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ use lookup_query::{process_block_bwd, process_block_fwd, LOOKUP_BLOCK_SIZE};
/// The high-level approach to building a tree is to use the [`BpBuilder`] to construct the tree
/// using depth-first traversal of all its nodes.
/// ```rust
/// # #![allow(long_running_const_eval)] // for some reason this is needed for test cases
/// use vers_vecs::{BitVec, BpBuilder, BpTree, TreeBuilder, Tree};
///
/// let mut builder = BpBuilder::<512>::new();
Expand Down Expand Up @@ -119,7 +118,6 @@ use lookup_query::{process_block_bwd, process_block_fwd, LOOKUP_BLOCK_SIZE};
/// This is also how trees with unbalanced parenthesis expressions can be constructed.
///
/// ```rust
/// # #![allow(long_running_const_eval)]
/// use vers_vecs::{BitVec, BpTree, Tree};
/// let bv = BitVec::pack_sequence_u8(&[0b1101_0111, 0b0010_0100], 8);
/// let tree = BpTree::<4>::from_bit_vector(bv);
Expand Down