Commit 01e0a2d
fix(wasm): remove prefill sleep — restores ASYNCIFY token streaming (#33)
The emscripten_sleep(0) added to quant.h's prefill loop (PR #30)
broke ASYNCIFY for the entire quant_generate call. The call stack
during tq_forward() is too deep (matmul → SIMD kernels) for
ASYNCIFY to unwind/rewind — it silently fails and the generation
callback's sleep stops working too.
Fix: remove prefill sleep entirely. The prefill blocks the browser
for a few seconds (unavoidable without a step-by-step API), but
"Thinking..." is shown before via requestAnimationFrame. Token
streaming during generation works again.
Also: pthreads removed (PR #32) to avoid pthreads+ASYNCIFY
conflict, build.sh now uses single-thread SIMD + ASYNCIFY only.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3df9a49 commit 01e0a2d
3 files changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15462 | 15462 | | |
15463 | 15463 | | |
15464 | 15464 | | |
15465 | | - | |
15466 | | - | |
| 15465 | + | |
| 15466 | + | |
| 15467 | + | |
| 15468 | + | |
| 15469 | + | |
15467 | 15470 | | |
15468 | 15471 | | |
15469 | | - | |
15470 | | - | |
15471 | | - | |
15472 | | - | |
15473 | 15472 | | |
15474 | 15473 | | |
15475 | 15474 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
0 commit comments