Files
foxhunt/docs
jgrusewski 1420383212 fix(sp14): A.3 — stagnation warmup gate at fold boundary
compute_aux_w_p0b's stagnation term was firing inappropriately at
fold reset because Pearl-A first-observation bootstrap forces both
EMAs equal:
  short_ema = sentinel 0.5 → first observation X
  long_ema  = sentinel 0.5 → first observation X (same update)
  improvement = max(0, short - long) = 0
  stagnation = (1 - 0/max(deficit, 0.005)) = 1.0
  aux_w *= (1 - 0.7) = 0.3 → spurious decay on a non-stagnation

Fix: add epochs_in_fold parameter; skip stagnation when < 1. Wait
one full epoch for the α=0.3 vs α=0.05 short/long EMA timescale
split to produce real improvement signal.

Atomic refactor (feedback_no_partial_refactor): all 5 callers
migrated — 1 production site (training_loop.rs:4257) plus 4
existing unit tests at trainers/dqn/trainer/tests.rs.

Test: aux_w_stagnation_warmup_gate_epoch_0 verifies:
  - Epoch 0: stagnation = 0, aux_w = base × deficit_amp = 0.625
  - Epoch 1: stagnation = 1.0, aux_w = floor 0.15

Combined with A.2 (clamp lift), Fold 2's aux_w should now hit
0.625 in epoch 0 (the controller's intended post-deficit-amp
value) instead of being collapsed to 0.164.

Audit doc: Fix 41 added; stale "A.1 deferred" note from a prior
killed agent was also removed (A.1 lands in the next commit, not
deferred per user direction).

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