code wiki / _hdl_build / nx_play_parity.nx

nx_play_parity.nx

buildroot/runtime/_hdl_build/nx_play_parity.nx

9838 B218 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_play_parity.nx -- the NATIVE GAME-PARITY TESTER (operator: "build a native tester in the nishi ecosystem ... like how google plays games, you could tell if it really is the same as a game we are competing against"). A SOVEREIGN agent that PLAYS a Nishi game (drives real inputs + reads real game state -- NOT a unit-gate checkbox, NOT 3rd-party playwright) and measures it against a named COMPETITOR capability-by-capability, producing an honest PARITY SCORE + the missing-capabilities list. This V1 targets the tactics engine (nx_tactics_engine_lib, cleanly native-drivable) vs XCOM / Into the Breach. Each capability is a PROBE that actually does the action and verifies the effect. Crucially it also probes a capability the game is KNOWN to LACK (fog-of-war) so the score is honest and the tester is proven non-rubber-stamp (the self-gate requires the absent capability to come back ABSENT). SELF-GATE (no args): PLAY-PARITY-GATE verdict=GREEN iff the tester is HONEST -- all 7 known-present capabilities detected PRESENT and the known-absent one (fog-of-war) detected ABSENT. The PARITY SCORE (7/8 -- same core, missing fog-of-war) is the OUTPUT answer to "is it really the same as XCOM". Writes knowledge/status/play_parity.log + knowledge/status/parity_tactics.tsv (data surface, auto-published by nx_game_publish). NEXT: minecraft_parity manifest + drive the voxel sim -> Minecraft-parity score. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tactics_engine_lib.nx nx_play_parity.nx

imports: nx_syscalls.nxnx_tactics_engine_lib.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap p_grid_block teng_init teng_build teng_cell_set teng_rng teng_cell_get teng_nunits teng_place_unit teng_rng ↻ teng_cell_get ↻ teng_unit_at teng_nunits ↻ teng_first_player teng_nunits ↻ teng_move_unit teng_cell_get ↻ teng_unit_at ↻ p_cover teng_init ↻ teng_chance p_range teng_init ↻ teng_nearest_foe teng_nunits ↻ teng_dist teng_abs teng_shoot teng_nearest_foe ↻ teng_dist ↻ teng_cell_get ↻ teng_chance ↻ teng_rng ↻ p_enemy_pursue teng_init ↻ teng_nearest_foe ↻ teng_dist ↻ teng_enemy_turn teng_nunits ↻

structs

none

consts

20const K_MAGIC_1000003: i64 = 1000003
21const K_MAGIC_6000: i64 = 6000
22const K_MAGIC_8192: i64 = 8192
23const K_MAGIC_12345: i64 = 12345

functions

25func pp_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 3: pp_cap_rowpp_tsv_rowmain calls 1: sys_write
26func pp_c(fd: i64, c: i64) -> i64 { let b: *u8 = sys_mmap(8); b[0] = c as u8; sys_write(fd, b, 1); return 0 }
27func pp_wn(fd: i64, v: i64) -> i64
called by 1: main calls 3: pp_csys_mmapsys_write
39func pp_bot(st: *i64, cap: i64) -> i64
70func pp_hash(st: *i64) -> i64
called by 1: p_determinism calls 1: teng_nunits
79func p_grid_block(st: *i64, cfg: *i64) -> i64
called by 1: main calls 2: teng_initteng_move_unit
88func p_cover(st: *i64, cfg: *i64) -> i64
called by 1: main calls 2: teng_initteng_chance
93func p_range(st: *i64, cfg: *i64) -> i64
105func p_enemy_pursue(st: *i64, cfg: *i64) -> i64
116func p_win(st: *i64, cfg: *i64) -> i64
125func p_lose(st: *i64, cfg: *i64) -> i64
called by 1: main calls 2: teng_initteng_check_end
133func p_determinism(st: *i64, cfg: *i64) -> i64
called by 1: main calls 3: teng_initpp_botpp_hash
141func p_fog_of_war(st: *i64, cfg: *i64) -> i64 { return 0 }
called by 1: main
143func pp_cap_row(fd: i64, name: *u8, present: i64) -> i64
called by 1: main calls 1: pp_w
148func pp_tsv_row(fd: i64, name: *u8, present: i64) -> i64
called by 1: main calls 2: pp_wpp_c
154func main() -> i64