code wiki / _hdl_build / nx_dd_verify.nx

nx_dd_verify.nx

buildroot/runtime/_hdl_build/nx_dd_verify.nx

5179 B83 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_f64.nx nx_f64_cvt.nx _pe_f64sinhcosh.nx nx_dd_verify.nx

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

main dv_p sys_write sys_openat_append sys_exit sys_mmap _sh_2sum nx_f64_add nx_f64_classify nx_f64_exp_field nx_f64_mant_field nx_f64_sign nx_f64_mant_field ↻ nx_f64_exp_field ↻ _f64_round_pack nx_f64_sub nx_f64_add ↻ nx_f64_neg dv_f sys_write ↻ dv_hx sys_mmap ↻ sys_write ↻ dv_chk dv_p ↻ dv_f ↻ nx_f64_add ↻ _sh_mul2 nx_f64_sub ↻ nx_f64_mul nx_f64_classify ↻ nx_f64_sign ↻ nx_f64_mant_field ↻ nx_f64_exp_field ↻ _f64_round_pack ↻ nx_f64_add ↻ dv_ulp nx_f64_mul ↻ _sh_expdd nx_f64_add ↻

structs

none

consts

none

functions

18func 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 }
called by 2: dv_chkmain calls 1: sys_write
19func 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 }
called by 2: dv_chkmain calls 1: sys_write
20func dv_hx(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
30func dv_ulp(a: i64, b: i64) -> i64 { if a >= b { return a - b } return b - a }
called by 1: main
31func dv_chk(lfd: i64, label: *u8, ok: i64, bad: *i64) -> i64
called by 1: main calls 2: dv_pdv_f
37func main() -> i64