Fixed-Capacity Succinct Dynamic Dictionary with High-Probability O_c(1) Operations #
This module packages the fixed-capacity succinct dynamic dictionary (insert, delete, query)
with high-probability O_c(1) worst-case operation time over Cslib.WordRAM.Basis.exact and
Cslib.WordRAM.Basis.standard as a reusable
Cslib.DataStructure.WordRAM.Randomized.HighProbStateTransitionImpl certificate
(Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.impl and implStandard) for
Cslib.DataStructure.Dictionary.Dynamic.spec U V n_max, 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.
Mathematical guarantees, model, and adaptations vs. SOSA 2024 #
For any failure-probability exponent 0 < c, capacity n_max ≤ U, word width 0 < w, and
addressable universe/value/footprint bounds Fits w U, Fits w V, and
Fits w (base + whpSpace c U V w n_max):
- Succinct
1 · OPT + O_c(n_max log log n_max)space (whpSpace_le_succinctWords): the allocated Word-RAM block occupieswhpSpace c U V w n_maxmachine words, bounded across allwandn_max ≤ UbyDynamic.succinctWords (whpSpaceFactor c) whpSpaceConst U V w n_max(⌈(OPT(U, V, n_max) + whpSpaceFactor c · n_max · logLogFactor n_max) / w⌉ + 160words). - Self-contained
O(n_max)randomized initialization (initTime_impl_le): whenwhpThreshold c ≤ n_max,initSetupCodesamples two independent uniform Thorup bit-packed double-tabulation seeds (BitPackedDoubleTabulation.resampleCode, [Tho13]) directly into[base + offHashBkt, base + offQuotWhp c w n_max)and initializes the fast front-yard/backyard/SWAR B+-tree metadata inO(n_max)deterministic worst-case instructions (≤ initTimeLinearFactor * n_max + initTimeLinearConst); belowwhpThreshold c, initialization requires0random draws and3allocSpaninstructions. - Worst-case
O_c(1)operations with probability≥ 1 - (max n_max 1)⁻¹ ^ c(reachable_step_whp,seq_whp,poly_seq_whp): on any oblivious operation sequenceops : List (Dynamic.Op U)satisfyingValidHistory (Dictionary.empty U) ops(chosen independently of the internal hash seeds):- Zero-error correctness: every execution path (including rare
¬IsFastStepHitfallback branches handled viafastToCsrGenProgandfallbackAndHealGenProg) produces the exact specification transcript((Dynamic.spec U V n_max).run (Dictionary.empty U) ops).2, preservesRep, and leaves caller memory outside[base, base + whpSpace c U V w n_max)untouched (Modifies). - Per-operation high-probability bound (
reachable_step_whp): after any valid oblivious prefixops(of arbitrary length), the next valid operationohalts in clockedevalRandwithinworstCaseTimeWhp c + 1instructions (O_c(1), independent ofU,V,w,n_max,base, andops.length) with probability at least1 - (max n_max 1 : ℝ≥0∞)⁻¹ ^ c. - Whole-sequence and polynomial-horizon bounds (
seq_whp,poly_seq_whp): acrossops, every operation runs withinworstCaseTimeWhp cbody instructions with probability at least1 - ops.length * (max n_max 1 : ℝ≥0∞)⁻¹ ^ c; instantiating at exponentc + c₀covers any polynomial sequenceops.length ≤ max n_max 1 ^ c₀with failure probability at most(max n_max 1 : ℝ≥0∞)⁻¹ ^ c.
- Zero-error correctness: every execution path (including rare
- Adaptations relative to SOSA 2024 Sections 3–5:
- Fixed capacity:
n_maxis fixed without table resizing (SOSA 2024 Section 6 adds resizing). - Key-value payloads and general universes: supports arbitrary key universe
n_max ≤ U < 2^wand value payloads< V < 2^wvia one-round Feistel quotienting, whereas SOSA 2024 Sections 3–5 state a key-only membership dictionary onw = Θ(log n)-bit keys. - Explicit seeded tabulation vs. random-oracle hashing: SOSA 2024 Section 2.1 assumes
zero-space oracle access to fully random hash functions; here both bucket and fingerprint hash
families are explicitly sampled and stored inside
whpSpace c U V w n_maxvia salted bit-packed double tabulation [Tho13], and below thec-only thresholdwhpThreshold c(bMinWhp c = Θ(c^6)) operations use a deterministic bit-packed array inO_c(1)time. - High-probability vs. deterministic query time: SOSA 2024 (Theorem 1.1, Lemma 4.3 on PDF
p. 5, and Section 5 on PDF pp. 6–7) achieves deterministic worst-case
O(1)queries alongside w.h.p.O(1)updates by resampling colliding bucket fingerprints from its random hash oracle until injective. BecauseSuccinctWhpsamples a static seed pair once duringinitSetupCode(0runtimerandcalls) and routes rare bad seeds to deterministicCsrState(O(n_max)scan),queryhere runs inO_c(1)worst-case time with high probability≥ 1 - (max n_max 1 : ℝ≥0∞)⁻¹ ^ c(reachable_step_whp) rather than deterministic worst-caseO(1)on bad seeds. - Width independence (
not_readsWidth_subroutineCode): none ofinitFresh,initClear, orcodeinspects the ambient word widthw(¬ReadsWidth).
- Fixed capacity:
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.rWhp,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.worstCaseTimeWhp,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.initSetupSteps,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.initSetupRandCalls,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.initTimeLinearFactor,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.initTimeLinearConst: parameter-free register budgetrWhp,c-only worst-case operation instruction budgetworstCaseTimeWhp c, and initialization instruction / RNG-call budgets.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.opCode,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.initSetupCode,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.subroutineCode: native Word-RAM operation body, self-contained initializer, andSubroutineCode .exact rWhp 0.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.GhostRep,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.Rep,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.encode,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.argMatch,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.decode: coupled Word-RAM representation invariants and ABI register conventions.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.impl,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.implStandard:HighProbStateTransitionImplcertificates overBasis.exactandBasis.standard.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.not_readsWidth_subroutineCode: width independence (¬ReadsWidth) ofinitFresh,initClear, andcode.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.initTime_impl_le: explicitO(n_max)deterministic upper bound on(impl ...).initTime.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.seq_whp,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.poly_seq_whp,Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.reachable_step_whp: headline whole-sequence, polynomial-horizon, and arbitrary-prefix per-operation high-probability theorems.
References #
Parameter-free total register count 132 + scratchWhp (0..11 for
BitPackedDoubleTabulation.resampleCode, 16..26 for persistent control and ABI registers,
32..131 for WhpCoreParams / WhpParams, and 132.. for Realizes scratch).
Bump-pointer frontier register 17 (sReg 17).
Nominal output register 24 for SubroutineCode.output.
Output Option ℕ presence-tag register 25 (0 = none, 1 = some).
Output Option ℕ value-payload register 26.
Unified initSetup code across both < whpThreshold c (.op (.const zeroReg 0), since zeroed
memory already represents emptySmallState) and ≥ whpThreshold c (initLargeCode).
Complete per-operation Word-RAM body: loads the 100 static WhpParams words into whpParamReg
and executes the compiled stepCode (whpStepPureGenProg).
Canonical SubroutineCode for the fixed-capacity high-probability succinct dynamic dictionary
on rWhp registers.
Section 2: Register Disjointness, Width Independence (¬ReadsWidth), and Cost Budgets #
Width independence (¬ReadsWidth) of all emitted programs in subroutineCode c U V w n_max:
none of initFresh, initClear, or code inspects the ambient word width w.
c-only deterministic worst-case instruction budget for a single dictionary operation
(100 parameter-load instructions plus the Realizes instruction budget for
whpFastBranchCost c).
Deterministic worst-case instruction budget for initSetupCode c U V w n_max.
Worst-case random word draws (unifFin) made by initSetupCode c U V w n_max.
Parameter-free slope on n_max in initTime_impl_le.
Parameter-free additive constant in initTime_impl_le.
Section 3: Representation Invariants and ABI Conventions #
Trajectory-coupled representation invariant at base for oblivious operation history ops,
seed θ : SeedWhp c U n_max, abstract dictionary state s_abs, and machine state x.
Existential state-level representation invariant exposed by (impl ...).rep.
Standalone register encoding for Dynamic.Op U matching encodeOpWhp:
.query u:tagReg = 0,argUReg = u.val,argVReg = 0.insert u v:tagReg = 1,argUReg = u.val,argVReg = v.delete u:tagReg = 2,argUReg = u.val,argVReg = 0
Argument-matching predicate tying (tagReg, (argUReg, argVReg)) to encodeOpWhp o.
Output decoder reading Option ℕ from (resTagReg, resValReg) for .query and () for
.insert/.delete.
Output registers resTagReg and resValReg are disjoint from subroutineCode.input.
Section 4: Execution of loadVecUpTo, allocSpan, initSetupCode, and opCode #
Section 5: Per-Operation Deterministic Execution (exec_opCode) #
Section 6: HighProbStateTransitionImpl Packaging and Headline Theorems #
Reusable HighProbStateTransitionImpl certificate over Basis.exact for the fixed-capacity
succinct dynamic dictionary (Dynamic.spec U V n_max).
Reusable HighProbStateTransitionImpl certificate over Basis.standard for the fixed-capacity
succinct dynamic dictionary (Dynamic.spec U V n_max).
Explicit O(n_max) deterministic upper bound on fresh initialization instructions:
(impl ...).initTime ≤ initTimeLinearFactor * n_max + initTimeLinearConst.
Headline whole-sequence with-high-probability theorem (seq_whp):
Starting from zeroed memory on [base, base + whpSpace c U V w n_max), fresh initialization halts
within (impl ...).initTime + 1 instructions, and across any valid oblivious operation sequence
ops : List (Dynamic.Op U) (ValidHistory (Dictionary.empty U) ops):
- every supported branch produces the exact specification state and transcript
((Dynamic.spec U V n_max).run (Dictionary.empty U) ops), maintainsRep, and leaves caller memory outside[base, base + whpSpace c U V w n_max)untouched (Modifies); - with probability at least
1 - ops.length * (max n_max 1 : ℝ≥0∞)⁻¹ ^ c, every single operation inopsexecutes withinworstCaseTimeWhp c(O_c(1)) deterministic worst-case instructions.
Polynomial-horizon whole-sequence corollary (poly_seq_whp):
Instantiating the dictionary at exponent c + c₀ (0 < c) guarantees that starting from ⟨0, x⟩,
fresh initialization produces ν₀ in (impl ...).initTime + 1 steps, every supported trajectory
yields the exact specification state and transcript while preserving caller memory (Modifies),
and across any valid oblivious sequence ops of polynomial length ops.length ≤ max n_max 1 ^ c₀,
every operation in ops executes within worstCaseTimeWhp (c + c₀) (O_{c, c₀}(1)) worst-case
instructions with probability at least 1 - (max n_max 1 : ℝ≥0∞)⁻¹ ^ c.
Headline per-operation with-high-probability theorem after an arbitrary-length prefix
(reachable_step_whp):
Starting from ⟨0, x⟩ via fresh initialization (ν₀) and executing any valid oblivious prefix
ops (regardless of ops.length) to τ_pref, preparing the next admissible operation o and
running (subroutineCode c U V w n_max).code.program outReg halts in clocked evalRand within
worstCaseTimeWhp c + 1 instructions (O_c(1)) with probability at least
1 - (max n_max 1 : ℝ≥0∞)⁻¹ ^ c, decoding the exact specification result, preserving Rep, and
leaving caller memory outside [base, base + whpSpace c U V w n_max) untouched relative to both the
prefix state and the caller's initial memory x.mem (Modifies).