Files
foxhunt/docs
jgrusewski eaf4adcb98 docs(sp14): spec — aux→Q wire + Earned Gradient Flow pearl
Designs the SP14 chain on top of SP13 Layer B (HEAD 6657e5626):

1. Sub-project A — stability fixes (3 small bugs found in Smoke A)
   - C51 atom-probability floor (ISV-driven from SP4 atom_pos_p99)
   - aux_w setter clamp lift [0.05, 0.3] → [0.15, 1.5]
   - Stagnation warmup gate at fold boundary

2. Sub-project B — the architectural piece (THIS spec)
   - Forward wire: aux_softmax_diff per-bar into direction Q-head input
     concat (in_dim+1, fingerprint bump, zero-init new column)
   - Earned Gradient Flow pearl — adaptive ISV-driven gradient gating:
     * Gate 1 (aux competence) — Schmitt-trigger hysteresis
     * Gate 2 (Q-head disagreement) — NEW signal, EMA per-step argmax
       mismatch
     * ISV-adaptive sigmoid steepness (variance-driven k_aux, k_q)
     * Per-epoch warmup ramp
     * Anti-gradient-hacking circuit breaker (mesa-opt defense)
   - 11 new ISV slots, 3 new GPU kernels, ~1060 LOC total
   - HEALTH_DIAG pearl_egf_diag observability line

3. Sub-project C — Adaptive LR (deferred until A+B effects measured)

Motivation from Smoke A diagnostic:
- aux_dir_acc reached 0.61 (signal extraction works)
- val_win_rate stuck 45-48% (no path to action selection)
- WR-flat-while-aux-varies = Q-head directional weights frozen
- 1109 GRAD_CLIP_OUTLIER events (chronic; not noise)

Three parallel diagnostic agents triangulated three interlocking root
causes:
- Slot 375 has zero readers (the wire was scoped but never built)
- C51 raw grad reaches 9.5e6, saturates SP7 budget controller
- aux_w controller muzzled by SP11-era [0.05, 0.3] clamp

The Earned Gradient Flow pearl is a new application of the codebase's
pearl pattern: ISV-driven adaptive controller, but applied to backward-
pass gradient flow instead of forward-pass features. The wire is one-
way (stop-gradient) by default; co-training is earned by both:
(a) aux head demonstrating label competence, AND
(b) Q-head showing it's actually fighting aux signal (informative
    disagreement above baseline).

Stability additions hardened against:
- Oscillation around target (Schmitt hysteresis)
- Numerical sigmoid saturation (argument clipping ±30)
- Stale variance EMAs across folds (state-reset-registry)
- Discontinuous warmup transitions (linear ramp)
- Mesa-optimization (gradient-hacking circuit breaker)
- Cold-start sentinel-state spurious gate openings (Pearl-A bootstrap)

Awaiting user review before invoking superpowers:writing-plans for
sub-project B (and a separate small plan for sub-project A).

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