code wiki / _hdl_build / nx_rpgstats_gate.nx

nx_rpgstats_gate.nx

buildroot/runtime/_hdl_build/nx_rpgstats_gate.nx

10361 B218 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_rpgstats_gate.nx -- CERTIFICATION of nx_rpgstats (gamebench gap-queue rank 1 after save/load landed). T1 XP curve strictly monotonic across 1..200 (a character can never fail to progress) T2 level_for_xp is the EXACT inverse of xp_for_level at every boundary and boundary-1 T3 ★MODIFIER STACKING IS ORDER-INDEPENDENT -- forward, reversed and rotated orders agree. This is the real bug class: +10 then +20% != +20% then +10 in most engines, so buff order silently changes outcomes and desyncs multiplayer. T4 saturation: absurd inputs clamp instead of overflowing into negative HP / wrapped levels T5 skill advancement monotonic in uses and capped at maxrank T6 DATA-DRIVEN: changing only the curve/formula parameters changes the outputs (proves the numbers are configuration, not literals baked into the code -- rule 11) T7 ANTI-VACUITY: a normal progression yields DISTINCT, sensibly ordered values. Without this a part that returned a constant (or zero) would satisfy monotonicity and clamping vacuously. T8 ★COMPOSES WITH nx_gamesave: a built character round-trips through gs_save/gs_load unchanged. This is the recombinator claim under test -- parts must actually compose, not just coexist. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_rpgstats.nx nx_gamesave.nx nx_gate_verdict.nx nx_rpgstats_gate.nx

imports: nx_syscalls.nxnx_rpgstats.nxnx_gamesave.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main rw sys_write rs_xp_for_level rs_smul rs_sadd rs_clamp rn sys_write ↻ sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ rs_level_for_xp rs_xp_for_level ↻ sys_mmap ↻ rs_apply_mods rs_sadd ↻ rs_smul ↻ rs_clamp ↻ rs_derived_hp rs_sadd ↻ rs_smul ↻ rs_clamp ↻ rs_skill_rank sys_unlinkat gs_save sys_mmap ↻ put64

structs

none

consts

none

functions

21func rw(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
22func rn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
32func main() -> i64