Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpFastBaseProg.Overmars

Per-Bucket Overmars Shadow B+-Tree Rebuild (overmarsStepGenProg) #

This module implements the compact BktMetaRt descriptor and the worst-case O_c(1) per-bucket Overmars shadow B+-tree rebuild subroutine (overmarsStepGenProg) on FastMemRep, certified over Basis.exact with zero local work via realize and Realizes.iterate₀:

  1. BktMetaRt, mkBktMetaRt, mkBktMetaRtProg, BktMetaBucketEnv, setOvermarsActRtProg: 4-word runtime descriptor for packed bktMeta multi-field updates.
  2. Activation, 16-coordinate bounded-fuel shadow-tree scan (overmarsScanLoopGenProg), and role-swap completion combined in overmarsStepGenProg.

Main definitions #

Main results #

Bundled read-only and fast-step specifications #

Section 1: BktMetaRt Descriptor and Role/Activation Substeps #

@[reducible, inline]

Compact 4-word runtime descriptor ((base, offBktMeta), (globalPtrBits, w)) for bktMeta packed-array accesses, keeping realize elaboration independent of WhpCoreParams width.

Construct the 4-word BktMetaRt descriptor for (c, U, V, w, n_max, base).

Existential admissibility predicate for (bm, b) on bktMeta.

@[irreducible]

Set (overmarsActive b, overmarsCursor b, overmarsInsCount b) := (actVal, 0, 0) on BktMetaRt (d = ((bm, b), actVal)).

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.setOvermarsActRtProg_fastStep {c U V w n_max base b actVal : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hact_le : actVal ≤ n_max) (hseed : SeedWhpMemRep base c U w n_max θ s.mem) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := setOvermarsActRtProg ((mkBktMetaRt c U V w n_max base, b), actVal); have s' := (Memory.spec 0).clientState s prog; WordRAM.Realization.memoryCost prog s = 12 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ FastStateStep base c U V w n_max θ { quotArr := fs.quotArr, valArr := fs.valArr, locState := fs.locState, bktCount := fs.bktCount, bktSalt := fs.bktSalt, liveRole := fs.liveRole, liveInsCount := fs.liveInsCount, overmarsRole := fs.overmarsRole, overmarsActive := Function.update fs.overmarsActive b actVal, overmarsCursor := Function.update fs.overmarsCursor b 0, overmarsInsCount := Function.update fs.overmarsInsCount b 0, rebDoneFlag := fs.rebDoneFlag, rebQueued := fs.rebQueued, backPtr := fs.backPtr, poolFreeTop := fs.poolFreeTop, poolFreeStack := fs.poolFreeStack, poolOwner := fs.poolOwner, slices := fs.slices, buf := fs.buf, curEp := fs.curEp, epochClock := fs.epochClock, rebStage := fs.rebStage, stageCursor := fs.stageCursor, dirtyCount := fs.dirtyCount, dirtyBuckets := fs.dirtyBuckets, dirtyIdx := fs.dirtyIdx, rebCandSalt := fs.rebCandSalt, rebScanCursor := fs.rebScanCursor, rebInsCount := fs.rebInsCount, rebCollision := fs.rebCollision } s s'

Section 2: Coordinate Scan Step and Bounded-Fuel Scan Loop #

Section 3: Role-Swap Completion and Full overmarsStepGenProg #

@[irreducible]

Complete overmarsStep Memory.Prog subroutine (d = ((wp, base), b)).

Minimal structural bounds on fs sufficient to execute overmarsStepGenProg safely on bucket b.

CoreFastInv + PreOvermarsBucketInv immediately yield OvermarsBucketStepBounds.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.overmarsStepGenProg_fastStep {c U V w n_max base b : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hbnds : OvermarsBucketStepBounds U n_max b fs) (hseed : SeedWhpMemRep base c U w n_max θ s.mem) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := overmarsStepGenProg ((mkWhpParams c U V w n_max, base), b); have s' := (Memory.spec 0).clientState s prog; WordRAM.Realization.memoryCost prog s ≤ 32 * hashEvalCostWhp c + 39326 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ FastStateStep base c U V w n_max θ (SuccinctWhp.overmarsStep c U n_max θ b fs) s s'