code wiki / _hdl_build / nx_nofloat_muon_gate.nx
nx_nofloat_muon_gate.nx
buildroot/runtime/_hdl_build/nx_nofloat_muon_gate.nx
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
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
structs
| none |
consts
| 16 | const UG_Q: i64 = 65536 |
| 17 | const UG_MU: i64 = 58982 // 0.9 momentum |
| 18 | const UG_LR: i64 = 6553 // 0.1 learning rate |
functions
| 20 | func ug_abs(x: i64) -> i64 { if x < 0 { return 0 - x } return x } |
| 21 | func 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 |
| 23 | func 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 } |
| 25 | func main() -> i64 |