spec(dqn): SP1 numerical stability investigation — F1 NaN root-cause
Brainstorm session 2026-04-29 produced this spec scoping Sub-project 1
of a three-sub-project decomposition addressing the F1 ep2 NaN
explosion that persists across 9+ defensive layers in Plan C Phase 2
(commits e445d07a..e9096c7be).
Decomposition:
- SP1 (this spec): F1 NaN root-cause; γ audit + β always-landing
instrumentation + surgical fix + multi-fold validation
- SP2 (future): numerical stability framework — codify guards
- SP3 (future): Q-learning structural stability — target-Q clip,
pessimistic ensemble, atom-range governance
Operating principles:
- No deferrals (anomalies fixed within SP1, not punted)
- Combined fixes — rich commits (per feedback_no_partial_refactor)
- Always-landing diagnostic instrumentation (24-slot nan_flags_buf
expands to 48; permanent regression sentinel)
- F0 Best Sharpe ≥ 55 preserved (no regression on the working path)
Pass criterion: all 3 folds train 5 epochs, F0+F1+F2 Sharpe ≥ 0,
zero NaN-CLAMPED-TO-ZERO log lines, all 48 flag slots remain zero.
5 design sections approved iteratively: Architecture, Components,
Data Flow, Error Handling, Testing. Next: writing-plans produces
implementation plan.