code wiki / _hdl_build / nx_examiner_test.nx
nx_examiner_test.nx source
↩ module page · 48 lines · 3775 B
1// nx_examiner_test.nx -- the team PERFORMS its own evaluation through the Examiner: it grades the
2// vector-quant result (honestly A-parity: beats scalar, not SOTA), confirms the one genuine S-class
3// exceed (boolean), and runs the teammate scorecard on the post-lift roster (all 12 now pass). The
4// Examiner owns all of it -- Claude is no longer the grader. Exit 0 if all hold. license_tier: ORIGINAL
5
6import "nx_examiner.nx"
7import "nx_syscalls.nx"
8
9func et_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
10func et_num(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;k=1}; while m>0 {t[k]=48+(m%10); 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 }
11func et_tier(g: i64) -> i64 { if g==SG_S_EXCEED {et_puts("S-EXCEED" as *u8)} if g==SG_A_PARITY {et_puts("A-parity" as *u8)} if g==SG_B_BEHIND {et_puts("B-behind" as *u8)} return 0 }
12
13func main() -> i64 {
14 et_puts("=== EXAMINER: the team grades ITSELF (capabilities, results, teammates) ===\n" as *u8)
15
16 // JOB 2: grade the vector-quant run -- MSE 20 beats scalar 124 but SOTA-VQ ~15 -> A-parity (honest)
17 let vq_grade: i64 = exam_grade_result(20, 124, 15)
18 et_puts(" [result] vector-quant MSE 20 vs scalar 124 vs SOTA 15 -> " as *u8); et_tier(vq_grade); et_puts(" (beats scalar, NOT SOTA)\n" as *u8)
19
20 // JOB 1: grade capabilities for S-class -- boolean is the one genuine (narrow) exceed
21 let g_bool: i64 = exam_grade_capability(1,1,1,1,0) // verified beat, triangulated -> S
22 let g_mult: i64 = exam_grade_capability(1,1,0,1,1) // tie -> A
23 et_puts(" [cap] boolean-minimization -> " as *u8); et_tier(g_bool); et_puts(" multiply-codegen -> " as *u8); et_tier(g_mult); et_puts("\n" as *u8)
24
25 // JOB 3: run the teammate scorecard on the POST-LIFT roster (Genealogist/Caretaker/Critic/Scribe lifted)
26 let sc: *i64 = sys_mmap(8*16) as *i64; let lev: *i64 = sys_mmap(8*16) as *i64
27 sc[0]=82; sc[1]=74; sc[2]=74; sc[3]=74; sc[4]=64; sc[5]=60; sc[6]=74; sc[7]=74; sc[8]=60; sc[9]=74; sc[10]=64; sc[11]=64
28 var i: i64 = 0; while i < 12 { lev[i] = 3; i = i + 1 }
29 let passes: i64 = exam_team_passes(12, sc)
30 let nextg: i64 = exam_next_growth(12, sc, lev)
31 et_puts(" [team] all 12 teammates pass=" as *u8); et_num(passes); et_puts(" next-growth-target=" as *u8); et_num(nextg); et_puts(" (-1 = none below bar)\n" as *u8)
32
33 // headline S-class count across the graded capabilities
34 let grades: *i64 = sys_mmap(8*8) as *i64; grades[0]=g_bool; grades[1]=g_mult; grades[2]=vq_grade
35 let sclass: i64 = exam_sclass_count(3, grades)
36 et_puts(" [headline] true S-class exceeds = " as *u8); et_num(sclass); et_puts(" (the real benchmark)\n" as *u8)
37
38 let r: *i64 = sys_mmap(8*8) as *i64
39 r[0] = 0; if vq_grade == SG_A_PARITY { r[0] = 1 } // honest VQ grade (not inflated to S)
40 r[1] = 0; if g_bool == SG_S_EXCEED { if g_mult == SG_A_PARITY { r[1] = 1 } } // capability grades
41 r[2] = 0; if passes == 1 { if nextg == 0 - 1 { r[2] = 1 } } // team all-pass, no growth target left
42 r[3] = 0; if sclass == 1 { r[3] = 1 } // exactly 1 true S-class (honest headline)
43 var pass: i64 = 0; var j: i64 = 0
44 while j < 4 { pass = pass + r[j]; j = j + 1 }
45 et_puts("----\n passed " as *u8); et_num(pass); et_puts("/4\n" as *u8)
46 if pass == 4 { et_puts(" EXAMINER LIVE: the team grades its own capabilities, results, and teammates -- honest, owned by one organ. Claude is out of the grading seat.\n" as *u8); sys_exit(0); return 0 }
47 et_puts(" FAIL\n" as *u8); sys_exit(1); return 1
48}