A7 (commit 4f13e2ca3) wired only 3 of 8 param-groups; the 5 aux-trainer
groups returned None from param_group_buffers and silently skipped.
Without this fix-up, Layer B's atomic flip would route IQN/IQL/Attn/
Curiosity Adam clamps to silently-zero ISV bounds → consumer
.max(EPS_CLAMP_FLOOR=1.0) → 1.0 clamp → catastrophic over-clamp on
aux-trainer params.
Architectural choice per A7's DONE_WITH_CONCERNS report: Option 3 (thread
aux-trainer buffers through the launcher's signature, FusedTrainingCtx
supplies them) over hoisting the launcher onto FusedTrainingCtx.
Accessors added (mirroring SP3 close-out v2's IQN online_params_ptr
template):
- IQN: online_grad_ptr/len (the only one missing — others added in v2)
- GpuIqlTrainer: full set (params/grads/adam_m/adam_v × ptr/len)
- GpuAttention: same full set
New types in gpu_dqn_trainer.rs:
- Sp4ParamGroupBufs { params_ptr, grads_ptr, adam_m_ptr, adam_v_ptr,
count } — one trainer's quartet, all four buffers same length.
- SP4AuxBuffers { iqn, iql_high, iql_low, attn } — 4-tuple (no
curiosity; see hold-out below).
Launcher signature changed:
- launch_sp4_param_group_oracles_all_groups(&self) →
launch_sp4_param_group_oracles_all_groups(&self, &SP4AuxBuffers).
- param_group_buffers(group, aux) consults aux for groups 3-6, the
existing main-DQN slicing for groups 0-2.
FusedTrainingCtx::build_sp4_aux_buffers() — anticipatory helper (Layer B
will consume; lint-suppressed until then) that constructs SP4AuxBuffers
from gpu_iqn / gpu_iql / gpu_iql_low / gpu_attention. Optional aux
trainers (gpu_iqn / gpu_attention) emit zero-count placeholders when
None so the launcher's count == 0 short-circuit silently skips.
DONE_WITH_CONCERNS — group 7 (Curiosity) is the architectural hold-out:
GpuCuriosityTrainer stores params/grads/Adam state as four separate
[w1, b1, w2, b2] sub-buffers (non-contiguous). A single (params_ptr,
count) tuple cannot describe the slice. Resolving this requires either
a per-layer launch loop (4× kernel cost) or a contiguous-flat re-layout
of the trainer; both are deeper architectural changes scoped beyond
A7's fix-up. ParamGroup::Curiosity still returns None, the launcher
silently skips, and Layer B must guard against ISV[143/151/159/167]
being the natural-zero floor for Curiosity-related clamps via
.max(EPS_CLAMP_FLOOR=1.0).
Test surface unchanged — the existing kernel-direct unit test
sp4_param_group_oracle_per_group_writes_distinct_isv_slots already
iterates g_idx ∈ 0..SP4_PARAM_GROUP_COUNT=8 with synthetic Box-Muller
buffers, validating all 8 groups at the kernel level. The fix-up only
changes the production launcher's API; the launcher has no callsite
yet (Layer B will add it).
cargo check -p ml --lib --tests clean. Test binary compiles.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>