code wiki / _hdl_build / nx_nollm_synth_register.nx
nx_nollm_synth_register.nx source
↩ module page · 54 lines · 4896 B
1// nx_nollm_synth_register.nx -- SUBMIT the no-LLM PROGRAM-SYNTHESIS capability (this session's NCF + evolve-test-
2// select + grammar-expansion + miner stack) to the nishi team's GOVERNANCE for admission. The capability's CORE
3// is EMITTER/SYNTHESIZER-authored: given a spec, the synthesizer WRITES the organ source (ncf_emit codegen) and
4// the god-rooted toolchain compiles+runs it, with NO Claude in that loop. So author=emitter is TRUTHFUL for the
5// capability's authorship (Claude authored the FRAMEWORK + submits; the SOLUTIONS -- synthesized organs, evolved
6// heuristics -- are machine-authored). RACI: author(role1) SUBMITS, Council(role2) ADMITS (no self-admit).
7// ENGINEER EVIDENCE (live, at register time, strongest possible): the synthesizer AUTHORS a working organ NOW --
8// synthesize abs(x) from examples -> materialize -> GOD-BUILD (nx_cc->nxasm) -> run HELD-OUT -> require 7000009.
9// Modeled exactly on nx_evo_synth_register. license_tier: ORIGINAL
10import "nx_ncf_synth.nx" // ncf_synth/ncf_emit/ncf_god_build/ncf_read -- the synthesizer authors+builds
11import "nx_cap_register.nx" // cr_can_register, cr_w/cr_wn, IG_*, ig_*
12import "nx_capreg_librarian.nx" // cl_next_idx, cl_register_dual
13import "nx_syscalls.nx"
14const K_MAGIC_1000000: i64 = 1000000
15const K_MAGIC_7000009: i64 = 7000009
16
17func main() -> i64 {
18 cr_w(1, "=== SUBMIT no-LLM program-synthesis (emitter-authored) to the nishi team (Council admits) ===\n" as *u8)
19
20 // ---- ENGINEER: the SYNTHESIZER authors a working organ LIVE. abs(x) from examples, held-out {-7->7, 9->9}. ----
21 let xs: *i64=sys_mmap(64) as *i64; let ys: *i64=sys_mmap(64) as *i64
22 xs[0]=0-3; xs[1]=0-1; xs[2]=0; xs[3]=2; xs[4]=5
23 ys[0]=3; ys[1]=1; ys[2]=0; ys[3]=2; ys[4]=5
24 let sp: *i64=sys_mmap(8) as *i64; sp[0]=0-1
25 let sfd: i64=sys_openat_wr(NCF_RESULT,420); if sfd>=0 { sys_write(sfd,sp as *u8,8); sys_close(sfd) }
26 let form: *i64=sys_mmap(160) as *i64
27 let kind: i64=ncf_synth(xs,ys,5,form) // synthesizer chooses the control flow (no Claude)
28 var built: i64=0
29 if kind>0 { if ncf_emit(kind,form,0-7,9,K_MAGIC_1000000)==0 { if ncf_god_build(NCF_NAME)==0 { built=1 } } }
30 let produced: i64=ncf_read(NCF_RESULT)
31 var gen: i64=0; if built==1 { if produced==K_MAGIC_7000009 { gen=1 } } // authored organ GENERALIZES on held-out
32 cr_w(1, "ENGINEER: synthesizer authored+god-built abs(x); held-out produced=" as *u8); cr_wn(1, produced); cr_w(1, " (expect 7000009) gen=" as *u8); cr_wn(1, gen); cr_w(1, "\n" as *u8)
33 let eng: i64 = ig_engineer(1, 1, 1, gen)
34
35 // ---- COUNCIL: admit only an Engineer-PASS that is authored-by-someone-else (author_id=1, admitter_id=2). ----
36 let council: i64 = ig_council(eng, 1, 1, 2)
37 let dec: i64 = ig_decision(eng, council, 1)
38 if dec != IG_INGEST {
39 cr_w(1, "HELD (engineer=" as *u8); cr_wn(1, eng); cr_w(1, " council=" as *u8); cr_wn(1, council); cr_w(1, ") -- not admitted\n" as *u8)
40 sys_exit(1); return 1
41 }
42 // ---- LINT: layer 5 (autonomy/self-improvement), status 2 (PROVEN). ----
43 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED by librarian lint\n" as *u8); sys_exit(1); return 1 }
44
45 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8
46 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8
47 let idx: i64 = cl_next_idx(lp, jp)
48 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 2,
49 "NO-LLM PROGRAM SYNTHESIS (this session, 100% sovereign nx_cc->nxasm, no LLM/gcc): the SYNTHESIZER authors organs from specs with no Claude in the loop. STACK = NCF construct ladder (conditional/loop/affine-index/quadratic-index/two-state/order-k recurrence; nx_ncf_synth + rungs) -> wiring (classifier NOVEL -> synth -> GOD-BUILD -> held-out-verified, nx_ncf_route) -> learned PRIOR (nx_synth_prior, 141x fewer enumerations) -> EVOLVE-TEST-SELECT (nx_evo_synth, beats random 60x) -> GRAMMAR EXPANSION (nx_grammar_expand selects a new primitive, kills red herrings) -> retrieval->TRANSLATION miner (nx_primitive_miner + nx_nl_concept_miner, grows coverage wake-sleep nx_wakesleep_scale) -> RICH DOMAIN (nx_binpack_synth MATCHES best-fit; nx_binpack_beat BEATS best-fit -8 bins via a synthesizer-EVOLVED nonlinear feature = FunSearch's win, no LLM). ENGINEER re-verified at register time: the synthesizer authored+GOD-BUILT abs(x) and it GENERALIZES on held-out (produced 7000009). author=emitter (SOLUTIONS machine-authored: synthesized organs + evolved heuristics; Claude authored the framework + role1 SUBMITTED), Council(role2) ADMITTED -- RACI, no self-admit." as *u8)
50 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1); return 1 }
51 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED -- no-LLM synthesis ADMITTED BY COUNCIL (author!=admitter), author=emitter, dual-written\n" as *u8)
52 sys_exit(0)
53 return 0
54}