nx_par_pool.nx
buildroot/runtime/nx_par_pool.nx
about
nx_par_pool.nx -- SOVEREIGN persistent worker POOL via PIPES (robust fix; busy-spin deadlocked on LICM,
ledger #21). Forks PP_NW workers ONCE; dispatches MANY matmuls via per-worker go/done PIPES -- kernel-
BLOCKING read/write (no busy-spin, no LICM hazard, no idle CPU burn). Data (A/B/C) in sys_mmap_shared (set
up BEFORE fork). Dispatch = write 1 byte to a worker's go-pipe; the worker computes its fixed range then
writes 1 byte to its done-pipe; shutdown = close the go-pipe (read returns 0 -> worker exits). Pure syscalls
(pipe2/fork/read/write/close/wait4) -- NO libvulkan/CUDA/pthread. Proves: fork-once + blocking dispatch =>
N-core speedup that HOLDS across many calls without per-call fork. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_f32.nxnx_f32_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
| 13 | const PP_M: i64 = 256 |
| 14 | const PP_K: i64 = 256 |
| 15 | const PP_N: i64 = 256 |
| 16 | const PP_NW: i64 = 8 |
| 17 | const PP_ITERS: i64 = 20 |
functions
| 19 | func pp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 24 | func pp_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 26 | func pp_mm_range(A: *i64, B: *i64, C: *i64, K: i64, N: i64, lo: i64, hi: i64) -> i64 |
| 41 | func pp_worker(w: i64, go_rd: i64, done_wr: i64, A: *i64, B: *i64, C: *i64, M: i64, K: i64, N: i64) -> i64 |
| 57 | func main() -> i64 |