code wiki / _hdl_build / nx_funcmine_gate.nx
nx_funcmine_gate.nx
buildroot/runtime/_hdl_build/nx_funcmine_gate.nx
about
nx_funcmine_gate.nx -- GATE for the function-body dedup miner (5 teeth incl neg-control +
determinism + MUTATION). PREREQ: stage _offc/nx_funcmine.elf. Run from nxc2 root. One miner
fork per tooth (self-exec chain). Fixture dir /tmp/fmdir with 3 files:
fa.nx: func shared_helper (BODY B) + func only_a
fb.nx: func shared_helper (BODY B, byte-identical) + func only_b
fc.nx: func only_c
T1 the identical shared_helper across fa+fb reported DUPFUNC copies=2 | T2 NEG the unique funcs
(only_a/b/c) NOT in any dup group | T3 summary dupgroups=1 | T4 determinism | T5 MUTATION: change
one byte of fb's shared_helper body -> no longer a dup -> dupgroups=0.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_seat_drive_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
structs
| none |
consts
| none |
functions
| 16 | func fg_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 |
| 17 | func fg_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 } |
| 18 | func fg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: fg_seed |
| 20 | func fg_run(dir: *u8, outp: *u8) -> i64 |
| 26 | func fg_seed(mutate: i64) -> i64 |
| 38 | func main(argc: i64, argv: *i64) -> i64 |