VectorClock
VectorClock: causal ordering for distributed actors.
A vector clock is a map from actor-id (String) to logical timestamp (Int). Each actor increments only its own slot. Comparing two clocks determines causal order: one event "happened before" another when every slot in the first clock is <= the corresponding slot in the second and at least one is <.
Types
Functions
Advance actor_id's slot to at least ts (no-op if already >= ts).
Compare two vector clocks and return their causal relationship.
True when neither clock precedes the other.
All (actor_id, timestamp) pairs in arbitrary order.
Return the logical timestamp for actor_id (0 if unseen).
True when a causally precedes b (a happened-before b).
Increment the slot for actor_id, returning the updated clock.
Component-wise maximum: keep the higher timestamp for each slot.
An empty vector clock (all timestamps implicitly 0).
Sum of all timestamps (useful as a monotone scalar counter).