Commit Graph

2 Commits

Author SHA1 Message Date
jgrusewski
55ffe2b26f scripts(alpha): rename + add cross-quarter validation pipeline
- New scripts/alpha_pipeline.sh: orchestrates the 2-quarter validation
  after fxcache lands. Auto-discovers the Q1+Q2 fxcache (newest
  .fxcache excluding the known Q1-only hash), trains
  alpha_train_stacker on it, then sweeps 4 conditions
  (baseline / +cost-rand / +regime-scale / +both) × 3 walk-forward
  folds, aggregating mean ± stddev Sharpe per cost across folds.
  No phase prefixes in name or contents — the script is meant to
  outlive any single milestone.

- scripts/build_2q_fxcache.sh: fix staging layout so MBP-10 / trades
  / OHLCV symlinks live in the symbol subdir (`mbp10/ES.FUT/...`)
  that precompute_features expects. Previous flat-layout build
  aborted with "MBP-10 directory not found: .../mbp10/ES.FUT".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 00:42:07 +02:00
jgrusewski
d090685ca9 feat(phase-e-4-a-T16): vol-regime detection + cost-aware training
Adds two coupled interventions on the regime fragility exposed by
walk-forward CV (mean Sharpe +27 ± 56 at half-tick across 3 folds —
std-dev ≈ mean means the strategy is regime-dependent).

(1) Vol-EMA regime detector (new ISV slots 549/550)
- New alpha_regime_vol_update.cu kernel: per inference step, reads B
  parallel-env mid prices, computes cross-env mean squared log-return,
  and maintains ISV[549]=REGIME_VOL_EMA (Wiener-α with 0.4 floor +
  Pearl A bootstrap) and ISV[550]=REGIME_VOL_REF (slow tracker β=0.005,
  ≈200-step horizon).
- Block-tree-reduce (no atomicAdd), guards against zero/non-finite mids.

(2) Pre-emptive Kelly attenuation (modified stacker controller)
- stacker_threshold_controller.cu takes 3 new args: regime_vol_ema_idx,
  regime_vol_ref_idx, regime_scale_floor.
- Multiplies its reactive Sharpe-error Kelly output by
    regime_scale = clamp(vol_ref / vol_ema, 0.25, 1.0)
- Disabled when indices = -1 (backward-compatible smoke + kernel test).

(3) Cost-aware training (--train-cost-hi)
- alpha_compose_backtest --train-cost-hi: when > --train-cost, each
  training epoch samples cost ~ U[lo, hi] so the Q-network learns
  cost-conservative behaviour across the realistic ES range.

(4) Wiring
- alpha_compose_backtest --regime-scale enables both per-step regime
  kernel firing during eval AND the regime hookup in the per-episode
  controller call. Mapped-pinned mids buffers, all compute device-side.
- ExecutionEnv exposes current_mid() so the host gather reads the
  active snapshot mid per env without leaking the private cursor field.

Smoke + test sites pass -1/-1 for regime indices (backward compat).
Doc: docs/isv-slots.md ledger for slots 549/550.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 00:28:01 +02:00