Repository navigation
Conversation
ashhart
force-pushed
the
lead/prefill-progress-events
branch
from
November 14, 2026 00:59
01938bd to
07ccc88
Compare
6 of 8 tasks
ashhart
force-pushed
the
lead/prefill-progress-events
branch
2 times, most recently
from
November 18, 2026 02:12
a7af417 to
cef7569
Compare
ashhart
added a commit
that referenced
this pull request
Nov 18, 2026
Add the Unreleased entry and reclaim one line in lane_host.zig, which the rebase left at 601 after the new progress call: an empty if-branch's comment now sits on its brace line, so the file stays at 600. Behaviour is unchanged.
ashhart
force-pushed
the
lead/prefill-progress-events
branch
from
November 19, 2026 01:42
cef7569 to
9bd4d1a
Compare
ashhart
added a commit
that referenced
this pull request
Nov 19, 2026
Add the Unreleased entry and reclaim one line in lane_host.zig, which the rebase left at 601 after the new progress call: an empty if-branch's comment now sits on its brace line, so the file stays at 600. Behaviour is unchanged.
ashhart
added a commit
that referenced
this pull request
Nov 21, 2026
Add the Unreleased entry and reclaim one line in lane_host.zig, which the rebase left at 601 after the new progress call: an empty if-branch's comment now sits on its brace line, so the file stays at 600. Behaviour is unchanged.
ashhart
force-pushed
the
lead/prefill-progress-events
branch
from
November 21, 2026 10:56
9bd4d1a to
395c0a7
Compare
ashhart
added a commit
that referenced
this pull request
Nov 21, 2026
Add the Unreleased entry and reclaim one line in lane_host.zig, which the rebase left at 601 after the new progress call: an empty if-branch's comment now sits on its brace line, so the file stays at 600. Behaviour is unchanged.
ashhart
force-pushed
the
lead/prefill-progress-events
branch
from
November 21, 2026 14:15
395c0a7 to
ed8479b
Compare
ashhart
added a commit
that referenced
this pull request
Nov 21, 2026
Add the Unreleased entry and reclaim one line in lane_host.zig, which the rebase left at 601 after the new progress call: an empty if-branch's comment now sits on its brace line, so the file stays at 600. Behaviour is unchanged.
ashhart
force-pushed
the
lead/prefill-progress-events
branch
2 times, most recently
from
November 21, 2026 23:19
a248ee2 to
4631a56
Compare
6 of 8 tasks
ashhart
force-pushed
the
lead/prefill-progress-events
branch
from
November 23, 2026 19:10
4631a56 to
6c2b125
Compare
…rst token A streamed chat completion, completion or Responses request with return_progress: true hears how far a prompt filled in more than one call has come. The lane host sends Event.progress (done, total, cached) after each fill-queue call that leaves the pass open and after each call of a lone driver that fills in pieces, for a backend that reports fill_at, each count higher than the last; the pass's prefilled event first sends done == total. Chat and completions write a chunk with "choices": [] and tensorfold.progress, as the include_usage chunk carries usage; Responses writes a tensorfold.progress event. The mailbox keeps the newest count and the reader takes it with the token chunk, so the last count always precedes the first token. Off by default: the engine sends none unless the request asks and its stream has a progress writer (a whole reply, Messages and Cortheon turns have none), so a stream without the field is unchanged. Counts come from the fill_at atomic after a call returns, outside the host lock: no lock is held longer and no GPU sync is added. Host tests cover the fill queue and a lone driver (counts end at the prompt, tokens unchanged), no counts without the flag, for a one-call fill or without fill reports, counts that never go back, and each route's frames over HTTP. Refs #3116.
ashhart
force-pushed
the
lead/prefill-progress-events
branch
from
November 26, 2026 15:32
6c2b125 to
f950798
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A streamed chat completion, completion or Responses request that sends
return_progress: truenow hears how far its prompt pass has come before the reply starts. It builds on the engine's existing prefill reporting:engine_api.Request.return_progress(default false) and a newEvent.progresswithdone,totalandcachedprompt tokens.doneincludes the restored prefix once, and the pass's prefilled event first sendsdone == total."choices": []and the counts undertensorfold.progress, the same shape as theinclude_usagechunk, so clients that readchoicespass over it. Responses writes atensorfold.progressevent, which typed clients skip as an unknown type.docs/api.md: the request field table, a Prompt progress section, and the Responses section.Why streams are unchanged with it off
The engine sends no progress unless the request asks for it and its stream has a progress writer: whole replies, the Messages route and Cortheon turns clear the flag before the request is submitted. Without the field no frame is added and no Responses sequence number moves, and a round costs one boolean test. The SSE goldens and the wire-bytes oracle pass unchanged. No lock is held longer and no GPU sync is added: each count comes from the
fill_atatomic the status reader already uses, read after the call returns and sent outside the host lock.Tests
Host tests, no GPU or weights:
lane_host_progress_test.zig: a four-call fill sends 8, 16, 24 and 32 of 32 before the prefilled event, with the same tokens as without the flag; none without the flag, for a prompt filled in one call, or for a backend that does not report fill; counts never go back after a requeue and the end is sent once; a lone driver that fills in pieces counts each call the same way.prompt_progress_test.zig: over HTTP with a scripted engine that moves on only after the client has read each count, chat, completions and Responses each stream the counts once, in order, before the first text, and the reply text matches the same request without the flag; a whole reply, an explicitfalseand the Messages route ask the engine for none.prompt_progress.zig: the chunk's shape.Steps run:
test-lane-api-host,test-lane-lone-host,test-lane-halt-host,test-lane-interrupted-host,test-prefill-service-host,test-server-cpu,test-golden,test-cuda-host,zig fmt --checkandgit diff --check;tools/zig/lean_check.pyreports no new problems. With the engine's counts, the server's write or the stream gate taken out, the new tests fail.Still owed: a served check, a 32K prompt on one Metal and one CUDA lane family, showing the counts and the same tokens and
token_shaas the same request without the flag.Fixes #3116