code wiki / _hdl_build / nx_dd_verify.nx
nx_dd_verify.nx
buildroot/runtime/_hdl_build/nx_dd_verify.nx
about
nx_dd_verify.nx -- the DD-PRIMITIVE CONTRACT VERIFIER (ONE-STEP-TEN-SECOND tool for
the dd-composition bug class). The gamma dd probe hit a ~5e11-ulp STRUCTURAL bug
from using _sh_mul2/_sh_2sum/_sh_expdd without verifying their hi/lo output contract.
Instead of hand-debugging twice, this organ is the TEAM's one-command answer: it runs
each dd primitive on KNOWN double-double values, PRINTS the actual contract (which
slot is hi, which is lo, what 2^n means), and gates the round-trip. Run it before
ANY dd composition -> the contract is known, the class is retired.
KATs (error-free-transform identities, exact):
_sh_2sum(a,b) : out[0]=round(a+b), out[1]=exact error; out[0]+out[1]==a+b
_sh_mul2(a,b) : out[0]=round(a*b), out[1]=exact error; out[0]+out[1]==a*b
_sh_expdd(v) : exp(v)==(out[0]+out[1])*2^out[2] (the scale contract)
Durable: DDVERIFY rows (with the OBSERVED slots) + DDGATE -> knowledge/status/
dd_verify.log. Exit 0 = all contracts hold. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_f64.nxnx_f64_cvt.nx_pe_f64sinhcosh.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
| none |
functions
| 18 | func dv_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func dv_f(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 } |
| 20 | func dv_hx(fd: i64, v: i64) -> i64 |
| 30 | func dv_ulp(a: i64, b: i64) -> i64 { if a >= b { return a - b } return b - a } called by 1: main |
| 31 | func dv_chk(lfd: i64, label: *u8, ok: i64, bad: *i64) -> i64 |
| 37 | func main() -> i64 |