nx_nofloat_olmoe_forward_gate.nx
buildroot/runtime/nx_nofloat_olmoe_forward_gate.nx
about
nx_nofloat_olmoe_forward_gate.nx -- MoE rung 5 (2026-07-15): a COMPLETE OLMoE forward -- 16 stacked
real layers + token embedding + final norm + LM head -> a REAL next-token from the real 64-expert model,
in deterministic no-float. Lazy per-layer weight load (attn set into REUSED buffers; experts lazy) over
the zero-copy mmap. Composes every eaten-debt piece: full-quant dequant, exact scale, real rope base 1e4,
sys_map_file, nolmoe_attn/nolmoe_moe (rung 4). Teeth:
T1 TOKENIZER round-trip: encode(prompt) -> decode == prompt (our BPE self-consistent on OLMoE's gpt2 vocab)
T2 NON-DEGENERATE logits: argmax logit strictly > min logit (the head discriminates, not all-equal)
T3 DETERMINISM: the full forward's predicted id + top logit byte-identical on repeat
T4 ROUTING ALIVE AT DEPTH: >=2 distinct expert-masks seen across the 16 layers' last-token routing
T5 PREDICTION real: a valid non-negative vocab id, decoded + printed (honest: OUR segmentation, uniform
Q16 -- HF-canonical BPE + q24 precision + H2H = rung 6, deliberately not claimed here)
Requires the OLMoE gguf. Heavy (~1-3 min: 16 layers x lazy dequant + 50304-row head). Return from main.
No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL
dependencies 12 imports · 0 importers
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_tok.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
structs
| none |
consts
| none |
functions
| 27 | func of_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 28 | func of_n(v: i64) -> i64 |
| 41 | func of_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 43 | func of_load_blk(buf: *u8, hdr: *NxGgufHeader, L: i64, suffix: *u8, out: *i64, nvals: i64) -> i64 called by 1: main calls 6: sys_mmapbuild_namenx_gguf_find_tensorof_slennx_gguf_tensor_atdequant_to_q16 |
| 52 | func of_expbase_blk(buf: *u8, hdr: *NxGgufHeader, L: i64, suffix: *u8, eb: *i64, slot: i64) -> i64 |
| 64 | func main() -> i64 |