Files
foxhunt/docs
jgrusewski 345867c599 test(dqn-v2): D.1 Mamba2 backward — grad-check validation (already wired)
Plan 1 A.5 audit found mamba2_scan_projected_bwd kernel + host call at
gpu_dqn_trainer.rs::mamba2_backward are ALREADY fully wired in the
adam_grad CUDA-graph child. Plan 2 Task 2 narrows from "implement" to
"validate".

Two smoke tests confirm correctness:
- mamba2_backward_gradients_propagate: grad Frobenius norm 0.25 after 3
  epochs (>> 1e-8 threshold), ruling out silent no-op like compute_iqr
  had pre-Task-A.6.
- mamba2_backward_grad_check: kernel-level reference check (B=2 K=2
  SH2=4 STATE_D=4); max rel_err d_gate=2.6e-7, d_x_out=2.6e-7,
  d_context=6.7e-8 — all well within 15% threshold (near machine
  epsilon, confirming bit-identical host/GPU results).

No production code change — test-only accessors exposed via #[cfg(test)]
impl blocks on GpuDqnTrainer and DQNTrainer. Audit doc updated.

Plan 2 Task 2. Spec §4.D.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 19:40:52 +02:00
..