code wiki / _hdl_build / nx_game_synth_gate.nx

nx_game_synth_gate.nx source

↩ module page · 45 lines · 3531 B

1// nx_game_synth_gate.nx -- proves the SOVEREIGN corroboration engine (gs_corroborate_game) over the REAL fetched 2// corpus. 100% sovereign, PRINT-ONLY (no tsv/csv/json written -- the stdout IS the result). For a set of game- 3// engine technique terms it shows the distinct-source corroboration count + verdict, and a LIAR-KILL neg-control: 4// a fabricated nonsense term must score 0 (the engine never fabricates corroboration). This is the Nishi 5// researcher's analysis, shown raw. license_tier: ORIGINAL expect_exit: 0 6import "nx_syscalls.nx" 7import "nx_game_synth.nx" 8 9func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 10func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); 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; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } 11func vstr(v: i64) -> *u8 { if v==2 { return "CORROBORATED" as *u8 } if v==1 { return "single-source" as *u8 } return "ABSENT" as *u8 } 12// print one corroboration row; return 1 iff CORROBORATED (>=2 sources). 13func show(axis: *u8, term: *u8, sources: i64) -> i64 { 14 let vd: i64 = gs_verdict(sources) 15 w(" ["); w(axis); w("] "); w(term); w(" sources="); wn(sources); w(" -> "); w(vstr(vd)); w("\n") 16 if vd==2 { return 1 } return 0 17} 18 19func main() -> i64 { 20 let pass: *i64 = sys_mmap(8) as *i64; pass[0]=0 21 w("=== NX-GAME-SYNTH (sovereign corroboration over the real corpus; print-only, no Claude) ===\n" as *u8) 22 let dir: *u8 = "knowledge/fetched" as *u8 23 let cap: i64 = 2097152 24 let buf: *u8 = sys_mmap(cap) 25 var c: i64 = 0 26 c = c + show("P1-VIZ" as *u8, "tile-based" as *u8, gs_corroborate_game(dir, "tile-based" as *u8, buf, cap)) 27 c = c + show("P1-VIZ" as *u8, "deferred" as *u8, gs_corroborate_game(dir, "deferred" as *u8, buf, cap)) 28 c = c + show("P1-VIZ" as *u8, "z-buffer" as *u8, gs_corroborate_game(dir, "z-buffer" as *u8, buf, cap)) 29 c = c + show("P2-NET" as *u8, "rollback" as *u8, gs_corroborate_game(dir, "rollback" as *u8, buf, cap)) 30 c = c + show("P2-NET" as *u8, "prediction" as *u8, gs_corroborate_game(dir, "prediction" as *u8, buf, cap)) 31 c = c + show("P3-RESP" as *u8, "data-oriented" as *u8, gs_corroborate_game(dir, "data-oriented" as *u8, buf, cap)) 32 c = c + show("P3-RESP" as *u8, "fixed-point" as *u8, gs_corroborate_game(dir, "fixed-point" as *u8, buf, cap)) 33 c = c + show("P5-GEN" as *u8, "procedural" as *u8, gs_corroborate_game(dir, "procedural" as *u8, buf, cap)) 34 c = c + show("P5-GEN" as *u8, "pathfinding" as *u8, gs_corroborate_game(dir, "pathfinding" as *u8, buf, cap)) 35 c = c + show("GENRE" as *u8, "tower" as *u8, gs_corroborate_game(dir, "tower" as *u8, buf, cap)) 36 37 let bogus: i64 = gs_corroborate_game(dir, "zqxwjkvbblorptech" as *u8, buf, cap) 38 w(" [NEG-CTL] fabricated term sources="); wn(bogus); w(" (expect 0)\n") 39 w(" corroborated terms="); wn(c); w("/10\n") 40 if c >= 6 { w(" R1: majority of technique terms CORROBORATED by >=2 sovereign sources\n"); pass[0]=pass[0]+1 } else { w(" R1 FAIL: corpus too thin\n") } 41 if bogus == 0 { w(" R2: LIAR-KILL -- fabricated term scored 0 (no fabricated corroboration)\n"); pass[0]=pass[0]+1 } else { w(" R2 FAIL\n") } 42 w("GAME-SYNTH rows=2 pass="); wn(pass[0]) 43 if pass[0]==2 { w(" verdict=GREEN\n"); sys_exit(0); return 0 } 44 w(" verdict=RED\n"); sys_exit(1); return 1 45}