speculation: a group the window snapshot restores is no hole in a drafter's KV after a prefix hit

On Gemma 4 (sliding layers the prefix cache does not index, no linear state) a hit resumes the
trunk's window from a window snapshot. The check for a hole in a block drafter's own KV after a
hit counted every paged group the prefix cache does not index, the trunk's windowed one included,
so it found a hole the snapshot fills. z-lab's DFlash drafter keeps a full-attention cache, which
the prefix cache indexes; with that false hole its floor sat at the hit, and with no window to
slide it was declined for the rest of every turn after a hit (on the 31B: 1.00 tokens a step on
those turns, 4.25 with this). The scheduler now counts a group the snapshot restores
(IKVManager::window_snapshot, the KV manager's KVGroupPlan::win_snap) as no hole, and the startup
line says how many: `draft floor: 3 paged group(s), 2 prefix-cached, 1 in the window snapshot -> a
hit leaves no hole`. A drafter's own windowed group is not in the snapshot, so DFlash2 and every
model with linear state are unchanged.

Tests: sched_test (a full-attention drafter drafts at once after a hit the window snapshot resumes,
and with the trunk's window counted as a hole never drafts again that turn; the fixture gains a
full-attention trunk).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AshlynandClaude Opus 5.5 authored and StillDeadcode committed 2026-10-26 09:21:44 +01:00
1 parent 5c1c71b147
commit 66c86b9f89
5 files changed
+118 -40

No files matched your search

+11
View File
@@ -339,6 +339,17 @@ struct FakeKV : IKVManager {
const KVGeom::G& gg = geom.g[(size_t)g];
return gg.paged ? gg.block_size : 0;
}
/* Groups a test says the window snapshot carries (KVGroupPlan::win_snap): a checkpoint slot
* then holds their window, and a hit at a snapshot seeds them (nothing to copy here). */
std::vector<int32_t> snap;
/* False: the snapshot is taken but its groups are not reported, as before
* IKVManager::window_snapshot existed. */
bool snap_reported = true;
bool window_snapshot(int32_t g) const override {
return snap_reported && std::find(snap.begin(), snap.end(), g) != snap.end();
}
bool has_window_snapshot() const override { return !snap.empty(); }
int seed_window(uint64_t, int64_t) override { return snap.empty() ? -1 : 0; }
};
struct FakePC : IPrefixCache {