Active-Epoch Migration Arena Growth and Rightward Item Shift (migrateSetupShiftCode) #
Internal second half of migrateSetupCode: grows [x.frontier, peakF) with zeroed words, shifts
the compacted old item region rightward to mOldItemDst (copyRightwardProg), writes the new
epoch header/parameters at mNewMeta, and prepares mHashBase = mNewMeta + 225.
noncomputable def Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.migrateSetupShiftCode :
Second half of migrateSetupCode: grows [x.frontier, peakF) with zeroed words, shifts old
items rightward to mOldItemDst, writes new header/params at mNewMeta, and sets mHashBase.
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.migrateSetupShiftCode_exec {U V w N_old n n_init base : ℕ} {θ_old : Succinct.QuotHashSeed U N_old} {s_abs : State U} {x s₈ : WordRAM.Resizable.RData rResize} (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)) (hs₈b : WordRAM.Resizable.RData.Bounded w s₈) (hs₈f : s₈.frontier = x.frontier) (habi₈ : abiPreserved x s₈) (hbelow₈ : ∀ addr < base, s₈.mem addr = x.mem addr) (hsplit₈ :
CompactedSplitRep base (base + offCompItems U w N_old) U V w N_old n n_init θ_old s_abs
{ mem := s₈.mem, frontier := s₈.frontier }) (hs₈_base : s₈.regs mBase = base) (hs₈_cnt : s₈.regs mCnt = n) (hs₈_nn : s₈.regs mNNew = targetCap U n) (hs₈_nm : s₈.regs mNewMeta = base + offCompItems U w N_old) (hs₈_off : s₈.regs mOffNew = offCompItems U w (targetCap U n)) (hs₈_iwo : s₈.regs mIwOld = compactedItemWords U V w N_old n) (hs₈_iwn : s₈.regs mIwNew = compactedItemWords U V w (targetCap U n) n) (hs₈_ar : s₈.regs mArena = base + offCompItems U w N_old + offCompItems U w (targetCap U n)) (hs₈_pf : s₈.regs mPeakFront = base + migratePeakWords U V w N_old n) (hs₈_k : s₈.regs mK = base + migratePeakWords U V w N_old n - x.frontier) (hs₈_oid :
s₈.regs mOldItemDst = base + offCompItems U w N_old + offCompItems U w (targetCap U n) + (migrateArenaWords U V w N_old (targetCap U n) n - compactedItemWords U V w N_old n)) (hs₈_ohp :
∀ (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) (hs₈_ocp : ∀ (i : Fin 36), s₈.regs (mOldCp i) = mkCompParams U V w N_old i) (hs₈_nhp :
∀ (i : Fin 19),
s₈.regs (mNewHp i) = HashFamily.WordRAM.RuntimeReducedKWise.mkHashParams w (epochQBits U (targetCap U n)) (epochHashB (targetCap U n))
(SuccinctBucket.totalMicroBits (targetCap U n)) 3 i) (hs₈_ncp : ∀ (i : Fin 36), s₈.regs (mNewCp i) = mkCompParams U V w (targetCap U n) i) :
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;
∃ (y : WordRAM.Resizable.RData rResize) (steps_s : ℕ),
(WordRAM.Resizable.RDemonicExec w peakF migrateSetupShiftCode s₈ steps_s fun (x : WordRAM.Resizable.RData rResize) =>
x = y) ∧ steps_s ≤ (132 * migFactor + 12050) * n ∧ WordRAM.Resizable.RData.Bounded w y ∧ y.frontier = peakF ∧ abiPreserved x y ∧ (∀ addr < base, y.mem addr = x.mem addr) ∧ RootHeaderValid U V w N_new n n newMeta y.mem ∧ EpochParamsStored U V w N_new newMeta y.mem ∧ HashFamily.WordRAM.ReducedKWise.Rep (base + epochHdrWords) w (Succinct.qBits U N_old)
(Succinct.hashB N_old) (SuccinctBucket.totalMicroBits N_old) 3 θ_old y.mem ∧ (∃ (s_fix_old : Memory.State),
Succinct.DictStateInv U V (ghostW w) N_old 0 θ_old s_abs s_fix_old ∧ Succinct.totalSlots N_old (compGmAt base U w N_old y.mem) = n ∧ FixedCoupled base (arenaB + (arenaW - iwOld)) U V w N_old s_fix_old
{ mem := y.mem, frontier := y.frontier }) ∧ y.regs mBase = base ∧ y.regs mCnt = n ∧ y.regs mFr = peakF ∧ y.regs mNewMeta = newMeta ∧ y.regs mOffNew = offNew ∧ y.regs mIwNew = iwNew ∧ y.regs mArena = arenaB ∧ y.regs mPeakFront = peakF ∧ y.regs mOldItemDst = arenaB + (arenaW - iwOld) ∧ y.regs mHashBase = newMeta + epochHdrWords ∧ (∀ (i : Fin 19),
y.regs (mOldHp i) = HashFamily.WordRAM.RuntimeReducedKWise.mkHashParams w
(epochQBits U N_old) (epochHashB N_old)
(SuccinctBucket.totalMicroBits N_old) 3 i) ∧ (∀ (i : Fin 36), y.regs (mOldCp i) = mkCompParams U V w N_old i) ∧ (∀ (i : Fin 19),
y.regs (mNewHp i) = HashFamily.WordRAM.RuntimeReducedKWise.mkHashParams w
(epochQBits U N_new) (epochHashB N_new)
(SuccinctBucket.totalMicroBits N_new) 3 i) ∧ ∀ (i : Fin 36), y.regs (mNewCp i) = mkCompParams U V w N_new i