Files
foxhunt/docs
jgrusewski 392fc7d698 feat(sp4): Tasks A10+A11 — wire all 5 SP4 producer launches in training_loop
Layer A: cold-path SP4 producer launches added next to launch_h_s2_rms_ema
and the surrounding ISV producers (mag_concat h_s2_rms_ema, fold_warmup,
iqn_quantile_ema, vsn_mask_ema, aux_heads_loss_ema, moe_expert_util_ema,
moe_lambda_eff_update). All five fire once per training step before the
HEALTH_DIAG line emit per the post-cascade-fix invariant (a5f23b28f).

Producers wired:
  - launch_sp4_target_q_p99               (TARGET_Q_BOUND, slot 131)
  - launch_sp4_atom_pos_p99_all_branches  (ATOM_POS_BOUND[0..4], 132-135)
  - launch_sp4_grad_norm_p99              (GRAD_CLIP_BOUND, slot 168)
  - launch_sp4_h_s2_p99                   (H_S2_BOUND, slot 169)
  - launch_sp4_param_group_oracles_all_groups via build_sp4_aux_buffers
    (WEIGHT/ADAM_M/ADAM_V/WD_RATE × 8 groups + L1_LAMBDA[trunk]; 33 slots)

For param_group_oracles, the SP4AuxBuffers descriptor is built each step
via FusedTrainingCtx::build_sp4_aux_buffers, threading curiosity_weights
and curiosity_trainer through from gpu_experience_collector. To support
that, added GpuExperienceCollector::curiosity_trainer() accessor mirroring
the existing has_curiosity_trainer / curiosity_weight_set pair. When the
collector is absent or curiosity is disabled, the curiosity descriptor
empties and the launcher's count==0 short-circuit silently skips group 7.

All 40 SP4 ISV bound slots are now populated correctly each step via
Pearls A+D (host-side EMA + p99 application). No consumer reads them yet —
Mech 1/2/5/6/9/10 clamps still use SP3 hardcoded multipliers, so behavior
is unchanged. Layer B will wire consumers and may relocate the captured-
graph-eligible producers (target_q_p99 in particular) as part of Mech 1's
pre-clamp ordering.

Each launch uses the same `if let Some(ref fused) = self.fused_ctx` guard
+ tracing::warn-on-error pattern as launch_h_s2_rms_ema. Errors never
propagate (warn-and-continue) since Layer A is observability-only.

cargo check -p ml --lib --tests clean (11 pre-existing warnings).
state_reset_registry suite passes (3/3).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 00:47:49 +02:00
..