code wiki / _hdl_build / nx_ws_exceed_gate.nx

nx_ws_exceed_gate.nx

buildroot/runtime/_hdl_build/nx_ws_exceed_gate.nx

10996 B260 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic ws
docsdependenciesstructsconstsfunctions

about

nx_ws_exceed_gate.nx -- WMS-R11: the MEASURED exceed-git scorecard (the no-wave proof). The [[feedback-no-wave-measured-exceed]] law: don't CLAIM we beat the incumbent -- MEASURE it with real numbers. git is the measuring stick (the reference workstream/state tracker every engineer knows): it gets crash-safety from (a) lock files that SERIALIZE writers (index.lock -- the loser FAILS and must retry) and (b) the reflog that REBUILDS lost refs. This gate MEASURES the WMS's hard numbers on the same two axes, head-to-head against the NAIVE baseline we actually execute (the unprotected path = "what you get WITHOUT these rungs"), and states git's guarantee as the named yardstick those numbers meet/exceed -- git is NOT run here (sovereign/no-bleed), so its column is a by-design reference, never reported as measured. MEASURED dimensions (our execution, identical concurrent load each side): DIM-A concurrent-write lost-update : NWORKERS write NPER distinct keys each. WMS = ws_put_locked (R8 flock) -> expect retrievable == total (0 lost) naive= ws_put_p (unlocked) -> expect retrievable < total (lost > 0) [the manifest RMW race] DIM-B crash-recovery completeness : NWORKERS write NPER reflog transitions concurrently; the derived registry is then LOST (wiped). WMS = ledger_rebuild from reflog -> expect recovered == total (100%) naive= no reflog / no rebuild -> expect recovered == 0 (everything gone) EXCEED CLAIM (precise, measured): the WMS hits git's atomicity + recoverability guarantees with ZERO git dependency AND -- unlike git's index.lock -- EVERY concurrent writer COMPLETES (the flock path serializes-and-finishes; it never refuses the loser). GREEN(0) iff the WMS side hits the durable target on BOTH dims AND the naive baseline measurably FAILS BOTH (load-bearing + non-vacuous measurement -- a number that proves itself). Self-log via fa_appendz (dogfoods R0b). Evidence -> knowledge/status/ws_exceed_gate.log. Sovereign: nx_ws_repair + nx_ws_cas + nx_ws_ledger + nx_workstream_store + nx_seg_store + nx_framed_append + nx_syscalls. license_tier: ORIGINAL

dependencies 7 imports · 0 importers

nx_ws_repair.nx nx_ws_cas.nx nx_ws_ledger.nx nx_workstream_store.nx nx_seg_store.nx nx_framed_append.nx nx_syscalls.nx nx_ws_exceed_gate.nx

imports: nx_ws_repair.nxnx_ws_cas.nxnx_ws_ledger.nxnx_workstream_store.nxnx_seg_store.nxnx_framed_append.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ ex_path ex_cat ex_catn sys_mmap ↻ ex_spawn sys_mmap ↻ sys_fork ex_wworker sys_mmap ↻ ex_key ex_cat ↻ ex_catn ↻ ex_cat ↻ ex_catn ↻ ws_put_locked sys_mmap ↻ wc_lockpath sys_openat_append sys_flock ws_put_p sys_mmap ↻ ws_len ss_get sys_mmap ↻ ss_scan ss_begin ss_begin_cap ss_add ss_add2 ss_len ws_seg_next ss_next_segid ss_commit ss_segid_ok sys_mmap ↻

structs

none

consts

37const EX_N: i64 = 12 // concurrent workers
38const EX_PER: i64 = 12 // ops per worker (12*12 = 144 < 256 manifest cap)
39const EX_MAXWS: i64 = 64
40const EX_REC: i64 = 320
41const EX_LOG: *u8 = "knowledge/status/ws_exceed_gate.log"

functions

43func ex_term(w: i64) -> i64 { return (w * 3 + 2) % 5 }
46func so(s: *u8) -> i64
called by 1: main calls 1: sys_write
52func son(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
66func ex_cat(dst: *u8, off: i64, s: *u8) -> i64
71func ex_catn(dst: *u8, off: i64, v: i64) -> i64
82func ex_path(out: *u8, tag: *u8, epoch: i64, suffix: *u8) -> i64
called by 1: main calls 2: ex_catex_catn
92func ex_key(out: *u8, w: i64, i: i64) -> i64
103func ex_wworker(prefix: *u8, w: i64, locked: i64) -> i64
119func ex_lworker(reflog: *u8, w: i64) -> i64
called by 1: ex_spawn calls 2: ex_termledger_append
132func ex_spawn(mode: i64, a: *u8, b: *u8) -> i64
156func ex_retrievable(prefix: *u8) -> i64
called by 1: main calls 4: ss_opensys_mmapex_keyss_hget
171func ex_get_state(prefix: *u8, ws: i64) -> i64
185func ex_rec_correct(prefix: *u8) -> i64
called by 1: main calls 2: ex_get_stateex_term
191func ex_present(prefix: *u8) -> i64
called by 1: main calls 1: ex_get_state
198func main() -> i64