Dataset Merge
Loads glue/sst2 from HuggingFace datasets (first 200 rows) or uses synthetic fallback. Splits into two node partitions with 50 overlapping records. Demonstrates conflict-free merge with configurable strategy.
E4 Trust Scoring Active (v0.9.5+): All merge operations now carry typed trust scores by default. Every record merge accumulates accuracy, consistency, recency, and provenance trust dimensions via GCounter-backed convergent accumulators. Trust propagation adds zero API overhead -- it activates transparently on
import crdt_merge.
LWW = Last Write Wins (by timestamp). MaxWins/MinWins = field max/min. Union = set union.
Merged Records (first 20 rows)
Conflict Analysis
Runs the same dataset through all 4 strategies and computes per-field conflict rates between strategy pairs. The heatmap shows how often two strategies disagree on a record.
How to Read the Results
- Conflict Rate Heatmap: Each cell shows the fraction of overlapping records where two strategies produce different values for a given field. Brighter = more disagreement. The diagonal is always 0 (a strategy agrees with itself).
sentence:LWWvssentence:MaxWins= "how often do LWW and MaxWins disagree on the sentence field?"- High conflict rates between strategies mean the choice of strategy materially affects the merged output.
- Comparison Table: Shows how each strategy differs from LWW (the baseline).
0 conflicts= identical behavior for this dataset. Higher numbers indicate the strategy resolves more records differently. - Why this matters: In production systems, teams need to understand which strategy is appropriate for their data. If all strategies agree, the choice doesn't matter. If they diverge significantly, the strategy selection is a critical design decision.
Strategy Comparison
Core CRDT Primitives
Live demonstration of GCounter, PNCounter, LWWRegister, and ORSet. Each primitive is operated on two nodes independently, then merged in both directions. Commutativity is verified: merge(A,B) must equal merge(B,A).
How to Read the Results
| Primitive | What It Does | Merge Semantics |
|---|---|---|
| GCounter | Grow-only counter | Each node's count is tracked separately. Merge takes the max per node, then sums. Node A=8 + Node B=7 → merged=15. |
| PNCounter | Increment/decrement counter | Two internal GCounters (positive + negative). Merge takes max per node for each. Net value = positives − negatives. |
| LWWRegister | Last-Writer-Wins register | Stores a single value + timestamp. Merge keeps the value with the latest timestamp. Node A writes "model_v2" at t=3.0 > Node B's t=2.0, so A wins. |
| ORSet | Observed-Remove Set | Add/remove elements with unique tags. Merge is the union of all adds minus confirmed removes. Both nodes' elements appear in the merged set. |
- merge(A,B) = merge(B,A): The "Commutative" column proves this. PASS means the primitive is safe for distributed use — merge order doesn't affect the result.
- These are the building blocks that power crdt-merge's higher-level DataFrame and model merge operations.
Primitive Commutativity Proof
crdt-merge v0.9.5 · Patent UK 2607132.4, GB2608127.3 · E4 Trust-Delta · BUSL-1.1 → Apache 2.0 (2028-03-29)
🏠 Flagship · 🔬 Data Playground · 🌐 Federation · GitHub · ⭐ Star Repo · 👁️ Watch · 📐 Architecture Deep Dive · PyPI · pip install crdt-merge