We have run diamond types' fuzzing test, comparing otto and diamond types side-by-side.
Otto agents converge to a common state. Diamond types agents converge to a common state.
In some cases, however, this common state isn't the same for otto and diamond types.
Even on unordered document contents β i.e. excluding cases where the changes appear in reverse order.
It would be interesting to see if we can tweak otto's behaviour to match diamond types' exactly.
Test case:
https://github.com/tablyinc/otto-test/blob/a986dd31ba1bf0574b2893f4e1fc5f441e795614/tests/oplog_merge_fuzzer.rs#L196-L199
Raw dump:
i 0
random operations at agent: 0
Operation { loc: RangeRev { span: T 0..1, fwd: true }, kind: Ins, content: Some("a") }
random operations at agent: 2
Operation { loc: RangeRev { span: T 0..1, fwd: true }, kind: Ins, content: Some("a") }
syncing agents: 0 β 2
diamond types (before): a
diamond types (before): a
diamond types (after): aa
otto (before): a
otto (before): a
otto (after): aa
i 1
random operations at agent: 1
Operation { loc: RangeRev { span: T 0..1, fwd: true }, kind: Ins, content: Some("a") }
random operations at agent: 0
Operation { loc: RangeRev { span: T 1..2, fwd: true }, kind: Del, content: Some("a") }
syncing agents: 1 β 2
diamond types (before): a
diamond types (before): aa
diamond types (after): aaa
otto (before): a
otto (before): aa
otto (after): aaa
i 2
random operations at agent: 2
Operation { loc: RangeRev { span: T 0..2, fwd: true }, kind: Del, content: Some("aa") }
random operations at agent: 1
Operation { loc: RangeRev { span: T 2..3, fwd: true }, kind: Del, content: Some("a") }
syncing agents: 0 β 2
diamond types (before): a
diamond types (before): a
diamond types (after):
otto (before): a
otto (before): a
otto (after): a
Diagrams showing otto's behaviour:
βββββ0βββββ βββββ1βββββ βββββ2βββββ
ββββββ
βββββ ββββββ
βββββ ββββββ
βββββ
random operations at agent: 0
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β ββββββ
βββββ ββββββ
βββββ
βββββaβββββ
random operations at agent: 2
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β ββββββ
βββββ β 2 ins a β
βββββaβββββ βββββaβββββ
syncing agents: 0 β 2
β β β β β β β β β β β β β β β β
| βΌ
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β ββββββ
βββββ β 2 ins a β
β 2 ins a β β 0 ins a β
βββββaaββββ βββββaaββββ
β² |
β β β β β β β β β β β β β β β β
random operations at agent: 1
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β β 1 ins a β β 2 ins a β
β 2 ins a β βββββaβββββ β 0 ins a β
βββββaaββββ βββββaaββββ
random operations at agent: 0
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β β 1 ins a β β 2 ins a β
β 2 ins a β βββββaβββββ β 0 ins a β
β 0 del a β βββββaaββββ
βββββaβββββ
syncing agents: 1 β 2
β β β β β β β ββ
| βΌ
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β β 1 ins a β β 2 ins a β
β 2 ins a β β 2 ins a β β 0 ins a β
β 0 del a β β 0 ins a β β 1 ins a β
βββββaβββββ ββββaaaββββ ββββaaaββββ
β² |
ββ β β β β β β β
random operations at agent: 2
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β β 1 ins a β β 2 ins a β
β 2 ins a β β 2 ins a β β 0 ins a β
β 0 del a β β 0 ins a β β 1 ins a β
βββββaβββββ ββββaaaββββ β 2 del aaβ
βββββaβββββ
random operations at agent: 1
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β β 1 ins a β β 2 ins a β
β 2 ins a β β 2 ins a β β 0 ins a β
β 0 del a β β 0 ins a β β 1 ins a β
βββββaβββββ β 1 del a β β 2 del aaβ
βββββaaββββ βββββaβββββ
syncing agents: 0 β 2
β β β β β β β β β β β β β β β β
| βΌ
βββββ0βββββ βββββ1βββββ βββββ2βββββ
β 0 ins a β β 1 ins a β β 2 ins a β
β 2 ins a β β 2 ins a β β 0 ins a β
β 0 del a β β 0 ins a β β 1 ins a β
β 1 ins a β β 1 del a β β 2 del aaβ
β 2 del aaβ βββββaaββββ β 0 del a β
ββββββ
βββββ ββββββ
βββββ
β² |
β β β β β β β β β β β β β β β β