SIGN IN SIGN UP

server: keep prompt cache current + re-enable ISWA chunk reuse

Three surgical fixes for the cache-hit collapse after agent trims (non-SSD path):

1. llama-kv-cache-iswa: remove the kv_base==kv_swa size-equality
   check from get_can_shift(). When the SWA cache is smaller
   (e.g. 6144 vs 131072 cells on Laguna-XS.2 SWA models),
   seq_add/seq_rm are safe no-ops on the SWA cache for ranges
   outside its window — the base cache handles everything
   beyond the SWA window. This re-enables cache_reuse (chunk
   reuse / non-contiguous KV block matching) which load_model
   was disabling with "cache_reuse is not supported by this
   context, it will be disabled".

2. server-context: lower f_keep threshold from 0.5f to 1.0f
   in get_available_slot(). Previously the prompt cache was only
   saved when >50% of the stored prompt was discarded. Moderate
   trims (40% loss) left the cache stale with no entry for cold
   starts. Now any LCP match triggers save/load.

3. server-task: lower f_keep_cur rejection threshold from 0.25f
   to 0.01f in prompt_load(). Cached entries with low LCP ratios
   are still considered, so post-trim prompts with moderate prefix
   overlap can find useful state in the cache.

Verified: clean build, test-tokenizer-0-llama-spm and test-sampling
pass. test-backend-ops on CPU unchanged (changes don't touch ggml ops).
F
fewtarius committed
f629077d1337a4ed8b502ce7a42010cdcbb77705
Parent: 105889b