code wiki / _hdl_build / nx_sclass_claim_test.nx

nx_sclass_claim_test.nx source

↩ module page · 56 lines · 4315 B

1// nx_sclass_claim_test.nx -- the Critic checks the BULLSHIT on S-class claims against EVERYTHING. 2// Four claims through the three-gate check (complete benchmark + genuine exceed + Critic sound): 3// - boolean minimization: exhaustive over ALL 256 functions (complete by construction), grade S, 4// Critic LAW -> S_VERIFIED. the one genuine exceed survives the check. 5// - SHARED-LLM REUSE (operator's example: one LLM for chat + image, flawless back-and-forth, 6// optimizing resources): the RIGHT kind of S feature -- real VRAM win + near-zero switch -- BUT 7// "unified = no quality loss" was REFUTED in research, so until WE MEASURE flawless quality both 8// ways the Critic status is CONTESTED -> BS_COUNTER. held, not claimed on faith. 9// - vector-quant: A-parity -> BS_NOT_EXCEED. 10// - a cherry-picked benchmark -> BS_INCOMPLETE. 11// Exit 0 if the check is honest. license_tier: ORIGINAL 12 13import "nx_sclass_claim.nx" 14import "nx_syscalls.nx" 15 16func ct_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 17func ct_num(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;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 } 18func ct_r(v: i64) -> i64 { if v==SCC_S_VERIFIED {ct_puts("S-VERIFIED" as *u8)} if v==SCC_BS_INCOMPLETE {ct_puts("BS(cherry-pick)" as *u8)} if v==SCC_BS_NOT_EXCEED {ct_puts("BS(not-exceed)" as *u8)} if v==SCC_BS_COUNTER {ct_puts("BS(counter/unmeasured)" as *u8)} return 0 } 19 20func main() -> i64 { 21 ct_puts("=== CRITIC BULLSHIT-CHECK on S-class claims (against EVERYTHING) ===\n" as *u8) 22 23 // boolean: complete (exhaustive 256), grade S, Critic LAW 24 let boolean: i64 = scc_check(1, SG_S_EXCEED, CRIT_LAW) 25 ct_puts(" boolean-minimization (exhaustive/256, S, LAW) -> " as *u8); ct_r(boolean); ct_puts("\n" as *u8) 26 27 // SHARED-LLM REUSE (operator example): show the resource win is real, then the honest hold. 28 // VRAM: shared = one Q4 4B LLM (~2300MB) + image head (~500MB); separate = same LLM + a T5-XXL 29 // encoder (~4500MB). reuse SAVES the duplicate encoder. 30 let shared_vram: i64 = 2300 + 500 31 let separate_vram: i64 = 2300 + 4500 32 let saved: i64 = separate_vram - shared_vram 33 // benchmark complete (vs separate-model + other reuse approaches) = 1; grade would be S IF flawless; 34 // but flawless-quality both ways is UNMEASURED + the "no quality loss" counter is REFUTED -> CONTESTED 35 let shared: i64 = scc_check(1, SG_S_EXCEED, CRIT_CONTESTED) 36 ct_puts(" shared-LLM chat+image: VRAM " as *u8); ct_num(separate_vram); ct_puts("->" as *u8); ct_num(shared_vram); ct_puts(" (saves " as *u8); ct_num(saved); ct_puts("MB) switch~0 -> claim " as *u8); ct_r(shared); ct_puts(" (real resource win; HELD until flawless quality is MEASURED)\n" as *u8) 37 38 // vector-quant: A-parity 39 let vq: i64 = scc_check(1, SG_A_PARITY, CRIT_LAW) 40 ct_puts(" vector-quant (A-parity) -> " as *u8); ct_r(vq); ct_puts("\n" as *u8) 41 // cherry-picked benchmark 42 let cherry: i64 = scc_check(0, SG_S_EXCEED, CRIT_LAW) 43 ct_puts(" cherry-picked benchmark -> " as *u8); ct_r(cherry); ct_puts("\n" as *u8) 44 45 let r: *i64 = sys_mmap(8*8) as *i64 46 r[0] = 0; if boolean == SCC_S_VERIFIED { r[0] = 1 } // genuine S survives 47 r[1] = 0; if shared == SCC_BS_COUNTER { if saved >= 4000 { r[1] = 1 } } // real resource win, but HELD (unmeasured quality) 48 r[2] = 0; if vq == SCC_BS_NOT_EXCEED { r[2] = 1 } // A-parity isn't S 49 r[3] = 0; if cherry == SCC_BS_INCOMPLETE { r[3] = 1 } // cherry-pick is BS 50 r[4] = 0; if scc_is_genuine(1, SG_S_EXCEED, CRIT_LAW) == 1 { if scc_is_genuine(1, SG_S_EXCEED, CRIT_CONTESTED) == 0 { r[4] = 1 } } 51 var pass: i64 = 0; var i: i64 = 0 52 while i < 5 { pass = pass + r[i]; i = i + 1 } 53 ct_puts("----\n passed " as *u8); ct_num(pass); ct_puts("/5\n" as *u8) 54 if pass == 5 { ct_puts(" BS-CHECK LIVE: only complete + genuine-exceed + Critic-sound = S. The shared-LLM feature is the RIGHT target -- held until flawless back-and-forth is MEASURED.\n" as *u8); sys_exit(0); return 0 } 55 ct_puts(" FAIL\n" as *u8); sys_exit(1); return 1 56}