nx_transformer_stack_test.nx
buildroot/runtime/nx_transformer_stack_test.nx
about
nx_transformer_stack_test.nx -- smoke for nx_transformer_stack.nx.
Builds a 1-layer synthetic Llama-shape GGUF with ALL-ZERO weights
(so the forward pass becomes an identity), feeds x_in through the
stack, and verifies x_in is unchanged.
Test spec: hidden=2, head_dim=2, ffn_dim=4, n_tokens=1.
Weights = 0 means:
- RMSNorm(x, 0) = 0 (gamma=0 zeros out the norm output)
- matmul(0, W) = 0 (zero input/weight = zero output)
- attention(0, 0, 0) = 0 (softmax of all-zero scores * zero V)
- residual: x + 0 = x (UNCHANGED)
- FFN: same identity-via-zero pattern
So output x == input x after the entire forward pass.
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_transformer_stack.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
| none |
functions
| 25 | func _write_ti(buf: *u8, off: i64, |
| 44 | func _mk_blk_name(suffix: *u8, suffix_len: nx_int, out: *u8) -> nx_int called by 1: main |
| 56 | func main() -> i64 |