CrdtConvergenceHarness

class CrdtConvergenceHarness<S : Quilted<S>>(val initial: S, val gen: OperationGenerator<S>, val replicaCount: Int = 3, val opsPerReplica: Int = 8)

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.

Two-pass approach:

  1. From initial, each replica builds its own independent history of opsPerReplica local ops.

  2. Every permutation of those replica states is folded into a fresh merge from initial; all must equal the canonical merge (fold in natural order). This exercises commutativity and associativity under random delivery orderings.

Multiplatform: uses Random (seed constructor) for determinism — the same seed produces the same outcome on JVM, wasmJs, and native.

Constructors

Link copied to clipboard
constructor(initial: S, gen: OperationGenerator<S>, replicaCount: Int = 3, opsPerReplica: Int = 8)

Properties

Link copied to clipboard
Link copied to clipboard
val initial: S
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun run(seed: Long): S

Run with a single seed; assert convergence. Returns the converged state.

Link copied to clipboard
fun runSeeds(seeds: LongRange): List<S>

Run over every seed in seeds; returns the converged state for each.