code wiki / _hdl_build / nx_consolidate_gate.nx

nx_consolidate_gate.nx

buildroot/runtime/_hdl_build/nx_consolidate_gate.nx

7112 B131 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_consolidate_gate.nx -- GATE for the consolidation architect (6 teeth incl 2 negative controls + determinism + a MUTATION proof). PREREQ: stage _offc/nx_consolidate.elf. Run from nxc2 root. One consolidator fork per tooth (self-exec chain). Fixture trees /tmp/cdA + /tmp/cdB with: same.nx = byte-identical in both -> IDENTICAL (safe collapse) diff.nx = different bytes -> DIVERGENT (hazard, never auto-collapse) only.nx = present but census names an absent tree copy -> MISSING (honest) T1 identical->IDENTICAL w=5 | T2 NEG divergent->DIVERGENT w=8 (behaviour would change) | T3 MISSING honest | T4 summary pairs=3 identical=1 divergent=1 missing=1 | T5 determinism (two runs seed byte-identical consolq) | T6 MUTATION: append a byte to A/same.nx -> IDENTICAL flips to DIVERGENT (the byte-equal gate genuinely discriminates; restore not needed, /tmp is scratch). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 0 importers

nx_seat_drive_lib.nx nx_store_seed_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_syscalls.nx nx_consolidate_gate.nx

imports: nx_seat_drive_lib.nxnx_store_seed_lib.nxnx_seg_store.nxnx_deploy_lib.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 cg_atoi sys_mkdir ss_writefile sys_openat_wr sys_write sys_close sys_fsync cg_len cg_run sys_mmap dep_run_capture sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve_clean sys_close ↻ sys_execve sys_exit sys_wait4 sys_mmap ↻ dp_read sys_openat_rd sys_read sys_close ↻ sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_cat ↻

structs

none

consts

none

functions

18func cg_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
called by 1: main
19func cg_itoa(dst: *u8, v: i64) -> i64 { var m: i64 = v; let t: *u8 = sys_mmap(24); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { dst[i] = t[k - 1 - i]; i = i + 1 } dst[k] = 0 as u8; return k }
called by 1: main calls 1: sys_mmap
20func cg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
22func cg_run(capp: *u8, cqp: *u8, outp: *u8) -> i64
called by 1: main calls 2: sys_mmapdep_run_capture
29func main(argc: i64, argv: *i64) -> i64