Active-Epoch Migration Parameter-Staging Subprogram (migrateSetupParamsCode) #
Internal first half of migrateSetupCode: loads active-epoch header and parameter blocks, stages
the new capacity parameters (targetCap U n, n, n) in scratch [base + 63, base + 126), loads
mNewHp / mNewCp, evaluates mIwNew, and computes the single-tape 1 · OPT arena bounds.
noncomputable def Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.migrateSetupParamsCode :
First half of migrateSetupCode: loads old epoch parameters, stages new parameters at
base + 63, loads mNewHp/mNewCp, computes mIwNew, and computes arena bounds.
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.migrateSetupParamsCode_exec {U V w N_old n n_init base : ℕ} {θ_old : Succinct.QuotHashSeed U N_old} {s_abs : State U} {x : WordRAM.Resizable.RData rResize} (hx : WordRAM.Resizable.RData.Bounded w x) (hn : 1 ≤ n) (hev : EpochValid U n N_old) (hfr : x.frontier = base + compactedEpochWords U V w N_old n) (hfit_peak : WordRAM.Fits w (base + migratePeakWords U V w N_old n)) (hsplit :
CompactedSplitRep base (base + offCompItems U w N_old) U V w N_old n n_init θ_old s_abs
{ mem := x.mem, frontier := x.frontier }) (hbase : x.regs mBase = base) :
have N_new := targetCap U n;
have newMeta := base + offCompItems U w N_old;
have offNew := offCompItems U w N_new;
have iwOld := compactedItemWords U V w N_old n;
have iwNew := compactedItemWords U V w N_new n;
have arenaW := migrateArenaWords U V w N_old N_new n;
have arenaB := newMeta + offNew;
have peakF := base + migratePeakWords U V w N_old n;
∃ (s₈ : WordRAM.Resizable.RData rResize) (steps_p : ℕ),
(WordRAM.Resizable.RDemonicExec w peakF migrateSetupParamsCode x steps_p fun (x : WordRAM.Resizable.RData rResize) =>
x = s₈) ∧ steps_p ≤ (131 * migFactor + 350) * n ∧ WordRAM.Resizable.RData.Bounded w s₈ ∧ s₈.frontier = x.frontier ∧ abiPreserved x s₈ ∧ (∀ addr < base, s₈.mem addr = x.mem addr) ∧ CompactedSplitRep base newMeta U V w N_old n n_init θ_old s_abs
{ mem := s₈.mem, frontier := s₈.frontier } ∧ s₈.regs mBase = base ∧ s₈.regs mCnt = n ∧ s₈.regs mNNew = N_new ∧ s₈.regs mNewMeta = newMeta ∧ s₈.regs mOffNew = offNew ∧ s₈.regs mIwOld = iwOld ∧ s₈.regs mIwNew = iwNew ∧ s₈.regs mArena = arenaB ∧ s₈.regs mPeakFront = peakF ∧ s₈.regs mK = peakF - x.frontier ∧ s₈.regs mOldItemDst = arenaB + (arenaW - iwOld) ∧ (∀ (i : Fin 19),
s₈.regs (mOldHp i) = HashFamily.WordRAM.RuntimeReducedKWise.mkHashParams w (epochQBits U N_old)
(epochHashB N_old) (SuccinctBucket.totalMicroBits N_old) 3 i) ∧ (∀ (i : Fin 36), s₈.regs (mOldCp i) = mkCompParams U V w N_old i) ∧ (∀ (i : Fin 19),
s₈.regs (mNewHp i) = HashFamily.WordRAM.RuntimeReducedKWise.mkHashParams w
(epochQBits U N_new) (epochHashB N_new)
(SuccinctBucket.totalMicroBits N_new) 3 i) ∧ ∀ (i : Fin 36), s₈.regs (mNewCp i) = mkCompParams U V w N_new i