code wiki / _hdl_build / nx_prim_synth.nx

nx_prim_synth.nx

buildroot/runtime/_hdl_build/nx_prim_synth.nx

11364 B191 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic prim
docsdependenciesstructsconstsfunctions

about

nx_prim_synth.nx -- prim lane F784 (SYNTHESIZE: compose validated primitives into a sovereign workflow). The last of the 4 meet-in-the-middle pillars. Given ordered primitive ids (the agent's chosen composition from F782/F783 matches), VALIDATE each exists in the F781 registry + pull its typed signature, then EMIT the composed plan-workflow (seq/tool rows for nx_plan_run) + the seed recipe. If ANY id is unresolved it REFUSES to emit a runnable plan (all_resolved=false, exit 3) and routes the caller to nx_prim_gap -- you cannot synthesize over a primitive that does not exist. Sovereign orchestration = a plan- workflow run by nx_plan_run, NOT LangGraph/Temporal. READ-ONLY over the registry; result to stdout + atomic out-file. nx_prim_synth <primitive-id> [<primitive-id> ...] exit: 0 all-resolved (runnable plan emitted) | 3 UNRESOLVED (>=1 id absent) | 4 registry unreadable | 2 usage. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_prim_synth.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main ps_w sys_write sys_exit sys_mmap ps_reads sys_openat_rd sys_read sys_close ps_off ps_b ps_q ps_slen ps_id ps_eq ps_bn sys_mmap ↻ ps_je ps_val ps_off ↻ sys_write ↻ sys_openat_wr sys_close ↻ sys_renameat

structs

none

consts

12const K_MAGIC_262100: i64 = 262100
13const K_MAGIC_262144: i64 = 262144
14const K_MAGIC_1024: i64 = 1024

functions

16func ps_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
17func ps_b(rep: *u8, pos: i64, s: *u8) -> i64 { var p: i64 = pos; var i: i64 = 0; while s[i] != (0 as u8) { if p < K_MAGIC_262100 { rep[p] = s[i]; p = p + 1 } i = i + 1 } return p }
called by 1: main
18func ps_bn(rep: *u8, pos: i64, v: i64) -> i64 { var p: i64 = pos; var m: i64 = v; if m < 0 { if p < K_MAGIC_262100 { rep[p] = 45 as u8; p = p + 1 } m = 0 - m } let t: *u8 = sys_mmap(28); 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 { if p < K_MAGIC_262100 { rep[p] = t[k - 1 - i]; p = p + 1 } i = i + 1 } return p }
called by 1: main calls 1: sys_mmap
19func ps_q(rep: *u8, pos: i64) -> i64 { var p: i64 = pos; if p < K_MAGIC_262100 { rep[p] = 34 as u8; p = p + 1 } return p }
called by 1: main
20func ps_je(rep: *u8, pos: i64, src: *u8, s: i64, e: i64) -> i64
called by 1: main
33func ps_reads(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
42func ps_off(buf: *u8, s: i64, e: i64, pat: *u8, pl: i64) -> i64
called by 2: ps_valmain
54func ps_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
55func ps_id(buf: *u8, ostart: i64, ce: i64, out: *u8) -> i64
called by 1: main
63func ps_eq(idb: *u8, dl: i64, b: *u8) -> i64
called by 1: main
70func ps_val(out: *u8, op: i64, buf: *u8, os: i64, ce: i64, key: *u8, klen: i64) -> i64
called by 1: main calls 1: ps_off
91func main(argc: i64, argv: *i64) -> i64