code wiki / _hdl_build / nx_paper_panel_gate.nx

nx_paper_panel_gate.nx source

↩ module page · 89 lines · 3944 B

1// nx_paper_panel_gate.nx -- KAT + neg-controls for manuscript-grade admissibility (AS-2). 2// The central assertion is T3: a PERFECT grade from a self-grader is INADMISSIBLE. A score 3// cannot launder the grader that produced it. T9 is the non-vacuity probe -- an independent 4// agreeing panel really does ADMIT, so the organ is not a constant "no". 5// DRY nx_gate_verdict lib (D001 migrate-on-touch). 6import "nx_paper_panel.nx" 7import "nx_gate_verdict.nx" 8 9func main() -> i64 { 10 let ctr: *i64 = gv_ctr() 11 gv_head("nx_paper_panel -- manuscript grade admissibility (AS-2)") 12 let out: *i64 = sys_mmap(2 * 8) as *i64 13 14 // T1 self-grade detected: grader id == author id 15 var ok1: i64 = 0 16 if pp_self_graded(7, 7) == 1 { 17 if pp_self_graded(7, 9) == 0 { ok1 = 1 } 18 } 19 gv_check("T1 self-grade detected by identity", ok1, ctr) 20 21 // T2 a genuinely independent grader is independent 22 var ok2: i64 = 0 23 if pp_grader_independent(9, 7, 0, 0, 0) == 1 { ok2 = 1 } 24 gv_check("T2 distinct id + no leakage = independent", ok2, ctr) 25 26 // T3 ***NEG-CONTROL, THE CENTRAL ONE***: a PERFECT 1000 from a SELF-grader is 27 // INADMISSIBLE and the reported grade is forced to 0. This is the exact situation 28 // of RT-004: the grader and the paper had the same author. 29 let indep_self: i64 = pp_grader_independent(7, 7, 1, 1, 1) 30 let adm_self: i64 = pp_admissible(indep_self, 1) 31 let v_self: i64 = pp_verdict(adm_self, 1000, 1000, 1000, out) 32 var ok3: i64 = 0 33 if v_self == PP_INADMISSIBLE { 34 if out[0] == 0 { ok3 = 1 } 35 } 36 gv_check("T3 NEG-CONTROL a perfect 1000 from a self-grader is INADMISSIBLE, grade forced to 0", ok3, ctr) 37 38 // T4 LEAKAGE: distinct ids are NOT enough -- shared family still invalidates (R6) 39 var ok4: i64 = 0 40 if pp_grader_independent(9, 7, 0, 0, 1) == 0 { 41 if pp_grader_independent(9, 7, 0, 1, 0) == 0 { 42 if pp_grader_independent(9, 7, 1, 0, 0) == 0 { ok4 = 1 } 43 } 44 } 45 gv_check("T4 leakage: same model / inheritance / family each invalidate", ok4, ctr) 46 47 // T5 CONTAMINATION: an independent grader on a contaminated holdout is inadmissible (R7) 48 var ok5: i64 = 0 49 if pp_admissible(1, 0) == 0 { 50 if pp_admissible(1, 1) == 1 { ok5 = 1 } 51 } 52 gv_check("T5 contaminated holdout is inadmissible even when independent", ok5, ctr) 53 54 // T6 dual grade AGREE -> ADMITTED at that grade 55 let adm_ok: i64 = pp_admissible(pp_grader_independent(9, 7, 0, 0, 0), 1) 56 var ok6: i64 = 0 57 if pp_verdict(adm_ok, 720, 720, 999, out) == PP_ADMITTED { 58 if out[0] == 720 { ok6 = 1 } 59 } 60 gv_check("T6 agreeing independent graders ADMIT at the agreed grade", ok6, ctr) 61 62 // T7 dual grade DIVERGE -> PROVISIONAL, resolved by the tie-break (not averaged) 63 var ok7: i64 = 0 64 if pp_verdict(adm_ok, 700, 400, 550, out) == PP_PROVISIONAL { 65 if out[0] == 550 { ok7 = 1 } 66 } 67 gv_check("T7 diverging graders are PROVISIONAL, resolved by tie-break not average", ok7, ctr) 68 69 // T8 divergence names the MISSING INPUT rather than splitting the difference 70 var ok8: i64 = 0 71 if pp_divergence_cause(0, 1) == PR_NEED_SOTA { 72 if pp_divergence_cause(1, 0) == PR_NEED_EVIDENCE { 73 if pp_divergence_cause(1, 1) == PR_OK { ok8 = 1 } 74 } 75 } 76 gv_check("T8 divergence cause names missing SOTA baseline or evidence", ok8, ctr) 77 78 // T9 NON-VACUITY: the organ is not a constant refusal -- a clean panel ADMITS a real 79 // grade and passes it through unchanged. 80 var ok9: i64 = 0 81 if pp_verdict(adm_ok, 306, 306, 0, out) == PP_ADMITTED { 82 if out[0] == 306 { ok9 = 1 } 83 } 84 gv_check("T9 non-vacuity: a clean panel ADMITS and preserves the grade", ok9, ctr) 85 86 let rc: i64 = gv_verdict("PAPER-PANEL", ctr, "self-grade + R6 leakage + R7 contamination gates, dual-grade tie-break, perfect-score-cannot-launder neg-control") 87 sys_exit(rc) 88 return rc 89}