code wiki / (root) / nx_bodyfit_canon_gate.nx

nx_bodyfit_canon_gate.nx

buildroot/runtime/nx_bodyfit_canon_gate.nx

13609 B255 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_bodyfit_canon_gate.nx -- DOES CANON MODE ACTUALLY TRANSFORM THE CANON, AND DOES IT REFUSE WHEN THE GENOME DOES NOT DESCRIBE IT? nx_bodyfit grew a second genome decoder (per-part ring scaling), and a decoder that silently COPIED its input would pass every downstream check there is: the body still generates, the renderer still renders, the judge still scores, and the search still reports a best-of-generation. Nothing in the pipeline can tell a working transform from a no-op, which is exactly the shape of defect that survives review and ships. nx_bodyfit_canon_gate (no args) ★★★THE IDENTITY CASE IS THE STRONGEST INVARIANT AVAILABLE: every gene at mid-envelope maps to a per-mille scale of exactly 1000, so the emitted canon must be BYTE-IDENTICAL to the source -- every R row, every negative offset, every P row, or the decoder is lossy somewhere. ★★BUT BYTE-IDENTITY ALONE IS PASSED BY A TRANSFORM THAT DOES NOTHING, so it is paired with a BITE cell: the extreme genome MUST differ from the source while the identity genome MUST match. Either tooth alone is vacuous; only the pair proves the transform both WORKS and IS NOT A COPY. ★IT ADDRESSES THE ARTIFACT BY THE PATH THE ORGAN ANNOUNCES (canon_path=), never by reconstructing the filename from bodyfit.conf's envelope midpoints -- a reconstructed name breaks silently the moment any bound is edited, and a gate that tests the wrong file reports GREEN about nothing. exit 0 GREEN | 1 RED | 3 SKIP license_tier: ORIGINAL. No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_bodyfit_canon_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main 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 ↻ gv_need gv_puts ↻ bg_exists sys_openat_rd sys_close sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ bg_trim_path bg_count_parts sys_mmap ↻ sys_read_file ↻ bg_ge0 sys_exit ↻ gv_verdict gv_note_bare_rate gv_bare_rate

structs

none

consts

25const BG_BODYFIT: *u8 = "/volume1/homes/elderwesto/nishihost/nx_bodyfit.elf"
26const BG_CANON: *u8 = "knowledge/canon_merge2.dat"
27const BG_CANON_PATH: *u8 = "knowledge/bodyfit_canon.path"
28const BG_OUTCAP: i64 = 262144
30const BG_TIMEOUT_MS: i64 = 300000
32const BG_MIDGENE: i64 = 500

functions

34func bg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
35func bg_trim_path(b: *u8, n: i64) -> i64 { var k: i64 = n; var done: i64 = 0; while k > 0 { if done == 0 { let c: i64 = b[k-1] as i64; if c == 10 { k = k - 1 } else { if c == 13 { k = k - 1 } else { if c == 32 { k = k - 1 } else { done = 1 } } } } } b[k] = 0 as u8; return k }
called by 1: main
36func bg_count_parts(p: *u8) -> i64 { let ln: *i64 = sys_mmap(16) as *i64; let b: *u8 = sys_read_file(p, ln); if (b as i64) == 0 { return 0 - 1 }; var i: i64 = 0; var bol: i64 = 1; var n: i64 = 0; while i < ln[0] { if bol == 1 { if b[i] == (80 as u8) { n = n + 1 } }; if b[i] == (10 as u8) { bol = 1 } else { bol = 0 }; i = i + 1 }; return n }
called by 1: main calls 2: sys_mmapsys_read_file
39func bg_num(d: *u8, off: i64, v: i64) -> i64
called by 1: bg_run_canon calls 1: sys_mmap
56func bg_find(h: *u8, n: i64, needle: *u8) -> i64
called by 2: bg_extractmain calls 1: bg_len
76func bg_extract(h: *u8, n: i64, key: *u8, dst: *u8, dcap: i64) -> i64
called by 1: main calls 2: bg_findbg_len
99func bg_same(a: *u8, b: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
121func bg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
122func bg_ne(a: i64, b: i64) -> i64 { if a != b { return 1 } return 0 }
123func bg_ge0(a: i64) -> i64 { if a >= 0 { return 1 } return 0 }
called by 1: main
124func bg_gt0(a: i64) -> i64 { if a > 0 { return 1 } return 0 }
called by 1: main
125func bg_exists(p: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
133func bg_run_canon(subj: *u8, v: i64, n: i64, out: *u8, olen: *i64) -> i64
150func main(argc: i64, argv: *i64) -> i64