Repository navigation
Widget: draw the first text at once and bound the reveal to half a second - #539
Merged
neuromechanist merged 6 commits intoSep 29, 2026
Merged
Conversation
…cond Refs #538. The reveal took about 2 s after the last chunk. Now the first text is drawn when it arrives and each later character no later than 500 ms after it arrived (an arrival log sets the pace against the oldest undrawn character's deadline; a backlog under 1000 chars/s is drawn at once); a finished reply waits at most 700 ms. Tested in the Bun suite (123 checks, including a 300-schedule property of the bound) and in real Chrome.
…schedules, real Chrome Refs #538. The delay bound is pinned in the tests (not derived from the constants, which let a 4 s drain cap pass), a seeded property checks that no character is drawn more than 580 ms after it arrived, and the Chrome check is updated: first words 0.3 to 15 ms after the first chunk, whole reply about 0.5 s after the last.
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
…ap at once, harden the bound Refs #538, review findings. One deadline for the whole backlog let a burst landing late in an earlier reveal be drawn in a single step; each chunk now sets its own pace and a chunk within a tick of its deadline is drawn now, so the bound no longer rests on timers firing exactly on time. Text arriving on an idle reveal is drawn at once (a line or so), the reveal reads a monotonic clock, and drain() on an unpaced reveal shows everything at once.
…em time change Refs #538, review findings. New checks for a burst after a pause and one that lands late in an earlier reveal, text arriving on an idle reveal, timers 1 ms early and 20 or 60 ms late, the default clock surviving a system time change, drain on an unpaced reveal and page hide (asserted synchronously). A count of distinct lengths with no margin is relaxed to 3 (it flaked under load); the Chrome check now fails a first paint of 50 ms or more. Each new behavior broken once and caught.
Refs #538, review findings.
neuromechanist
deleted the
feature/issue-538-tighter-reveal-progress
branch
September 29, 2026 14:59
This was referenced Sep 29, 2026
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.
Refs #538 (the reveal half; the progress-status half is a separate PR).
Why
The paced reveal from #533 started within about 0.1 s of the first chunk but finished about 2 s after the last one, which reads as delay. Measured against real Bedrock (same prompt, no tools), the wait before Luna's first word is the model's own and OSA adds nothing to it:
With tools it is much longer (NEMAR: 15.8 s to the first word, 48.8 s in total). Luna's effort stays at max; this PR only removes what the widget adds after the text arrives.
What this does
Measured (real Chrome 154, headless, three runs)
The burst is still spread over a visible window (7 steps), so it does not flash in, but it adds at most half a second.
Testing
frontend/browser-harness/paced-reveal-check.mjs) updated to the new contract; 3 of 3 runs pass.Not verified
Not run against the dev API with Luna in a foreground browser window (the Chrome window connected to my session was in the background). The numbers above are the real widget in real Chrome against a local stream shaped like Luna's.
Review
An independent review confirmed the bound (a randomized search over arrivals up to 200,000 characters, gaps of 0 to 1,000 ms, and late-timer models found a worst delay of 499 ms) and found these, all addressed:
>= 5distinct lengths had zero margin; 1 of 18 runs failed under CPU load):>= 3.performance.now()(a system time change made a burst look younger; tested by steppingDate.nowback 10 s, and broken once to see it caught);drain()on an unpaced reveal shows everything at once instead of waiting on a throttled timer.knowncounter is redundant with the arrival pruning (a memory guard only).