Repository navigation
Conversation
…prompt-cache/limit)
A cache is never need (Joel, 2026-11-11: 'Why would you grab what you aren't actively using').
On the M5 a 4 MB learner waited forever ('0 of 4096000 governed Vram bytes are free') while the
host prompt cache (--cache-ram 13056) held ~13 GB counted as serving's need (continuum card
494c99f1). The cache already trims to a mutable limit (server_prompt_cache::update evicts the
oldest states while size() > limit_size), but only --cache-ram set it, at launch.
POST /prompt-cache/limit {limit_mib >= 1} runs on the serving loop (it owns the cache), sets the
limit, trims, and replies {refusal, limit_mib, held_bytes, freed_bytes, states}, so the core frees
exactly what was measured. 0 is refused (to the cache it means 'no limit'). Router mode proxies it.
Fixture: tests/prompt-cache-limit.py (fill, refuse 0, lower to 1 MiB and assert bytes freed and the
cache fits, raise again).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…_t (Cormac on #110) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Review of fork #110 at 357096e (Cormac): CHANGES REQUESTED, one fix; the rest is right. Verified by reading (not run here: the patch does not apply on top of #109, so running its fixture needs its own build tree):
The fix: Nit (non-blocking, card it or fix here): the reply reuses Owner question for the core slice: a lowered limit outlives a core that dies before raising it again; who restores it (a lease the core holds, released on its death)? |
|
Re-review (Cormac): APPROVE. Verified by reading the new head's diff: max_mib = SIZE_MAX >> 20 (2^44 - 1 on 64-bit), so limit_mib * 2^20 < 2^64 and never wraps; 0 and anything above max_mib are refused 400; a JSON integer past INT64_MAX reads back negative and fails >= 1; the fixture asserts 2^62 refused. The non-blocking nit (generic receipt type) and the core-side question (who restores a lowered limit after the core dies) stand for the core slice. |
Slice 1 of continuum card 494c99f1 (the learning blocker). A cache is never need. On the M5, a 4 MB learner waited forever because the ~13 GB host prompt cache counted as serving's need.
Change:
POST /prompt-cache/limit {limit_mib >= 1}.update()already did this; only--cache-ramcould set the limit, and only at launch.{refusal, limit_mib, held_bytes, freed_bytes, states}, so the core frees exactly what was measured.0is refused, because to the cache it means no limit.Fixture:
tests/prompt-cache-limit.py. It fills the cache, checks0is refused, lowers the limit to 1 MiB and asserts bytes were freed and the cache fits, then raises the limit again.Next slices (core): serving's cache becomes its own reclaimable lease, whose eviction calls this verb. A learner's refused lease then reclaims cache bytes before waiting.
🤖 Generated with Claude Code