Skip to content

ux(wasm): clarify prefill wait + confirm streaming works#35

Merged
unamedkr merged 1 commit into
mainfrom
fix/wasm-prefill-ux-message
Apr 10, 2026
Merged

ux(wasm): clarify prefill wait + confirm streaming works#35
unamedkr merged 1 commit into
mainfrom
fix/wasm-prefill-ux-message

Conversation

@unamedkr
Copy link
Copy Markdown
Collaborator

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

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>
@unamedkr unamedkr merged commit 09adb11 into main Apr 10, 2026
@unamedkr unamedkr deleted the fix/wasm-prefill-ux-message branch April 10, 2026 11:36
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.

1 participant