pub struct DflashProposerState {Show 15 fields
pub block_table: Vec<u32>,
pub seq_len: usize,
pub last_num_drafted: usize,
pub prefill_done: bool,
pub ctx_hidden_acc: DevicePtr,
pub ctx_len: usize,
pub last_num_accepted: usize,
pub skip_next_decode_append: bool,
pub max_ctx_len: usize,
pub ctx_slot_bytes: usize,
pub block_table_dev: Option<DevicePtr>,
pub ctx_count_drafter: usize,
pub max_ctx_count_drafter: usize,
pub ctx_committed: usize,
pub ctx_positions: Vec<i32>,
}Expand description
2026-09-25: Per-sequence DFlash drafter state. One block table serves every drafter layer: the paged cache has a pool per layer, addressed by the same slots.
Fields§
§block_table: Vec<u32>2026-09-25: Host copy of the drafter block table.
seq_len: usize§last_num_drafted: usize2026-09-25: Drafts the last propose returned; after_verify and
free_state reset it to 0.
prefill_done: bool2026-09-25: max_ctx_len rows of ctx_slot_bytes: captured target
hiddens, one row per ctx position, the first ctx_len valid. Model-engine
appends rows and slides the window when it is full; propose_drafts
appends while there is room.
ctx_len: usize2026-09-25: Valid rows in ctx_hidden_acc, at most max_ctx_len.
last_num_accepted: usize§skip_next_decode_append: bool2026-09-25: Model-engine has already appended the latest capture; the
next propose_drafts skips its own append and clears the flag.
max_ctx_len: usize2026-09-25: Rows ctx_hidden_acc holds (the window of
alloc_state_windowed).
ctx_slot_bytes: usize2026-09-25: Bytes per ctx_hidden_acc row:
target_layer_ids.len() * target_hidden_size * 2.
block_table_dev: Option<DevicePtr>2026-09-25: Device copy of block_table, made once when the first
propose allocates the table; None before that and after free_state.
ctx_count_drafter: usize2026-09-25: Ctx rows of the paged cache the γ block attends to;
propose_drafts sets it to ctx_len.
max_ctx_count_drafter: usize2026-09-25: Slots the allocated block table covers
(block_table.len() * BLOCK_SIZE).
ctx_committed: usize2026-09-25: Ctx rows [0, ctx_committed) whose K/V is already in the
paged cache; the next precompute starts here. Model-engine’s window
slides reset it to 0.
ctx_positions: Vec<i32>2026-09-25: One RoPE position per ctx row (len() == ctx_len), stamped
when the row is appended and kept when the window slides. Model-engine’s
update_dflash_ctx_len_after_prefill seeds prefill row i with i.