code wiki / (root) / nx_nofloat_simd_dot_probe_gate.nx

nx_nofloat_simd_dot_probe_gate.nx

buildroot/runtime/nx_nofloat_simd_dot_probe_gate.nx

7966 B138 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_simd_dot_probe_gate.nx -- DECISIVE probe for Stage 2 (SIMD decode). Before rebuilding the whole decode around __i16x16_madd (vpmaddwd), answer three questions on representative data: (1) does the W8A8 SIMD dot MATH work end-to-end (i16-lane pack2 store + vpmaddwd + i32x8 hsum + rescale)? (2) how big is the quantization ERROR vs the exact i64 dot (the precision cost of the fork)? (3) is it actually FASTER than the scalar i64 dot (the whole point)? If error is small AND it's faster, wire into the real decode + measure token faithfulness. Else keep i32 lossless. NOTE: nx_cc has NO i16 type -> i16 lanes are *u8 buffers with manual LE pack2 (as nx_nofloat_gemm does). No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_nofloat_gemm.nx nx_nofloat_simd_dot_probe_gate

imports: nx_syscalls.nxnx_nofloat_gemm.nx

imported by: nobody (leaf or entry point)

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

main sp sys_write sys_mmap exact_dot simd_w8a8_dot iabs pack2 hsum_sx iabs ↻ sn sys_mmap ↻ sys_write ↻ pack2 ↻ sys_now_ms sys_mmap ↻ sys_clock_gettime_mono hsum_sx ↻

structs

none

consts

none

functions

12func sp(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 1: main calls 1: sys_write
13func sn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
14func iabs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 2: simd_w8a8_dotmain
17func hsum_sx(acc: *u8) -> i64
called by 2: simd_w8a8_dotmain
25func exact_dot(x: *i64, w: *i64, n: i64, shift: i64) -> i64
called by 1: main
32func simd_w8a8_dot(x: *i64, w: *i64, xi: *u8, wi: *u8, acc: *u8, n: i64, shift: i64) -> i64
called by 1: main calls 3: iabspack2hsum_sx
47func main() -> i64