nx_gen_rmsnorm_verify.nx
buildroot/runtime/nx_gen_rmsnorm_verify.nx
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
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
structs
| none |
consts
| 32 | const K_MAGIC_1000000: i64 = 1000000 |
functions
| 34 | func zr_strlen(s: *u8) -> i64 called by 1: main |
| 40 | func main(argc: i64, argv: *i64) -> i64 |