dflash_ctx_cap

Function dflash_ctx_cap 

Source
pub fn dflash_ctx_cap() -> usize
Expand description

The DFlash context-window bound, in tokens: the most recent target positions the drafter is allowed to accumulate and attend to.

SINGLE DEFINITION on purpose. Two buffers are sized from it — the per-sequence ctx accumulator here, and the model-level whole-prompt hidden capture (impl_a1) that feeds prefill_drafter — and the drafter cannot use more prompt than it can store, so capturing past this bound is dead memory. Letting the two drift is exactly the ceiling-vs-need bug this bound exists to close.

ATLAS_DFLASH_CTX_CAP=<tokens>; 0 disables the cap entirely.