code wiki / _hdl_build / nx_game_sclass_census.nx
nx_game_sclass_census.nx source
↩ module page · 186 lines · 17330 B
1// nx_game_sclass_census.nx -- THE S-CLASS GAME-EMISSION FOUNDATION CENSUS. Mechanizes the hardware-rung-up
2// roadmap (Nishi researcher corpus + the research team's synthesis) toward AUTONOMOUSLY EMITTING S-class games
3// across all 17 open-source-games genres INCLUDING MMOs. For each foundational RUNG it grades coverage from
4// on-disk FACTS, never self-scored:
5// EXCEEDS = a measured gate organ for that rung opens on disk
6// PRESENT = an implementing organ opens on disk
7// RESEARCHED = the sovereign corpus (knowledge/fetched/gr_*.raw) corroborates it (>=2 sources), not yet built
8// NOTED = 1 corpus source (hearsay, not enough)
9// ABSENT = nothing yet
10// Then it emits the PRIORITIZED GAP ROADMAP: the not-yet-built rungs in build-order (the research team's step
11// sequence), so the team knows exactly what to build next to make the most genres emittable. LIAR-KILL: a
12// fabricated rung mapped to a fabricated organ must NEVER grade PRESENT/EXCEEDS. Print-only, sovereign, no tsv.
13// census-subject: product-surface
14// INSTRUMENT-UPGRADED 2026-07-10 (operator liar-kill "toy level / censuses avoid UI"): + UI/PRODUCT AXES
15// section scoring OUR EMITTED GAMES vs NAMED DATED bars -- Godot 4.x / Luanti / Veloren (banked 2026-07-09/10:
16// pb_* layer/feature/release + rh_* repo-health evidence; axes cross-corroborated by nx_axis_discover 782-term
17// field vocabulary). Foundation grading kept (additive, not reductive).
18// license_tier: ORIGINAL expect_exit: 0
19import "nx_game_synth.nx"
20import "nx_syscalls.nx"
21const K_MAGIC_2097152: i64 = 2097152
22
23func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
24func 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 }
25func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
26func gstr(g: i64) -> *u8 { if g==4 { return "EXCEEDS " as *u8 } if g==3 { return "PRESENT " as *u8 } if g==2 { return "RESEARCHED" as *u8 } if g==1 { return "NOTED " as *u8 } return "ABSENT " }
27
28// ctx: [0]=dir [1]=buf [2]=cap [3]=st(6) [4]=rp [5]=rid [6]=rg [7]=rcbox
29func cell(tier: *u8, id: *u8, name: *u8, key: *u8, organ: *u8, exceed: *u8, prio: i64, ctx: *i64, isneg: i64) -> i64 {
30 let dir: *u8 = ctx[0] as *u8; let buf: *u8 = ctx[1] as *u8; let cap: i64 = ctx[2]; let st: *i64 = ctx[3] as *i64
31 let corrob: i64 = gs_corroborate_game(dir, key, buf, cap)
32 let ho: i64 = gs_file_exists(organ); let he: i64 = gs_file_exists(exceed)
33 var g: i64 = 0
34 if he == 1 { g = 4 } else { if ho == 1 { g = 3 } else { if corrob >= 2 { g = 2 } else { if corrob >= 1 { g = 1 } else { g = 0 } } } }
35 w(" ["); w(gstr(g)); w("] "); w(tier); w(" "); w(id)
36 var pad: i64 = slen(id); while pad < 22 { w(" " as *u8); pad = pad + 1 }
37 w(" src="); wn(corrob); w(" org="); wn(ho); w(" exc="); wn(he); w(" "); w(name); w("\n")
38 if g==4 { st[0]=st[0]+1 } else { if g==3 { st[1]=st[1]+1 } else { if g==2 { st[2]=st[2]+1 } else { if g==1 { st[3]=st[3]+1 } else { st[4]=st[4]+1 } } } }
39 if isneg==1 { if g>=3 { st[5]=st[5]+1 } }
40 if isneg==0 { if g < 3 {
41 let rp: *i64 = ctx[4] as *i64; let rid: *i64 = ctx[5] as *i64; let rg: *i64 = ctx[6] as *i64; let rcbox: *i64 = ctx[7] as *i64
42 let c: i64 = rcbox[0]; rp[c]=prio; rid[c]=id as i64; rg[c]=g; rcbox[0]=c+1
43 } }
44 return g
45}
46
47// product-bar row (us vs bar, evidence-cited); accumulates ut[0]=us ut[1]=max
48func ub(nm: *u8, us: i64, bar: i64, ev: *u8, ut: *i64) -> i64 {
49 w(" [" as *u8)
50 if us >= bar { w("PARITY " as *u8) } else { w("BEHIND " as *u8) }
51 w("] " as *u8); w(nm); w(" (us " as *u8); wn(us); w("/" as *u8); wn(bar); w(") " as *u8); w(ev); w("\n" as *u8)
52 ut[0] = ut[0] + us
53 ut[1] = ut[1] + bar
54 return 0
55}
56
57func main(argc: i64, argv: *i64) -> i64 {
58 w("=== NISHI S-CLASS GAME-EMISSION FOUNDATION CENSUS (rung-up to autonomous emit; on-disk + corpus, liar-killed) ===\n" as *u8)
59 w("grade: EXCEEDS=gate-on-disk > PRESENT=organ-on-disk > RESEARCHED=corpus>=2 > NOTED=1 > ABSENT. Goal: emit S-class games (incl MMOs).\n\n" as *u8)
60 let cap: i64 = K_MAGIC_2097152
61 let buf: *u8 = sys_mmap(cap)
62 let st: *i64 = sys_mmap(64) as *i64; st[0]=0; st[1]=0; st[2]=0; st[3]=0; st[4]=0; st[5]=0
63 let rp: *i64 = sys_mmap(8*128) as *i64; let rid: *i64 = sys_mmap(8*128) as *i64; let rg: *i64 = sys_mmap(8*128) as *i64
64 let rcbox: *i64 = sys_mmap(16) as *i64; rcbox[0]=0
65 let ctx: *i64 = sys_mmap(8*16) as *i64
66 ctx[0] = "knowledge/fetched" as *u8 as i64; ctx[1] = buf as i64; ctx[2] = cap; ctx[3] = st as i64
67 ctx[4] = rp as i64; ctx[5] = rid as i64; ctx[6] = rg as i64; ctx[7] = rcbox as i64
68 let X: *u8 = "-" as *u8
69
70 w("-- Tier 0: substrate (every game) --\n" as *u8)
71 cell("T0" as *u8, "int-raster-fb" as *u8, "integer raster / framebuffer" as *u8, "rasterization" as *u8, "runtime/_hdl_build/nx_shade.nx" as *u8, "runtime/_hdl_build/nx_tile_render_gate.nx" as *u8, 1, ctx, 0)
72 cell("T0" as *u8, "fixed-point-math" as *u8, "pure-integer / fixed-point (determinism)" as *u8, "fixed-point" as *u8, "runtime/_hdl_build/nx_game_render.nx" as *u8, "runtime/_hdl_build/nx_game_render_gate.nx" as *u8, 1, ctx, 0)
73 cell("T0" as *u8, "fixed-timestep" as *u8, "fixed-timestep sim loop" as *u8, "fixed-timestep" as *u8, X, "runtime/_hdl_build/nx_timestep_exceed_gate.nx" as *u8, 1, ctx, 0)
74 cell("T0" as *u8, "input-core" as *u8, "input handling + buffering" as *u8, "input" as *u8, "runtime/_hdl_build/nx_platformer_play.nx" as *u8, X, 2, ctx, 0)
75
76 w("-- Tier 1: 2D presentation & feel --\n" as *u8)
77 cell("T1" as *u8, "tilemap-sprite" as *u8, "tilemap + sprite rendering" as *u8, "tile-based" as *u8, X, "runtime/_hdl_build/nx_tile_render_gate.nx" as *u8, 2, ctx, 0)
78 cell("T1" as *u8, "font-text" as *u8, "font / text rendering" as *u8, "font" as *u8, "runtime/nx_nishi_font_core.nx" as *u8, "runtime/_hdl_build/nx_nishi_font_gate.nx" as *u8, 1, ctx, 0)
79 cell("T1" as *u8, "audio-synth" as *u8, "integer audio synthesis / mixing" as *u8, "audio" as *u8, X, X, 2, ctx, 0)
80 cell("T1" as *u8, "sprite-anim-fsm" as *u8, "animation state machine" as *u8, "animation" as *u8, X, X, 4, ctx, 0)
81
82 w("-- Tier 2: simulation primitives --\n" as *u8)
83 cell("T2" as *u8, "collision-int" as *u8, "integer collision & physics" as *u8, "collision" as *u8, "runtime/nx_wasm_platformer.nx" as *u8, "runtime/_hdl_build/nx_wasm_platformer_gate.nx" as *u8, 2, ctx, 0)
84 cell("T2" as *u8, "char-controller" as *u8, "kinematic character controller" as *u8, "platformer" as *u8, "runtime/nx_wasm_platformer.nx" as *u8, "runtime/_hdl_build/nx_platformer_play_gate.nx" as *u8, 2, ctx, 0)
85 cell("T2" as *u8, "entity-ecs" as *u8, "entity pool / ECS data-oriented" as *u8, "data-oriented" as *u8, X, "runtime/_hdl_build/nx_dod_cache_gate.nx" as *u8, 6, ctx, 0)
86 cell("T2" as *u8, "spatial-partition" as *u8, "quadtree/octree/grid proximity" as *u8, "quadtree" as *u8, X, X, 6, ctx, 0)
87 cell("T2" as *u8, "camera-2d" as *u8, "follow camera (look-ahead/deadzone)" as *u8, "camera" as *u8, X, X, 2, ctx, 0)
88
89 w("-- Tier 3: AI & world logic --\n" as *u8)
90 cell("T3" as *u8, "pathfind-astar" as *u8, "A* / Dijkstra grid pathfinding" as *u8, "pathfinding" as *u8, X, "runtime/_hdl_build/nx_pathfind_gate.nx" as *u8, 4, ctx, 0)
91 cell("T3" as *u8, "pathfind-scale" as *u8, "flow-field / HPA* / steering at scale" as *u8, "steering" as *u8, X, X, 6, ctx, 0)
92 cell("T3" as *u8, "ai-fsm-bt" as *u8, "FSM / behavior-tree AI" as *u8, "behavior tree" as *u8, "runtime/nx_game_engine_lib.nx" as *u8, "runtime/_hdl_build/nx_char_ai_gate.nx" as *u8, 1, ctx, 0)
93 cell("T3" as *u8, "ai-tactical" as *u8, "utility / influence / minimax+MCTS" as *u8, "monte carlo" as *u8, X, X, 5, ctx, 0)
94 cell("T3" as *u8, "fov-los" as *u8, "field of view / line of sight" as *u8, "line of sight" as *u8, X, X, 4, ctx, 0)
95 cell("T3" as *u8, "turn-scheduler" as *u8, "turn scheduling (energy/initiative)" as *u8, "turn-based" as *u8, "runtime/nx_game_engine_lib.nx" as *u8, X, 4, ctx, 0)
96
97 w("-- Tier 4: content systems --\n" as *u8)
98 cell("T4" as *u8, "procgen-core" as *u8, "noise / BSP / CA / WFC generation" as *u8, "procedural" as *u8, "runtime/_hdl_build/nx_game_scaffold.nx" as *u8, "runtime/_hdl_build/nx_procgen_gate.nx" as *u8, 3, ctx, 0)
99 cell("T4" as *u8, "procgen-solvable" as *u8, "solvability-guaranteed generation" as *u8, "maze" as *u8, "runtime/_hdl_build/nx_maze_gen.nx" as *u8, "runtime/_hdl_build/nx_maze_gate.nx" as *u8, 3, ctx, 0)
100 cell("T4" as *u8, "script-vm" as *u8, "game-logic scripting VM (logic-as-data)" as *u8, "scripting" as *u8, X, "runtime/_hdl_build/nx_story_vm_gate.nx" as *u8, 8, ctx, 0)
101 cell("T4" as *u8, "dialogue-quest" as *u8, "dialogue & quest engine (no-dead-end)" as *u8, "quest" as *u8, X, "runtime/_hdl_build/nx_story_quest_gate.nx" as *u8, 8, ctx, 0)
102 cell("T4" as *u8, "rules-engine" as *u8, "declarative grid/rules (maze: walls-as-data + win)" as *u8, "game mechanics" as *u8, "runtime/_hdl_build/nx_maze_gen.nx" as *u8, "runtime/_hdl_build/nx_maze_gate.nx" as *u8, 3, ctx, 0)
103 cell("T4" as *u8, "economy-sim" as *u8, "economy / supply-demand simulation" as *u8, "city-building" as *u8, X, X, 9, ctx, 0)
104 cell("T4" as *u8, "combat-frame" as *u8, "frame-data combat (hitbox/hurtbox)" as *u8, "fighting game" as *u8, X, X, 11, ctx, 0)
105 cell("T4" as *u8, "vehicle-physics" as *u8, "integer tire / vehicle dynamics" as *u8, "racing" as *u8, X, X, 13, ctx, 0)
106
107 w("-- Tier 5: persistence / streaming / pipeline --\n" as *u8)
108 cell("T5" as *u8, "save-persist" as *u8, "deterministic save / serialization" as *u8, "serialization" as *u8, "runtime/nx_game_engine_lib.nx" as *u8, X, 4, ctx, 0)
109 cell("T5" as *u8, "world-stream" as *u8, "chunked world streaming / voxel LOD" as *u8, "sandbox" as *u8, X, X, 14, ctx, 0)
110 cell("T5" as *u8, "spec-emitter" as *u8, "spec -> runnable game emitter" as *u8, "game engine" as *u8, "runtime/_hdl_build/nx_game_render.nx" as *u8, "runtime/_hdl_build/nx_game_scaffold_gate.nx" as *u8, 1, ctx, 0)
111
112 w("-- Tier 6: networking --\n" as *u8)
113 cell("T6" as *u8, "net-lockstep" as *u8, "deterministic lockstep (inputs only)" as *u8, "lockstep" as *u8, X, "runtime/_hdl_build/nx_lockstep_gate.nx" as *u8, 12, ctx, 0)
114 cell("T6" as *u8, "net-rollback" as *u8, "rollback netcode (resim)" as *u8, "rollback" as *u8, X, "runtime/_hdl_build/nx_rollback_gate.nx" as *u8, 18, ctx, 0)
115 cell("T6" as *u8, "net-prediction" as *u8, "client prediction + reconciliation" as *u8, "prediction" as *u8, X, "runtime/_hdl_build/nx_netpredict_gate.nx" as *u8, 15, ctx, 0)
116 cell("T6" as *u8, "net-authoritative" as *u8, "authoritative server" as *u8, "client-server" as *u8, X, X, 12, ctx, 0)
117 cell("T6" as *u8, "net-replication" as *u8, "entity replication / state sync" as *u8, "replication" as *u8, X, X, 15, ctx, 0)
118 cell("T6" as *u8, "net-interp" as *u8, "snapshot / entity interpolation" as *u8, "interpolation" as *u8, X, X, 15, ctx, 0)
119
120 w("-- MMO: distributed backend (grow toward MMOs) --\n" as *u8)
121 cell("MMO" as *u8, "mmo-authoritative" as *u8, "authoritative dedicated servers" as *u8, "massively multiplayer" as *u8, X, X, 19, ctx, 0)
122 cell("MMO" as *u8, "mmo-aoi" as *u8, "interest management / area-of-interest" as *u8, "dead reckoning" as *u8, X, X, 19, ctx, 0)
123 cell("MMO" as *u8, "mmo-sharding" as *u8, "sharding / zoning / instancing" as *u8, "shard" as *u8, X, X, 19, ctx, 0)
124 cell("MMO" as *u8, "mmo-persistence" as *u8, "durable scalable persistence (tiered)" as *u8, "eventual consistency" as *u8, X, X, 19, ctx, 0)
125 cell("MMO" as *u8, "mmo-identity" as *u8, "account / identity / auth" as *u8, "distributed computing" as *u8, X, X, 19, ctx, 0)
126
127 w("-- Synthesis: the autonomous-emit layer --\n" as *u8)
128 cell("SYN" as *u8, "spec-lang" as *u8, "declarative game-description language" as *u8, "game design" as *u8, "runtime/_hdl_build/nx_nishi_builder.nx" as *u8, "runtime/_hdl_build/nx_game_scaffold_gate.nx" as *u8, 3, ctx, 0)
129 cell("SYN" as *u8, "gen-content" as *u8, "content generators (level/quest/entity)" as *u8, "procedural" as *u8, "runtime/_hdl_build/nx_game_scaffold.nx" as *u8, "runtime/_hdl_build/nx_game_scaffold_gate.nx" as *u8, 3, ctx, 0)
130 cell("SYN" as *u8, "gate-solvable" as *u8, "solver/reachability playability gate" as *u8, "solver" as *u8, "runtime/_hdl_build/nx_maze_gen.nx" as *u8, "runtime/_hdl_build/nx_maze_gate.nx" as *u8, 20, ctx, 0)
131 cell("SYN" as *u8, "gate-playtest" as *u8, "MCTS/agent auto-playtest" as *u8, "monte carlo tree search" as *u8, X, X, 20, ctx, 0)
132 cell("SYN" as *u8, "evo-loop" as *u8, "evolutionary emit->test->improve loop" as *u8, "evolutionary" as *u8, X, X, 20, ctx, 0)
133
134 // NEG-CTL: fabricated rung -> must stay ABSENT (liar-kill armed)
135 cell("NEG" as *u8, "fabricated-rung" as *u8, "liar-kill control" as *u8, "zzzz-no-such-technique" as *u8, "runtime/_hdl_build/nx_FAKE_RUNG_NONEXISTENT.nx" as *u8, "runtime/_hdl_build/nx_FAKE_RUNG_NONEXISTENT.nx" as *u8, 99, ctx, 1)
136
137 // ---- UI/PRODUCT AXES (instrument standard 2026-07-10): OUR emitted games vs the NAMED DATED product bars.
138 // Bars: Godot 4.x (pb_godot_* banked 2026-07-09, rh_godot 29/30 recent commits + CI + 100% community
139 // 2026-07-10) / Luanti (rh 30/30+CI+87%) / Veloren (rh 26/30+CI+50%). Axes from nx_axis_discover
140 // common-core (physics sound server animation texture) + differentiators (editor multiplayer rendering).
141 // Scored honestly vs the bar trio; ub() accumulates ut[0]=us ut[1]=max.
142 let ut: *i64 = sys_mmap(16) as *i64
143 ut[0] = 0
144 ut[1] = 0
145 w("\n-- UI/PRODUCT AXES: our emitted games vs Godot/Luanti/Veloren (bars banked+dated) --\n" as *u8)
146 ub("U1 visual fidelity (vs Veloren voxel-GI-class 3D look)" as *u8, 0, 2, "{mineworld/platformer = flat-shaded blocks/tiles; no lighting-class visuals in emitted games; BAR Veloren shaders/clouds (pb_veloren_readme 2026-07-09)}" as *u8, ut)
147 ub("U2 interaction depth (vs Luanti move/build/craft/inventory)" as *u8, 1, 2, "{platformer move/jump + maze + mineworld place/break EXIST (gates green 2026-06/07); no inventory/craft/combat loops; BAR luanti lua_api 460KB}" as *u8, ut)
148 ub("U3 info design (HUD/menus/onboarding in emitted games)" as *u8, 0, 2, "{score text only; no menus/settings/save-UI/onboarding in ANY emitted game; BAR godot list_of_features UI toolkit (pb_godot_features 2026-07-09)}" as *u8, ut)
149 ub("U4 polish/feel (juice: easing/particles/screenshake/sound-feedback)" as *u8, 0, 2, "{HONEST 0: no easing/particles/audio-feedback in emitted games -- the operator's 'toy level' lives HERE; BAR all 3 products ship polish layers}" as *u8, ut)
150 ub("F1 common-core coverage (physics sound server animation texture)" as *u8, 1, 2, "{collision-physics + lockstep-server rungs EXCEED (gates); sound-synth ABSENT, animation-fsm ABSENT, texture-pipeline thin; axes = nx_axis_discover 2026-07-09 common-core 5/6}" as *u8, ut)
151 ub("F2 differentiator: EDITOR (vs Godot editor-class authoring)" as *u8, 1, 2, "{spec-lang + emitters = authoring-by-spec (scaffold gates green); no interactive editor; Godot editor = the bar (rh_godot 100% community health)}" as *u8, ut)
152 ub("E1 ecosystem context (bars healthy = bars CURRENT)" as *u8, 2, 2, "{bar trio verified LIVING 2026-07-10: rh_* maintained 26-30/30 recent commits + CI 3/3 -- comparisons are against CURRENT products, not stale ones (nx_repo_health_gate 7/7)}" as *u8, ut)
153 w(" U/PRODUCT SCORE = " as *u8)
154 wn((ut[0] * 1000) / ut[1])
155 w(" permille [" as *u8)
156 wn(ut[0])
157 w("/" as *u8)
158 wn(ut[1])
159 w("] -- the games are FOUNDATION-strong, PRODUCT-weak (honest; the climb = juice/UI/sound/animation)\n" as *u8)
160
161 w("\n TALLY: EXCEEDS="); wn(st[0]); w(" PRESENT="); wn(st[1]); w(" RESEARCHED="); wn(st[2]); w(" NOTED="); wn(st[3]); w(" ABSENT="); wn(st[4]); w(" liar="); wn(st[5]); w("\n")
162 let built: i64 = st[0] + st[1]
163 w(" BUILT (EXCEEDS+PRESENT)="); wn(built); w(" the foundational rungs already standing.\n" as *u8)
164
165 // PRIORITIZED GAP ROADMAP: the not-yet-built rungs in build-order (lowest prio number = build first)
166 w("\n=== PRIORITIZED GAP ROADMAP (build next, in order -> most genres emittable fastest) ===\n" as *u8)
167 let rc: i64 = rcbox[0]
168 var p: i64 = 1
169 while p <= 20 {
170 var i: i64 = 0
171 while i < rc {
172 if rp[i] == p {
173 w(" step "); wn(p); w(" ["); w(gstr(rg[i])); w("] "); w(rid[i] as *u8); w("\n")
174 }
175 i = i + 1
176 }
177 p = p + 1
178 }
179
180 w("\n" as *u8)
181 var ok: i64 = 1
182 if st[5] != 0 { w(" RED: a NEG-CTL fabricated rung graded PRESENT/EXCEEDS (liar-kill disarmed)\n" as *u8); ok = 0 }
183 if st[0] < 5 { w(" RED: fewer than 5 measured-EXCEEDS rungs on disk\n" as *u8); ok = 0 }
184 if ok == 1 { w("S-CLASS-FOUNDATION-CENSUS verdict=GREEN (foundation graded on-disk+corpus; gap roadmap emitted; liar-kill armed)\n" as *u8); sys_exit(0); return 0 }
185 w("S-CLASS-FOUNDATION-CENSUS verdict=RED\n" as *u8); sys_exit(1); return 1
186}