Collaborative text editors have long relied on replicated lists to allow multiple users to edit a document simultaneously. However, existing algorithms for these lists suffer from a problem where concurrent insertions at the same position in the document can result in interleaved and corrupted text passages. This issue affects both CRDTs (Conflict-free Replicated Data Types) and Operational Transformation and has gone unnoticed for decades. In response, a team of researchers from Carnegie Mellon University, Technical University of Munich, and an independent contributor have developed Fugue - the first algorithm that guarantees maximal non-interleaving - a new correctness property for replicated lists. The Fugue algorithm comes in two variants: one based on a tree and another based on a list. The researchers proved that both variants are semantically equivalent; meaning they produce the same output given the same input. They also implemented Fugue and demonstrated that it offers performance comparable to state-of-the-art CRDT libraries for text editing. To test their implementation's efficiency, the team used Yjs and Tree-Fugue with documents containing 10.5 million characters - far longer than any typical text document. Despite this sizeable amount of data, Tree-Fugue's performance remained tolerable with an 18MB save size, less than two seconds to save or load, and 223MB memory usage. Furthermore, the researchers proved that Tree-Fugue is maximally non-interleaving by avoiding interleaving of both forward and backward insertions to the maximum extent possible; concurrent edits end up in different subtrees that are traversed separately. In conclusion, Fugue represents a significant step forward in collaborative text editing by addressing an issue that has plagued replicated lists for years. Its implementation provides comparable performance to existing solutions while guaranteeing maximal non-interleaving - ensuring that edited documents remain readable without corruption or interleaved passages.
- - Collaborative text editors rely on replicated lists to allow multiple users to edit a document simultaneously.
- - Existing algorithms for these lists suffer from interleaved and corrupted text passages when concurrent insertions occur at the same position in the document.
- - Fugue is the first algorithm that guarantees maximal non-interleaving, a new correctness property for replicated lists.
- - Fugue comes in two variants: one based on a tree and another based on a list, both of which are semantically equivalent.
- - Fugue offers performance comparable to state-of-the-art CRDT libraries for text editing, even with documents containing 10.5 million characters.
- - Tree-Fugue's performance remained tolerable with an 18MB save size, less than two seconds to save or load, and 223MB memory usage.
- - Tree-Fugue avoids interleaving of both forward and backward insertions to the maximum extent possible; concurrent edits end up in different subtrees that are traversed separately.
- - Fugue represents a significant step forward in collaborative text editing by addressing an issue that has plagued replicated lists for years.
Collaborative text editors are tools that let many people work on a document together at the same time.
Sometimes, when multiple people try to add something to the same spot in the document, it can get mixed up and hard to read.
Fugue is a new way of organizing the document so that everyone's changes stay separate and easy to understand.
There are two versions of Fugue - one based on a tree and another based on a list - but they both work the same way.
Fugue is really good at keeping everything organized, even if there are lots of people working on a big document.
Definitions- Collaborative: working together with other people
- Replicated: copied or duplicated
- Algorithms: sets of instructions for solving problems using computers
- Interleaved: mixed up or jumbled together
- Correctness property: making sure something is done right or accurately
- Semantically equivalent: having the same meaning or purpose
- Performance: how well something works or how fast it can do things
- CRDT libraries: software tools for collaborative editing
- Subtrees: smaller parts of a larger tree structure
Fugue: A New Algorithm for Maximally Non-Interleaving Replicated Lists
Collaborative text editing has been a popular feature of many applications for decades. However, existing algorithms used to enable this feature have suffered from a problem where concurrent insertions at the same position in the document can result in interleaved and corrupted text passages. This issue affects both CRDTs (Conflict-free Replicated Data Types) and Operational Transformation and has gone unnoticed until recently. In response, a team of researchers from Carnegie Mellon University, Technical University of Munich, and an independent contributor have developed Fugue - the first algorithm that guarantees maximal non-interleaving - a new correctness property for replicated lists.
What is Fugue?
Fugue is an algorithm designed to address the issue of interleaving in collaborative text editing. It comes in two variants: one based on a tree and another based on a list. The researchers proved that both variants are semantically equivalent; meaning they produce the same output given the same input. They also implemented Fugue and demonstrated that it offers performance comparable to state-of-the-art CRDT libraries for text editing. To test their implementation's efficiency, the team used Yjs and Tree-Fugue with documents containing 10.5 million characters - far longer than any typical text document. Despite this sizeable amount of data, Tree-Fugue's performance remained tolerable with an 18MB save size, less than two seconds to save or load, and 223MB memory usage.
Maximally Non-Interleaving
The most significant aspect of Fugue is its ability to guarantee maximally non-interleaving; meaning it avoids interleaving of both forward and backward insertions to the maximum extent possible; concurrent edits end up in different subtrees that are traversed separately. This ensures that edited documents remain readable without corruption or interleaved passages which was not previously achievable with existing algorithms such as CRDTs or Operational Transformation algorithms..
Conclusion
In conclusion, Fugue represents a significant step forward in collaborative text editing by addressing an issue that has plagued replicated lists for years. Its implementation provides comparable performance to existing solutions while guaranteeing maximal non-interleaving - ensuring that edited documents remain readable without corruption or interleaved passages