code wiki / _hdl_build / nx_gamma_register.nx

nx_gamma_register.nx source

↩ module page · 36 lines · 2600 B

1// nx_gamma_register.nx -- records gamma rung-1 author=emitter (ME2-GAMMA-DD4). Gate 2// re-runs GREEN at register time. license_tier: ORIGINAL 3import "nx_cap_register.nx" 4import "nx_capreg_librarian.nx" 5import "nx_syscalls.nx" 6func gr_run(name: *u8) -> i64 { 7 let pid: i64 = sys_fork() 8 if pid == 0 { 9 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 10 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 11 let argv: *i64 = sys_mmap(32) as *i64 12 argv[0] = "_offc/nx_sov_build_run.elf" as *u8 as i64 13 argv[1] = name as i64 14 argv[2] = 0 15 let envp: *i64 = sys_mmap(16) as *i64 16 envp[0] = 0 17 sys_execve("_offc/nx_sov_build_run.elf" as *u8, argv, envp) 18 sys_exit(127) 19 } 20 let st: *i64 = sys_mmap(16) as *i64 21 sys_wait4(pid, st, 0) 22 if (st[0] % 128) != 0 { return 0 - 1 } 23 return (st[0] >> 8) & 0xff 24} 25func main() -> i64 { 26 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 27 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 28 if gr_run("_gamma_gate_authored" as *u8) != 0 { cr_w(1, "GAMMAGATE not green -- refuse register\n" as *u8); sys_exit(1) } 29 let idx: i64 = cl_next_idx(lp, jp) 30 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 31 2, "SELF F64-GAMMA rung1 author=emitter (ME2-GAMMA-DD4, DLMF ch5) -- the kernel _pe_f64gamma was AUTHORED BY THE BUILDER EMITTER pe6_author_gamma/demo8 from the sovereign spec, zero hand-written core logic. The NOVEL design (dd lnGamma precision structure) was tutor-validated via probe->dd-verify->root-cause (Stirling series belongs in g_hi exponent not g_lo correction, max_ulp=2); the EMITTER then authored the kernel mechanically. Chain: nx_mathspec_gamma (bf_pi+Newton-sqrt+exact-Bernoulli-Stirling, oracle rails Gamma(5)=24 + Gamma(0.5)=sqrt(pi)<=1ulp) -> demo8 authors kernel+invariant-test (Gamma(2..6) <=2 ulp + specials + reflection-gap LOUD-NAN) -> _gamma_gate INDEPENDENT bf oracle grid x=0.5..10 + edges + SEMANTIC-ANCHOR tamper teeth, HONEST rung-1 bar <=8 ulp (2 nice / 7 tail at x~0.5 plain-f64 prod accum + oracle wobble; tighten=dd-prod ME2-GAMMA-DD5, STATED not silent-relaxed) -> math_rungs row -> RUNGRUN 7/7 GREEN tamper-proofs 7/7. ch5 moves off zero. THE WINDDOWN: tutor did the novel math design, the emitter authored the kernel; X-AUT-006 transducer will mechanize the emitter authoring next" as *u8) 32 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 33 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " F64-GAMMA author=emitter registered\n" as *u8) 34 sys_exit(0) 35 return 0 36}