code wiki / (root) / nx_nofloat_olmoe_gate.nx

nx_nofloat_olmoe_gate.nx

buildroot/runtime/nx_nofloat_olmoe_gate.nx

10758 B222 linesdepth 9pulls 25 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 12 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; +2 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.nxnx_stage_path.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 nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_map_file sys_openat_rd sys_lseek sys_close sp_guarded sp_path sp_root sp_resolve_root sp_env sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ sp_match sp_take_value sp_slen sp_conf ep_open_rd sys_mmap ↻ sys_read ↻ sys_close ↻ sp_match ↻

structs

none

consts

none

functions

25func 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
26func og_n(v: i64) -> i64
called by 1: main calls 3: og_wsys_mmapsys_write
39func 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
40func og_det(i: i64) -> i64 { return ((i * 2654435761) % 8191) - 4095 }
called by 1: main
42func og_load(buf: *u8, hdr: *NxGgufHeader, name: *u8, out: *i64, nvals: i64) -> i64
49func og_expbase(buf: *u8, hdr: *NxGgufHeader, name: *u8, eb: *i64, slot: i64) -> i64
59func main() -> i64