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.
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.
- 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)
Add CRDTosphere to your Cargo.toml:
[dependencies]
crdtosphere = { version = "0.1", default-features = false }
# Enable platform-specific optimizations
[features]
stm32 = ["crdtosphere/stm32"]
# OR
aurix = ["crdtosphere/aurix"]Configure memory for your platform:
#![no_std]
use crdtosphere::prelude::*;
// Define memory configuration for your platform
define_memory_config! {
name: MyPlatformConfig,
total_memory: 32 * 1024, // 32KB budget
max_registers: 100,
max_counters: 50,
max_sets: 20,
max_maps: 10,
max_nodes: 32,
}
// Use configurable CRDTs
let mut sensor_reading = LWWRegister::<i16, MyPlatformConfig>::new();
sensor_reading.set(42, clock.now());
// Automatic conflict resolution
sensor_reading.merge(&other_node_reading)?;| 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 |
// Multi-ECU sensor fusion with ISO 26262 compliance
let mut temp_fusion = AutomotiveSensorFusion::<i16, AutomotiveConfig>::new();
temp_fusion.add_reading(85, ecu_1_clock, SENSOR_RELIABILITY_HIGH);
temp_fusion.add_reading(87, ecu_2_clock, SENSOR_RELIABILITY_MEDIUM);
let consensus_temp = temp_fusion.consensus_value();// Multi-robot task allocation
let mut task_allocation = RobotTaskAllocation::<RoboticsConfig>::new();
task_allocation.assign_task(task_id, robot_id, clock.now());// Device mesh coordination
let mut device_mesh = DeviceMesh::<IoTConfig>::new();
device_mesh.add_device(device_id, capabilities, clock.now());// Equipment health monitoring
let mut equipment_health = EquipmentHealth::<IndustrialConfig>::new();
equipment_health.record_vibration(machine_id, level, clock.now());Pre-configured setups for common platforms:
// High-performance automotive ECU
use crdtosphere::configs::AutomotiveECUConfig; // 128KB budget
// General embedded device
use crdtosphere::configs::STM32F4Config; // 32KB budget
// Constrained IoT sensor
use crdtosphere::configs::IoTSensorConfig; // 4KB budget
// Industrial controller
use crdtosphere::configs::IndustrialConfig; // 256KB budget- 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
| 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 |
- 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
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.
