diff --git a/crates/ml-backtesting/src/sim/mod.rs b/crates/ml-backtesting/src/sim/mod.rs index f66d34b5a..7c46cc506 100644 --- a/crates/ml-backtesting/src/sim/mod.rs +++ b/crates/ml-backtesting/src/sim/mod.rs @@ -821,48 +821,6 @@ impl LobSimCuda { Ok(()) } - fn snapshot_realized_pnl(&self) -> Result> { - let pos_bytes = std::mem::size_of::(); - let mut raw = vec![0u8; self.n_backtests * pos_bytes]; - self.stream.memcpy_dtoh(&self.pos_d, raw.as_mut_slice())?; - let mut out = vec![0.0f32; self.n_backtests]; - for b in 0..self.n_backtests { - let off = b * pos_bytes + 8; // realized_pnl offset (i32 + f32 then f32 here) - let mut bytes = [0u8; 4]; - bytes.copy_from_slice(&raw[off..off + 4]); - out[b] = f32::from_le_bytes(bytes); - } - Ok(out) - } - - fn snapshot_position_lots(&self) -> Result> { - let pos_bytes = std::mem::size_of::(); - let mut raw = vec![0u8; self.n_backtests * pos_bytes]; - self.stream.memcpy_dtoh(&self.pos_d, raw.as_mut_slice())?; - let mut out = vec![0i32; self.n_backtests]; - for b in 0..self.n_backtests { - let off = b * pos_bytes; // position_lots is field 0 - let mut bytes = [0u8; 4]; - bytes.copy_from_slice(&raw[off..off + 4]); - out[b] = i32::from_le_bytes(bytes); - } - Ok(out) - } - - fn snapshot_open_horizon_mask(&self) -> Result> { - let pos_bytes = std::mem::size_of::(); - let mut raw = vec![0u8; self.n_backtests * pos_bytes]; - self.stream.memcpy_dtoh(&self.pos_d, raw.as_mut_slice())?; - let mut out = vec![0u32; self.n_backtests]; - for b in 0..self.n_backtests { - let off = b * pos_bytes + 20; - let mut bytes = [0u8; 4]; - bytes.copy_from_slice(&raw[off..off + 4]); - out[b] = u32::from_le_bytes(bytes); - } - Ok(out) - } - /// Write per-horizon ISV-Kelly state for a specific backtest (warm-start). pub fn write_isv_kelly( &mut self,