Files
foxhunt/crates
jgrusewski 6f3639bfbf feat(ml-alpha): Phase 2A-D B1 — gate LR multiplier (ISV slot 790)
Addresses the gate-not-learning failure mode observed at 3-seed
local mid-smoke verification of HEAD 5f10bcde3: gate_entropy_mean
stayed at MAX (Δ -0.0003 over 2000 steps) and max(gate_argmax_mass)
stuck at 1.0. Root cause: at uniform gate (g_k ≈ 1/K), the chain
grad_pi_probs → grad_gate_probs has small magnitude — gate Adam
moves W_gate too slowly to escape the uniform basin.

## Mechanism

* New ISV slot 790 RL_POLICY_GATE_LR_MULTIPLIER_INDEX, bootstrap
  5.0 inside the flag-gated block (slots 761-764 +790).
  RL_SLOTS_END = 791.
* Per-step LR-set site (only inside if self.use_multi_head_policy):
    lr_gate = lr_pi * isv[790]
    self.mhp_w_gate_adam.lr = lr_gate
    self.mhp_b_gate_adam.lr = lr_gate
* Head Adams (mhp_w_heads_adam, mhp_b_heads_adam) keep raw lr_pi.

## Verification (single-seed seed=42, flag-on, b=128, 2000 steps)

* gate_entropy_mean trajectory (5× multiplier vs baseline 5f10bcde3):
    step 0     1.0986 → 1.0986
    step 100   1.0986 → 1.0968 (Δ -0.0018)
    step 500   1.0985 → 1.0968
    step 1000  1.0985 → 1.0944
    step 1500  1.0985 → 1.0822
    step 1999  1.0983 → 1.0829 (Δ -0.0157)
  → 52× more gate gradient flow at 5× LR multiplier.
* gate_probs_mean differentiated: [0.333, 0.333, 0.333] →
  [0.252, 0.382, 0.366]. Head 0 (Short-bias, init = +0.5 on
  ShortLarge) deselected by 0.081 — semantically sensible because
  test data is 2024-Q1 ES futures (bullish/range-bound regime).
* max(gate_argmax_mass) = 1.0 still (head 1 wins 100% of batches
  by margin 0.382 vs 0.366) — soft routing emerging in gate_probs
  but argmax has not yet crossed over.

## Status

5.0 multiplier is "GATE_MOVING (partial pass)" per the dispatch's
threshold (entropy ≤ 1.05 not crossed). Slot is ISV-tunable so
escalation to 10×-20× is a single-line bootstrap change. The 52×
local improvement projected to cluster scale (b=1024 × 20k steps,
~80× more gradient signal) suggests the gate should specialize
clearly at cluster — but a stronger local multiplier first
verifies the dose-response curve hasn't saturated at 5×.

## Other verification gates

* 13/13 invariants PASS (unchanged).
* FOXHUNT_USE_MULTI_HEAD_POLICY=0 ./scripts/determinism-check.sh
  --quick: exit 0. isv_state checksum byte-identical to pre-B1
  (slot 790 zero-bootstrap contributes 0² to checksum).
* FOXHUNT_USE_MULTI_HEAD_POLICY=1 determinism-check.sh: exit 0.
* Pre-commit: 0 atomicAdd, 0 raw memcpy_htod/dtoh, 0 TODO.

## Linked
* Phase 2A-A: 0b3e40150 (foundation, inert)
* Phase 2A-B: e22da61cf (backward + aux KL prior)
* Phase 2A-C: 3e36f4a0e (trainer integration behind flag)
* Phase 2A-C+: 5f10bcde3 (device-aggregated gate diag)
* Phase 2A-D verdict: 3-seed pnl t=+0.223 (NOISE), G4 FAIL
  (argmax_mass=1.0) → motivated B1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 13:49:20 +02:00
..