Pick a strategy. Merge two models. See the mathematical proof that merge(A,B) == merge(B,A).
Uses real prajjwal1/bert-tiny weights from HuggingFace Hub when available, otherwise synthetic tensors.
Note: Some strategies may produce similar or identical outputs with only 2 models at equal weights โ this is mathematically expected. Differences become significant with 3+ models or real fine-tuned weights.
26 strategies. Task-vector strategies (ties, dare, etc.) use a synthetic base.
Per-Layer Provenance
Every strategy tested live against all three CRDT laws โ commutativity, associativity, idempotency. The two-layer OR-Set architecture makes any strategy CRDT-compliant without modifying the strategy itself.
Full Compliance Matrix
The Mathematical Proof โ Naive vs crdt-merge
Standard merge strategies fail associativity: merge(merge(A,B), C) โ merge(A, merge(B,C)).
crdt-merge's OR-Set layer absorbs this โ the gap drops to exactly 0.0 for every strategy.
Associativity Verification
Real benchmark results from NVIDIA A100-SXM4-40GB ยท v0.7.1 ยท Python 3.12. Polars engine peak: 38.8ร speedup over Python at 500K rows. Streaming merge: O(1) memory verified โ throughput dead-flat from 100K to 5M rows.
Raw Benchmark Data (A100 v0.7.1)
10,000,000 | 219K/s | 6.8M/s | 32.8ร |
10,000 | 219K/s | 42K/s | 0.2ร |
50,000 | 207K/s | 6.8M/s | 32.8ร |
100,000 | 225K/s | 8.3M/s | 37.0ร |
500,000 | 217K/s | 8.4M/s | 38.8ร |
1,000,000 | 225K/s | 7.9M/s | 35.2ร |
5,000,000 | 223K/s | 5.0M/s | 22.5ร |
10,000,000 | 225K/s | 4.8M/s | 21.4ร |
Explore the architecture layers, distributed protocols, and domain-specific merge capabilities.
Two-Layer Architecture โ The Key Innovation
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LAYER 1 โ OR-Set CRDT State (CRDTMergeState) โ
โ โ
โ Contributions arrive in ANY order from ANY node โ
โ OR-Set union: commutative + associative + idempotent by definition โ
โ Every contribution: content-addressed (SHA-256 Merkle hash) โ
โ Version vectors for causal ordering โ
โ Tombstones for safe remove/replace operations โ
โ โ
โ merge(state_a, state_b) โ set union โ CRDT laws guaranteed here โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ resolve() โ applied atomically
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LAYER 2 โ Strategy Execution (pure function over sorted set) โ
โ โ
โ Sees a SET โ ordering non-determinism completely absorbed โ
โ 26 strategies: weight_average, slerp, ties, dare, fisher, dual_ โ
โ projection, evolutionary, negative, safe_merge, and 18 more ... โ
โ Same inputs โ always same output (determinism via canonical sort) โ
โ โ
โ f(sorted_set_of_contributions) โ merged_tensor โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Why this works: Layer 1 guarantees all replicas converge to the same set of inputs. Layer 2 guarantees the same set โ same output. Together: full CRDT convergence for any strategy.
crdt-merge v0.9.4 ยท Patent Pending UK 2607132.4 ยท BUSL-1.1 โ Apache 2.0 (2028-03-29)
๐ Flagship ยท ๐ฌ Data Playground ยท ๐ Federation ยท GitHub ยท PyPI ยท pip install crdt-merge