CRDTosphere is a comprehensive no_std Rust library implementing Conflict-free Replicated Data Types (CRDTs) optimized for embedded systems. It provides ultra-efficient, configurable CRDT implementations for automotive, robotics, IoT, and industrial applications across multiple platforms.
IMPORTANT SAFETY DISCLAIMER
This library is intended for NON-SAFETY-CRITICAL applications only. While CRDTosphere includes safety-oriented features and compliance support frameworks, it should NOT be used for safety-critical functions such as:
- Primary vehicle control systems (steering, braking, acceleration)
- Life-support or medical devices
- Flight control systems
- Nuclear reactor control
- Emergency shutdown systems
Recommended Use Cases:
- Infotainment systems
- Telematics and connectivity features
- Non-critical sensor data aggregation
- Configuration management
- Diagnostic and monitoring systems
- User preference synchronization
The automotive examples in this library are for educational and demonstration purposes only. Any production automotive use should be limited to non-safety-critical domains such as infotainment, user preferences, and diagnostic data collection.
Features
- Universal Platform Support - AURIX, STM32, ARM Cortex-M, RISC-V
- Configurable Memory - 2KB to 1MB+ budgets with compile-time verification
- Multi-Domain Ready - Automotive, robotics, IoT, industrial applications
- Safety Critical - ISO 26262, IEC 61508, DO-178C compliance support
- Ultra-Efficient - 5-100 byte CRDT instances with hardware optimizations
- No Dynamic Allocation - Pure static allocation for deterministic behavior
- Real-Time Guarantees - Bounded execution time (<1000 CPU cycles)
Quick Start
Add CRDTosphere to your Cargo.toml:
[]
= { = "0.1", = false }
# Enable platform-specific optimizations
[]
= ["crdtosphere/stm32"]
# OR
= ["crdtosphere/aurix"]
Configure memory for your platform:
use *;
// Define memory configuration for your platform
define_memory_config!
// Use configurable CRDTs
let mut sensor_reading = new;
sensor_reading.set;
// Automatic conflict resolution
sensor_reading.merge?;
Platform Support
| Platform | Architecture | Memory | Use Cases |
|---|---|---|---|
| AURIX TC3xx/TC4xx | TriCore/ARM Cortex-R52 | 240KB-1MB | Automotive ECUs, safety systems |
| STM32 Series | ARM Cortex-M0/M3/M4/M7 | 4KB-2MB | General embedded, IoT, robotics |
| ARM Cortex-M | M0/M0+/M3/M4/M7 | 2KB-1MB+ | IoT devices, sensor networks |
| RISC-V | RV32I/M/A/C | 32KB-8MB+ | Edge computing, custom applications |
Domain Applications
Automotive
// Multi-ECU sensor fusion with ISO 26262 compliance
let mut temp_fusion = new;
temp_fusion.add_reading;
temp_fusion.add_reading;
let consensus_temp = temp_fusion.consensus_value;
Robotics
// Multi-robot task allocation
let mut task_allocation = new;
task_allocation.assign_task;
IoT
// Device mesh coordination
let mut device_mesh = new;
device_mesh.add_device;
Industrial
// Equipment health monitoring
let mut equipment_health = new;
equipment_health.record_vibration;
Memory Configurations
Pre-configured setups for common platforms:
// High-performance automotive ECU
use AutomotiveECUConfig; // 128KB budget
// General embedded device
use STM32F4Config; // 32KB budget
// Constrained IoT sensor
use IoTSensorConfig; // 4KB budget
// Industrial controller
use IndustrialConfig; // 256KB budget
Examples
- Automotive - ECU coordination, sensor fusion, safety systems
- Robotics - Swarm coordination, task allocation, SLAM
- IoT - Device mesh, sensor networks, low-power coordination
- Industrial - Production monitoring, predictive maintenance
- Platforms - Platform-specific optimizations
CRDT Types
| Type | Description | Memory | Use Case |
|---|---|---|---|
| LWWRegister | Last-writer-wins register | 5-16 bytes | Sensor readings, configuration |
| GCounter | Grow-only counter | 8-32 bytes | Event counting, telemetry |
| ORSet | Observed-remove set | 6-64 bytes | Feature flags, device lists |
| LWWMap | Last-writer-wins map | Variable | Key-value configuration |
Safety & Compliance
- ISO 26262 (Automotive) - ASIL-A through ASIL-D support
- IEC 61508 (Industrial) - SIL-1 through SIL-4 support
- DO-178C (Aerospace) - DAL-A through DAL-E support
- Deterministic behavior with mathematical convergence guarantees
- Bounded execution time for real-time systems
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Bug Reports - GitHub Issues
- Feature Requests - GitHub Discussions
- Documentation - Help improve our docs
- Testing - Add tests for new platforms or use cases
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.