lumbda/wasm
russell@unturf.com 89d4877ee9
playground streaming: split chunks on \n in the worker, send eol flag
After (4) rounds of newline-debugging where node tests said chunks
contained \n but fox's Firefox tab still rendered horizontal text
for the c tier (python+asm rendered vertical with the same code
path), giving up on trying to guess where the \n was being eaten
and instead getting rid of \n bytes on the wire entirely.

Worker now splits each onChunk slice on \n at the source and posts
one message per line — { kind:'chunk', tier, chunk:'tick 0', eol:true }
— so the line break is carried as a boolean flag rather than a byte.
Main thread re-attaches the '\n' before handing to liveBlock.append,
which still walks bytes for charCodeAt 10 and stacks per line.

Effectively: the loader's currentOnChunk(line + '\n') feeds the
worker which immediately splits back on the \n, both halves still
arrive on the main thread, the main thread reconstitutes them with
a fresh \n that we now know our DOM split honors (proved by the
python tier which uses the same liveBlock.append). C-tier-specific
\n loss between Module.print and postMessage drops out of the
picture.
2026-06-15 06:24:57 -04:00
..
app playground streaming: split chunks on \n in the worker, send eol flag 2026-06-15 06:24:57 -04:00
asm wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
c playground: split streamed chunks into per-line divs + per-program drafts 2026-06-15 06:02:37 -04:00
dist-repl playground: split streamed chunks into per-line divs + per-program drafts 2026-06-15 06:02:37 -04:00
python playground: stream tier output line-by-line during eval 2026-06-14 20:25:47 -04:00
repl gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00
tests wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
Makefile bend: fix C tier LinkError — switch EM_JS to --js-library mergeInto 2026-06-14 19:33:07 -04:00