oficina / docs Public

Docs native: describe what a replica parks; real damaged snapshots

The engine's `parked` op describes what a replica holds but cannot
integrate: the id ranges of parked structs and parked deletions, by
client, sorted. It is empty when the replica is whole, and it reads the
same after a rebuild from the replica's own snapshot. A replica can then
tell parking it has accepted (the server's own) from anything new
(#147 findings 1 and 2).

native/crdt/tests/fixtures/damaged-snapshots holds 29 real damaged
snapshots with the server's state at the same step. Claude Fable's
review wrote them through the WASM sandbox with the GC fix reverted.
damaged_snapshots.rs checks the recovery on each one:
- After applying the server's state, the replica shows what the server
  shows, but often still parks the damaged duplicate.
- Rebuilt from its own snapshot, it parks only what the server parks,
  and so does the record DocsReplicaCache stores from it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev b7b46503c9be52c8dc42224a0cf7764b85093f42 parent d2f16cb
60 files changed, +104 −0
  • native/crdt/src/lib.rs +30 −0
  • native/crdt/tests/damaged_snapshots.rs +74 −0
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-105-56.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-107-179.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-110-125.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-116-24.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-119-81.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-123-65.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-141-36.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-2-62.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-21-65.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-22-59.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-24-105.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-27-72.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-31-66.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-33-110.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-38-74.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-40-85.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-43-86.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-59-43.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-61-76.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-69-191.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-71-193.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-72-42.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-78-28.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-81-33.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-86-51.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-88-64.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-9-27.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-96-175.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/damaged-99-15.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-105-56.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-107-179.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-110-125.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-116-24.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-119-81.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-123-65.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-141-36.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-2-62.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-21-65.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-22-59.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-24-105.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-27-72.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-31-66.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-33-110.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-38-74.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-40-85.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-43-86.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-59-43.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-61-76.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-69-191.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-71-193.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-72-42.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-78-28.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-81-33.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-86-51.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-88-64.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-9-27.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-96-175.bin binary
  • native/crdt/tests/fixtures/damaged-snapshots/good-99-15.bin binary
diff --git a/native/crdt/src/lib.rs b/native/crdt/src/lib.rs
index e4af925..5d98b8c 100644
--- a/native/crdt/src/lib.rs
+++ b/native/crdt/src/lib.rs
@@ -47,6 +47,35 @@ impl Editor {
let txn = self.doc.transact();
txn.store().pending_update().is_none() && txn.store().pending_ds().is_none()
}
+ /// What this replica holds but cannot integrate, as a canonical string:
+ /// the id ranges of parked structs and of parked deletions, by client.
+ /// Empty when whole. Stable across a rebuild from the replica's own
+ /// snapshot, so a replica can tell parking it has accepted (the server's
+ /// own) from anything new (#147).
+ pub fn parked(&self) -> String {
+ fn render(mut clients: Vec<(u64, Vec<(u32, u32)>)>, out: &mut String) {
+ clients.sort();
+ for (client, ranges) in clients {
+ out.push_str(&client.to_string());
+ for (start, end) in ranges { out.push_str(&format!(" {start}-{end}")); }
+ out.push(';');
+ }
+ }
+ let txn = self.doc.transact();
+ let store = txn.store();
+ let mut out = String::new();
+ if let Some(pending) = store.pending_update() {
+ let structs = yrs::DeleteSet::from(pending.update.insertions(true));
+ render(structs.iter().map(|(c, r)| (*c, r.iter().map(|x| (x.start, x.end)).collect())).collect(), &mut out);
+ }
+ if let Some(deletes) = store.pending_ds() {
+ let mut deletes = deletes.clone();
+ deletes.squash();
+ out.push('|');
+ render(deletes.iter().map(|(c, r)| (*c, r.iter().map(|x| (x.start, x.end)).collect())).collect(), &mut out);
+ }
+ out
+ }
pub fn snapshot(&self) -> Vec<u8> {
self.doc.transact().encode_state_as_update_v1(&StateVector::default())
}
@@ -169,6 +198,7 @@ pub fn dispatch(bytes: &[u8]) -> Result<Vec<u8>, &'static str> {
},
Some("snapshot") => Ok(editor.snapshot()),
Some("whole") => serde_json::to_vec(&editor.is_whole()).map_err(|_| "invalid_projection"),
+ Some("parked") => serde_json::to_vec(&editor.parked()).map_err(|_| "invalid_projection"),
Some("anchor") => serde_json::to_vec(&editor.anchor(request["at"].as_u64().and_then(|v| u32::try_from(v).ok()).ok_or("invalid_range")?)?).map_err(|_| "invalid_anchor"),
Some("resolve") => serde_json::to_vec(&editor.resolve(&request["anchor"])?).map_err(|_| "invalid_anchor"),
Some("clients") => serde_json::to_vec(&editor.doc.transact().state_vector().iter().map(|(id, _)| *id).collect::<Vec<_>>()).map_err(|_| "invalid_projection"),
diff --git a/native/crdt/tests/damaged_snapshots.rs b/native/crdt/tests/damaged_snapshots.rs
new file mode 100644
index 0000000..c35c9ba
--- /dev/null
+++ b/native/crdt/tests/damaged_snapshots.rs
@@ -0,0 +1,74 @@
+//! Real damaged snapshots (oficina/docs #147, finding 1). Claude Fable's review
+//! wrote them with the undo-kept GC fix reverted, through the WASM sandbox: a
+//! fuzz of editors with undo, stopped at the first snapshot a fresh sandbox
+//! could not integrate whole. Each `damaged-<seed>-<step>.bin` is that
+//! snapshot and `good-<seed>-<step>.bin` the server's state at the same step.
+//!
+//! The recovery DocsModel runs on such a replica: catch up from the start,
+//! then rebuild from its own snapshot. Applying the server's state alone is
+//! not enough: yrs checks a parked struct's dependencies before noticing it
+//! is already integrated, so the damaged duplicate stays parked (21 of 29).
+//! The rebuild drops it, since a snapshot merges parked structs with
+//! integrated ones and the duplicate goes.
+use docs_native_crdt::Editor;
+use std::path::Path;
+
+fn open(bytes: &[u8], client: u64) -> Editor { let e = Editor::new("keep", client); e.apply(bytes).unwrap(); e }
+
+fn pairs() -> Vec<(String, Vec<u8>, Vec<u8>)> {
+ let directory = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/damaged-snapshots");
+ let mut names: Vec<String> = std::fs::read_dir(&directory).unwrap()
+ .map(|e| e.unwrap().file_name().into_string().unwrap())
+ .filter(|n| n.starts_with("damaged-")).collect();
+ names.sort();
+ names.into_iter().map(|name| {
+ let damaged = std::fs::read(directory.join(&name)).unwrap();
+ let good = std::fs::read(directory.join(name.replace("damaged", "good"))).unwrap();
+ (name, damaged, good)
+ }).collect()
+}
+
+#[test]
+fn every_damaged_snapshot_heals_by_catching_up_from_the_start_and_rebuilding() {
+ let pairs = pairs();
+ assert_eq!(pairs.len(), 29);
+ let mut parked_after_catch_up = 0;
+ for (name, damaged, good) in pairs {
+ let server = open(&good, 97);
+ let replica = open(&damaged, 99);
+ assert!(!replica.is_whole() && !replica.parked().is_empty(), "{name}: reads whole");
+ // Catching up from the start: the server's whole state.
+ replica.apply(&good).unwrap();
+ assert_eq!(replica.projection()["children"], server.projection()["children"], "{name}: shows other than the server");
+ if !replica.is_whole() { parked_after_catch_up += 1; }
+ // Rebuilt from its own snapshot, it parks only what the server does.
+ let rebuilt = open(&replica.snapshot(), 98);
+ assert_eq!(rebuilt.parked(), server.parked(), "{name}: still parks the damaged struct");
+ assert_eq!(rebuilt.projection()["children"], server.projection()["children"], "{name}");
+ // DocsReplicaCache merges the damaged stored state with it: the
+ // record it stores reopens as the rebuilt replica does.
+ let merger = open(&damaged, 96);
+ merger.apply(&rebuilt.snapshot()).unwrap();
+ let stored = open(&merger.snapshot(), 95);
+ assert_eq!(stored.parked(), server.parked(), "{name}: the stored record parks");
+ assert_eq!(stored.projection()["children"], server.projection()["children"], "{name}");
+ }
+ // The case the rebuild exists for (21 of 29 when the review found it).
+ assert!(parked_after_catch_up > 0);
+}
+
+/// What a replica parks is described the same way after a rebuild from its
+/// own snapshot, so accepted parking (the server's own) stays accepted.
+#[test]
+fn parked_content_reads_the_same_after_a_rebuild() {
+ let mut writer = Editor::new("keep", 11);
+ let paragraph = writer.command(&serde_json::json!({"op":"insert_element","at":0,"type":"paragraph"})).unwrap();
+ let typed = writer.command(&serde_json::json!({"op":"display_edit","at":0,"length":0,"text":"Parked"})).unwrap();
+ let parked = open(&typed, 12);
+ assert!(!parked.is_whole());
+ assert_eq!(open(&parked.snapshot(), 13).parked(), parked.parked());
+ assert_eq!(open(&open(&parked.snapshot(), 14).snapshot(), 15).parked(), parked.parked());
+ parked.apply(&paragraph).unwrap();
+ assert!(parked.is_whole());
+ assert_eq!(parked.parked(), "");
+}
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-105-56.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-105-56.bin
new file mode 100644
index 0000000..4952e0c
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-105-56.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-107-179.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-107-179.bin
new file mode 100644
index 0000000..967a011
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-107-179.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-110-125.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-110-125.bin
new file mode 100644
index 0000000..ba78e08
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-110-125.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-116-24.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-116-24.bin
new file mode 100644
index 0000000..db5ffdb
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-116-24.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-119-81.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-119-81.bin
new file mode 100644
index 0000000..e89ae34
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-119-81.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-123-65.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-123-65.bin
new file mode 100644
index 0000000..b7343a4
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-123-65.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-141-36.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-141-36.bin
new file mode 100644
index 0000000..4431863
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-141-36.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-2-62.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-2-62.bin
new file mode 100644
index 0000000..82cb4ae
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-2-62.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-21-65.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-21-65.bin
new file mode 100644
index 0000000..ecf7120
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-21-65.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-22-59.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-22-59.bin
new file mode 100644
index 0000000..8d11dfd
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-22-59.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-24-105.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-24-105.bin
new file mode 100644
index 0000000..fcd9125
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-24-105.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-27-72.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-27-72.bin
new file mode 100644
index 0000000..fe32bc5
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-27-72.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-31-66.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-31-66.bin
new file mode 100644
index 0000000..781c628
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-31-66.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-33-110.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-33-110.bin
new file mode 100644
index 0000000..78edf56
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-33-110.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-38-74.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-38-74.bin
new file mode 100644
index 0000000..c305894
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-38-74.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-40-85.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-40-85.bin
new file mode 100644
index 0000000..b4c4547
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-40-85.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-43-86.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-43-86.bin
new file mode 100644
index 0000000..461f2fc
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-43-86.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-59-43.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-59-43.bin
new file mode 100644
index 0000000..7e0587d
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-59-43.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-61-76.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-61-76.bin
new file mode 100644
index 0000000..6e11264
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-61-76.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-69-191.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-69-191.bin
new file mode 100644
index 0000000..51301d7
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-69-191.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-71-193.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-71-193.bin
new file mode 100644
index 0000000..3136c50
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-71-193.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-72-42.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-72-42.bin
new file mode 100644
index 0000000..394d5a5
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-72-42.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-78-28.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-78-28.bin
new file mode 100644
index 0000000..a40076b
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-78-28.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-81-33.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-81-33.bin
new file mode 100644
index 0000000..428a6d2
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-81-33.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-86-51.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-86-51.bin
new file mode 100644
index 0000000..c62159f
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-86-51.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-88-64.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-88-64.bin
new file mode 100644
index 0000000..9dad2a5
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-88-64.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-9-27.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-9-27.bin
new file mode 100644
index 0000000..1ae1d69
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-9-27.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-96-175.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-96-175.bin
new file mode 100644
index 0000000..b92487b
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-96-175.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/damaged-99-15.bin b/native/crdt/tests/fixtures/damaged-snapshots/damaged-99-15.bin
new file mode 100644
index 0000000..4bd5e35
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/damaged-99-15.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-105-56.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-105-56.bin
new file mode 100644
index 0000000..2d37074
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-105-56.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-107-179.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-107-179.bin
new file mode 100644
index 0000000..5d1aca6
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-107-179.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-110-125.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-110-125.bin
new file mode 100644
index 0000000..eb76ac9
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-110-125.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-116-24.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-116-24.bin
new file mode 100644
index 0000000..38c2af9
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-116-24.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-119-81.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-119-81.bin
new file mode 100644
index 0000000..fa2da37
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-119-81.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-123-65.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-123-65.bin
new file mode 100644
index 0000000..a7a3e15
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-123-65.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-141-36.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-141-36.bin
new file mode 100644
index 0000000..0ab3c20
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-141-36.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-2-62.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-2-62.bin
new file mode 100644
index 0000000..0c03641
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-2-62.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-21-65.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-21-65.bin
new file mode 100644
index 0000000..79b5b62
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-21-65.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-22-59.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-22-59.bin
new file mode 100644
index 0000000..64f8644
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-22-59.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-24-105.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-24-105.bin
new file mode 100644
index 0000000..321a893
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-24-105.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-27-72.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-27-72.bin
new file mode 100644
index 0000000..374dda1
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-27-72.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-31-66.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-31-66.bin
new file mode 100644
index 0000000..02ee25a
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-31-66.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-33-110.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-33-110.bin
new file mode 100644
index 0000000..4e45b1c
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-33-110.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-38-74.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-38-74.bin
new file mode 100644
index 0000000..cc9786d
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-38-74.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-40-85.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-40-85.bin
new file mode 100644
index 0000000..b13f0e2
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-40-85.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-43-86.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-43-86.bin
new file mode 100644
index 0000000..7b10394
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-43-86.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-59-43.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-59-43.bin
new file mode 100644
index 0000000..708e83e
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-59-43.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-61-76.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-61-76.bin
new file mode 100644
index 0000000..71e8a1d
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-61-76.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-69-191.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-69-191.bin
new file mode 100644
index 0000000..55e6d09
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-69-191.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-71-193.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-71-193.bin
new file mode 100644
index 0000000..1d85a89
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-71-193.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-72-42.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-72-42.bin
new file mode 100644
index 0000000..f79d260
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-72-42.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-78-28.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-78-28.bin
new file mode 100644
index 0000000..2a6175a
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-78-28.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-81-33.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-81-33.bin
new file mode 100644
index 0000000..cb9bf47
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-81-33.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-86-51.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-86-51.bin
new file mode 100644
index 0000000..6ed5e4f
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-86-51.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-88-64.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-88-64.bin
new file mode 100644
index 0000000..ec0d6a8
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-88-64.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-9-27.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-9-27.bin
new file mode 100644
index 0000000..50156d1
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-9-27.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-96-175.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-96-175.bin
new file mode 100644
index 0000000..e6c43fd
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-96-175.bin differ
diff --git a/native/crdt/tests/fixtures/damaged-snapshots/good-99-15.bin b/native/crdt/tests/fixtures/damaged-snapshots/good-99-15.bin
new file mode 100644
index 0000000..ec8b347
Binary files /dev/null and b/native/crdt/tests/fixtures/damaged-snapshots/good-99-15.bin differ