Single-file fix to `compute_epoch_financials`: remove the
`if n_returns_f >= bars_per_year` short-rollout fallback that
left v2 semantics in place for sub-year rollouts. For Foxhunt's
volume bars, `bars_per_day ≈ 34_496` → `bars_per_year ≈ 8.69M`,
while a training epoch produces `n_returns ≈ 4.10M`. The guard
fired on every production epoch, so the v3 CAGR fix was a no-op.
Diagnosis chain:
- v3 commit (2937da889) merged the n_returns >= bars_per_year guard
- Smoke v4 (commit 62b5a50e8, workflow train-frv8x) epoch 1 showed
Return=+2.963e2% — bit-identical to v1's pre-fix output
- Hypothesis 1 (cache poisoning): ruled out — ensure-binary log
shows "Cache MISS: compiling binaries for 62b5a50e8" and ml crate
was recompiled fresh
- Hypothesis 2 (different commit): ruled out — workflow params confirm
commit-sha = 62b5a50e8 = current HEAD
- Hypothesis 3 (bars_per_year mismatch): confirmed — v4 log emits
"Bars per day (from data): 34496" which makes bars_per_year > n_returns
and triggers the v2 fallback inside the v3 branch
Fix: unconditional CAGR. The log-space clamp [-23, +20] bounds
the display in all edge cases (tests with tiny n_returns
extrapolate aggressively; the clamp caps at exp(20) - 1 ≈ +4.85e8%).
Expected v5 epoch 1 Return: ~+1.770e3% (was +2.963e2% under v4).
The new value is the *actual annualized* projection: 1377% over
a 0.47-year rollout. Overfit cycles cap at +4.85e8% (was +e19%).
Tests:
- cargo test -p ml --lib financials → 7/7
- Sign-only assertions in test cases (all > 0.0) — no regressions
Files changed:
- crates/ml/src/trainers/dqn/financials.rs: 1 conditional removed,
comment block updated with v3 → v3.1 history
- docs/dqn-wire-up-audit.md: diagnosis + fix entry for 2026-05-11
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>