code wiki / _hdl_build / nx_playtest_creature.nx

nx_playtest_creature.nx

buildroot/runtime/_hdl_build/nx_playtest_creature.nx

6220 B101 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_playtest_creature.nx -- a SOVEREIGN AUTOMATED PLAYTESTER (the Google/DeepMind-style "agents actually play the game" tooling, built hardware-rung-up). It drives nx_creature_game BLACK-BOX (only cg_status/cg_nlegal/ cg_observe/cg_step -- no privileged internals), across many seeds x two policies (RANDOM exploration + a HEURISTIC player), checking INVARIANTS every step (state stays valid, a legal move always exists while ongoing, the game always TERMINATES). Then it renders an HONEST verdict that CAN FAIL: a game is PLAYABLE only if 0 invariant violations, 0 hangs/softlocks, it is WINNABLE under good play, AND it has real fail states + skill depth (heuristic beats random). If this fails, our game ecosystem is not delivering a real game yet. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_creature_game.nx nx_syscalls.nx nx_playtest_creature.nx

imports: nx_creature_game.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main w sys_write wn w ↻ sys_mmap sys_write ↻ sys_mmap ↻ pt_run pt_session cg_init sys_mmap ↻ cb_set cb_addmove sys_mmap ↻ cg_status cg_observe cg_nlegal pt_inv pol_rng cg_step cg_rng st_rngbox cw_spawn cb_set ↻ cb_addmove ↻ cw_set_catch cw_try_catch cw_catch_a cb_rng st_rngbox ↻ cg_wild_attacks cb_best cb_eff cb_damage cb_eff ↻ cb_rng ↻ st_rngbox ↻ cb_damage ↻ sys_exit

structs

none

consts

10const N_MAGIC_1103515245: i64 = 1103515245
11const N_MAGIC_12345: i64 = 12345
12const N_MAGIC_32767: i64 = 32767
13const N_MAGIC_2654435761: i64 = 2654435761
15const N_SESS: i64 = 64

functions

17func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: wnmain calls 1: sys_write
18func 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 }
called by 1: main calls 3: wsys_mmapsys_write
19func pol_rng(b: *i64) -> i64 { var x: i64 = b[0]; x = x*N_MAGIC_1103515245 + N_MAGIC_12345; b[0]=x; return (x >> 16) & N_MAGIC_32767 }
called by 1: pt_session
22func pt_inv(o: *i64, nlegal: i64, status: i64) -> i64
called by 1: pt_session
35func pt_session(seed: i64, policy: i64, vbox: *i64) -> i64
63func pt_run(policy: i64, base: i64, r: *i64, vbox: *i64) -> i64
called by 1: main calls 1: pt_session
74func main(argc: i64, argv: *i64) -> i64