code wiki / (root) / nx_f32_llm_probe.nx

nx_f32_llm_probe.nx

buildroot/runtime/nx_f32_llm_probe.nx

8147 B167 linesdepth 13pulls 56 transitivereach 0 importersview sourcekind probetopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_llm_probe.nx -- SOVEREIGN FORWARD PROBE: the tool that turns "why is the LLM forward garbage?" into a one-run solve. Loads the real model, runs ONE token through layer-0 stage by stage, and prints tensor HEALTH after every stage: NaN/Inf count + max biased exponent (magnitude proxy: 127=|x|~1, 134=~128, 142=~32k, 150=~8M, 255=NaN/Inf) + the first 3 raw f32 words. The FIRST stage whose exponent explodes or whose naninf>0 (relative to a sane transformer activation, maxexp~127-140) is the bug. No gen loop, no sampler -- pure forward dissection. Reuses the REAL functions (rmsnorm/lazy_matmul/ attn_with_cache/silu) so it measures the real path, not a reimplementation. expect_exit: 0 license_tier: ORIGINAL module: nishi-core.llm.probe

dependencies 15 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_f32.nx nx_silu.nx nx_f32_rmsnorm.nx nx_f32_kv_cache.nx nx_f32_lazy_weight.nx nx_f32_llm_probe.nx

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

imports: nx_syscalls.nxnx_tier.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_f32.nxnx_silu.nxnx_f32_rmsnorm.nxnx_f32_kv_cache.nxnx_f32_lazy_weight.nxnx_f32_attn_cached.nxnx_f32_llama_block_v4.nxnx_f32_llama_layer_lazy_load.nxnx_f32_llm_v4.nxnx_f32_llm_read_dims.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close pr_puts sys_write 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 ↻ nx_f32_llama_model_alloc sys_mmap ↻ nx_f32_llm_read_dims_from_ 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 _fld_read_arch_u32 sys_mmap ↻ _fld_concat_key nx_gguf_meta_find ↻ nx_gguf_meta_read_u32 nx_le_read_u32 ↻ _fld_read_vocab_size_from_ sys_mmap ↻

structs

none

consts

24const K_MAGIC_9707: i64 = 9707

functions

26func pr_puts(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: probemain calls 1: sys_write
27func pr_num(v: i64) -> i64
called by 2: probemain calls 2: sys_mmapsys_write
31func pr_hex8(v: i64) -> i64
called by 2: probemain calls 2: sys_mmapsys_write
41func probe(label: *u8, vec: *i64, n: nx_int) -> i64
called by 1: main calls 3: pr_putspr_numpr_hex8
63func main() -> i64