code wiki / _hdl_build / nx_ge_census.nx

nx_ge_census.nx source

↩ module page · 103 lines · 6701 B

1// nx_ge_census.nx -- R0 KEYSTONE of the 5-pillar sovereign game engine: the honest, data-driven 2// MATURITY SCORECARD (mirrors the charter's nx_evolution_ladder + the image-stack R0 genesis gate). 3// One row per (pillar x capability), graded ABSENT->PRESENT->PARITY->EXCEEDS from EVIDENCE. The gate 4// LIAR-KILLS any PARITY/EXCEEDS row lacking measured evidence (a has_ev flag set only when a real gate/ 5// head-to-head backs it), so no "beats X" can be claimed without proof -- by construction. Negative 6// control proves the liar-kill fires. Grades are HONEST 2026-06-20 (reuse-verified in the tree); 7// EXCEEDS=0 across engine pillars -- nowhere near S-class yet, exactly as the charter's ladder reports. 8// Later rungs EARN PARITY/EXCEEDS by attaching a measured gate (set has_ev=1 + name the gate). 9// NOTE: uses an explicit has_ev:i64 flag, NOT empty-string-literal tests (slen("") is unreliable here). 10// 100% sovereign. license_tier: ORIGINAL expect_exit: 0 11import "nx_syscalls.nx" 12 13const G_ABSENT: i64 = 0 14const G_PRESENT: i64 = 1 15const G_PARITY: i64 = 2 16const G_EXCEEDS: i64 = 3 17 18func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 19func sn(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 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 } 20 21func grade_name(g: i64) -> i64 { 22 if g==G_ABSENT { sw("ABSENT " as *u8) } 23 if g==G_PRESENT { sw("PRESENT" as *u8) } 24 if g==G_PARITY { sw("PARITY " as *u8) } 25 if g==G_EXCEEDS { sw("EXCEEDS" as *u8) } 26 return 0 27} 28 29// the LIAR-KILL rule: PARITY/EXCEEDS (grade>=2) REQUIRE has_ev==1. ABSENT/PRESENT do not. 30func cap_valid(grade: i64, has_ev: i64) -> i64 { 31 if grade >= G_PARITY { if has_ev == 0 { return 0 } } 32 return 1 33} 34 35func row(pillar: *u8, cap: *u8, grade: i64, evidence: *u8, has_ev: i64, tot: *i64) -> i64 { 36 sw(" " as *u8); sw(pillar); sw(" | " as *u8); sw(cap); sw(" -> " as *u8); grade_name(grade) 37 if cap_valid(grade, has_ev) == 0 { sw(" <== INVALID: PARITY/EXCEEDS without evidence (LIAR-KILL)" as *u8); tot[4] = tot[4] + 1 } 38 else { if has_ev == 1 { sw(" [ev: " as *u8); sw(evidence); sw("]" as *u8) } } 39 sw("\n" as *u8) 40 tot[grade] = tot[grade] + 1 41 return 0 42} 43 44func main() -> i64 { 45 let tot: *i64 = sys_mmap(64) as *i64 46 tot[0]=0; tot[1]=0; tot[2]=0; tot[3]=0; tot[4]=0 // ABSENT,PRESENT,PARITY,EXCEEDS,INVALID 47 48 sw("=== nx_ge_census R0 -- SOVEREIGN GAME ENGINE maturity scorecard (honest 2026-06-20) ===\n" as *u8) 49 sw("grades: ABSENT < PRESENT < PARITY < EXCEEDS (PARITY/EXCEEDS REQUIRE measured evidence)\n" as *u8) 50 51 sw("-- P1 VISUALIZATION --\n" as *u8) 52 row("P1-viz " as *u8, "sw-raster (tri/voxel) " as *u8, G_PRESENT, "nx_voxel_spec_gate" as *u8, 1, tot) 53 row("P1-viz " as *u8, "z-buffer " as *u8, G_PRESENT, "nx_wasmvox3d_gate" as *u8, 1, tot) 54 row("P1-viz " as *u8, "texture/gouraud shading " as *u8, G_PRESENT, "nx_shade_gate (PNG eyeball-verified)" as *u8, 1, tot) 55 row("P1-viz " as *u8, "tile-based mobile render " as *u8, G_EXCEEDS, "nx_tile_render_gate (tile-local bw 3-6x vs immediate-mode, MEASURED)" as *u8, 1, tot) 56 row("P1-viz " as *u8, "SPIR-V/GPU backend " as *u8, G_ABSENT, "none" as *u8, 0, tot) 57 58 sw("-- P2 NETWORKING --\n" as *u8) 59 row("P2-net " as *u8, "transport (TLS/UDP) " as *u8, G_PRESENT, "nx_tls13_stack" as *u8, 1, tot) 60 row("P2-net " as *u8, "client prediction " as *u8, G_PRESENT, "nx_netpredict" as *u8, 1, tot) 61 row("P2-net " as *u8, "deterministic lockstep " as *u8, G_EXCEEDS, "nx_lockstep_exceed_gate (bw 8-128x vs state-sync, MEASURED)" as *u8, 1, tot) 62 row("P2-net " as *u8, "rollback " as *u8, G_EXCEEDS, "nx_rollback_exceed_gate (0 input-lag vs delay-based, MEASURED)" as *u8, 1, tot) 63 64 sw("-- P3 RESPONSIVENESS --\n" as *u8) 65 row("P3-resp" as *u8, "fixed-timestep loop " as *u8, G_EXCEEDS, "nx_timestep_exceed_gate (frame-rate deterministic vs variable-dt, MEASURED)" as *u8, 1, tot) 66 row("P3-resp" as *u8, "ECS / data-oriented " as *u8, G_EXCEEDS, "nx_dod_cache_gate (SoA 4-8x fewer cache lines vs AoS, MEASURED)" as *u8, 1, tot) 67 row("P3-resp" as *u8, "LOD / culling " as *u8, G_PRESENT, "nx_cull_lod_gate (70% work cut, measured)" as *u8, 1, tot) 68 row("P3-resp" as *u8, "floor-device budget " as *u8, G_PRESENT, "nx_frame_budget_gate (culled fits 30fps floor)" as *u8, 1, tot) 69 70 sw("-- P4 STORY --\n" as *u8) 71 row("P4-stry" as *u8, "story-graph VM " as *u8, G_PRESENT, "nx_story_vm_gate" as *u8, 1, tot) 72 row("P4-stry" as *u8, "dialogue trees " as *u8, G_PRESENT, "nx_story_quest_gate" as *u8, 1, tot) 73 row("P4-stry" as *u8, "quests / branching " as *u8, G_PRESENT, "nx_story_quest_gate" as *u8, 1, tot) 74 75 sw("-- P5 GENERATIVE --\n" as *u8) 76 row("P5-gen " as *u8, "procgen content " as *u8, G_PRESENT, "nx_voxel_spec_gate" as *u8, 1, tot) 77 row("P5-gen " as *u8, "char AI (BT/FSM) " as *u8, G_PRESENT, "nx_char_ai_gate" as *u8, 1, tot) 78 row("P5-gen " as *u8, "char dialogue (LLM) " as *u8, G_ABSENT, "none" as *u8, 0, tot) 79 row("P5-gen " as *u8, "char visuals (diffusion)" as *u8, G_ABSENT, "none" as *u8, 0, tot) 80 81 sw("--- DISTRIBUTION ---\n" as *u8) 82 sw(" ABSENT=" as *u8); sn(tot[0]) 83 sw(" PRESENT=" as *u8); sn(tot[1]) 84 sw(" PARITY=" as *u8); sn(tot[2]) 85 sw(" EXCEEDS=" as *u8); sn(tot[3]) 86 sw("\n (honest: each EXCEEDS is EARNED per-cell by a measured head-to-head gate; most cells still PRESENT/ABSENT -- early, not yet broadly S-class)\n" as *u8) 87 sw(" invalid_rows=" as *u8); sn(tot[4]); sw("\n" as *u8) 88 89 // NEGATIVE CONTROL -- prove the liar-kill actually fires 90 var neg_ok: i64 = 1 91 if cap_valid(G_EXCEEDS, 0) != 0 { neg_ok = 0 } // fake EXCEEDS, no evidence -> MUST be invalid 92 if cap_valid(G_PARITY, 0) != 0 { neg_ok = 0 } // fake PARITY, no evidence -> MUST be invalid 93 if cap_valid(G_EXCEEDS, 1) != 1 { neg_ok = 0 } // EXCEEDS WITH evidence -> valid 94 if cap_valid(G_PRESENT, 0) != 1 { neg_ok = 0 } // PRESENT, no evidence -> valid (allowed) 95 sw(" NEG-CONTROL liar-kill fires correctly: " as *u8); if neg_ok==1 { sw("YES\n" as *u8) } else { sw("NO\n" as *u8) } 96 97 var green: i64 = 0 98 if tot[4] == 0 { if neg_ok == 1 { green = 1 } } 99 if green == 1 { sw("VERDICT: GREEN (scorecard honest; no unproven PARITY/EXCEEDS; liar-kill armed)\n" as *u8); sys_exit(0) } 100 sw("VERDICT: RED\n" as *u8) 101 sys_exit(1) 102 return 1 103}