From f68e0a1d0d774f66080548ed0e96caa4f547ecca Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Fri, 22 May 2026 21:21:21 +0200 Subject: [PATCH] revert(loader): multi-resolution default '1:32' (single-scale) after htpp6 falsification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Phase 1 multi-resolution layout (10 raw + 10 agg@30 + 12 agg@100) regressed ALL horizons in alpha-perception-htpp6 (2026-05-22): - auc_h100: 0.681 -> 0.512 (-0.169) - auc_h300: 0.617 -> 0.506 (-0.111) - auc_h1000: 0.576 -> 0.526 (-0.050) Hypothesis falsified. Root cause: Mamba2+CfC SSM encoder already used all 32 raw ticks effectively via state-recurrence; replacing 22 raw ticks with arithmetic-mean aggregates destroyed within-window microstructure variance (the actual h100 signal) AND broke temporal continuity that the recurrence relies on. Δt Fourier encoder couldn't compensate. Architectural pearl: SSM/RNN/CfC + multi-resolution input is incompatible without separate-encoder-per-scale or explicit scale tokens. Transformer-style positional encoding tolerates scale-mixing; recurrent state updates assume consecutive positions. Reverts default to '1:32'. Adds explicit single_scale_32() constructor for callers (harness, tests). Keeps default_three_scale() in code with deprecation note for future sub-variant experiments. Production defaults across alpha_train CLI, Argo template, dispatcher script, ml-backtesting harness now match the proven baseline. --- crates/ml-alpha/examples/alpha_train.rs | 15 ++++++++------- crates/ml-alpha/src/data/aggregation.rs | 19 +++++++++++++++---- crates/ml-alpha/tests/multi_horizon_loader.rs | 4 ++-- crates/ml-backtesting/src/harness.rs | 2 +- crates/ml-backtesting/tests/ring3_replay.rs | 2 +- crates/ml-backtesting/tests/trainer_parity.rs | 2 +- infra/k8s/argo/alpha-perception-template.yaml | 2 +- scripts/argo-alpha-perception.sh | 2 +- 8 files changed, 30 insertions(+), 18 deletions(-) diff --git a/crates/ml-alpha/examples/alpha_train.rs b/crates/ml-alpha/examples/alpha_train.rs index 90df33f31..704f187ca 100644 --- a/crates/ml-alpha/examples/alpha_train.rs +++ b/crates/ml-alpha/examples/alpha_train.rs @@ -14,7 +14,7 @@ //! --mbp10-data-dir \ //! --predecoded-dir \ //! --epochs 5 \ -//! --multi-resolution 1:10,30:10,100:12 \ +//! --multi-resolution 1:32 \ //! --mamba2-state-dim 16 \ //! --lr-cfc 3e-3 \ //! --lr-mamba2 1e-3 \ @@ -56,12 +56,13 @@ struct Cli { epochs: usize, /// Multi-resolution input window: `:[,:]...`. - /// Default `1:10,30:10,100:12` gives 32 positions covering 1510 ticks - /// (10 raw + 10 aggregated@30 + 12 aggregated@100). Use `1:32` for the - /// degenerate single-scale parity-check config. - /// - /// See `docs/superpowers/plans/2026-05-22-multi-resolution-input.md`. - #[arg(long, default_value = "1:10,30:10,100:12")] + /// Default `1:32` (single-scale 32 raw ticks) restores the proven + /// baseline. The Phase 1 experimental `1:10,30:10,100:12` layout + /// regressed all horizons in alpha-perception-htpp6 (2026-05-22; see + /// `docs/superpowers/plans/2026-05-22-multi-resolution-input.md` and + /// the falsification commit message). Sub-variants like + /// `1:28,100:4` may be tried in future experiments. + #[arg(long, default_value = "1:32")] multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig, #[arg(long, default_value_t = 16)] diff --git a/crates/ml-alpha/src/data/aggregation.rs b/crates/ml-alpha/src/data/aggregation.rs index 81f35a834..a3a724c3b 100644 --- a/crates/ml-alpha/src/data/aggregation.rs +++ b/crates/ml-alpha/src/data/aggregation.rs @@ -24,10 +24,21 @@ pub struct MultiResolutionConfig { } impl MultiResolutionConfig { - /// Phase 1 design: 10 raw + 10 aggregated@30 + 12 aggregated@100. - /// Total 32 positions covering 1510 ticks. This is the default for - /// the alpha_train binary; tests use it unless they need a degenerate - /// single-scale config for diagnostic comparisons. + /// Production default: 32 raw ticks (single-scale). Restores the + /// pre-multi-resolution baseline behavior because the experimental + /// `default_three_scale` Phase 1 layout regressed all horizons in + /// the alpha-perception-htpp6 smoke (2026-05-22; auc_h100: 0.681 → + /// 0.512, auc_h1000: 0.576 → 0.526). Used by alpha_train CLI default + /// and ml-backtesting harness. + pub fn single_scale_32() -> Self { + Self { scales: vec![(1, 32)] } + } + + /// Phase 1 EXPERIMENTAL design: 10 raw + 10 aggregated@30 + 12 + /// aggregated@100 = 32 positions covering 1510 ticks. Falsified by + /// alpha-perception-htpp6 (2026-05-22) — all horizons regressed + /// vs single-scale. Retained for future variant experiments + /// (sub-variants like 28 raw + 4 agg@100); NOT the production default. pub fn default_three_scale() -> Self { Self { scales: vec![(1, 10), (30, 10), (100, 12)] } } diff --git a/crates/ml-alpha/tests/multi_horizon_loader.rs b/crates/ml-alpha/tests/multi_horizon_loader.rs index 20948cfb8..e58bf7015 100644 --- a/crates/ml-alpha/tests/multi_horizon_loader.rs +++ b/crates/ml-alpha/tests/multi_horizon_loader.rs @@ -21,7 +21,7 @@ fn cfg_from_env() -> Option { Some(MultiHorizonLoaderConfig { files, predecoded_dir: predec, - multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(), + multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::single_scale_32(), horizons: HORIZONS, n_max_sequences: 100, seed: 0xA1A2_A3A4, @@ -65,7 +65,7 @@ fn loader_errors_on_empty_files() { let cfg = MultiHorizonLoaderConfig { files: Vec::new(), predecoded_dir: PathBuf::from("/tmp/does_not_exist_foxhunt_test"), - multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(), + multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::single_scale_32(), horizons: HORIZONS, n_max_sequences: 10, seed: 0, diff --git a/crates/ml-backtesting/src/harness.rs b/crates/ml-backtesting/src/harness.rs index 0d6d80b22..92fee62be 100644 --- a/crates/ml-backtesting/src/harness.rs +++ b/crates/ml-backtesting/src/harness.rs @@ -247,7 +247,7 @@ impl BacktestHarness { let loader_cfg = MultiHorizonLoaderConfig { files, predecoded_dir: cfg.predecoded_dir.clone(), - multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(), + multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::single_scale_32(), horizons: ml_alpha::heads::HORIZONS, n_max_sequences: 0, seed: 0, diff --git a/crates/ml-backtesting/tests/ring3_replay.rs b/crates/ml-backtesting/tests/ring3_replay.rs index 09c2d4181..37153806c 100644 --- a/crates/ml-backtesting/tests/ring3_replay.rs +++ b/crates/ml-backtesting/tests/ring3_replay.rs @@ -43,7 +43,7 @@ fn try_loader() -> Option { let cfg = MultiHorizonLoaderConfig { files, predecoded_dir: mbp10.clone(), - multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(), + multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::single_scale_32(), horizons: ml_alpha::heads::HORIZONS, n_max_sequences: 0, seed: 0xCAFE_F00D, diff --git a/crates/ml-backtesting/tests/trainer_parity.rs b/crates/ml-backtesting/tests/trainer_parity.rs index 66744d55e..054c95b29 100644 --- a/crates/ml-backtesting/tests/trainer_parity.rs +++ b/crates/ml-backtesting/tests/trainer_parity.rs @@ -30,7 +30,7 @@ fn try_loader(inference_only: bool) -> Option { let cfg = MultiHorizonLoaderConfig { files, predecoded_dir: mbp10.clone(), - multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::default_three_scale(), + multi_resolution: ml_alpha::data::aggregation::MultiResolutionConfig::single_scale_32(), horizons: ml_alpha::heads::HORIZONS, n_max_sequences: 1, seed: 0xCAFEF00D, diff --git a/infra/k8s/argo/alpha-perception-template.yaml b/infra/k8s/argo/alpha-perception-template.yaml index 946f11ac2..cdaf3048c 100644 --- a/infra/k8s/argo/alpha-perception-template.yaml +++ b/infra/k8s/argo/alpha-perception-template.yaml @@ -49,7 +49,7 @@ spec: - name: epochs value: "5" - name: multi-resolution - value: "1:10,30:10,100:12" + value: "1:32" - name: mamba2-state-dim value: "16" - name: lr-cfc diff --git a/scripts/argo-alpha-perception.sh b/scripts/argo-alpha-perception.sh index 0c89b8b72..2458631d1 100755 --- a/scripts/argo-alpha-perception.sh +++ b/scripts/argo-alpha-perception.sh @@ -20,7 +20,7 @@ SHA=HEAD BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || echo "ml-alpha-phase-a") GPU_POOL=ci-training-l40s EPOCHS=5 -MULTI_RESOLUTION="1:10,30:10,100:12" +MULTI_RESOLUTION="1:32" MAMBA2_STATE_DIM=16 LR_CFC=3e-3 LR_MAMBA2=1e-3