pub struct LatentPlaneSnapshot {
pub rows: CudaSlice<f32>,
pub width: usize,
pub len: usize,
pub index_width: usize,
pub index_pool: usize,
pub index_tail: Option<CudaSlice<f32>>,
pub index_pool_keys: Option<CudaSlice<f32>>,
pub index_pools_ready: usize,
}Expand description
One MLA/DSA layer’s captured latent-plane state: everything mla_attn_cached +
mla_kpool_indices need to continue as if the destination session had primed the prefix
itself (lane/glm5-prefix-latent, 2026-08-30; design in
research/glm5-prefix-latent-20260830/DESIGN.md).
The three asymmetries against an ordinary PrefixPlane, and how each is carried:
rowsis deliberately UNQUANTIZED f32 (the maxdiff oracle depends on the f32 plane), so the copy is f32-for-f32 — no quantization program is introduced at the snapshot seam.index_rowsis a TAIL RING whose rows belowindex_pools_ready * poolare OVERWRITTEN by design, so “the index plane” is not copyable and not rebuildable: the snapshot carries the DERIVED keys (final by the append-only invariant, bit-identical to a rebuild) plus thelen % poolstill-live tail rows (index_tail, at mostpool - 1rows).index_pool_keys/index_pools_readycarry the append-only finality invariant, so the capture assertsindex_pools_ready == len / pool(every call boundary leaves the drain there) and the restore re-establishes both, keeping the engine’s residency tripwire andindex_ring_takearithmetic blind to the fact that a restore happened.
Fields§
§rows: CudaSlice<f32>Rows [0..len) of the latent plane, len * width f32.
width: usize§len: usize§index_width: usize0 = the layer has no indexer state plane (and every index_* field below is empty).
index_pool: usizeThe indexer’s pool size at capture (LatentKvLayer::index_pool); 0 iff no indexer.
index_tail: Option<CudaSlice<f32>>The live tail-ring rows [index_pools_ready * pool, len), (len % pool) * index_width
f32; None when the boundary is pool-aligned.
index_pool_keys: Option<CudaSlice<f32>>The FINAL pool keys [0..index_pools_ready * d), d = index_width / 2; None when no
pool has completed.
index_pools_ready: usize