code wiki / _hdl_build / nx_ncf_synth.nx
nx_ncf_synth.nx
buildroot/runtime/_hdl_build/nx_ncf_synth.nx
about
nx_ncf_synth.nx -- the SHARED control-flow SYNTHESIS CORE (no main; imported by the rungs + the WIRING).
The clean DRY home for X-AUT-NCF-001 synthesis: rungs 1-2 (nx_ncf_synth_gate, nx_ncf_loop_gate) proved the
CONSTRUCTS (conditional, bounded loop) self-contained; this is the importable core + the unified entry
`ncf_synth` that the router uses to route a NOVEL spec (input->output examples) to synthesis. Grammar:
affine ops, a single conditional, a bounded loop. ALL identifiers are ncf_-prefixed so importers that also
pull nx_pattern_classify/library never collide. license_tier: ORIGINAL
dependencies 1 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: nx_syscalls.nx
imported by: nx_autonomy_create.nxnx_autonomy_grow.nxnx_autonomy_grow_hardened.nxnx_autonomy_grow_loop.nxnx_evo_synth_gate.nxnx_final_rung_gate.nxnx_ncf_cube_gate.nxnx_ncf_quad_gate.nxnx_ncf_recur_gate.nxnx_ncf_route_gate.nxnx_ncf_state_gate.nxnx_nollm_synth_register.nxnx_synth_prior_gate.nx
structs
| none |
consts
| 8 | const NCF_MAGIC_8192: i64 = 8192 |
| 9 | const NCF_MAGIC_999999: i64 = 999999 |
| 10 | const NCF_MAGIC_888888: i64 = 888888 |
| 12 | const NCF_ORGAN: *u8 = "runtime/_hdl_build/ncf_organ.nx" |
| 13 | const NCF_NAME: *u8 = "ncf_organ" |
| 14 | const NCF_RESULT: *u8 = "knowledge/status/ncf_out.bin" |
| 15 | const NCF_RUNNER: *u8 = "_offc/nx_sov_build_run.elf" |
functions
| 17 | func ncf_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func ncf_n(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0 { sys_write(1,"-" as *u8,1); m=0-m } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } let o: *u8=sys_mmap(24); var w: i64=0; var q: i64=k-1; while q>=0 { o[w]=t[q]; w=w+1; q=q-1 } sys_write(1,o,w); return 0 } |
| 19 | func ncf_cat(buf: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){ buf[o]=s[i]; o=o+1; i=i+1 } return o } |
| 20 | func ncf_catn(buf: *u8, off: i64, v: i64) -> i64 { var o: i64=off; if v==0 { buf[o]=48 as u8; return o+1 } var m: i64=v; if m<0 { buf[o]=45 as u8; o=o+1; m=0-m } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } var i: i64=0; while i<k { buf[o]=t[k-1-i]; o=o+1; i=i+1 } return o } called by 12: ncf_cat_retncf_cat_predncf_cat_bodyncf_cat_body2ncf_cat_body3ncf_cat_arg+6 calls 1: sys_mmap |
| 23 | func ncf_op_eval(op: i64, arg: i64, x: i64) -> i64 |
| 31 | func ncf_pred_eval(pred: i64, k: i64, x: i64) -> i64 |
| 37 | func ncf_loop_eval(init: i64, bop: i64, c: i64, x: i64) -> i64 |
| 50 | func ncf_loop_eval2(init: i64, c1: i64, c0: i64, x: i64) -> i64 |
| 57 | func ncf_loop_eval3(init: i64, c2: i64, c1: i64, c0: i64, x: i64) -> i64 |
| 66 | func ncf_loop_eval4(a0: i64, b0: i64, paa: i64, pab: i64, pba: i64, pbb: i64, x: i64) -> i64 |
| 76 | func ncf_pow3(k: i64) -> i64 { var r: i64=1; var t: i64=0; while t<k { r=r*3; t=t+1 } return r } called by 1: ncf_search_recur |
| 77 | func ncf_recur_eval(form: *i64, x: i64) -> i64 |
| 93 | func ncf_search_linear(xs: *i64, ys: *i64, n: i64) -> i64 |
| 126 | func ncf_search_branch(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 160 | func ncf_search_loop(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 180 | func ncf_search_loop2(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 200 | func ncf_search_loop3(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 225 | func ncf_search_loop4(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 259 | func ncf_search_recur(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 282 | func ncf_synth(xs: *i64, ys: *i64, n: i64, form: *i64) -> i64 |
| 294 | func ncf_eval(kind: i64, form: *i64, x: i64) -> i64 |
| 305 | func ncf_cat_ret(buf: *u8, off: i64, op: i64, arg: i64, ind: *u8) -> i64 |
| 316 | func ncf_cat_pred(buf: *u8, off: i64, pred: i64, k: i64) -> i64 |
| 323 | func ncf_cat_body(buf: *u8, off: i64, bop: i64, c: i64) -> i64 |
| 334 | func ncf_cat_body2(buf: *u8, off: i64, c1: i64, c0: i64) -> i64 |
| 342 | func ncf_cat_body3(buf: *u8, off: i64, c2: i64, c1: i64, c0: i64) -> i64 |
| 351 | func ncf_cat_arg(buf: *u8, off: i64, v: i64) -> i64 |
| 356 | func ncf_emit_main(buf: *u8, off: i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 365 | func ncf_emit_branch(form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 381 | func ncf_emit_loop(form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 395 | func ncf_emit_loop2(form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 409 | func ncf_emit_loop3(form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 424 | func ncf_emit_loop4(form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 441 | func ncf_emit_recur(form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 465 | func ncf_emit(kind: i64, form: *i64, ha: i64, hb: i64, scale: i64) -> i64 |
| 476 | func ncf_god_build(name: *u8) -> i64 |
| 492 | func ncf_read(path: *u8) -> i64 |