From cfcec6bc94d14b7aaf6acf08301fdf0f4b451b48 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Thu, 26 Mar 2026 00:47:15 +0100 Subject: [PATCH] fix: pass 3 missing args to experience_action_select in backtest evaluator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kernel was updated with portfolio_states, min_hold_bars, max_position params (Task 3 of trade lifecycle fix) but the backtest evaluator's launch site wasn't updated. It passed 10 args to a 13-param kernel, causing SIGSEGV from reading garbage for the missing params. Fix: pass NULL/0/0.0 for the 3 new params (hold enforcement disabled during evaluation for now — will be enabled in eval cleanup plan). Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/ml/src/cuda_pipeline/gpu_backtest_evaluator.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ml/src/cuda_pipeline/gpu_backtest_evaluator.rs b/crates/ml/src/cuda_pipeline/gpu_backtest_evaluator.rs index 68bda2efa..0c561fcd8 100644 --- a/crates/ml/src/cuda_pipeline/gpu_backtest_evaluator.rs +++ b/crates/ml/src/cuda_pipeline/gpu_backtest_evaluator.rs @@ -1205,7 +1205,11 @@ impl GpuBacktestEvaluator { } // ── Phase 4: Greedy action selection on chunked Q-values ───────── - // Kernel signature: (q_values, out_actions, rng_states, out_q_gaps, epsilon, N, b0, b1, b2, q_gap_threshold) + // Kernel signature: (q_values, out_actions, rng_states, out_q_gaps, epsilon, N, + // b0, b1, b2, q_gap_threshold, portfolio_states, min_hold_bars, max_position) + let null_portfolio: u64 = 0; // NULL — backtest has no hold enforcement yet + let eval_min_hold: i32 = 0; // 0 = disabled during evaluation + let eval_max_pos: f32 = 0.0; unsafe { self.stream .launch_builder(as_kernel) @@ -1219,6 +1223,9 @@ impl GpuBacktestEvaluator { .arg(&b1) .arg(&b2) .arg(&self.q_gap_threshold) + .arg(&null_portfolio) // portfolio_states (NULL — no hold masking in eval) + .arg(&eval_min_hold) // min_hold_bars (0 = disabled) + .arg(&eval_max_pos) // max_position (unused when disabled) .launch(launch_cfg) .map_err(|e| MLError::ModelError(format!( "chunked action_select chunk_start={chunk_start}: {e}"