code wiki / _hdl_build / nx_worldsim_gate.nx

nx_worldsim_gate.nx

buildroot/runtime/_hdl_build/nx_worldsim_gate.nx

8851 B219 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_worldsim_gate.nx -- CERTIFICATION of nx_worldsim (gamebench rank 1, hard GAP, Strive:Conquest keystone). T1 ★CONSERVATION -- 500 randomised trades move wealth without minting or burning a single unit T2 ★SYMMETRIC RELATIONS -- rel(A,B) and rel(B,A) can never disagree, after arbitrary one-sided edits T3 ACCOUNTED PRODUCTION -- a tick adds EXACTLY ws_production(), no more, no less T4 DETERMINISM -- two worlds, same seed, 200 ticks -> identical state T5 BOUNDED -- relations clamp to [-1000,1000]; resources never go negative; overdraw is refused T6 NO SELF-DEALING -- a faction cannot trade with itself or edit its own relation T7 ★ANTI-VACUITY -- the world actually EVOLVES (wealth grows, relations move). A frozen world would satisfy conservation, symmetry and determinism perfectly while simulating nothing. T8 composes with nx_gamesave: a whole world arena round-trips through save/load license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_worldsim.nx nx_gamesave.nx nx_worldsim_gate.nx

imports: nx_syscalls.nxnx_worldsim.nxnx_gamesave.nx

imported by: nobody (leaf or entry point)

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

main ww sys_write sys_mmap ws_bytes ws_words seedworld ws_init ws_o_res ws_o_pop ws_nfac ws_o_terr ws_nfac ↻ ws_o_rel ws_nfac ↻ ws_set_res ws_o_res ↻ ws_set_pop ws_o_pop ↻ ws_clamp ws_set_terr ws_o_terr ↻ ws_clamp ↻ ws_total_res ws_nfac ↻ ws_o_res ↻ ws_rng ws_trade ws_nfac ↻ ws_o_res ↻ ws_adjust_rel ws_nfac ↻ ws_rel_idx ws_o_rel ↻ ws_nfac ↻ ws_clamp ↻ ws_res ws_o_res ↻ wn sys_write ↻

structs

none

consts

none

functions

16func ww(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 1: main calls 1: sys_write
17func wn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
26func seedworld(a: *i64, n: i64, seed: i64) -> i64
38func main() -> i64