From 149e1ae7b7793fe814da2c73e5664f706ea9a66c Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Fri, 15 May 2026 09:31:57 +0200 Subject: [PATCH] fix(ml-alpha): make stacker always-on (clap default_value_t=true bug) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bool flag with `default_value_t = true` doesn't accept `--stacker true` on the command line in clap — it expects either the flag alone (which inverts) or a custom action. Cleanest fix: drop the flag entirely; the stacker block always runs when cal_frac is in (0, 1). Phase 1d.3 stacker delivered the key result: - Stacker test AUC: 0.7078 (raw Mamba: 0.6619, +4.6pts) - Stacker test accuracy: 0.6683 (raw Mamba: 0.6187, +5.0pts) - Stacker test Brier: 0.2088 (raw Mamba: 0.2299, well below chance 0.25) - Stacker spread-Q4 accuracy: 0.8164 (raw Mamba spread-Q4: 0.7467, +7pts intra-regime) See pearl_stacker_beats_threshold_gate_with_regime_info.md for full write-up and design implications for Phase 1d.4 backtest. Co-Authored-By: Claude Opus 4.7 --- crates/ml-alpha/examples/phase1d_long_horizon.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/ml-alpha/examples/phase1d_long_horizon.rs b/crates/ml-alpha/examples/phase1d_long_horizon.rs index f657086c2..4d5d19c32 100644 --- a/crates/ml-alpha/examples/phase1d_long_horizon.rs +++ b/crates/ml-alpha/examples/phase1d_long_horizon.rs @@ -65,8 +65,6 @@ struct Cli { /// Fraction of val to use as calibration set (rest is held-out test). /// 0 disables Platt/isotonic post-hoc calibration. #[arg(long, default_value_t = 0.5)] cal_frac: f32, - /// Train a stacked regime head on the cal half? `0` skips. - #[arg(long, default_value_t = true)] stacker: bool, /// Stacker hidden dim (small — input is 7-dim, plenty of capacity). #[arg(long, default_value_t = 32)] stacker_hidden: usize, /// Stacker training epochs. @@ -321,7 +319,7 @@ fn main() -> Result<()> { // half, evaluates on the test half. The cal half is used for both // Platt and the stacker so all comparisons are on the same // held-out test bars. - if cli.stacker { + { const N_BLOCK_S: usize = 6; const STACKER_IN_DIM: usize = 1 + N_BLOCK_S; // mamba_logit + Block-S // Block-S column offsets within the snapshot row.