code wiki / _hdl_build / nx_gamma_oracle_register.nx
nx_gamma_oracle_register.nx source
↩ module page · 46 lines · 3711 B
1// nx_gamma_oracle_register.nx -- registers the ME2 GAMMA ORACLE rung via the
2// Librarian. ENGINEER evidence = the oracle self-anchor gate re-run live.
3// license_tier: ORIGINAL
4import "nx_cap_register.nx"
5import "nx_capreg_librarian.nx"
6import "nx_syscalls.nx"
7
8func ggr_run(path: *u8) -> i64 {
9 let pid: i64 = sys_fork()
10 if pid == 0 {
11 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4)
12 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) }
13 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0
14 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0
15 sys_execve(path, argv, envp); sys_exit(127)
16 }
17 let st: *i64 = sys_mmap(16) as *i64
18 sys_wait4(pid, st, 0)
19 return st[0]
20}
21
22func main() -> i64 {
23 var allok: i64 = 1
24 if ggr_run("/tmp/_bf_gamma_gate_authored.sov.elf" as *u8) != 0 { allok = 0 }
25 cr_w(1, "ENGINEER: gamma oracle self-anchor gate pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8)
26 if allok == 1 {
27 let lg: i64 = sys_openat_append("knowledge/status/math_engine.log" as *u8, 0x1a4)
28 if lg >= 0 {
29 cr_w(lg, "GAMMAORACLE epoch=run-2026-06-10 module=_bf_gamma_gate_authored factorials=18/18-exact-to-18bang recurrence=100/100 half-square-pi=rel-2^-100 reflection-product=40/40-rel-2^-95 specials=C99-PASS verdict=GREEN oracle=nx_bigfloat120_gamma(SOVEREIGN,stirling-17-bernoulli-z30+shift+reflection) domain=TOTAL lane=nx_sov_build_run\n" as *u8)
30 sys_close(lg)
31 }
32 }
33 let eng: i64 = ig_engineer(1, 1, 1, allok)
34 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1)
35 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
36 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
37 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8
38 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8
39 let idx: i64 = cl_next_idx(lp, jp)
40 let ok: i64 = cl_register_dual(lp, jp, idx, 5,
41 2, "GEN BIGFLOAT-GAMMA ORACLE -- ME2 OPENS (DLMF ch.5 enters the engine; the novel core for the GAMMAGATE/LGAMMAGATE scorecard rows): nx_bigfloat120_gamma = COMPOSITION of blessed organs, near-zero new primitives: ln Gamma via Stirling at z>=30 with 17 INTEGER-BERNOULLI rational terms B_2..B_34 (DLMF 24.2; tail < 2^-138 at z=30, 28 bits past the oracle contract; B_36 exceeds i64 and is provably unneeded) + bigfloat-in ln (exponent split exact + atanh form) + recurrence shift-up for x<30 + reflection pi/(sin(pi x)Gamma(1-x)) over the BLESSED trig organ for negatives + exp from the pow organ. C99 tgamma matrix: +-0 -> +-inf, neg ints/-inf -> NaN, x>=172 -> inf (raw-compare lesson applied: positive raws order as integers, no exponent guard needed -- first draft had e>=8 guards that NEVER FIRE for e=7 values like 172/184, caught on self-review), x<-184 -> signed zero by interval parity. SELF-ANCHOR GREEN FIRST RUN: 18 EXACT factorials to 18! across 18 shift depths rel<2^-100 + recurrence Gamma(x+1)=xGamma(x) 100/100 + Gamma(1/2)^2=pi (square trick, no sqrt needed) + reflection product G(x)G(1-x)sin(pi x)=pi 40/40 + parity-signed deep-negative zeros. NEXT (named): f64 tgamma kernel rung = dd Stirling over the EXISTING toolkit (dd-log2 from pow + exp-dd from sinhcosh + dd shift-product; error budget ~2^-56) + nx_mathspec_gamma + emitter template 7 + math_rungs.tsv ROW (lands in the autonomous beat); then lgamma + erf (ch7). Composes CAPREG285/289/294/335/372" as *u8)
42 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) }
43 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED (bigfloat gamma oracle, ME2 opens)\n" as *u8)
44 sys_exit(0)
45 return 0
46}