code wiki / _hdl_build / nx_vec_fuse_gate.nx
nx_vec_fuse_gate.nx
buildroot/runtime/_hdl_build/nx_vec_fuse_gate.nx
about
nx_vec_fuse_gate.nx -- KAT for R-VEC-5 (nx_vec_fuse). Proves the defining RRF/hybrid behavior with two ranked
lists a human can verify by hand. expect_exit: 0 license_tier: ORIGINAL
Lexical(BM25) order: A B C D | Vector(cosine) order: C B E A
RRF (k=60,SCALE=1e6): A=16393+15625=32018 B=16129+16129=32258 C=15873+16393=32266 D=15625 E=15873
Fused: C > B > A > E > D -- B and C (only #2/#3 in each list, but in BOTH) BEAT A (#1 in lexical only).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_vec_fuse.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
| 9 | func vf_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 10 | func vf_pn(v: i64) -> i64 { let bb: *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{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 11 | func vf_ch(id: i64) -> i64 { let c: *u8=sys_mmap(2); c[0]=(65+id) as u8; sys_write(1,c,1); return 0 } // 0->A 1->B ... |
| 12 | func vf_w(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 } |
| 13 | func vf_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; 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{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 15 | func main() -> i64 |