code wiki / _hdl_build / nx_pattern_emit6_demo.nx
nx_pattern_emit6_demo.nx source
↩ module page · 25 lines · 992 B
1// nx_pattern_emit6_demo.nx -- the TEAM authoring the f64 natural log (no Claude core logic).
2// Spec data = _pm_log_spec.nx (oracle-generated by _f64_log_oracle_gen.py, mpmath@60dps).
3// Emits _pe_f64log.nx (func nx_f64_log) + _pe_f64log_test.nx (invariant KATs).
4import "nx_pattern_emit6.nx"
5import "_pm_log_spec.nx"
6import "nx_syscalls.nx"
7
8func p6_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
9
10func main() -> i64 {
11 let c: *i64 = sys_mmap(8 * 32) as *i64
12 let ncoef: i64 = pm_log_spec_fill(c)
13 let a: i64 = pe6_author_logf64("nx_f64_log" as *u8,
14 "_pe_f64log.nx" as *u8,
15 "runtime/_hdl_build/_pe_f64log.nx" as *u8,
16 "runtime/_hdl_build/_pe_f64log_test.nx" as *u8,
17 c, ncoef)
18 if a == 1 {
19 p6_w("TEAM AUTHORED CORE: _pe_f64log (MATH_KERNEL/LOG_REDUCE, ncoef from spec) -- Engineer verify next\n" as *u8)
20 sys_exit(0)
21 }
22 p6_w("author failed\n" as *u8)
23 sys_exit(1)
24 return 1
25}