code wiki / (root) / nx_pipeline_test.nx

nx_pipeline_test.nx

buildroot/runtime/nx_pipeline_test.nx

3486 B96 linesdepth 8pulls 15 transitivereach 0 importersview sourcekind gate/prooftopic pipeline
docsdependenciesstructsconstsfunctions

about

nx_pipeline_test.nx -- 3-stage pipeline stress + backpressure check. Pipeline: input -> [stage 0: x*2] -> [stage 1: x+1] -> [stage 2: x*10] Each stage runs n_workers parallel workers. Output of input i is ((i*2)+1)*10 = 20i + 10. Push 100 inputs, drain 100 outputs, verify EVERY output's value is in the expected set {20i + 10 | i in 0..99}. Don't require FIFO across stages because parallel workers within a stage may reorder.

dependencies 6 imports · 0 importers

nx_kernel_v2.nx nx_log.nx nx_atom.nx nx_thread_pool.nx nx_pipeline.nx nx_hw.nx nx_pipeline_test.nx

imports: nx_kernel_v2.nxnx_log.nxnx_atom.nxnx_thread_pool.nxnx_pipeline.nxnx_hw.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_hw_worker_count nx_hw_cpu_count sys_mmap sys_munmap nx_pool_new nx_hw_worker_count ↻ sys_mmap ↻ nx_chan_new sys_mmap ↻ _nx_chan_cell sys_thread_create nx_thread_spawn sys_mmap ↻ nx_thread_spawn_fn sys_mmap ↻ nx_pipeline_new nx_hw_worker_count ↻ sys_mmap ↻ nx_pipeline_add_stage _nx_pipe_stage_at nx_chan_new ↻ nx_pipeline_start _nx_pipe_stage_at ↻ nx_pool_submit nx_atom_faa_i64 nx_chan_send nx_chan_try_send _nx_chan_cell ↻ nx_thread_yield _pool_futex_wake_all sys_futex_wake nx_pipeline_push nx_chan_send ↻ nx_pipeline_recv nx_chan_recv sys_mmap ↻ nx_chan_try_recv _nx_chan_cell ↻ nx_thread_yield ↻

structs

none

consts

18const N_INPUTS: i64 = 64

functions

20func stage0_double(x: i64) -> i64 { return x * 2 }
21func stage1_add1(x: i64) -> i64 { return x + 1 }
22func stage2_x10(x: i64) -> i64 { return x * 10 }
24func main() -> nx_exit