code wiki / (root) / nx_f16_kat.nx

nx_f16_kat.nx

buildroot/runtime/nx_f16_kat.nx

2380 B45 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_f16_kat.nx -- regression KAT for nx_f16_to_f32, guarding the subnormal fix (nx_f32_cvt.nx: f32_exp was 114-exp_adj, correct 113-exp_adj). The old bug DOUBLED every subnormal f16 -> the Q6_K ffn_down 2x forward bug that blocked the sovereign LLM for the project's whole history. This KAT asserts exact f32 bits for normals, subnormals (incl smallest 2^-24 and the largest-subnormal/smallest-normal boundary), and zero. GREEN = the fix holds. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_f32_cvt.nx nx_f16_kat.nx

imports: nx_syscalls.nxnx_tier.nxnx_f32_cvt.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main kw sys_write sys_mmap chk nx_f16_to_f32 kw ↻ kh sys_mmap ↻ sys_write ↻ kh ↻ sys_exit

structs

none

consts

none

functions

10func kw(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: chkmain calls 1: sys_write
11func kh(v: i64) -> i64 { let b: *u8=sys_mmap(8); var i: i64=0; while i<8 { let n: i64=(v>>((7-i)*4))&0xF; if n<10 {b[i]=(48+n) as u8} else {b[i]=(87+n) as u8} i=i+1 } sys_write(1,b,8); return 0 }
called by 2: chkmain calls 2: sys_mmapsys_write
13func chk(label: *u8, f16: i64, want: i64, pass: *i64, tot: *i64) -> i64
called by 1: main calls 3: nx_f16_to_f32kwkh
21func main() -> i64