lumbda/wasm/python
russell@unturf.com 1f2ef730a2
python tier: SAB-backed pause poll — auto-pause now works on python too
leval() in lumbda.py grows a counter-gated check (every 1024th
iteration) that calls a module-level _lumbda_pause_hook. Native
Python users leave the hook None and the check short-circuits to a
single bitwise AND. The pyodide loader installs a hook that reads
_lumbdaPyPauseRequested (a JS callback over Atomics.load on the
SAB) so the REPL's auto-pause-on-tab-switch flow drops into the
same path on python that it already uses on C.

Also adds setPauseFlag to the python tier's returned object so
runner.setPauseFlag propagates the SAB through worker config.

repl.js's autoPauseTab no longer falls back to hard-cancel when
the active tier is python — the SAB-poll path covers both. Asm
remains on hard-cancel since the WAT tier has no in-eval poll
site yet.

Test suite (tests.py, 571 tests) passes — verified the no-op
hook path doesn't change native eval semantics.
2026-06-15 11:16:50 -04:00
..
lumbda-py.js python tier: SAB-backed pause poll — auto-pause now works on python too 2026-06-15 11:16:50 -04:00