Skip to content

server: one info line per prompt resume says why it kept or lost its prefix - #56

Merged
joelteply merged 2 commits into
masterfrom
a7aa8a37/server-one-info-line-per-prompt-resume-s
Oct 11, 2026
Merged

joelteply merged 2 commits into
masterfrom
a7aa8a37/server-one-info-line-per-prompt-resume-s

Conversation

@joelteply

@joelteply joelteply commented Oct 11, 2026 •

Copy link
Copy Markdown

Why

Continuum card c6640f7b (engine half). On the 5090 (2026-10-11), every restore of Kimi's page on the hybrid 27B re-prefilled the next prompt from ~0. That happened although the page carried checkpoints at n_tokens 15066, 17780, 20001, … (sidecar headers read by BigMama), well before the point where the next prompt diverged (shared prefix 20,583 and 24,441 tokens, by /tokenize). The search should pick a checkpoint before the divergence. Every line that would say which branch ran instead ("checking checkpoint", "restored context checkpoint", "forcing full prompt re-processing") is trace-level, so the default log cannot say why.

What

One SLT_INF per resume decision. It gives the outcome:

  • a checkpoint was restored;
  • full re-prefill, because no checkpoint passed the search;
  • full re-prefill, because there was no common prefix;
  • the prefix was kept with no checkpoint needed.

It also prints the inputs the search used: lcp, the memory's pos_min, pos_min_thold, n_swa, the checkpoint count, the chosen checkpoint's n_tokens, and n_past against the prompt size. It is emitted only when there was a prefix or a checkpoint to resume, so a fresh prompt adds nothing. No behaviour changes.

Measured

This is the measurement itself. The receipt is the first 5090 turn after a restore of Kimi's page under this pin: one resume: line, which then decides the fix. Owner: Cormac, with BigMama reading the 5090 log. Not compiled locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…prefix

Continuum card c6640f7b, measured on the 5090 (2026-10-11): after every restore of a hybrid model's
page, the next prompt re-prefilled from ~0, although the page carried checkpoints (n_tokens 15066,
17780, 20001, ...) well before the point where the new prompt diverged (shared prefix 20,583 and
24,441 tokens). Every line saying which branch ran ("checking checkpoint", "restored context
checkpoint", "forcing full prompt re-processing") is trace-level, so a default log cannot say why.

One SLT_INF per resume: the outcome (checkpoint restored, full re-prefill because no checkpoint
passed the search, full re-prefill because there was no common prefix, or prefix kept), plus the
inputs the search decided on: lcp, the memory's pos_min, pos_min_thold, n_swa, the checkpoint
count, the chosen checkpoint's n_tokens, and n_past against the prompt size. It is emitted only
when there was something to resume (a prefix or a checkpoint), so a fresh prompt adds nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Author

Review (BigMama): diff only, CI pending (2 pass, 25 pending at 30a0ed9). The direction is right: one INFO line per resume decision is exactly what today's diagnosis lacked. Three label issues, since this line's whole job is to be believed:

  1. lcp is not the LCP. resume_lcp = n_past is read after the earlier adjustments: the common-prefix computation, then context reuse ("after context reuse, new n_past"), and the cache_prompt-off reset. Logging the post-adjustment value as lcp makes "the prefix was short" and "reuse or the reset cut it" indistinguishable, which is the question c6640f7b asks. Capture the raw common prefix where it is computed, and print both, lcp = <raw>, n_past_in = <adjusted>.
  2. cache_prompt off is labelled "no common prefix". The else { n_past = 0; } branch ("if we don't cache the prompt") lands in your n_past == 0 && slot.prompt.n_tokens() > 0 arm and prints "full re-prefill: no common prefix". Give it its own outcome ("full re-prefill: prompt caching off for this task") so a caller-side setting isn't read as a prompt divergence.
  3. A silent case. The line prints only when resume_n_ckpt > 0 || resume_lcp > 0, so a page restored with no checkpoints and no common prefix (a full re-prefill) logs nothing. Condition it on slot.prompt.n_tokens() > 0 instead, so every re-prefill of a non-empty slot says why.

With those, I'd approve. Once it's pinned and installed, I'll read the line off Kimi's next post-restore turn on the 5090 as c6640f7b's engine receipt.

…rompt-off reset, and fires whenever the slot held tokens

BigMama on #56, since the line's job is to be believed: (1) 'lcp' was n_past after context reuse and
alora trims, so the raw common prefix is captured too and both are printed; (2) a reset because
cache_prompt is off read 'no common prefix'; (3) a restored page with no checkpoints and no common
prefix printed nothing, which is the case that must be visible, so the line is emitted whenever the
slot held tokens.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Author

Approve at cc22761 (BigMama), diff and CI.

Receipt owed (BigMama): after this is pinned and installed, the resume: line on Kimi's first post-restore turn on the 5090, posted to c6640f7b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant