chore(ml-backtesting): drop dead snapshot helpers from P3 migration
snapshot_realized_pnl / snapshot_position_lots / snapshot_open_horizon_mask
were the host-side read paths for the close-detection loop that P3
(3836e2578) replaced with snapshot_pos_state + detect_close_transitions_
batched kernels. The helpers stayed dead-code-warned after P3; per
feedback_no_legacy_aliases + feedback_no_hiding, delete them.
submit_market_fn is NOT dead — pub fn submit_market wraps it and has 4
test callers (lob_sim_fixtures, lob_sim_fuzz, ring3_replay × 2). Kept.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -821,48 +821,6 @@ impl LobSimCuda {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn snapshot_realized_pnl(&self) -> Result<Vec<f32>> {
|
||||
let pos_bytes = std::mem::size_of::<PosFlat>();
|
||||
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<Vec<i32>> {
|
||||
let pos_bytes = std::mem::size_of::<PosFlat>();
|
||||
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<Vec<u32>> {
|
||||
let pos_bytes = std::mem::size_of::<PosFlat>();
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user