nx_lamport_clock.nx
buildroot/runtime/nx_lamport_clock.nx
about
nx_lamport_clock.nx -- Lamport logical clock (Leslie Lamport 1978): causal ordering across actors, the id source
for the sequence CRDT. Each actor holds (clock, actor_id); tick() bumps + returns a monotonic clock for a new op;
observe(remote) advances local to max(local,remote) so a happens-before edge always yields a strictly greater id.
Combined with the actor_id tie-break this gives a DETERMINISTIC TOTAL ORDER every replica computes identically =
the backbone of CRDT convergence. 100% integer. V-COLLAB rung. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_crdt_sync.nxnx_crdt_sync_gate.nx
structs
| none |
consts
| none |
functions
| 9 | func lc_new(actor: i64) -> *i64 |
| 15 | func lc_actor(c: *i64) -> i64 { return c[1] } called by 1: sync_insert |
| 16 | func lc_value(c: *i64) -> i64 { return c[0] } |
| 18 | func lc_tick(c: *i64) -> i64 { c[0] = c[0] + 1; return c[0] } called by 1: sync_insert |
| 20 | func lc_observe(c: *i64, remote: i64) -> i64 called by 1: sync_apply_log |