code wiki / (root) / nx_nofloat_olmoe_gate.nx

nx_nofloat_olmoe_gate.nx

buildroot/runtime/nx_nofloat_olmoe_gate.nx

10717 B221 linesdepth 9pulls 20 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_olmoe_gate.nx -- MoE rung 4 (2026-07-15): a FAITHFUL OLMoE transformer LAYER on REAL blk.0 weights, end to end in deterministic no-float. Attention (pre-norm -> QKV -> QK-norm over full 2048 -> RoPE base 1e4 -> 16-head causal MHA -> Wo -> residual) then MoE-FFN (ffn_norm -> lazy top-8 SwiGLU mix -> residual). T=2 tokens (proves per-token routing + causal attention). Teeth: T1 DETERMINISM: whole-layer output byte-identical on repeat T2 REAL TRANSFORMATION: layer output differs from input on >half the cells (both tokens) T3 PER-TOKEN ROUTING: the two tokens select DIFFERENT expert sets (real router, real per-token MoE) T4 QK-NORM MATTERS (neg-control): skipping q_norm (gamma=1) changes the output -- proves QK-norm is live T5 LAZY FETCH: exactly K=8 experts dequanted per token (cnt sum == T*K), attention output nonzero Requires /home/elderwesto/nx_stage/nx_moe_model.gguf. ~4.2GB mapped (zero-copy). Return from main. No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 11 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_nofloat_llm.nx nx_nofloat_arch.nx nx_nofloat_olmoe.nx nx_nofloat_olmoe_gate.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_nofloat_llm.nxnx_nofloat_arch.nxnx_nofloat_olmoe.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 og_w sys_write sys_mmap sys_map_file sys_openat_rd sys_lseek sys_close nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nac_read_config sys_mmap ↻ nx_gguf_meta_find nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gmeta_bytes_equal nx_gguf_skip_value _gguf_skip_value ↻ nx_gguf_meta_read_string_l nx_le_read_u64 ↻ nx_gguf_meta_read_string_p nac_u32 sys_mmap ↻ nac_key nx_gguf_meta_find ↻ nx_gguf_meta_read_u32 nx_le_read_u32 ↻ isqrt nac_f32_int sys_mmap ↻ nac_key ↻ nx_gguf_meta_find ↻ f32_to_q16

structs

none

consts

none

functions

24func og_w(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 2: og_nmain calls 1: sys_write
25func og_n(v: i64) -> i64
called by 1: main calls 3: og_wsys_mmapsys_write
38func og_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: og_loadog_expbase
39func og_det(i: i64) -> i64 { return ((i * 2654435761) % 8191) - 4095 }
called by 1: main
41func og_load(buf: *u8, hdr: *NxGgufHeader, name: *u8, out: *i64, nvals: i64) -> i64
48func og_expbase(buf: *u8, hdr: *NxGgufHeader, name: *u8, eb: *i64, slot: i64) -> i64
58func main() -> i64