code wiki / _hdl_build / nx_coedit_gate.nx

nx_coedit_gate.nx

buildroot/runtime/_hdl_build/nx_coedit_gate.nx

11382 B193 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_coedit_gate.nx -- gate for the CO-EDITING KERNEL (RGA text CRDT). The rows ARE the CRDT laws: 1 type+apply a session of position-based edits materializes exactly 2 CONVERGENCE merge(A,B) and merge(B,A) apply to the SAME bytes (pinned): concurrent append after the same char ordered by the (counter,replica) tie-break; a concurrent delete lands 3 tombstone-anchor inserting AFTER a concurrently-DELETED char still places correctly (RGA property) 4 idempotent-remerge merge(AB, A) == AB (byte-equal log; re-applying ops is a no-op) 5 edit-del position-based delete produces the pinned text 6 conflict-loud same op id with DIFFERENT content = LOUD protocol violation (never silent) 7 badref-loud insert after an unknown id = LOUD license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_coedit_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main eg_p sys_write eg_slen sys_openat_rd sys_close eg_runv sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 eg_args6 sys_mmap ↻ eg_mkempty sys_openat_wr ↻ sys_close ↻ eg_fileis sys_mmap ↻ eg_readall sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ eg_slen ↻ eg_row eg_p ↻ eg_write sys_openat_wr ↻ sys_write ↻ eg_slen ↻ sys_close ↻ eg_cp sys_mmap ↻ eg_readall ↻ sys_openat_wr ↻ sys_write ↻ sys_close ↻

structs

none

consts

none

functions

13func eg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n }
14func eg_p(s: *u8) -> i64 { sys_write(1, s, eg_slen(s)); return 0 }
called by 2: eg_rowmain calls 2: sys_writeeg_slen
15func eg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8) { dst[off+i]=s[i]; i=i+1 } return off+i }
called by 1: main
16func eg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
22func eg_write(path: *u8, content: *u8) -> i64
26func eg_readall(path: *u8, szout: *i64) -> *u8
32func eg_runv(elf: *u8, args: *i64, outpath: *u8) -> i64
47func eg_has(path: *u8, needle: *u8) -> i64
called by 1: main calls 3: sys_mmapeg_readalleg_slen
54func eg_fileis(path: *u8, exact: *u8) -> i64
called by 1: main calls 3: sys_mmapeg_readalleg_slen
62func eg_fileeq(p1: *u8, p2: *u8) -> i64
called by 1: main calls 2: sys_mmapeg_readall
73func eg_args6(a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8) -> *i64
called by 1: main calls 1: sys_mmap
78func eg_row(name: *u8, pass: i64) -> i64
called by 1: main calls 1: eg_p
82func eg_mkempty(path: *u8) -> i64
called by 1: main calls 2: sys_openat_wrsys_close
87func eg_cp(src: *u8, dst: *u8) -> i64
95func main(argc: i64, argv: *i64) -> i64