Skip to content

kern-serve: first prefill completions retain their stop cause - #62

Merged
xiaguan merged 1 commit into
pegainfer-project:masterfrom
Venkat2811:codex/first-token-stop-cause-20261015
Oct 19, 2026
Merged

xiaguan merged 1 commit into
pegainfer-project:masterfrom
Venkat2811:codex/first-token-stop-cause-20261015

Conversation

@Venkat2811

Copy link
Copy Markdown
Contributor

The PP non-handoff path classifies its first output token but discards the typed cause when emitting completion. Preserve that cause through Front and the scheduler ledger so EOS and explicit-stop finishes remain distinguishable from length finishes.

The model-free Linux regression exercises the production completion helper, Finish::notes, Front and the ledger. It compiles and fails before at stop_cause: None instead of Some(Eos(2)), then passes after. It also covers explicit stops, ignored EOS, ordinary length completion, token counts and no output after completion. All 48 kern-serve tests, formatting and all-target Clippy with warnings denied pass.

The HTTP bridge was source-audited: a Stop finish without a cause takes its compatibility-EOS fallback. These tests do not execute that HTTP bridge or establish HTTP end-to-end accounting; no model or throughput claim is made. Dependencies and the lockfile are unchanged.

The non-handoff PP completion path classifies the first token but drops
the result when sending Note::Finish. A Stop terminal without a typed
cause asks the frontend bridge to append its legacy compatibility EOS,
although the stopping token has already been emitted.

Keep the classification in the completion notes and preserve it through
Front and the scheduler ledger. Factor only this emit/finish pair into a
private helper so the regression exercises production completion logic
without a model or CUDA runtime.

Cover primary EOS precedence, explicit stop tokens, ignored EOS, one-token
length finishes, token accounting, and absence of output after completion.
Linux CPU regression fails before at the missing typed cause and passes
after; all 48 serving tests, formatting and all-target kern-serve Clippy
with warnings denied pass. The HTTP bridge is source-audited, not executed
by these tests; no HTTP end-to-end, model or throughput claim is made.

Signed-off-by: Venkat Raman <vraman2811@gmail.com>
@xiaguan
xiaguan merged commit bab92a1 into pegainfer-project:master Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants