🤖 AI Summary
In collaborative text editing, concurrent insertions at identical positions by multiple users frequently cause interleaved text segments, degrading readability—a longstanding challenge for both CRDT and operational transformation (OT) approaches. This paper introduces “Max-Non-Interleaving,” the first formal correctness criterion capturing the essential requirement to prevent semantic corruption due to insertion interleaving. Building upon this principle, we design two CRDT algorithms: Fugue, optimized for efficiency and practical deployment, and FugueMax, which strictly satisfies Max-Non-Interleaving. Both employ position-aware sequence representations and partial-order-based merging, enabling decentralized operation and strong eventual consistency. Experimental evaluation shows that Fugue matches the performance of state-of-the-art CRDT text libraries, while FugueMax consistently produces semantically intact and human-readable merged texts under high concurrency—resolving the interleaving problem rigorously, both theoretically and empirically, for the first time.
📝 Abstract
Most existing algorithms for replicated lists, which are widely used in collaborative text editors, suffer from a problem: when two users concurrently insert text at the same position in the document, the merged outcome may interleave the inserted text passages, resulting in corrupted and potentially unreadable text. The problem has gone unnoticed for decades, and it affects both CRDTs and Operational Transformation. This paper defines maximal non-interleaving, our new correctness property for replicated lists. We introduce two related CRDT algorithms, Fugue and FugueMax, and prove that FugueMax satisfies maximal non-interleaving. We also implement our algorithms and demonstrate that Fugue offers performance comparable to state-of-the-art CRDT libraries for text editing.