| 330 | |
| 331 | if (best_idx >= 0) { |
| 332 | move_to_end(best_idx); |
| 333 | lifetime_hits_.fetch_add(1, std::memory_order_relaxed); |
| 334 | std::fprintf(stderr, "[pc] lookup hit slot=%d prefix_len=%d (of %zu total)\n", |
| 335 | best_slot, best_len, prompt_ids.size()); |
| 336 | } |
| 337 | return {best_slot, best_len}; |
| 338 | } |
| 339 | |
| 340 | std::pair<int, int> PrefixCache::prepare_inline_snap( |
| 341 | const std::vector<int32_t> & prompt_ids, |
| 342 | int restored_prefix_len, |
| 343 | bool prefer_tools_boundary, |
| 344 | int forced_cut) { |
| 345 | if (disabled_) return {-1, 0}; |