nx_zimage_attn_verify.nx
buildroot/runtime/nx_zimage_attn_verify.nx
about
nx_zimage_attn_verify.nx -- SOVEREIGN Z-Image block piece #2: JointAttention, verified vs the oracle.
z_image.hpp JointAttention: qkv = Linear(h); split Q|K|V each 30 heads x 128; per-head QK-RMSNorm(qn/kn);
axial RoPE; per-head SDPA (softmax(q.k^T / sqrt(128)) v); out = Linear. Reads oracle dumps h_attn (input),
qkv_w/out_w/qn/kn (weights), cosr/sinr (rope), and golden ao_out; computes sovereignly; verifies to tol.
Reference dumps are oracle-only; the ORGAN is pure Nishi (nx_f32_*, raw syscalls, static ELF).
license_tier: ORIGINAL
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_le.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nxnx_f32_exp.nxnx_strconv.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
| 15 | const K_MAGIC_3840: i64 = 3840 |
| 16 | const K_MAGIC_11520: i64 = 11520 |
| 17 | const K_MAGIC_100000: i64 = 100000 |
| 18 | const K_MAGIC_2000: i64 = 2000 |
functions
| 20 | func zav_load(name: *u8, nl: i64, n_floats: i64) -> *u8 |
| 48 | func zav_qknorm_rope(qkv: *i64, off: i64, w: *u8, cosr: *u8, sinr: *u8, t: i64, eps: i64) -> i64 |
| 69 | func zstage(n: i64) -> i64 |
| 75 | func main() -> i64 |