code wiki / (root) / nx_bench_scale_test.nx

nx_bench_scale_test.nx

buildroot/runtime/nx_bench_scale_test.nx

6724 B168 linesdepth 11pulls 45 transitivereach 0 importersview sourcekind gate/prooftopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_scale_test.nx -- substrate scaling under increasing workload. Runs the v2 LLM actor at 3 different iteration counts (10 / 30 / 100) and emits ONE TSV row + wallclock_elapsed_us per scale to stdout. Each scale is an INDEPENDENT measurement: fresh session, fresh fixture, fresh PRNG seed, fresh wall-clock window. What this answers: * Does wall-clock scale ROUGHLY LINEARLY with iteration count? If yes -> substrate has no quadratic overhead under load. If no -> there's a scaling bug we need to find. * Do counters scale exactly linearly? (They should: 3 phases per iteration * N iterations = 3*N actor steps; 1000us logical per step = 3000*N us logical runtime.) Output format: standard nx_bench TSV header once, then one row per scale (labels "scale_v2_10" / "scale_v2_30" / "scale_v2_100") plus per-scale wallclock_elapsed_us lines. Operator can pipe to file + sort -t$'\t' -k7n to see the scaling curve. HONEST SCOPE: qemu-riscv64 wall-clock includes interpreter overhead; the SHAPE of the scaling (linear vs quadratic) is what matters, not the absolute numbers. Physical-hardware run will refine the absolute numbers; the shape claim should hold across both.

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_companion_tsv.nx nx_gguf_fixture_tiny.nx nx_bench_scale_test.nx

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_companion_tsv.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 nx_bc_emit_tsv_header sys_mmap ↻ sys_write _run_scale 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_hash_probe

structs

none

consts

none

functions

38func _emit_dec_i64(fd: i64, n: i64) -> i64
called by 1: _run_scale calls 2: sys_mmapsys_write
57func _emit_elapsed_label(fd: i64) -> i64
called by 1: _run_scale calls 2: sys_mmapsys_write
75func _run_scale(n_iters: nx_int,
131func main() -> i64