Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Migration.ParamsCompute.Scales

Runtime Root-Header Copy, Logarithmic Scales, Bucket Scales, and GlobalMeta Bases #

Implements the 8-word root-header writer (writeRootHdrSubProg) together with the read-only evaluators for (logN, qBitsVal, llf) (computeLogScalesProg), compacted bucket/slab/tail scales (computeCompScalesProg), and GlobalMeta region base offsets (computeGmBasesProg).

Root Header Copy (writeRootHdrSubProg) #

Copy the 5 static root-header words [U - 1, V - 1, w, keyBits U, valBits V] from [srcHdrBase, +5) and write the 8-word root header at [dstMetaBase, +8), returning (w, (keyBits U, valBits V)).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.ParamsComputeAux.writeRootHdrSubProg_spec {w U V N_old n_old n_init_old srcHdrBase dstMetaBase N n_cur n_init_new : ℕ} {s : Memory.State} (hhdr : RootHeaderValid U V w N_old n_old n_init_old srcHdrBase s.mem) (hV : V ≤ 2 ^ w) (hN_fit : WordRAM.Fits w N) (hnc_fit : WordRAM.Fits w n_cur) (hni_fit : WordRAM.Fits w n_init_new) (h7 : WordRAM.Fits w 7) (hsrc_fr : srcHdrBase + 5 ≤ s.frontier) (hdst_fr : dstMetaBase + 8 ≤ s.frontier) :
have d := ((srcHdrBase, dstMetaBase), N, n_cur, n_init_new); have prog := writeRootHdrSubProg d; have s' := (Memory.spec 0).clientState s prog; WriteRootHdrSubPre w d s ∧ (Memory.spec w).ValidHistory s ((Memory.spec w).clientHistory s prog) ∧ (Memory.spec 0).clientResult s prog = (w, FeistelQuotient.keyBits U, FeistelQuotient.valBits V) ∧ s'.frontier = s.frontier ∧ RootHeaderValid U V w N n_cur n_init_new dstMetaBase s'.mem ∧ (∀ (a : ℕ), ¬(dstMetaBase ≤ a ∧ a < dstMetaBase + 8) → s'.mem a = s.mem a) ∧ WordRAM.Realization.memoryCost prog s ≤ 13

Functional specification and ≤ 13 memory-cost bound for writeRootHdrSubProg.

Logarithmic Scales (computeLogScalesProg) #

Compute (logN, (qBitsVal, llf)) from (dstMetaBase, (N, kBits)) via log2CapProg.

Bucket/Slab Scales and GlobalMeta Bases (computeCompScalesProg, computeGmBasesProg) #

Pure helper computing (maxTail, ((gmDirBase, gmTailPtr), (gmTailOwn, gmSlabMeta))).