code wiki / (root) / nx_writebench_gate.nx

nx_writebench_gate.nx

buildroot/runtime/nx_writebench_gate.nx

11662 B223 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_writebench_gate.nx -- the LIAR-KILL gate for nx_writebench. A benchmark that grades us is worthless unless something can prove it is not a rubber stamp. Teeth: T1 THE RULER IS REAL -- the banked corpus exists and clears the decoy byte floor. T2 THE RULER IS THAT PAPER -- the corpus literally contains the paper's own distinctive strings (FlowGPT / Krippendorff / the H-/C+ finding). This is the anti-fabrication tooth: it makes it impossible to benchmark against an INVENTED paper, which is the whole failure mode of a self-authored ruler. T3 EVERY CLAIMED ARTIFACT EXISTS -- each evidence artifact the board attaches to a HAVE/PARTIAL is stat'd on disk from this gate's OWN independent list. Board, gate and disk are three copies. T4 NEG-CONTROL -- a fabricated artifact path must NOT exist. Without this, T3 could pass by accident (if the stat helper always returned success) and the gate would be a rubber stamp. T5 HONESTY CANNOT ROT -- the board source must still carry the SELF-GRADED deflation AND the DAN-class policy declaration. If a later edit quietly deletes either so the number reads like parity, this gate goes RED. T6 COVERAGE IS COMPUTED -- this gate recomputes the score from its own independent copy of the 28 verdicts and asserts it equals both the arithmetic (20/56 = 357 permil) AND the figure the board actually emitted into its log. Inflating the board alone cannot move this. T7 THE PARTITION SUMS -- the ruler's four class sizes must sum to 378, and 378 minus the 2 dual-labelled bots must equal the 376 distinct corpus. A partition is a claim: check the parts. T8 RULER DATA IS NON-VACUOUS -- the headline datum the board grades against (22.8) must be present in the banked corpus, not just in our prose about it. Evidence -> stdout + knowledge/status/writebench_gate.log. Exit 0 GREEN / 1 RED. Sovereign x86_64. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_estate_path.nx nx_writebench_gate.nx

imports: nx_syscalls.nxnx_estate_path.nx

imported by: nobody (leaf or entry point)

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

main sys_openat_append gw sys_write sys_mmap wg_slurp ep_open_rd sys_openat_rd sys_mmap ↻ ep_join sys_read sys_close gnum gw ↻ sys_mmap ↻ gsub wg_find gw ↻ gnum ↻ gkv gw ↻ gnum ↻ sys_close ↻ sys_exit

structs

none

consts

28const WG_NAXES: i64 = 28
29const WG_RULER_MIN: i64 = 50000
30const WG_EXP_SCORE: i64 = 35
31const WG_EXP_PERMIL: i64 = 625
32const WG_SCRATCH: i64 = 524288
33const WG_N_AICHAR: i64 = 279
34const WG_N_STORY: i64 = 63
35const WG_N_IMAGE: i64 = 15
36const WG_N_DAN: i64 = 21
37const WG_CLASS_SUM: i64 = 378
38const WG_CORPUS_N: i64 = 376
39const WG_DUAL: i64 = 2

functions

41func gw(fd: i64, s: *u8) -> i64
called by 4: gnumgkvgsubmain calls 1: sys_write
48func gnum(fd: i64, v: i64) -> i64
called by 3: gkvgsubmain calls 2: gwsys_mmap
62func gkv(fd: i64, label: *u8, got: i64, exp: i64) -> i64
called by 1: main calls 2: gwgnum
75func wg_slurp(p: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: ep_open_rdsys_readsys_close
91func wg_find(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: gsub
107func gsub(fd: i64, label: *u8, hay: *u8, n: i64, needle: *u8, want: i64) -> i64
called by 1: main calls 3: wg_findgwgnum
118func main() -> i64