code wiki / (root) / nx_caplab_sim_test.nx

nx_caplab_sim_test.nx

buildroot/runtime/nx_caplab_sim_test.nx

4380 B100 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic caplab
docsdependenciesstructsconstsfunctions

about

nx_caplab_sim_test.nx -- gate for Capitalism Lab R3 (the tick-loop engine). Proves: (1) one tick banks the right profit per firm, (2) cash accumulates across many ticks, (3) production CAPACITY caps sales, (4) the sim is DETERMINISTIC (same inputs -> byte-identical cash, replay-safe), (5) the AI competitor undercuts but never prices below cost, (6) NEG-CONTROL: a firm priced out of the market earns nothing, (7) the CAPITALISM_LAB game config.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_caplab_sim.nx nx_caplab_sim_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_caplab_sim.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 println sys_write strlen sys_mmap ↻ mk2 sys_mmap ↻ nx_clab_sim_tick sys_mmap ↻ nx_clab_split nx_clab_appeal_sum nx_clab_appeal sys_mmap ↻ nx_clab_appeal ↻ nx_assert_eq print sys_write ↻ strlen ↻ print_i64 sys_mmap ↻ itoa sys_mmap ↻ sys_write ↻ println ↻ nx_clab_sim_run sys_mmap ↻ nx_clab_sim_tick ↻ nx_clab_ai_price nx_clab_mode_init print ↻ print_i64 ↻

structs

none

consts

none

functions

14func nx_assert_eq(label: *u8, got: nx_int, want: nx_int, pass_n: *nx_int, fail_n: *nx_int)
called by 1: main calls 3: printprint_i64println
26func mk2(a: nx_int, b: nx_int) -> *i64
called by 1: main calls 1: sys_mmap
33func main() -> nx_exit