code wiki / _hdl_build / nx_bd_calc_gate.nx
nx_bd_calc_gate.nx
buildroot/runtime/_hdl_build/nx_bd_calc_gate.nx
about
nx_bd_calc_gate.nx -- known-answer gate for the sovereign BD organ (2026-07-29).
THE DOCTRINE INVERSION: the python cubic Bjontegaard (numpy polyfit) is now the ORACLE inside this
gate and nothing else -- the lane instrument is nx_bd_calc (sovereign f64 PWL). Oracle values below
were generated 2026-07-29 from the BANKED 4-seq curves (bd_rdoq.txt PRE vs bd_lam.txt LAM4 @2593,
kbps_milli = total*5 exactly, psnr_milli from sseY/npix): foreman -148.4 akiyo -101.9 bus -28.8
mobile -12.9 permille. MEASURED estimator delta PWL-vs-cubic on these pairs: max 2.1 permille =>
TOLERANCE = +/-5 permille (derived from measurement + margin, never taste).
Teeth: T1-T4 the four oracle pairs in-band; T5 identity == 0 exactly; T6 reverse comparison equals
the EXACT algebraic inverse 1/(1+bd)-1 within +/-2 permille (self-consistency, catches sign bugs).
The organ is forked as the INSTALLED artifact (_offc) -- the gate tests the shipped path.
license: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_tool_run.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
| 14 | const BDG_TOL: i64 = 5 |
| 15 | const BDG_TOL_INV: i64 = 2 |
functions
| 17 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func gn(v: i64) -> i64 |
| 23 | func wnum(fd: i64, v: i64) -> i64 called by 1: wpts |
| 29 | func wpts(path: *u8, km: *i64, pm: *i64, n: i64) -> i64 |
| 38 | func run_bd(a: *u8, t: *u8) -> i64 |
| 65 | func chk(name: *u8, got: i64, want: i64, tol: i64, pass: *i64, fail: *i64) -> i64 |
| 73 | func main() -> i64 |