isEquivalentTo

fun <T> Draft<T>.isEquivalentTo(other: Draft<T>): Boolean

Returns true when this Draft is structurally equivalent to other under the CALM commutativity theorem.

Two drafts are equivalent when they would produce the same convergent result:

  • They share the same multiset of DraftStage.Source opIds (handles multi-branch DAGs produced by Draft.combine — branch order is irrelevant).

  • They share the same multiset of embroider opIds (order-insensitive; a DraftStage.BatchedEmbroider is treated as the multiset of its constituent opIds — so a consolidated draft is equivalent to the un-consolidated draft it was derived from).

  • The multiset of free-stage operation names is identical after flattening fused stages — so reordering monotone stages or fusing adjacent ones never breaks equivalence.

This predicate is the proof vehicle for E-2 and G3. Execution-based proof arrives with E-5.