code wiki / (root) / nx_coindex_bench_gate.nx

nx_coindex_bench_gate.nx

buildroot/runtime/nx_coindex_bench_gate.nx

7199 B162 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic coindex
docsdependenciesstructsconstsfunctions

about

nx_coindex_bench_gate.nx -- MEASURED concurrent-writer benchmark for the conflict-free co-index (R-ORCH-2). Exists because the coordinator CAUGHT ITSELF crediting nx_coindex with the WMS's R11 measurement it never individually earned (the exact self-grading the triage v2 forbids). This gate makes it earn a number: 8 FORKED writer processes x 12 appends each, through BOTH paths -- GOOD = ci_append (flock + O_APPEND single-write): must land 96/96, ZERO lost, timed. BAD = the naive read-modify-write a hand-edited shared file degrades to (read whole -> append in memory -> truncate-write whole, no lock, deliberate window): must MEASURABLY lose entries -- the RUN comparator proving the failure mode is real physics, not hypothesis. git = the named external yardstick, STATED by-design (index.lock: concurrent committers serialize-or-FAIL and must retry; the naive path loses SILENTLY; coindex = all land, no retry). GREEN iff good_lost==0 AND bad_lost>0 (the neg-control must fire). Journals the measured line. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_coindex_core.nx nx_coindex_bench_gate.nx

imports: nx_syscalls.nxnx_coindex_core.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_openat_wr sys_close sys_now_ms sys_mmap ↻ sys_clock_gettime_mono b_run_fleet sys_fork b_good_child sys_mmap ↻ ccz_cat_str ccz_cat_num ci_append ci_lock sys_openat_wr ↻ sys_flock sys_close ↻ sys_openat_append ci_unlock sys_flock ↻ sys_close ↻ sys_mmap ↻ ccz_cat_str ↻ sys_write sys_close ↻ sys_sleep_ms sys_mmap ↻ sys_munmap b_bad_child sys_mmap ↻ ccz_read sys_openat_rd sys_read sys_close ↻ ccz_cat_str ↻ ccz_cat_num ↻ sys_sleep_ms ↻ sys_openat_wr ↻ sys_write ↻

structs

none

consts

19const NW: i64 = 8 // workers
20const NR: i64 = 12 // appends per worker

functions

16func b_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
17func b_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
23func b_good_child(w: i64) -> i64
45func b_bad_child(w: i64) -> i64
66func b_run_fleet(which: i64) -> i64
82func main(argc: i64, argv: *i64) -> i64