code wiki / (root) / nx_fabric_collective_gate.nx

nx_fabric_collective_gate.nx

buildroot/runtime/nx_fabric_collective_gate.nx

6390 B129 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic fabric
docsdependenciesstructsconstsfunctions

about

nx_fabric_collective_gate.nx -- LIVE GATE for R4 (collective communication: ring all-reduce). Proves ring all-reduce is byte-exact correct AND its per-process bottleneck stays ~constant as N grows, where naive root-based all-reduce bottlenecks at O(N) -- with negative controls. criteria: 1 ring all-reduce byte-exact correct (N=8) (the algorithm is REAL, not a cost model) 2 naive all-reduce byte-exact correct (N=8) (baseline sanity) 3 ring bottleneck * 3 <= naive bottleneck (N=8) (>=3x less per-process data; actual ~Nx) 4 ring max_bytes(N=16) <= 2 * ring max_bytes(N=4) (ring per-process BOUNDED as N grows) 5 naive max_bytes(N=16) >= 3 * naive max_bytes(N=4)(naive root grows ~linearly -- the contrast) negative controls: NC1 ring with the REDUCTION disabled -> WRONG result (the sum is load-bearing, not the shuffle) NC2 ring correct at N=4 AND N=16 (correct across scale, not a fixed-N fluke) NC3 ring(N=8) result == naive(N=8) result byte-exact (two independent algorithms agree) expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_fabric_collective.nx nx_fabric_collective_gate.nx

imports: nx_fabric_collective.nx

imported by: nobody (leaf or entry point)

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

main gp gn col_run sys_mmap col_mod show gp ↻ gn ↻ chk gp ↻ sys_openat_append fdn

structs

none

consts

none

functions

19func gp(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 3: chkshowmain
20func gn(v: i64) -> i64
called by 2: showmain
30func fdn(fd: i64, v: i64) -> i64
called by 1: main
39func chk(name: *u8, ok: i64) -> i64
called by 1: main calls 1: gp
43func show(tag: *u8, m: *ColMetrics) -> i64
called by 1: main calls 2: gpgn
48func main() -> i64