code wiki / (root) / nx_bench_scale_dist_emit_test.nx

nx_bench_scale_dist_emit_test.nx

buildroot/runtime/nx_bench_scale_dist_emit_test.nx

7880 B197 linesdepth 11pulls 45 transitivereach 0 importersview sourcekind gate/prooftopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_scale_dist_emit_test.nx -- distribution measurement at 3 scales. Composes [[nx_bench_stats]] over multiple scale points to produce a real variance-vs-load curve. 30 total independent runs: * 10 runs of v2 LLM 10-iter -> distribution A * 10 runs of v2 LLM 30-iter -> distribution B * 10 runs of v2 LLM 100-iter -> distribution C Emits all three distributions side-by-side to stdout so the operator sees how min/max/p50/p95/stddev scale with workload. Substrate-honest claim this measurement supports: * If p50 scales linearly with iter count and stddev scales roughly linearly too -> substrate is well-behaved. * If stddev grows faster than mean -> there's a load-dependent variance bug. * If p95/p50 ratio stays roughly constant across scales -> no tail-degradation under load.

dependencies 11 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_clock.nx nx_actor.nx nx_message.nx nx_session.nx nx_bench_companion.nx nx_bench_companion_timed.nx nx_bench_stats.nx nx_gguf_fixture_tiny.nx nx_bench_scale_dist_emit_test.

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_clock.nxnx_actor.nxnx_message.nxnx_session.nxnx_bench_companion.nxnx_bench_companion_timed.nxnx_bench_stats.nxnx_gguf_fixture_tiny.nxnx_actor_role_llm_v2.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 _collect_dist _drive_one_run nx_gft_build_tiny_llama sys_mmap ↻ nx_le_write_u64 nx_le_write_u32 _gft_mk_blk_name _gft_write_ti nx_le_write_u64 ↻ nx_le_write_u32 ↻ nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nx_model_spec_new sys_mmap ↻ nx_model_spec_validate nx_norm_is_valid nx_act_is_valid nx_pos_is_valid nx_ffn_is_valid nx_bpe_vocab_new sys_mmap ↻ nx_intern_new nx_intern_next_pow2 nx_hash_new nx_bpe_add_token nx_intern_get nx_hash_fnv1a_bytes nx_hash_get nx_intern_bytes_eq nx_hash_put nx_prng_init

structs

none

consts

none

functions

32func _emit_dec_i64(fd: i64, n: i64) -> i64
called by 1: _emit_dist_row calls 2: sys_mmapsys_write
53func _emit_str(fd: i64, s: *u8, n: i64) -> i64 { sys_write(fd, s, n); return 0 }
called by 1: _emit_dist_row calls 1: sys_write
54func _emit_tab(fd: i64) -> i64 { let t: *u8 = sys_mmap(1); t[0] = 0x09 as u8; sys_write(fd, t, 1); return 0 }
called by 1: _emit_dist_row calls 2: sys_mmapsys_write
55func _emit_nl(fd: i64) -> i64 { let n: *u8 = sys_mmap(1); n[0] = 0x0A as u8; sys_write(fd, n, 1); return 0 }
called by 1: _emit_dist_row calls 2: sys_mmapsys_write
58func _drive_one_run(prng_seed: i64, n_iters: nx_int, now: nx_size) -> i64
89func _collect_dist(samples: *i64, n_runs: nx_int, n_iters: nx_int,
called by 1: main calls 1: _drive_one_run
102func _emit_dist_row(label: *u8, label_len: nx_int,
124func main() -> i64