pub struct LayerCache {
pub kvc: CudaSlice<f32>,
pub n_blocks: usize,
pub pend_kv: Option<CudaSlice<f32>>,
pub pend_score: Option<CudaSlice<f32>>,
pub ikvc: Option<CudaSlice<f32>>,
pub i_blocks: usize,
pub ipend_kv: Option<CudaSlice<f32>>,
pub ipend_score: Option<CudaSlice<f32>>,
}Expand description
Lane-6 decode cache for ONE trunk layer, on the layer’s owning stage. Layout mirrors
the reference (model.py:473-474, :491): kvc = [win + cap_blocks, hd] f32 with the
128-slot window ring at rows [0, win) (slot = pos % win, M:530) and compressed block
j at row win + j (decode index offset = win, M:509). Pending state = RAW wkv/wgate
rows (ape added at pool time — see the lane-6 receipts): fine [2·ratio, latent] with
rows [0, ratio) = previous block / [ratio, 2·ratio) = current (M:344-370 state
machine); coarse [ratio, latent]. pend_score is initialized to −inf so a block
with no predecessor reproduces the reference j==0 masking bit-exactly.
Fields§
§kvc: CudaSlice<f32>§n_blocks: usize§pend_kv: Option<CudaSlice<f32>>§pend_score: Option<CudaSlice<f32>>§ikvc: Option<CudaSlice<f32>>indexer compressed-kv store [cap_blocks, index_head_dim] (FP4-QAT’d values) + its own pending pair — fine layers only.
i_blocks: usize§ipend_kv: Option<CudaSlice<f32>>§ipend_score: Option<CudaSlice<f32>>