fix(ml-alpha): make stacker always-on (clap default_value_t=true bug)

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 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-05-15 09:31:57 +02:00
parent ab4b7c64cb
commit 149e1ae7b7

View File

@@ -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.