nx_parallel_test.nx
buildroot/runtime/nx_parallel_test.nx
about
nx_parallel_test.nx -- larger-scale parallel primitive stress.
T1: parallel_map of N elements where every input is the counter
address; fn FAA-bumps the counter. Functionally equivalent
to parallel_for(0, N, bump) but avoids the pre-existing
static-i64-from-main codegen bug documented in
[[project-nx-threads-bedrock-2026-05-15]] pitfalls.
T2: parallel_map: square 4096 elements, verify each.
T3: parallel_reduce: sum 1..1000 == 500500.
dependencies 6 imports · 0 importers
imports: nx_kernel_v2.nxnx_log.nxnx_atom.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
| 18 | const T1_ITERS: i64 = 4000 |
| 19 | const MAP_LEN: i64 = 4096 |
| 20 | const REDUCE_LEN: i64 = 1000 // sum 1..1000 = 1000*1001/2 = 500500 |
functions
| 24 | func bump_via_addr(addr_as_i64: i64) -> i64 calls 1: nx_atom_faa_i64 |
| 30 | func square(x: i64) -> i64 { return x * x } |
| 31 | func iadd(a: i64, b: i64) -> i64 { return a + b } |
| 33 | func main() -> nx_exit |