1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/// Number of fixed ring buckets in the lock-free sliding window (`2^4 = 16`).
pub const SLIDING_WINDOW_BUCKETS: usize = 16;
/// Bitmask mapping a bucket epoch to a ring slot in `0..16`.
pub const SLIDING_WINDOW_MASK: usize = SLIDING_WINDOW_BUCKETS - 1;
/// Right-shift converting a bucket epoch into its ring wrap cycle (`epoch >> 4`).
pub const SLIDING_WINDOW_SHIFT: u32 = 4;
/// Bit width reserved for the per-bucket saturating counter (`67,108,863` per bucket).
pub const BUCKET_COUNT_BITS: u32 = 26;
/// Bitmask extracting the 26-bit counter from a packed bucket word.
pub const BUCKET_COUNT_MASK: u64 = - 1;
/// Bit width reserved for the sliding-window wrap cycle inside the bucket tag.
pub const BUCKET_CYCLE_BITS: u32 = 28;
/// Bitmask extracting the 28-bit cycle from a bucket tag.
pub const BUCKET_CYCLE_MASK: u64 = - 1;
/// Half-ring threshold for monotonic modular cycle comparison.
pub const BUCKET_CYCLE_HALF: u64 = 1u64 << ;
/// Bit width reserved for the breaker generation inside the bucket tag.
pub const BUCKET_GEN_BITS: u32 = 10;
/// Bitmask extracting the 10-bit generation tag.
pub const BUCKET_GEN_MASK: u64 = - 1;
/// Highest ring-bucket index (`15`) used to detect full-window saturation.
pub const SLIDING_WINDOW_LAST_SLOT: u64 = as u64;
/// Half-ring threshold for monotonic modular generation comparison.
pub const BUCKET_GEN_HALF: u64 = 1u64 << ;
/// Number of cache-line-isolated success stripes eliminating atomic RMW address stalls.
pub const SUCCESS_STRIPE_COUNT: usize = 4;
/// Mask selecting one of the four cache-line-isolated success stripes (`0..4`).
pub const SUCCESS_STRIPE_MASK: usize = SUCCESS_STRIPE_COUNT - 1;
/// Headroom below `BUCKET_COUNT_MASK` allowing wait-free `fetch_add` without tag overflow.
pub const BUCKET_COUNT_SAFE_MAX: u64 = BUCKET_COUNT_MASK - 65_535;