code wiki / (root) / nx_bench_companion.nx

nx_bench_companion.nx

buildroot/runtime/nx_bench_companion.nx

8374 B212 linesdepth 4pulls 8 transitivereach 17 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_companion.nx -- substrate-honest measurement primitive for parallel-companion scenarios. Captures EVERY measurable axis from a running [[nx_session]] into one structured report. Designed for substrate-internal counters (deterministic + paired) so qemu-riscv64 produces meaningful comparison numbers BEFORE the physical-hardware run lands. Per CARDINAL [[feedback-no-strawman-perf-comparisons]]: this primitive emits ONLY measured counters from real substrate calls. No throughput ratio is claimed without paired measurement of the SAME workload on the SAME substrate (e.g. nx_actor_role_llm v1 vs v2; or future Nishi vs llama.cpp on identical Llama-7B Q4_K). V1 ships the counter-tabulation primitive + the report struct. V2 will add the run-N-iterations loop that drives a session through multiple cycles and accumulates the deltas. V3 will add TSV emission via nx_runtime fact stream for cross-session comparison.

dependencies 8 imports · 17 importers

nx_syscalls.nx nx_tier.nx nx_actor.nx nx_message.nx nx_stream_multiplexer.nx nx_resource_arbiter.nx nx_interrupt_broker.nx nx_session.nx nx_bench_companion.nx nx_bench_companion_test.nx nx_bench_companion_timed.nx nx_bench_companion_timed_test.nx nx_bench_companion_tsv.nx nx_bench_companion_tsv_parse.nx nx_bench_companion_tsv_parse_test. nx_bench_companion_tsv_test.nx nx_bench_dist_emit_test.nx nx_bench_dist_persist_test.nx nx_bench_scale_dist_emit_test.nx

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

imports: nx_syscalls.nxnx_tier.nxnx_actor.nxnx_message.nxnx_stream_multiplexer.nxnx_resource_arbiter.nxnx_interrupt_broker.nxnx_session.nx

imported by: nx_bench_companion_test.nxnx_bench_companion_timed.nxnx_bench_companion_timed_test.nxnx_bench_companion_tsv.nxnx_bench_companion_tsv_parse.nxnx_bench_companion_tsv_parse_test.nxnx_bench_companion_tsv_test.nxnx_bench_dist_emit_test.nxnx_bench_dist_persist_test.nxnx_bench_scale_dist_emit_test.nxnx_bench_scale_test.nxnx_bench_stress_autoreg_test.nxnx_bench_stress_emit_test.nxnx_bench_v1_vs_v2_test.nxnx_dual_real_llm_compose_test.nxnx_dual_real_llm_emit_test.nxnx_quad_real_emit_test.nx

structs

52struct NxBenchReport

consts

32const NX_BC_V_OK: nx_int = 0
33const NX_BC_V_NULL_SESSION: nx_int = 1
34const NX_BC_V_NULL_REPORT: nx_int = 2
35const NX_BC_V_SESSION_NOT_READY: nx_int = 3
36const NX_BC_V_INVALID: nx_int = 4
37const NX_BC_V_N: nx_int = 5
74const NX_BC_REPORT_BYTES: nx_int = 152 // 19 fields * 8

functions

39func nx_bc_v_is_valid(v: nx_int) -> nx_int
called by 1: main
78func nx_bc_report_new() -> *NxBenchReport
called by 11: mainmainmainmain_run_scalemain+5 calls 1: sys_mmap
109func nx_bc_capture(s: *NxSession,
169func nx_bc_diff(a: *NxBenchReport,
called by 4: mainmainmainmain
199func nx_bc_report_verdict(r: *NxBenchReport) -> nx_int
called by 1: main
204func nx_bc_report_actors_completed(r: *NxBenchReport) -> nx_int
called by 1: main
209func nx_bc_report_total_steps(r: *NxBenchReport) -> nx_int
called by 1: main