Backyard-Pool Allocation and Shared Fresh-Insertion Invariants #
Internal backyard-pool slot allocation (pool_alloc_new) and common CoreFastInv field proofs
(FastInsertFreshBase, fastInsertFresh_base) shared by both the colliding-fingerprint buffer
branch and the collision-free live-slice branch of fastInsert
[BFCKK24].
Main definitions #
Cslib.DataStructure.Dictionary.SuccinctWhp.FastInsertFreshBase: bundle of commonCoreFastInvand coordinate-preservation properties offastInsertFreshindependent ofhasFpCollision.
Main results #
Cslib.DataStructure.Dictionary.SuccinctWhp.fastInsertFresh_base: establishesFastInsertFreshBasewheneverfastFindLocmisses and capacity/buffer-lookup guards pass.
References #
Common coordinate-preservation, dictionary-refinement, backyard-pool, and reduced-key
non-collision properties of fastInsertFresh shared by both hasFpCollision branches.
- hfsIns_bkt : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); fsIns.bktCount = Function.update fs.bktCount b (X + 1)
Updated
bktCountincrements bucketbby1. - hfp_pres : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ (salt b' : ℕ), b' < numBucketsWhp n_max → ∀ loc < fs.bktCount b', FastState.fpAt c U n_max θ fsIns salt b' loc = FastState.fpAt c U n_max θ fs salt b' loc
Fingerprints at all pre-existing active coordinates are preserved.
- hrk_pres : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b' < numBucketsWhp n_max, ∀ loc < fs.bktCount b', FastState.rKeyAt c U n_max θ fsIns b' loc = FastState.rKeyAt c U n_max θ fs b' loc
Reduced keys at all pre-existing active coordinates are preserved.
- hfp_new : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ (salt : ℕ), FastState.fpAt c U n_max θ fsIns salt b X = fpOfSalt c U n_max θ.2 salt u
Fingerprint at the newly allocated coordinate
(b, X)equalsfpOfSalt. - hrk_new : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); FastState.rKeyAt c U n_max θ fsIns b X = fpReducedKey c U n_max θ.2 u
Reduced key at the newly allocated coordinate
(b, X)equalsfpReducedKey. - hno_rk_cur (b' : ℕ) : b' < numBucketsWhp n_max → ∀ l' < fs.bktCount b', fs.locState b' l' = 2 + fs.curEp → FastState.rKeyAt c U n_max θ fs b' l' ≠ fpReducedKey c U n_max θ.2 u
No pre-existing
curEp-buffered coordinate sharesu's reduced key. - hno_rk_any (b' : ℕ) : b' < numBucketsWhp n_max → ∀ l' < fs.bktCount b', 2 ≤ fs.locState b' l' → FastState.rKeyAt c U n_max θ fs b' l' ≠ fpReducedKey c U n_max θ.2 u
No pre-existing buffered coordinate (
2 ≤ locState) sharesu's reduced key. - hqv_glob' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ (p : ℕ), fsIns.quotArr p < 2 ^ quotBitsWhp U n_max ∧ fsIns.valArr p < max V 1
Global quotient/value word bounds on
fsIns. - hbkt_le' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b' < numBucketsWhp n_max, fsIns.bktCount b' ≤ totalLocalCoordsWhp n_max
Active coordinate count bound on
fsIns. - hbkt_ge0' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ (b' : ℕ), numBucketsWhp n_max ≤ b' → fsIns.bktCount b' = 0
Out-of-range bucket counts remain
0onfsIns. - hact_item' : let h1 := bktHash c U n_max θ.1; let b := FeistelQuotient.feistelBucket (bWhp n_max) h1 ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b' < numBucketsWhp n_max, ∀ l' < fsIns.bktCount b', let kv := FastState.keyValAt c U n_max θ.1 fsIns b' l'; kv < U ∧ FeistelQuotient.feistelBucket (bWhp n_max) h1 kv = b' ∧ FeistelQuotient.keyQuotient (bWhp n_max) kv = fsIns.quotArr (FastState.physSlot n_max fsIns b' l') ∧ fsIns.valArr (FastState.physSlot n_max fsIns b' l') < V
Active item reconstruction validity on
fsIns. - hquot_inj' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b' < numBucketsWhp n_max, ∀ l₁ < fsIns.bktCount b', ∀ l₂ < fsIns.bktCount b', fsIns.quotArr (FastState.physSlot n_max fsIns b' l₁) = fsIns.quotArr (FastState.physSlot n_max fsIns b' l₂) → l₁ = l₂
Intra-bucket quotient injectivity on
fsIns. - hdict_map' : let h1 := bktHash c U n_max θ.1; let b := FeistelQuotient.feistelBucket (bWhp n_max) h1 ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ (u' : Fin U), let b' := FeistelQuotient.feistelBucket (bWhp n_max) h1 ↑u'; let q' := FeistelQuotient.keyQuotient (bWhp n_max) ↑u'; (Function.update dict u (some v) u' = none ↔ ∀ loc < fsIns.bktCount b', fsIns.quotArr (FastState.physSlot n_max fsIns b' loc) ≠ q') ∧ ∀ (v' : ℕ), Function.update dict u (some v) u' = some v' ↔ ∃ loc < fsIns.bktCount b', fsIns.quotArr (FastState.physSlot n_max fsIns b' loc) = q' ∧ fsIns.valArr (FastState.physSlot n_max fsIns b' loc) = v'
Exact
Function.update dict u (some v)refinement onfsIns. - hpoolTop' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); fsIns.poolFreeTop ≤ poolSizeWhp n_max
Backyard pool top bound on
fsIns. - hbp_val' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b' < numBucketsWhp n_max, ∀ k < fsIns.bktCount b' - capFrontWhp n_max, fsIns.backPtr b' k < poolSizeWhp n_max ∧ fsIns.poolOwner (fsIns.backPtr b' k) = b' * capBackWhp n_max + k
Backyard pointer/owner correspondence on
fsIns. - hfree_lt' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ j < fsIns.poolFreeTop, fsIns.poolFreeStack j < poolSizeWhp n_max
Free-stack slot bounds on
fsIns. - hbp_inj' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b₁ < numBucketsWhp n_max, ∀ k₁ < fsIns.bktCount b₁ - capFrontWhp n_max, ∀ b₂ < numBucketsWhp n_max, ∀ k₂ < fsIns.bktCount b₂ - capFrontWhp n_max, fsIns.backPtr b₁ k₁ = fsIns.backPtr b₂ k₂ → b₁ = b₂ ∧ k₁ = k₂
Backyard pointer injectivity on
fsIns. - hfree_inj' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ j₁ < fsIns.poolFreeTop, ∀ j₂ < fsIns.poolFreeTop, fsIns.poolFreeStack j₁ = fsIns.poolFreeStack j₂ → j₁ = j₂
Free-stack injectivity on
fsIns. - hdisj' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); ∀ b' < numBucketsWhp n_max, ∀ k < fsIns.bktCount b' - capFrontWhp n_max, ∀ j < fsIns.poolFreeTop, fsIns.backPtr b' k ≠ fsIns.poolFreeStack j
Disjointness of allocated backyard slots and free-stack slots on
fsIns. - hcons' : let b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u; let X := fs.bktCount b; let fsIns := fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u) (fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs); fsIns.poolFreeTop + ∑ b' ∈ Finset.range (numBucketsWhp n_max), (fsIns.bktCount b' - capFrontWhp n_max) = poolSizeWhp n_max
Backyard pool slot conservation on
fsIns.
Establishes FastInsertFreshBase when u is absent from fs and all fresh-insertion capacity
and buffer-collision guards pass.