In-Epoch Operational Dispatcher on the Resizable Word RAM #
This module formalizes the in-epoch operational dispatcher of the resizable succinct dynamic
dictionary on the word-granular Resizable Word RAM (Cslib.WordRAM.Resizable), wiring the
RealizesBounded .exact (¬ReadsWidth) subroutines from Accessors.lean, SlotOps.lean,
BucketOps.lean, and RuntimeReducedKWise.lean into parameter-free native RCode .exact rEpoch
operational dispatchers:
- Parameter-Free Native Dispatchers (
inEpochQueryCode,inEpochInsertCode,inEpochDeleteCode,inEpochOpCode): RelocatableRCode .exact rEpochprograms independent of(U, V, w, N, n, base):inEpochQueryCode: readsnfrombase + 6, returnsnoneinO(1)steps whenn = 0, and otherwise loadsHashParams/CompParamsfrom[base + 8, base + 63), reconstructsx.frontierintorFr, evaluatesh_q, and runscompQueryWithHashGenProg;inEpochInsertCode: searches(b, m)viacompInsertSearchWithHashGenProg, updates the existing slot in place viacompWritePhysValGenProgon a hit, and on a miss grows the item stream byΔ ≤ 2zeroed words viagrowZeroCode, appends the new slot viacompInsertAppendNewGenProg, and incrementsnatbase + 6;inEpochDeleteCode: returns immediately whenn = 0, and otherwise executes two-phase deletion (compDeletePrepWithHashGenProg, second hash evaluation onq_last, andcompDeleteFinishWithHashGenProg), shrinking the item stream byΔ ≤ 2words viashrinkCodeand decrementingnatbase + 6whenfound = 1;inEpochOpCode: unified per-operation dispatcher branching onrTag.
- Operational Invariant,
1 · OPTPeak Space, and Expected Amortized $O(1)$ Cost:inEpochOpCode_active_demonicExecandinEpochOpCode_demonicExec: preserveCompactedSplitRep(with the same latent seedθ) andCompactedRepacross everyInEpochValidoperation;inEpochPeakWords_le_succinctWordsandinEpochOpCode_peakFrontierLe: bound the hardware word frontier at every intermediate step bybase + Dynamic.succinctWords 1355 441 U V w (max n n')(1 · OPT, never2 · OPT);inEpochOpCode_execRCodeDistandinEpochOpCode_expected_amortized: lift execution toExecRCodeDistand prove a parameter-free $O(1)$ expected amortized instruction boundinEpochChargeunder a uniformQuotHashSeed U N.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.rEpoch: parameter-free register count.Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.inEpochQueryCode,inEpochInsertCode,inEpochDeleteCode,inEpochOpCode: parameter-freeRCode .exact rEpochoperational dispatchers.Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.InEpochValid,inEpochPeakWords,inEpochPotential,inEpochBaseCharge,inEpochCharge: admissibility, peak-space, potential, and parameter-free $O(1)$ charge definitions.Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.encode,argMatch,decode: ABI register conventions forDynamic.Op U.
Main results #
not_readsWidth_inEpochOpCode:inEpochOpCodedoes not inspect the ambient word widthw.inEpochPeakWords_le_succinctWords:inEpochPeakWordsis bounded by1 · OPTsuccinct words.inEpochOpCode_active_demonicExec,inEpochOpCode_demonicExec: deterministicRDemonicExecpreservingCompactedSplitRep/CompactedRepwithO(1 + probeExcess)potential-amortized step bound.inEpochOpCode_execRCodeDist,inEpochOpCode_peakFrontierLe: non-vacuous distributional execution and stepwise1 · OPTPeakFrontierLecertificates.inEpochOpCode_expected_amortized: uniform-seed $O(1)$ expected amortized instruction bound.
References #
Section 1: Native RCode .exact rEpoch Operational Dispatchers #
In-epoch query operational code (RCode .exact rEpoch, parameter-free):
loads n from base + 6, returns none when n = 0, and otherwise runs
compQueryWithHashGenProg to write (rOutTag, rOutVal).
In-epoch insert operational code (RCode .exact rEpoch, parameter-free):
searches (b, m) via compInsertSearchWithHashGenProg, overwrites the value in place on a hit,
and on a miss grows [0, frontier) by Δ ≤ 2 zeroed words (growZeroCode), appends the new
entry (compInsertAppendNewGenProg), and increments n at base + 6.
In-epoch delete operational code (RCode .exact rEpoch, parameter-free):
no-op when n = 0, and otherwise runs two-phase deletion (compDeletePrepWithHashGenProg,
second hash evaluation on q_last, and compDeleteFinishWithHashGenProg), shrinking
[0, frontier) by Δ ≤ 2 words (shrinkCode) and decrementing n at base + 6 on a hit.
Unified parameter-free in-epoch operational dispatcher (RCode .exact rEpoch):
branches on rTag between inEpochQueryCode (0), inEpochInsertCode (1), and
inEpochDeleteCode (2).
Section 2: Width-Independence (¬inEpochOpCode.ReadsWidth) #
inEpochQueryCode does not inspect the ambient word width w.
inEpochInsertCode does not inspect the ambient word width w.
inEpochDeleteCode does not inspect the ambient word width w.
inEpochOpCode does not inspect the ambient word width w (¬inEpochOpCode.ReadsWidth).
Section 3: Per-Operation Execution and Main Certificates #
Section 4: Main Operational Execution, 1 · OPT PeakFrontierLe, and O(1) Expectation #
Active-Epoch Seeded Operational Execution (inEpochOpCode_active_demonicExec):
For any active epoch (0 < n, latent seed θ : QuotHashSeed U N) and any o : Dynamic.Op U
satisfying InEpochValid V N s_abs o, inEpochOpCode executes deterministically in steps
instructions, keeps the hardware frontier ≤ base + inEpochPeakWords V w N n s_abs o at every
step, decodes the exact Dynamic.spec result, preserves CompactedSplitRep at the same latent
seed θ, preserves rBase and caller memory < base, and satisfies the potential-amortized step
bound steps + Φ(y) ≤ Φ(x) + inEpochBaseCharge + (12 * inEpochFactor) * probeExcess.
In-Epoch Compacted Representation Execution (inEpochOpCode_demonicExec):
For every resting CompactedRep U V w N n n_init base s_abs x (both n = 0 and 0 < n) and every
o : Dynamic.Op U satisfying InEpochValid V N s_abs o, inEpochOpCode executes without faulting
under peak hardware frontier base + inEpochPeakWords V w N n s_abs o, returns the Dynamic.spec
output via decode o, and preserves CompactedRep, rBase, and caller memory < base.
In-Epoch Distributional Execution (inEpochOpCode_execRCodeDist):
Lifts inEpochOpCode_demonicExec directly to ExecRCodeDist, certifying fault-freedom across all
adaptive adversaries, exact CompactedRep preservation, and 1 · OPT peak hardware frontier
bounded by base + Dynamic.succinctWords 1355 441 U V w (max n n').
Stepwise 1 · OPT Hardware-Frontier Certificate (inEpochOpCode_peakFrontierLe):
Throughout execution of inEpochOpCode.program rOutTag on any valid in-epoch operation, the active
hardware word frontier never exceeds base + Dynamic.succinctWords 1355 441 U V w (max n n').
Uniform-Seed $O(1)$ Expected Amortized In-Epoch Bound (inEpochOpCode_expected_amortized):
For any seed-indexed family xOf : QuotHashSeed U N → RData rEpoch representing s_abs in an
active epoch (0 < n, EpochValid U n N, InEpochValid V N s_abs o), inEpochOpCode transitions
each xOf θ to yOf θ in stepsOf θ instructions with expected amortized cost at most the
parameter-free constant inEpochCharge under PMF.uniformOfFintype (QuotHashSeed U N).