ux(wasm): clarify prefill wait + confirm streaming works#35
Merged
Conversation
The "hang" users see is actually the prefill phase (processing all
prompt tokens through 28 layers in WASM). This takes 5-10s for a
0.8B model and cannot be interrupted — it runs synchronously before
the first ASYNCIFY yield point in the generation callback.
Changes:
- Message now says "Processing prompt (may take a few seconds)..."
to set expectations correctly
- Stats bar shows "processing prompt..."
- Confirmed ccall({async:true}) is the correct ASYNCIFY pattern
and generation streaming works AFTER prefill completes
The prefill blocking is a fundamental WASM limitation without a
step-by-step API. Future: expose a single-token-forward API to
enable prefill yielding.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
The "hang" is the prefill phase (5-10s for 0.8B in WASM). Shows "Processing prompt (may take a few seconds)..." to set expectations. Generation streaming works correctly after prefill via ccall({async:true}).
🤖 Generated with Claude Code