nx_sum_bench_all.nx
buildroot/runtime/nx_sum_bench_all.nx
about
nx_sum_bench_all.nx -- comprehensive sum-of-N-i64 bench across
all NishiLang paths for cross-language comparison.
Same workload as sum_c.c (N=1M i64 sum, 100 reps) but exercises
every parallelism axis NishiLang ships:
1. scalar single-thread, no SIMD
2. parallel_reduce MIMD across pool workers
3. SIMD-only i64x4 horizontal reduce in chunks of 4
4. parallel + SIMD per-chunk SIMD reduce, parallel across chunks
All paths produce bit-exact results vs the scalar reference.
Wall-time numbers are reported but qemu interpretive emulation
distorts both MIMD (single-CPU emulator) and SIMD (per-lane
interpretive cost), so the wall-time signal is noisy -- see
docs/PERF_NISHI_VS_C.md for the honest interpretation.
dependencies 7 imports · 0 importers
imports: nx_kernel_v2.nxnx_log.nxnx_atom.nxnx_clock.nxnx_thread_pool.nxnx_parallel.nxnx_hw.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 32 | const N: i64 = 1000000 |
| 33 | const REPS: i64 = 10 // fewer reps than C bench -- |
functions
| 36 | func scalar_sum(arr: *i64) -> i64 called by 1: main |
| 43 | func simd_sum(arr: *i64) -> i64 called by 1: main |
| 55 | func iadd(a: i64, b: i64) -> i64 { return a + b } |
| 57 | func main() -> nx_exit |