code wiki / (root) / nx_build_firsttry_gate.nx

nx_build_firsttry_gate.nx

buildroot/runtime/nx_build_firsttry_gate.nx

14232 B186 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic build
docsdependenciesstructsconstsfunctions

about

nx_build_firsttry_gate.nx -- CE2 (codeeffectiveness ce_build_firsttry): the build pillar's two rates read from a ship journal, PROVEN on planted journals with hand-computed answers. In-process over nx_build_firsttry_lib (the ONE ruler nx_organ_ship's firsttry verb calls), with a FIXED now so every expected count was decided before the run. Neg-controls the rung demands: a known revert raises rework AND reverts by EXACTLY ONE over the single-ship control; a window with nothing in it reads UNOBSERVABLE and writes NO spine row; the production spine is unchanged by any fixture run; an unreadable journal is UNREADABLE, never a zero rate. Rows are written with real TAB bytes by a row writer, never by a string literal, so the fixture is the wire shape the loop writes. exit: 0 GREEN . 1 RED . 3 SKIP license_tier: ORIGINAL No hw writes.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_build_firsttry_lib.nx nx_build_firsttry_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_build_firsttry_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mkdir bfg_open sys_unlinkat sys_openat_wr bfg_ship bfg_row bfg_n sys_mmap ↻ bft_catn sys_mmap ↻ sys_write ↻ bfg_tab sys_mmap ↻ sys_write ↻ bfg_w sys_write ↻ bfg_slen bfg_nl sys_mmap ↻ sys_write ↻

structs

none

consts

13const BFG_ROOT: *u8 = "/tmp/nx_build_firsttry_gate"
14const BFG_F0: *u8 = "/tmp/nx_build_firsttry_gate/f0.jrnl"
15const BFG_F1: *u8 = "/tmp/nx_build_firsttry_gate/f1.jrnl"
16const BFG_F2: *u8 = "/tmp/nx_build_firsttry_gate/f2.jrnl"
17const BFG_F3: *u8 = "/tmp/nx_build_firsttry_gate/f3.jrnl"
18const BFG_F4: *u8 = "/tmp/nx_build_firsttry_gate/f4.jrnl"
19const BFG_F5: *u8 = "/tmp/nx_build_firsttry_gate/f5.jrnl"
20const BFG_F1_SPINE: *u8 = "/tmp/nx_build_firsttry_gate/f1.jrnl.firsttry.spine"
21const BFG_F5_SPINE: *u8 = "/tmp/nx_build_firsttry_gate/f5.jrnl.firsttry.spine"
22const BFG_MISSING: *u8 = "/tmp/nx_build_firsttry_gate/does-not-exist.jrnl"
23const BFG_F6: *u8 = "/tmp/nx_build_firsttry_gate/f6.jrnl"
24const BFG_NOW: i64 = 1788656000
25const BFG_WINDOW: i64 = 14
26const BFG_MODE_RWX: i64 = 493
27const BFG_MODE_RW: i64 = 420
28const BFG_LINE: i64 = 512
29const BFG_MIN: i64 = 60
31const BFG_B_FIRST: i64 = 1000
32const BFG_B_REVERT: i64 = 900
33const BFG_B_GROW: i64 = 1100
34const BFG_F4_ROWS: i64 = 10
35const BFG_F4_ROWS_IN: i64 = 8
36const BFG_F4_EPISODES: i64 = 3
37const BFG_F4_FIRST_PERMIL: i64 = 500 // first_pass 1 of (first_pass 1 + code_fail 1); the box refusal is outside the denominator
38const BFG_F4_SHIPPED: i64 = 3
39const BFG_F4_TARGETS: i64 = 3

functions

41func bfg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: bfg_w
42func bfg_w(fd: i64, s: *u8) -> i64 { return sys_write(fd, s, bfg_slen(s)) }
called by 1: bfg_row calls 2: sys_writebfg_slen
43func bfg_tab(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = BFT_TAB as u8; return sys_write(fd, b, 1) }
called by 1: bfg_row calls 2: sys_mmapsys_write
44func bfg_nl(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = BFT_NL as u8; return sys_write(fd, b, 1) }
called by 1: bfg_row calls 2: sys_mmapsys_write
45func bfg_n(fd: i64, v: i64) -> i64 { let b: *u8 = sys_mmap(BFG_LINE); let o: i64 = bft_catn(b, 0, v); return sys_write(fd, b, o) }
called by 1: bfg_row calls 3: sys_mmapbft_catnsys_write
47func bfg_row(fd: i64, epoch: i64, target: *u8, stage: *u8, verdict: *u8, detail: *u8) -> i64
51func bfg_open(path: *u8) -> i64 { sys_unlinkat(path); return sys_openat_wr(path, BFG_MODE_RW) }
called by 1: main calls 2: sys_unlinkatsys_openat_wr
53func bfg_ship(fd: i64, at: i64, target: *u8, b: i64) -> i64
called by 1: main calls 3: bfg_rowsys_mmapbft_catn
66func bfg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
67func bfg_size(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 } let s: i64 = sys_lseek(fd, 0, 2); sys_close(fd); return s }
69func bfg_lines(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
79func main(argc: i64, argv: *i64) -> i64