pub struct MidchunkCapture<'a> {
pub cap_local: usize,
pub h_dsts: &'a [DevicePtr],
pub conv_dsts: &'a [DevicePtr],
pub h_bytes: usize,
pub conv_bytes: usize,
pub ssm_layer_counter: &'a AtomicUsize,
pub cap_local_early: Option<usize>,
pub h_dsts_early: &'a [DevicePtr],
pub conv_dsts_early: &'a [DevicePtr],
}Expand description
Per-pass descriptor for mid-chunk SSM tail capture. Points at the reserved Marconi snapshot slot’s per-SSM-layer destination buffers (already offset to the slot) plus the split point in local (chunk) token coordinates.
ssm_layer_counter is a fresh per-pass counter: each SSM layer’s prefill
increments it once, in model order, so the value indexes h_dsts/conv_dsts
(which are in the same SSM-layer order as the snapshot pool).
Fields§
§cap_local: usizeSplit point in local token coordinates: capture state AFTER this many
tokens (== tb - proc_start).
h_dsts: &'a [DevicePtr]Per-SSM-layer h_state snapshot destination (offset to the reserved slot).
conv_dsts: &'a [DevicePtr]Per-SSM-layer conv_state snapshot destination (offset to the reserved slot).
h_bytes: usizeBytes per layer of h_state.
conv_bytes: usizeBytes per layer of conv_state.
ssm_layer_counter: &'a AtomicUsizeFresh per-pass SSM-layer ordinal counter (model order == pool order).
cap_local_early: Option<usize>Optional SECOND capture one KV block earlier, at tb - block_size
(local split point cap_local - block_size). Some only when the pass
also covers that point. On ~5/19 warm turns the next turn’s block-floored
matched_tokens lands exactly tb - block_size (generation-suffix /
retokenize divergence), one block short of the tail; registering this
earlier restore point makes those turns zero-replay too.
h_dsts_early: &'a [DevicePtr]Per-SSM-layer h_state dst for the tb - block_size slot (offset applied).
conv_dsts_early: &'a [DevicePtr]Per-SSM-layer conv_state dst for the tb - block_size slot.