Documentation

CslibFrontier.DataStructure.Dictionary.SuccinctWhpParams

Parameters, Threshold Inequalities, and Succinct Space Accounting for the WHP Dictionary #

This module defines the dimension, hashing, buffer, SWAR B+-tree, and memory-layout parameters for the with-high-probability fixed-capacity succinct dynamic dictionary (insert, delete, query), and proves the threshold and succinct word-space inequalities across all word widths w and all n_max ≤ U, adapting the partition hash table architecture of Bender, Farach-Colton, J. Kuszmaul, and W. Kuszmaul, SOSA 2024, Sections 2.2 and 3–5, pp. 363–373; author copy pp. 3–7.

Parameter regimes, adaptations vs. SOSA 2024, and theoretical O_c(1) constants #

Where SOSA 2024 assumes zero-space oracle access to fully random hash functions on w-bit keys with w = Θ(log n) and no associated values, this formalization instantiates explicit seeded hashing, arbitrary key universes n_max ≤ U, value payloads Fin V, and arbitrary word widths w:

Main definitions #

Main results #

References #

Section 1: c-only exponent, tabulation, and capacity-threshold parameters #

Normalized failure exponent max c 1 ≥ 1.

Normalized failure exponent cEff c is at least 1.

Number of base-2 ^ bCharWhp key characters 8 * (cEff c + 5) (≥ 48), serving as both the Stage-1 reduced-key character count and the constant height of the G/S buffer tries.

Character count cTabWhp c is at least 48.

Double-tabulation expansion parameter q = 4 * (cEff c + 6) + 2 (≥ 30).

Double-tabulation expansion parameter qTabWhp c is at least 30.

Double-tabulation intermediate tuple length d = 2 * qTabWhp c * (cTabWhp c + 1).

Combined logarithmic exponent multiplier 320 + 16 * (cTabWhp c + 1) ^ 2 * qTabWhp c (Θ(c^3)) chosen so codeExpWhp c * Dynamic.logLogFactor n_max ≤ bCharWhp n_max discharges both Thorup's code bound and all polylogarithmic scale inequalities. Kept non-exposed so whnf never unrolls whpThreshold c = 2 ^ bMinWhp c.

Logarithmic exponent multiplier codeExpWhp c is at least 320.

Minimum ⌊log₂ n_max⌋ threshold 64 * (codeExpWhp c) ^ 2 + 16 * codeExpWhp c (Θ(c^6)). Kept non-exposed so whnf never unrolls whpThreshold c = 2 ^ bMinWhp c.

Minimum log-capacity threshold bMinWhp c is at least 6553600.

Normalized failure exponent plus 4 is bounded by bMinWhp c.

Capacity threshold 2 ^ bMinWhp c separating the deterministic bit-packed regime (n_max < whpThreshold c) from the succinct two-stage double-tabulation regime (whpThreshold c ≤ n_max). Kept non-exposed so whnf never reduces 2 ^ bMinWhp c.

Capacity threshold whpThreshold c is strictly positive.

Section 2: Bucket, quotient, fingerprint, salt, B+-tree, and buffer parameters #

Tabulation character width ⌊log₂ n_max⌋ / 4.

Feistel bucket index bit-width ⌊log₂ n_max⌋ - 12 * Dynamic.logLogFactor n_max.

Number of Feistel buckets M = 2 ^ bWhp n_max.

Stored quotient bit-width keyBits U - bWhp n_max.

Salted fingerprint bit-width 36 * Dynamic.logLogFactor n_max (2 ^ fpBitsWhp n_max = (slabScale n_max) ^ 36).

Per-bucket salt search bound (cEff c + 4) * slabScale n_max.

Required k-wise independence degree 2 * sMaxWhp c n_max.

Deamortization epoch length Q = (slabScale n_max) ^ 18.

Per-bucket load concentration margin δ = n_max / (numBucketsWhp n_max * (8 * slabScale n_max)).

Dedicated front-yard slot capacity per bucket ⌊n_max / M⌋ - 4 * deltaWhp n_max.

Per-bucket backyard pointer directory capacity 2 * (slabScale n_max) ^ 11.

Maximum good-event bucket occupancy 4 * (slabScale n_max) ^ 12.

Global shared backyard pool capacity n_max - numBucketsWhp n_max * capFrontWhp n_max.

Minimum degree t ≥ 2 of internal SWAR B+-tree nodes: max 2 (⌊log₂ n_max⌋ / (160 * Dynamic.logLogFactor n_max)).

SWAR key lane bit-width fpBitsWhp n_max + 2 = 36 * Dynamic.logLogFactor n_max + 2.

SWAR child/local-coord lane bit-width 12 * Dynamic.logLogFactor n_max + 8.

Packed SWAR keys-word bit-width 2 * tMinWhp n_max * keyLaneBitsWhp n_max.

Packed SWAR values/children-word bit-width 2 * tMinWhp n_max * valLaneBitsWhp n_max.

Packed SWAR B+-tree node metadata bit-width Dynamic.logLogFactor n_max + 4 (isLeaf + keyCount).

Nodes per SWAR B+-tree slice 32 * (slabScale n_max) ^ 12 / (tMinWhp n_max - 1) + 64.

Total SWAR B+-tree nodes across all 3 * M slices (3 independent roles per bucket).

Maximum BufTrie nodes per buffer ((cTabWhp c + 1) * qEpochWhp n_max + 2).

Section 3: Threshold inequalities for whpThreshold c ≤ n_max #

When whpThreshold c ≤ n_max, bMinWhp c ≤ ⌊log₂ n_max⌋.

Every capacity n_max ≥ whpThreshold c is at least 4.

