Expand description
Hybrid Logical Clock (HLC) implementation for causal ordering.
HLC combines physical time with logical counters to provide total ordering of events across distributed GPU kernels while maintaining close relationship with real time.
§Properties
- Total Ordering: All timestamps can be compared
- Causality: If event A causes event B, then HLC(A) < HLC(B)
- Bounded Drift: Physical component stays within bounded drift of real time
§Usage
use ringkernel_core::hlc::{HlcTimestamp, HlcClock};
let clock = HlcClock::new(1); // Node ID = 1
let ts1 = clock.tick();
let ts2 = clock.tick();
assert!(ts1 < ts2); // tick() guarantees strictly increasing timestampsStructs§
- HlcClock
- Hybrid Logical Clock for generating causally-ordered timestamps.
- HlcState
- Compact HLC state for GPU-side storage (16 bytes).
- HlcTimestamp
- Hybrid Logical Clock timestamp.
Constants§
- MAX_
CLOCK_ SKEW_ MS - Maximum allowed clock skew in milliseconds.