code wiki / _hdl_build / nx_nofloat_muon_gate.nx

nx_nofloat_muon_gate.nx

buildroot/runtime/_hdl_build/nx_nofloat_muon_gate.nx

7476 B151 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_muon_gate.nx -- gate: the FULL Per-Head Muon optimizer loop (momentum + NS-orthogonalize + apply), deterministic, per-head. Honest scope: proves the OPTIMIZER STEP mechanics + the novel exceed (bit-exact), NOT a full training convergence run (that rides the GPU seat F101). T1 MOMENTUM heavy-ball: repeated aligned grads grow the buffer beyond a single grad (geometric sum) T2 ORTHOGONALIZED update: U = NS(momentum) has far lower orthogonality error than the raw momentum T3 UPDATE APPLIED EXACTLY: W_after == W_before - lr*U elementwise (mechanical correctness) T4 DETERMINISTIC: two identical per-head runs -> bit-identical weights (the exceed: float Muon drifts) T5 PER-HEAD INDEPENDENCE: perturbing head-0's grad changes head-0's W but NOT head-1's W T6 STABLE: 12 steps stay bounded (no blowup) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 4 imports · 0 importers

nx_nofloat_muon.nx nx_nofloat_muon_ns.nx nx_gate_verdict.nx nx_syscalls.nx nx_nofloat_muon_gate.nx

imports: nx_nofloat_muon.nxnx_nofloat_muon_ns.nxnx_gate_verdict.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ ug_copy mu_momentum ug_l1 ug_abs gv_check gv_puts ↻ mn_ortho_err sys_mmap ↻ mn_transpose mn_mm mn_orthogonalize mn_orthogonalize_it mn_isqrt sys_mmap ↻ mn_transpose ↻ mn_mm ↻ mn_comb mu_step mu_momentum ↻ mn_orthogonalize ↻ mu_apply mu_perhead_step mu_step ↻ ug_abs ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻

structs

none

consts

16const UG_Q: i64 = 65536
17const UG_MU: i64 = 58982 // 0.9 momentum
18const UG_LR: i64 = 6553 // 0.1 learning rate

functions

20func ug_abs(x: i64) -> i64 { if x < 0 { return 0 - x } return x }
called by 2: ug_l1main
21func ug_copy(src: *i64, dst: *i64, nn: i64) -> i64 { var i: i64 = 0; while i < nn { dst[i] = src[i]; i = i + 1 } return 0 }
called by 1: main
23func ug_l1(x: *i64, nn: i64) -> i64 { var s: i64 = 0; var i: i64 = 0; while i < nn { s = s + ug_abs(x[i]); i = i + 1 } return s }
called by 1: main calls 1: ug_abs
25func main() -> i64