Package-level declarations

Types

Link copied to clipboard
class CodecReport(val seeds: Int, val states: Long, val distinctStates: Long, val distinctEncodings: Long, val joinPairs: Long, val absorbingJoinPairs: Long)

What one binding's codec pass actually put through the wire, measured by LatticeLawHarness.runCodecLaws.

Link copied to clipboard

LatticeLawSuite for a type that garbage-collects — bind here instead, and the two compaction phases of LatticeLawHarness.run become load-bearing (#2019).

Link copied to clipboard
class CompactionCoverage(val runs: Int = 0, val postMergeRunsWithCompaction: Int = 0, val postMergeMaxDroppedInOneStep: Int = 0, val preMergeRunsWithTwoOrMoreCompacting: Int = 0)

What the compaction phases actually reached, accumulated across one harness's run calls — the rig receipt for CompactableLatticeLawSuite.compactionIsReachedAndBigEnoughToDiscriminate.

Link copied to clipboard
class CompactionFloors(val postMergeRunsWithCompaction: Int, val postMergeMaxDroppedInOneStep: Int, val preMergeRunsWithTwoOrMoreCompacting: Int)

Per-binding floors on CompactionCoverage. Per binding, never shared: the distributions differ by type, and a floor low enough for the thinnest binding stops separating a healthy generator from a broken one for every other (#2019).

Link copied to clipboard
class CompactionStep<S>(val state: S, val droppedCount: Int)

One compaction step: the resulting state and how many ids it dropped.

Link copied to clipboard
fun interface CrdtCompactor<S>

Invokes one compaction of state at a harness-derived cut, or returns null when nothing qualifies. The whole body of a real one is a call to that type's own compact(…) plus unwrapping the returned pair.

Link copied to clipboard
class LatticeLawHarness<S : Quilted<S>>(val initial: S, val alphabet: List<LatticeOp<S>>, val serializer: KSerializer<S>, val criticalShapes: List<List<String>> = defaultCriticalShapes(alphabet), val floors: VacuityFloors = VacuityFloors.DEFAULT, val replicaCount: Int = 3, val opsPerReplica: Int = 8, val compactor: CrdtCompactor<S>? = null)

Drives replicaCount replicas (default 3) through opsPerReplica random operations distributed across them, then merges in every possible pairwise order and asserts all replicas converge to the same value.

Link copied to clipboard
abstract class LatticeLawSuite<S : Quilted<S>>

Sibling to us.tractat.kuilt.conformance.QuiltedConformanceSuite. Subclass and implement newHarness to bind a CRDT type.

Link copied to clipboard
class LatticeOp<S>(val name: String, val kind: OpKind, val apply: (state: S, replicaIndex: Int, random: Random) -> S)

One named operation a binding can perform against its state.

Link copied to clipboard
fun interface OperationGenerator<S>

Strategy for generating an operation against a model state, producing the next state.

Link copied to clipboard
enum OpKind : Enum<OpKind>

Whether an op asserts something new or retires something an earlier op asserted.

Link copied to clipboard
class VacuityFloors(val strictAncestorPairs: Double = 0.15, val concurrentPairs: Double = 0.15, val effectiveRetireSteps: Double = 0.1, val maxNoOpSteps: Double = 0.25, val totalOrder: Boolean = false)

How much searching a binding's generator has to do before its green counts for anything.

Link copied to clipboard
class VacuityReport(val pairs: Long, val strictAncestorPairs: Long, val concurrentPairs: Long, val steps: Int, val effectiveRetireSteps: Int, val noOpSteps: Int, val floors: VacuityFloors)

What one binding's generator actually searched, measured by LatticeLawHarness.measureVacuity and checked against VacuityFloors.

Functions

Link copied to clipboard

The shape every retiring type must reach: assert, retire, re-assert.