code wiki / (root) / nx_nofloat_autograd_ddp_gate.nx

nx_nofloat_autograd_ddp_gate.nx

buildroot/runtime/nx_nofloat_autograd_ddp_gate.nx

8194 B168 linesdepth 3pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_autograd_ddp_gate.nx -- DEEPER R4->LLM: bit-reproducible data-parallel training driven by the REAL no-float autograd tape (vs the linear/SGD stand-in in nx_nofloat_ddp_train_gate). (knowledge/research/2026-06-23-fabric-applies-to-room-and-elsewhere.md ยง4.) Each of D workers builds the SAME SSE loss graph on its OWN sample shard via the general Q16 autograd (nfa_leaf/nfa_matvec/nfa_mse/nfa_vadd -> one nfa_backward reverse sweep -> nfa_grad), extracts its W gradient, then R4's `ring_allreduce` sums the per-worker gradients and `nfa_sgd` applies the update. THE EXCEED: the updated weights are BYTE-IDENTICAL across D in {1,2,4,8} AND equal to a single-process full-batch step -- because the autograd is exact integer (associative) AND the all-reduce is order- independent. Real trainer components, not a stand-in. Float DDP/NCCL cannot guarantee this. Composes the verified nx_nofloat_autograd (gate B/C pattern) + nx_fabric_collective.ring_allreduce. HONEST SCOPE: a linear W[1x8] model trained by the GENERAL tape (same engine the Q16 transformer uses); N logical workers in one box. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_nofloat_autograd.nx nx_fabric_collective.nx nx_gate_verdict.nx nx_nofloat_autograd_ddp_gate.n

imports: nx_nofloat_autograd.nxnx_fabric_collective.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main ap dda_step dda_build nfa_leaf nfa_new nfa_matvec nfa_new ↻ nfa_mse nfa_new ↻ nfa_vadd nfa_new ↻ nfa_backward nfa_qmul nfa_silud nfa_sigmoid nfa_fxexp nfa_qmul ↻ nfa_isqrt vm_isqrt nfa_fxexp ↻ nfa_cosf nfa_reduce2pi nfa_cosq nfa_qmul ↻ nfa_sinf nfa_reduce2pi ↻ nfa_sinq nfa_qmul ↻ nfa_grad ring_allreduce sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻

structs

none

consts

none

functions

25func dda_build(tape: *i64, vals: *i64, st: *i64, Wp: *i64, X: *i64, Y: *i64, s0: i64, s1: i64, V: i64, outW: *i64) -> i64
43func dda_step(D: i64, S: i64, V: i64, Wp: *i64, X: *i64, Y: *i64, tape: *i64, vals: *i64, grads: *i64, st: *i64, lr: i64, outWp: *i64) -> i64
66func dda_single(S: i64, V: i64, Wp: *i64, X: *i64, Y: *i64, tape: *i64, vals: *i64, grads: *i64, st: *i64, lr: i64, outWp: *i64) -> i64
79func ap(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
80func an(v: i64) -> i64
called by 1: main
90func aeq(a: *i64, b: *i64, V: i64) -> i64 { var i: i64 = 0; while i < V { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
92func main() -> i64