code wiki / (root) / nx_nofloat_mla_gate.nx

nx_nofloat_mla_gate.nx

buildroot/runtime/nx_nofloat_mla_gate.nx

7256 B139 linesdepth 9pulls 18 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_mla_gate.nx -- MLA no-float SERVE (the census's #1 remaining July-2026 gap, 2026-07-15). Proves DeepSeek's Multi-head Latent Attention runs in deterministic integer no-float AND that its KV-compression is LOSSLESS by construction. Two paths on the SAME weights/input: LATENT (cache = LC-dim c) vs FULL-KV (cache = 2*D). Teeth: T1 LOSSLESS COMPRESSION: latent-path output == full-KV-path output, EXACT (0 mismatch) -- caching the LC-dim latent loses NOTHING vs caching full K,V (they up-project deterministically from c) T2 COMPRESSION REAL + MEASURED: latent cache bytes < full-KV cache bytes; ratio = 2*D/LC (report it) T3 DETERMINISM: latent path byte-identical on repeat T4 REAL TRANSFORM: output differs from input on >half the cells T5 NEG-CONTROL: corrupt the down-projection Wdkv -> output CHANGES (the latent bottleneck is load-bearing, not a bypass) AND with LC>=2*D (no compression) it still matches full-KV (degenerate check sane) Synthetic Q16 weights (mechanism proof -- no small real MLA gguf exists; DeepSeek V4 = 671B). Runs in ms. expect_exit: 0 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_nofloat_mla.nx nx_gate_verdict.nx nx_nofloat_mla_gate.nx

imports: nx_syscalls.nxnx_nofloat_mla.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 mg_w sys_write sys_mmap mg_det nmla_forward_latent nmla_downproj mm_out_in nmla_upproj mm_out_in ↻ mm_out_in ↻ nmla_mha qmul fx_exp nmla_forward_fullkv nmla_downproj ↻ nmla_upproj ↻ mm_out_in ↻ nmla_mha ↻ mg_n mg_w ↻ sys_mmap ↻ sys_write ↻ gv_ctr sys_mmap ↻ gv_verdict gv_puts sys_write ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻

structs

none

consts

none

functions

18func mg_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: mg_nmain calls 1: sys_write
19func mg_n(v: i64) -> i64
called by 1: main calls 3: mg_wsys_mmapsys_write
32func mg_det(i: i64) -> i64 { return ((i * 2654435761) % 8191) - 4095 }
called by 1: main
34func main() -> i64