feat(sp14-c): aux trunk forward kernel + Rust wrapper + oracle test

3-layer MLP forward (Linear→ELU→Linear→ELU→Linear). Pre-loaded
CudaFunction for graph-capture safety per pearl_no_host_branches_in_captured_graph.
Oracle test verifies bit-for-bit match against numpy reference within
1e-4 tol. Saves h_aux1 and h_aux2 to global memory for backward.

Phase C.3 of SP14 Layer C separate-aux-trunk refactor (plan:
docs/superpowers/plans/2026-05-07-sp14-layer-c-separate-aux-trunk.md).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-05-08 00:56:23 +02:00
parent 4926fb7c65
commit cb6bca4629
7 changed files with 661 additions and 0 deletions

View File

@@ -196,6 +196,16 @@ fn main() {
// Producer-only; ISV[AUX_NEXT_BAR_MSE_EMA_INDEX] +
// ISV[AUX_REGIME_CE_EMA_INDEX] consumer wires in Commit B.
"aux_heads_loss_ema_kernel.cu",
// SP14 Layer C Phase C.3 (2026-05-08): aux trunk forward kernel —
// 3-layer Linear→ELU→Linear→ELU→Linear MLP parallel to Q's GRN
// trunk. Reads encoder output (`x_in [B, ENCODER_OUT_DIM]`),
// writes `h_s2_aux [B, AUX_HIDDEN_DIM]` plus saved-for-backward
// hidden activations `h_aux1` and `h_aux2`. Module is additive
// in this commit — wire-up into the collector chain lands in
// Phase C.5 (atomic). Backward kernel + Adam updates land in
// Phase C.4. See plan §C.3 in
// `2026-05-07-sp14-layer-c-separate-aux-trunk.md`.
"aux_trunk_forward_kernel.cu",
// Plan A Phase 0 (Thompson sampling spec 2026-04-26): standalone test
// kernel exercised only by `distributional_q_tests.rs`. Implements the
// Thompson direction sampling math (inverse-CDF over C51 atoms,