diff --git a/crates/ml-alpha/src/trainer/integrated.rs b/crates/ml-alpha/src/trainer/integrated.rs index 14a603671..53554765c 100644 --- a/crates/ml-alpha/src/trainer/integrated.rs +++ b/crates/ml-alpha/src/trainer/integrated.rs @@ -694,12 +694,12 @@ pub struct IntegratedTrainer { // Regime observer (F1.4) — emits unified state-machine signals consumed // by Kelly (F2), v9 (F3), popart (F4), IQN τ (F5). _rl_regime_flat_count_module: Arc, - rl_regime_flat_count_fn: CudaFunction, - _rl_regime_observer_module: Arc, - rl_regime_observer_fn: CudaFunction, - /// Per-step flat-count helper buffer: holds the block-reduce output - /// (number of accounts with lots==0) for one step. Length 1. - flat_count_d: CudaSlice, + rl_regime_flat_count_fn: CudaFunction, + _rl_regime_observer_module: Arc, + rl_regime_observer_fn: CudaFunction, + // Per-step flat-count helper buffer: holds the block-reduce output + // (number of accounts with lots==0) for one step. Length 1. + flat_count_d: CudaSlice, // EMA producers feeding the new controllers. _rl_win_rate_ema_update_module: Arc, rl_win_rate_ema_update_fn: CudaFunction, @@ -3834,17 +3834,17 @@ impl IntegratedTrainer { /// Regime observer helper — block-reduce per-account flat count. /// Output: `flat_count_d[0]` = number of accounts with lots==0. /// Launch: Grid=(1,1,1), Block=(256,1,1), smem=256*sizeof(int). - pub fn launch_rl_regime_flat_count(&mut self, lots_d: &CudaSlice, b_size: usize) -> Result<()> { + pub fn launch_rl_regime_flat_count(&self, lots_d: &CudaSlice, b_size: usize) -> Result<()> { let mut args = RawArgs::new(); args.push_ptr(lots_d.raw_ptr()); args.push_ptr(self.flat_count_d.raw_ptr()); args.push_i32(b_size as i32); let mut ptrs = args.build_arg_ptrs(); - let smem_bytes = (256 * std::mem::size_of::()) as u32; + let smem = (256 * std::mem::size_of::()) as u32; unsafe { raw_launch( self.rl_regime_flat_count_fn.cu_function(), - (1, 1, 1), (256, 1, 1), smem_bytes, + (1, 1, 1), (256, 1, 1), smem, self.raw_stream, &mut ptrs[..args.len()], ).map_err(|e| anyhow::anyhow!("rl_regime_flat_count: {:?}", e))?;