nx_nofloat_arch_moe_gate.nx
buildroot/runtime/nx_nofloat_arch_moe_gate.nx
about
nx_nofloat_arch_moe_gate.nx -- gates the arch-config debt eaten 2026-07-15: EXACT attention scale +
REAL rope base from metadata + fx_ln_int, across the fleet's 3 real models. Teeth:
T1 fx_ln_int KATs: ln(1e6)~905419, ln(1e4)~603597, ln(2)~45426, ln(1)=0. Tol +-20 Q16-ulps = the
Q16 fixed-point floor (~2e-4 rel), NOT slack: after the rope /np division + exp it is negligible,
and llama.cpp computes these in f32 with comparable relative error. Exactness would need a Q24/Q32
internal accumulate -- a real but zero-value-for-rope rung, deliberately not spent here.
T2 EXACT scale: hd=64 -> 8192 (IDENTITY, unchanged), hd=128 -> 5792 (was 5957 = ~2.8% high), hd=96 exact
T3 Qwen2.5-0.5B config UNCHANGED: base=1e6, scale=8192 (identity -- serve/gate reproduce byte-for-byte)
T4 Qwen2.5-1.5B: base=1e6, hd=128 -> scale 5792 (the correction lands on the 1.5B's real head_dim)
T5 OLMoE: base=1e4 (NOT 1e6 -- the hardcoded default would have garbled OLMoE rope), ln(base) sane
Reads real ggufs (arch config only, no forward) -- fast. expect_exit: 0 license_tier: ORIGINAL
dependencies 10 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_nofloat_llm.nxnx_nofloat_arch.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
structs
| none |
consts
| none |
functions
| 23 | func ag_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 24 | func ag_n(v: i64) -> i64 |
| 37 | func ag_near(got: i64, want: i64, tol: i64) -> i64 { var d: i64 = got - want; if d < 0 { d = 0 - d } if d <= tol { return 1 } return 0 } called by 1: main |
| 39 | func ag_scale(hd: i64) -> i64 { let s: i64 = isqrt(hd << 32); return 4294967296 / s } |
| 41 | func ag_cfg(path: *u8, cfg: *i64) -> i64 |
| 52 | func main() -> i64 |