nx_qa_score.nx
buildroot/runtime/nx_qa_score.nx
about
nx_qa_score.nx -- KAT gate for the sovereign word-level F1 + Exact-Match scorer (the standard QA benchmark
metric used by DeepResearcher (arXiv 2504.03160) / SQuAD / HotpotQA). The scoring functions now live in
nx_qa_score_lib.nx (importable by benchmark harnesses); this file keeps the KAT + the negative control
(a wrong answer MUST score 0 -- liar-kill on a rigged "always-full" metric). Integer/no-float, PERMILLE.
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_qa_score_lib.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
| 7 | const K_MAGIC_2000: i64 = 2000 |
| 8 | const K_MAGIC_4000: i64 = 4000 |
functions
| 10 | func qw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 11 | func qn(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(1,bb,k); return 0 } |
| 13 | func kat(pred: *u8, gold: *u8, exp_f1: i64, exp_em: i64, tot: *i64) -> i64 |
| 25 | func main() -> i64 |