Archived
Scheduler::preempt_back dropped everything a request had computed: unlike close_request it published nothing, so a preempted 96.6k-token prompt was computed again from its first token. The publish block of close_request is now Scheduler::publish_prefix, called by both. Its blocks stay in the cache, so a preemption that published gives eviction its rounds back (the decode ensure loop and the overdue path) and the cache gives them back, the newest last, before another request is preempted. preempted_can_prefill counts the blocks the recompute adopts from the cache (pc_->lookup), so a preempted request is not held back for room its own cached prompt already covers. Shared KV with RADIANCE_KV_GUARANTEE=1 (nine Qwen requests preempted for TranslateGemma's start pool): Qwen 587 -> 458 s, TranslateGemma 139 -> 80 s; without the guarantee unchanged (340 / 58 vs 339 / 56). Test: a_preempted_request_publishes_its_prefix; sched 187, engine_e2e and the related suites pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>