[HIP] loop-controller kernels (RMS pack + gain/forget apply) verified
- k_ctrl_pack / vetta_ctrl_pack: exact strata k1_loop_ctrl_rms +
k1_loop_ctrl_pack_in_bf16 — inv_c=rsqrt(mean(cur^2)+eps),
inv_m=rsqrt(mean(msg^2)+eps); packed BF16 [2D] = [cur*inv_c ; msg*inv_m].
- k_ctrl_apply / vetta_ctrl_apply: exact k1_loop_ctrl_apply_out —
out = (1-tanh(forget))*cur + tanh(gain)*msg (gain/forget gating of the loop
message). The down/gain/forget low-rank projections reuse gemm_bf16.
- loop_controller_parity_vs_cpu: full controller chain (pack -> down GEMM
[gate_rank] -> cast -> gain/forget GEMM [D] -> apply) vs a CPU oracle:
max_rel_err 1.6e-7. The loop controller composes correctly.
This is the last kernel needed for the full Inkling forward. All mechanisms
(SWA + full-attn attention, MoE NVFP4, deep-residual block-mix, shortconv
static/dyn, loop controllers) are now verified microkernels.
Verified: RUSTFLAGS="-D warnings" cargo test --workspace = 97/97 PASS;
lean proofs (5 files) green; GPU 17/17 (--features hip).