compact

fun compact(stableCut: VersionVector, frontierMax: VersionVector, delivered: VersionVector): Pair<MovableTree<V>, MoveTreeCompact>?

Garbage-collect causally-stable ops whose effect has been superseded.

A MoveOp is eligible for GC when ALL hold:

  1. Causally stableop.seq ≤ stableCut[op.replica]: every live peer delivered it.

  2. Superseded — a later causally-stable op exists on the same node whose effect is what the replay actually keeps; this op is not the winning placement for its node.

  3. Not a creation op that is still referenced — creation ops (value != null) that any live op still references as node or newParent must be retained.

  4. Frontier-completedelivered.dominates(frontierMax): self has delivered every op known to exist (guards against a concurrent move that would make an op non-superseded).

Returns the compacted tree and a MoveTreeCompact to broadcast to peers, or null if no op is eligible.

Parameters

stableCut

S — elementwise min over live peers' delivered VVs.

frontierMax

F — elementwise max of live and retained-evicted peer frontiers.

delivered

this replica's own contiguous delivered VV.