From 81a9319d84d4149ece34bc13bbb0698941d72598 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Thu, 7 May 2026 10:25:50 +0200 Subject: [PATCH] =?UTF-8?q?fix(sp15-wave3b-followup):=20migrate=20evaluate?= =?UTF-8?q?=5Fbaseline.rs=203=20GpuBacktestEvaluator::new=20sites=20?= =?UTF-8?q?=E2=80=94=20Wave=203b=20missed=20the=20example=20binary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wave 3b (4320820ae) added a 6th window_lob_bars parameter to GpuBacktestEvaluator::new and migrated 3 production lib call sites + 6 test call sites, but the lib-only `cargo check -p ml --features cuda` validation didn't catch the 3 example-binary call sites in evaluate_baseline.rs (lines 1344, 1641, 1802). Argo's ensure-binary step compiles all 4 example binaries (hyperopt_baseline_rl, train_baseline_rl, evaluate_baseline, precompute_features), and evaluate_baseline failed with E0061 (wrong number of args). This commit migrates all 3 sites to construct zero-OFI LobBar SoA inline (eval-path lacks per-bar OFI features — same degradation pattern as the PPO hyperopt adapter Wave 3b D4 resolution; OFI-impact term degrades to 0 while commission + half-spread × position still apply). Validated: `cargo check -p ml --features cuda --all-targets` clean (was --features cuda only before — now expanded to catch example/test/bin compile-breaks). Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/ml/examples/evaluate_baseline.rs | 34 ++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/crates/ml/examples/evaluate_baseline.rs b/crates/ml/examples/evaluate_baseline.rs index eb8c57014..c9b92abd1 100644 --- a/crates/ml/examples/evaluate_baseline.rs +++ b/crates/ml/examples/evaluate_baseline.rs @@ -1340,10 +1340,22 @@ fn evaluate_dqn_fold_gpu( ..Default::default() }; - // Single window = full test fold + // Single window = full test fold. Build zero-OFI LobBar SoA for the + // SP15 cost-net pipeline — eval-path lacks per-bar OFI features, so the + // OFI-impact term degrades to 0 (commission + half-spread × position + // still apply). Same degradation pattern as the PPO hyperopt adapter. + let lob_bars: Vec = prices + .iter() + .map(|ohlc| ml::cuda_pipeline::lob_bar::LobBar { + price: ohlc[3], // close + spread: gpu_config.spread_cost, + ofi: 0.0, + }) + .collect(); let mut evaluator = GpuBacktestEvaluator::new( &[prices], &[features], + &[lob_bars], market_feature_dim, gpu_config, &stream, @@ -1638,9 +1650,19 @@ fn evaluate_ppo_fold_gpu( ..Default::default() }; + // Zero-OFI LobBar SoA — see DQN fold above for rationale. + let lob_bars: Vec = prices + .iter() + .map(|ohlc| ml::cuda_pipeline::lob_bar::LobBar { + price: ohlc[3], + spread: gpu_config.spread_cost, + ofi: 0.0, + }) + .collect(); let mut evaluator = GpuBacktestEvaluator::new( &[prices], &[features], + &[lob_bars], market_feature_dim, gpu_config, &ppo_stream, @@ -1799,9 +1821,19 @@ fn evaluate_supervised_fold_gpu( ..Default::default() }; + // Zero-OFI LobBar SoA — see DQN fold above for rationale. + let lob_bars: Vec = prices + .iter() + .map(|ohlc| ml::cuda_pipeline::lob_bar::LobBar { + price: ohlc[3], + spread: gpu_config.spread_cost, + ofi: 0.0, + }) + .collect(); let mut evaluator = GpuBacktestEvaluator::new( &[prices], &[features], + &[lob_bars], market_feature_dim, gpu_config, &sup_stream,