code wiki / _hdl_build / nx_ws_exceed_gate.nx
nx_ws_exceed_gate.nx
buildroot/runtime/_hdl_build/nx_ws_exceed_gate.nx
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
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
structs
| none |
consts
| 37 | const EX_N: i64 = 12 // concurrent workers |
| 38 | const EX_PER: i64 = 12 // ops per worker (12*12 = 144 < 256 manifest cap) |
| 39 | const EX_MAXWS: i64 = 64 |
| 40 | const EX_REC: i64 = 320 |
| 41 | const EX_LOG: *u8 = "knowledge/status/ws_exceed_gate.log" |
functions
| 43 | func ex_term(w: i64) -> i64 { return (w * 3 + 2) % 5 } |
| 46 | func so(s: *u8) -> i64 |
| 52 | func son(v: i64) -> i64 |
| 66 | func ex_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 71 | func ex_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 82 | func ex_path(out: *u8, tag: *u8, epoch: i64, suffix: *u8) -> i64 |
| 92 | func ex_key(out: *u8, w: i64, i: i64) -> i64 |
| 103 | func ex_wworker(prefix: *u8, w: i64, locked: i64) -> i64 |
| 119 | func ex_lworker(reflog: *u8, w: i64) -> i64 |
| 132 | func ex_spawn(mode: i64, a: *u8, b: *u8) -> i64 |
| 156 | func ex_retrievable(prefix: *u8) -> i64 |
| 171 | func ex_get_state(prefix: *u8, ws: i64) -> i64 |
| 185 | func ex_rec_correct(prefix: *u8) -> i64 |
| 191 | func ex_present(prefix: *u8) -> i64 |
| 198 | func main() -> i64 |