sched: checkpoint sliding windows at prefill intervals

Keep intermediate window snapshots as well as the prompt-tail snapshot so a tail edit can resume below its divergence instead of re-prefilling the entire matched prefix. Reuse the existing checkpoint retention policy and preserve the pre-template-divergence tail boundary.

Add scheduler and cache regression tests for interval snapshots, aligned prompt tails, constrained chunk budgets, and edited-prefix lookup. Update the geometry report and guide to describe periodic window snapshots.
This commit is contained in:
John authored and StillDeadcode committed 2026-10-24 11:08:38 +02:00
1 parent 9eaf10da6e
commit 192fe10278
6 files changed
+89 -16

No files matched your search

+3 -4
View File
@@ -51,10 +51,9 @@ struct ChunkGeometry {
/* Every contributor by name, for the startup line and the refusal. */
std::string why;
/* No linear state but a sliding window: the checkpoint snapshots only the window behind a
* prompt's tail (KVManager::has_window_snapshot). Chunks are not split at the interval, since
* a mid-prompt window snapshot gains nothing; the interval is only the shortest prompt worth
* a snapshot. */
/* No linear state but a sliding window: checkpoints snapshot the window behind an
* interval boundary or the prompt's tail (KVManager::has_window_snapshot). Intermediate
* snapshots let an edited prompt resume below its divergence instead of from zero. */
bool window_ckpt = false;
bool checkpoints() const { return checkpoint_interval > 0; }