For every n_max, tMinWhp n_max ≤ slabScale n_max.

Exact power-of-two expansion 2 ^ valLaneBitsWhp n_max = 256 * (slabScale n_max) ^ 12.

Core threshold separation: for all whpThreshold c ≤ n_max, codeExpWhp c * Dynamic.logLogFactor n_max ≤ bCharWhp n_max.

When whpThreshold c ≤ n_max, 320 * Dynamic.logLogFactor n_max ≤ bCharWhp n_max.

When whpThreshold c ≤ n_max, 1280 * Dynamic.logLogFactor n_max ≤ Nat.log 2 n_max.

When n_max ≤ U, bucket bit-width bWhp n_max is at most keyBits U.

Quotient bit-width plus bucket bit-width equals keyBits U whenever n_max ≤ U.

When whpThreshold c ≤ n_max, numBucketsWhp n_max * (slabScale n_max) ^ 12 ≤ n_max.

Capacity n_max is bounded by 2 * numBucketsWhp n_max * (slabScale n_max) ^ 12.

When whpThreshold c ≤ n_max, sMaxWhp c n_max ≤ 2 ^ bCharWhp n_max.

When whpThreshold c ≤ n_max, 8 ≤ tMinWhp n_max.

Thorup's k-uniqueness threshold inequality for (cTabWhp c + 1, dTabWhp c, qTabWhp c): whenever whpThreshold c ≤ n_max, 2 * doubleTabCodeBound (cTabWhp c + 1) (dTabWhp c) (qTabWhp c) (kIndepWhp c n_max) ≤ 2 ^ bCharWhp n_max.

Section 4: Three-case Front-Yard / Backyard conservation bound #

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.sum_sub_capFront_le_poolSize {c n_max : ℕ} (hth : whpThreshold c ≤ n_max) (X : Fin (numBucketsWhp n_max) → ℕ) (hsum : ∑ b : Fin (numBucketsWhp n_max), X b ≤ n_max) (hupper : ∀ (b : Fin (numBucketsWhp n_max)), numBucketsWhp n_max * X b ≤ ∑ b' : Fin (numBucketsWhp n_max), X b' + numBucketsWhp n_max * deltaWhp n_max) (hlower : ∀ (b : Fin (numBucketsWhp n_max)), ∑ b' : Fin (numBucketsWhp n_max), X b' ≤ numBucketsWhp n_max * X b + numBucketsWhp n_max * deltaWhp n_max) :
(∀ (b : Fin (numBucketsWhp n_max)), X b - capFrontWhp n_max < capBackWhp n_max) ∧ (∀ (b : Fin (numBucketsWhp n_max)), X b ≤ capMaxWhp n_max) ∧ ∑ b : Fin (numBucketsWhp n_max), (X b - capFrontWhp n_max) ≤ poolSizeWhp n_max

Three-case Front-Yard / Backyard conservation theorem: Suppose M = numBucketsWhp n_max buckets hold counts X : Fin M → ℕ summing to n ≤ n_max, and every bucket satisfies both M * X b ≤ n + M * deltaWhp n_max and n ≤ M * X b + M * deltaWhp n_max (|X b - n / M| ≤ deltaWhp n_max). Then:

  1. Every bucket uses fewer than capBackWhp n_max backyard slots (X b - capFrontWhp n_max < capBackWhp n_max),
  2. Every bucket has total load at most capMaxWhp n_max, and
  3. Total backyard usage across all M buckets satisfies ∑ b, (X b - capFrontWhp n_max) ≤ poolSizeWhp n_max.

Section 5: Memory layout and master succinct space theorem (whpSpace_le_succinctWords) #

Word footprint in the small-n_max deterministic regime (n_max < whpThreshold c): 32 header words plus bit-packed Present (1 bit), Keys (keyBits U bits), and Values (valBits V bits).

Word footprint in the large-n_max regime (whpThreshold c ≤ n_max), summing 32 header words, Stage-2 salted bucket and fingerprint double-tabulation tables, bit-packed quotients and values, per-slot and per-bucket metadata, shared backyard slab pools, SWAR B+-tree slices, and both epoch BufTrie arrays.

The large-regime layout reserves its first 32 words for the header.

Total w-bit word footprint of the WHP succinct dictionary across all n_max.

c-only redundancy multiplier on n_max * logLogFactor n_max (Θ(c^6) due to bMinWhp c).

Universal additive w-bit word slack (160 words, independent of c, U, V, w, n_max).

When whpThreshold c ≤ n_max, 2 ^ (3 * bCharWhp n_max) ≤ n_max.

When whpThreshold c ≤ n_max, all 2 ^ bCharWhp n_max-scaled hash and BufTrie bit counts are individually bounded by n_max.

Master succinct word-space bound valid across all c, U, V, w, n_max with n_max ≤ U: whpSpace c U V w n_max ≤ Dynamic.succinctWords (whpSpaceFactor c) whpSpaceConst U V w n_max.

Branching cube bound for SWAR B+-tree height: when whpThreshold c ≤ n_max, slabScale n_max ≤ (tMinWhp n_max) ^ 3.

Section 5: Stage-1 hash bit-widths and auxiliary large-regime logarithmic bounds #

Stage-1 universe-reduced key bit-width cTabWhp c * bCharWhp n_max.

Stage-1 input bit-width max 1 (keyBits U) ≥ 1, satisfying U ≤ 2 ^ w0Whp U for all U.

w0Whp U is strictly positive for all U.

sMaxWhp c n_max is strictly positive.

When whpThreshold c ≤ n_max, (slabScale n_max) ^ 96 ≤ n_max.