code wiki / _hdl_build / nx_auto_builder_s20.nx
nx_auto_builder_s20.nx
buildroot/runtime/_hdl_build/nx_auto_builder_s20.nx
about
nx_auto_builder.nx -- the BUILDER's SELF-BUILD organ (the S-class-exceed rung of build-code
synthesis): a NEW CAPABILITY IS A SPEC FILE. Reads a build-spec grammar, routes the shape via
the CLASSIFIER (no human/Claude shape decision), dispatches the right pattern emitter, then
builds AND RUNS the authored KAT sovereignly -- spec in, gated capability out, hands-off.
name <module> the authored module name (paths derived)
feature <fname> classifier feature vector rows (in_table, in_state, ...)
param <ints...> shape-specific parameter vector, meaning per routed shape:
shape 12 WIRE_TLV: type_w len_w type_first len_le pad2 trail_w (pe7 v3)
shape 13 STRUCT_WALK: nfields k0 w0 k1 w1 ... (pe8 v2)
shape 18 STATE_MACHINE nstates nevents s0 t[0] t[1] ... (pe13)
VERDICTS (honest, exit-coded): GREEN(0) authored + KAT green; RED(1) KAT failed;
REFUSED(2) malformed spec or emitter rail refused; NEEDS-TUTOR(3) classifier routed a shape
this organ has no dispatch row for (NOVEL stays measured, never silently absorbed).
Durable: AUTOBUILD rows w/ measured ms -> knowledge/status/auto_builder.log.
EXCEEDS manual authoring: zero marginal Claude lines per capability, ms-scale latency,
byte-REPRODUCIBLE output (same spec -> identical module), classifier-routed dispatch.
Usage: nx_auto_builder <specpath>
LAWS: struct-free, integer-only, flat ifs (per-row parse helpers), no &&/||, <=6 args.
license_tier: ORIGINAL
dependencies 9 imports · 0 importers
imports: nx_pattern_classify.nxnx_pattern_emit7.nxnx_pattern_emit8.nxnx_pattern_emit10.nxnx_pattern_emit13.nxnx_pattern_emit14.nxnx_pattern_emit6.nxnx_pattern_emit6_erf.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
| 29 | const K_MAGIC_1000000: i64 = 1000000 |
| 30 | const K_MAGIC_2048: i64 = 2048 |
functions
| 32 | func ab_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 } |
| 33 | func ab_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;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{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 35 | func ab_ms() -> i64 |
| 41 | func ab_cat(dst: *u8, o: i64, s: *u8) -> i64 |
| 49 | func ab_tok(buf: *u8, ls: i64, le: i64, idx: i64, se: *i64) -> i64 called by 1: ab_parse_line |
| 77 | func ab_teq(buf: *u8, s: i64, e: i64, lit: *u8) -> i64 |
| 90 | func ab_tint(buf: *u8, s: i64, e: i64) -> i64 called by 1: ab_parse_line |
| 104 | func ab_tcopy(buf: *u8, s: i64, e: i64, pool: *u8, pp: *i64) -> i64 called by 1: ab_parse_line |
| 114 | func ab_feat_idx(buf: *u8, s: i64, e: i64) -> i64 |
| 134 | func ab_parse_line(spec: *u8, ls: i64, le: i64, st: *i64) -> i64 |
| 180 | func ab_author_12(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64 |
| 184 | func ab_author_13(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64 |
| 194 | func ab_author_18(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64 |
| 203 | func ab_author_4(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64 |
| 214 | func ab_author_15(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64 |
| 230 | func ab_load_spec(path: *u8, c: *i64) -> i64 |
| 277 | func ab_author_11(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64, sf: *u8) -> i64 |
| 298 | func ab_kat(testname: *u8) -> i64 |
| 317 | func ab_log(name: *u8, shape: i64, ms: i64, verdict: *u8) -> i64 |
| 328 | func main(argc: i64, argv: *i64) -> i64 |