code wiki / _hdl_build / nx_machine_gen.nx

nx_machine_gen.nx

buildroot/runtime/_hdl_build/nx_machine_gen.nx

9232 B99 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic machine
docsdependenciesstructsconstsfunctions

about

nx_machine_gen.nx -- MACHINE GENERATOR (toward the team authoring its own substrate): from a compact DATA spec (op-fragments + (a,b,y) examples) it EMITS a complete, working evo-deriver to runtime/_hdl_build/nx_gen_machine.nx. The emitted machine, when built+run, SEARCHES op-sequences to fit the examples and self-verifies on held-out -- i.e. a NEW machine is authored from DATA, not hand-written. Claude authors THIS generator (the meta- substrate, like the compiler/genesis seed); machines become data-authored = the real reduction of Claude from the substrate. Demo spec derives f(a,b)=a*b+a. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_machine_gen.nx

imports: nx_syscalls.nxnx_itoa_lib.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 mg_w mg_table mg_w ↻ mg_wn sys_mmap ↻ mg_xa mg_xb mg_xy mg_wn ↻ mg_op sys_openat_wr mg_pr sys_write sys_write ↻ sys_close mg_prn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

10const K_MAGIC_32768: i64 = 32768
12const NOPS: i64 = 6
13const NEX: i64 = 10

functions

16func mg_op(k: i64) -> *u8
called by 1: main
24func mg_xa(i: i64) -> i64 { if i==0 {return 2} if i==1 {return 4} if i==2 {return 3} if i==3 {return 5} if i==4 {return 6} if i==5 {return 1} if i==6 {return 7} if i==7 {return 3} if i==8 {return 8} return 4 }
called by 1: mg_table
25func mg_xb(i: i64) -> i64 { if i==0 {return 3} if i==1 {return 5} if i==2 {return 2} if i==3 {return 1} if i==4 {return 2} if i==5 {return 7} if i==6 {return 2} if i==7 {return 3} if i==8 {return 1} return 4 }
called by 1: mg_table
26func mg_xy(i: i64) -> i64 { if i==0 {return 8} if i==1 {return 24} if i==2 {return 9} if i==3 {return 10} if i==4 {return 18} if i==5 {return 8} if i==6 {return 21} if i==7 {return 12} if i==8 {return 16} return 20 }
called by 1: mg_table
28func mg_w(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { buf[off+i] = s[i]; i = i + 1 } return off + i }
called by 2: mg_tablemain
29func mg_wn(buf: *u8, off: i64, v: i64) -> i64
called by 2: mg_tablemain calls 1: sys_mmap
38func mg_pr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
43func mg_prn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
46func mg_table(buf: *u8, off: i64, name: *u8, which: i64) -> i64
called by 1: main calls 5: mg_wmg_wnmg_xamg_xbmg_xy
63func main() -> i64