ollama/x/mlxrunner/cache
Jesse Gross 144893850f mlxrunner: stop cache rewind refills from corrupting later lazy snapshots
A lazy KV snapshot indexes into the cache's live buffer instead of owning
a copy, so it must be copied out before an append overwrites the slots it
names. appendKV checked for that only on the first append after a rewind,
and only against that append's own range: a still-lazy snapshot further
ahead in the buffer was overwritten without a copy when a later append
reached it. This happens when a request reuses a short prefix of a longer
cached conversation and prefills past one of the old conversation's
snapshots; restoring that snapshot later silently serves the new request's
KV in place of the old conversation's.

Scan every append instead. The overlap test already limits copies to
snapshots the current write clobbers, and appends outside a rewind refill
sit above every snapshot, so the steady-state scan walks a short list and
finds nothing. This restores the invariant Restore's lazy fast path relies
on: a snapshot still in its lazy state has never been overwritten.
2026-08-05 16:31:56 -07:00
..
cache.go mlxrunner: drive MTP speculation through cache snapshots 2026-06-09 00:39:19 -07:00
cache_test.go
kvcache.go mlxrunner: stop cache rewind refills from corrupting later lazy snapshots 2026-08-05 16:31:56 -07:00
lazy_test.go mlxrunner: drive MTP speculation through cache snapshots 2026-06-09 00:39:19 -07:00
recurrent.go cache: stop recurrent conv state from pinning the forward buffer 2026-07-14 10:32:04 -07:00
recurrent_test.go nn/recurrent: run the gated-delta step in one launch 2026-07-31 10:18:54 -07:00
rotating.go mlxrunner: drive MTP speculation through cache snapshots 2026-06-09 00:39:19 -07:00
rotating_attention_test.go mlxrunner: drive MTP speculation through cache snapshots 2026-06-09 00:39:19 -07:00
rotating_multiturn_test.go
snapshot_capture_test.go mlxrunner: drive MTP speculation through cache snapshots 2026-06-09 00:39:19 -07:00