crdt-merge — Federation
Distributed gossip convergence simulation. Every node maintains a CRDTMergeState. Nodes exchange states via merge() — no coordinator, no locking. Convergence is guaranteed.
pip install crdt-merge · GitHub · PyPI · Patent UK 2607132.4, GB2608127.3 · E4 Trust-Delta Architecture
Gossip Convergence Simulation
Each node starts with its own weight tensor. Nodes exchange CRDTMergeState via merge()
following the selected topology. Convergence is measured as average pairwise L2 distance.
When all nodes reach the same state_hash, the system has converged — no coordinator, no locking, no message ordering required.
This simulates real-world federated model merging where:
- Nodes are geographically distributed (edge devices, data centers)
- Network connectivity is unreliable (partitions, late joiners)
- There is no central server dictating merge order
New in v0.9.5 -- E4 Trust-Delta: Federation now carries trust metadata via the Symbiotic Lattice Trust (SLT) protocol. Every gossip exchange propagates typed trust scores (accuracy, consistency, recency, provenance) as first-class CRDT dimensions. Byzantine peers are detected and isolated with 34% fault tolerance and zero coordinator overhead. The convergence chart now includes a secondary y-axis showing real-time trust evolution for each node.
Gossip Audit Log (last 50 events)
OR-Set State Trace
Traces the internal provenance() data at each gossip step. Shows wire protocol payload sizes, tombstone counts, and round-trip serialization proof.
Round-trip proof: from_dict(to_dict(state)).state_hash == state.state_hash must hold for all nodes.
How to Read the Results
- Wire Protocol Chart: Shows the serialized state size (bytes) for each node over gossip rounds. As nodes absorb more contributions via
merge(), their wire payload grows. After convergence, all nodes have the same payload size (they hold the same set of contributions). - Provenance Trace Table: Each row shows a contributor inside a node's state at a given round.
merkle_hashis the content-addressed hash of that contribution's tensor.weightshows how much influence this contribution has in the final resolve. As gossip proceeds, nodes accumulate contributions from all peers. - Round-trip Serialization Proof: For each node,
to_dict()serializes the state to JSON, thenfrom_dict()reconstructs it. PASS means the reconstructed state has an identicalstate_hash— serialization is lossless. This proves states can be safely transmitted over the wire without data corruption. - Tombstone Count: OR-Set remove semantics. When a model contribution is removed (e.g., a node retracts its weights), a tombstone is added. Tombstones ensure the removal is propagated to all replicas — even those that haven't seen the remove yet. High tombstone counts may indicate excessive churn.
New in v0.9.5 -- E4 Trust-Delta: State mutations are now wrapped in
CausalTrustClockoperations providing Lamport-style causal ordering. Each round's state is tracked viaTrustBoundMerklefor tamper-evident provenance. See the E4 section below the tombstone summary for full causal clock trace and Merkle root evolution.
Provenance Trace
Round-trip Serialization 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