code wiki / (root) / nx_gen_rmsnorm_verify.nx

nx_gen_rmsnorm_verify.nx

buildroot/runtime/nx_gen_rmsnorm_verify.nx

5225 B132 linesdepth 6pulls 12 transitivereach 0 importersview sourcekind tooltopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_rmsnorm_verify.nx -- SOVEREIGN RMSNorm, verified vs the oracle. out[t][i] = x[t][i] / sqrt(mean_i(x[t]^2) + eps) * w[i] RMSNorm appears four times per DiT block and in every Llama-class text encoder, so this is one of the highest-multiplicity ops in the whole gen stack. Named for the OP; the model, the tap names and eps are all arguments. Usage: nx_gen_rmsnorm_verify <model_id> <x_name> <w_name> <y_name> [rows] [eps_recip] eps_recip eps expressed as 1/N (default 1000000 = 1e-6, the ggml RMSNorm default). Passed as an integer reciprocal because eps is always a negative power of ten in practice and an argv float parser is a defect surface this organ does not need. ONE THING TO KNOW ABOUT THE ORACLE FIXTURE: in this engine RMSNorm ends with ggml_mul_inplace, so its result is a VIEW of the rms_norm output. Tapping a view without protecting its storage dumps recycled memory -- see reference-inplace-view-tap-defect-2026-08-06. The tap now flags the whole view chain, which is why these fixtures are trustworthy at all. Hot loop uses the HARDWARE __f32_* intrinsics, not the nx_f32_* software IEEE-754 twins: the software pair measured 9-10x slower in this lane's matmul and is the single easiest way to make a correct sovereign kernel look like a failed one. license_tier: ORIGINAL

dependencies 8 imports · 0 importers

nx_syscalls.nx nx_le.nx nx_f32.nx nx_f32_div.nx nx_f32_cvt.nx nx_strconv.nx nx_genfix.nx nx_genver.nx nx_gen_rmsnorm_verify.nx

imports: nx_syscalls.nxnx_le.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nxnx_strconv.nxnx_genfix.nxnx_genver.nx

imported by: nobody (leaf or entry point)

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

main nx_genver_emit 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 ↻ nx_strconv_format_i64 sys_write ↻ zr_strlen sys_mmap ↻ nx_strconv_parse_i64 nx_ascii_is_digit nx_genfix_dims sys_mmap ↻ _gf_read_manifest sys_mmap ↻ _gf_cpyz nx_genfix_root sys_openat_rd sys_read sys_close nx_genfix_load _gf_path sys_mmap ↻ _gf_cpyz ↻ nx_genfix_root ↻ _gf_cpy sys_openat_rd ↻ sys_mmap ↻

structs

none

consts

32const K_MAGIC_1000000: i64 = 1000000

functions

34func zr_strlen(s: *u8) -> i64
called by 1: main
40func main(argc: i64, argv: *i64) -> i64