code wiki / (root) / nx_bandwidth_ladder.nx

nx_bandwidth_ladder.nx

buildroot/runtime/nx_bandwidth_ladder.nx

4514 B68 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_bandwidth_ladder.nx -- GENEALOGIST physics grade, 3rd axis: MEMORY BANDWIDTH (for streaming ops). Latency is the floor for random lookups (graded: at it). FLOP is the floor for compute (graded: ~468x off). BANDWIDTH is the floor for STREAMING -- scans, fills, copies, framebuffer clears, segment reads: you cannot process a stream faster than memory delivers it. This measures read bandwidth on a 128MB array (> any cache, so DRAM-bound) single-thread and multicore (fork: more cores saturate more memory channels toward the DRAM ceiling), proves the multicore sum is bit-identical to serial, and grades streaming at the bandwidth floor. Sovereign: sys_mmap_shared + sys_fork + sys_wait4 + sys_now_us. KAT: bandwidth measured; multicore saturates MORE than single-thread (channel parallelism); sums identical. No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_bandwidth_ladder.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main bw_puts sys_write sys_mmap_shared sys_now_us sys_mmap sys_clock_gettime_mono bw_sum sys_mmap ↻ sys_fork sys_exit sys_wait4 bw_num sys_mmap ↻ sys_write ↻

structs

none

consts

11const K_MAGIC_16000000: i64 = 16000000

functions

13func bw_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
14func bw_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func bw_sum(arr: *i64, lo: i64, hi: i64) -> i64 { var s: i64=0; var i: i64=lo; while i<hi { s=s+arr[i]; i=i+1 } return s }
called by 1: main
19func main() -> i64