Lasm 0.3.8
A bug-fix release. Upgrade with npm install -D @lasm/[email protected].
0.3.7 was never published: its release checks failed on a timing-dependent stress test (fixed here), so its changes ship in 0.3.8.
Fixes
- A hang in synchronous JavaScript callbacks (Node).
- The bug: a synchronous Lasm.JS callback that made the program's first asynchronous runtime request (for example, its first timer) hung forever. Starting Lean's completion thread waits for Node's main thread, and the main thread was blocked waiting for the callback.
- The fix: while it waits, the main thread now also runs the work other threads hand to it, every 10 ms.
- How it was found: while modelling the host bridge in Lean for model
checking (the lazy completion thread). It is reproduced on 0.3.5 and
covered by a regression test and the
js-callbacksfixture.
- WASI dev builds after a Node dev build.
lasm build --devfollowed bylasm build --target wasi --dev(alsowasi-httpandfastly) failed with duplicatelean_uv_tcp_*symbols. The WASI link now drops the Node runtime's dev members, as the edge link already did. Found by differential testing. LEAN_BACKTRACEandLEAN_ABORT_ON_PANICon the edge targets (#26). The edge runtime's C code now sees the host's environment variables, soLEAN_BACKTRACE=0andLEAN_ABORT_ON_PANIC=1work there as on Node. A browser has no environment, so these keep their defaults there (EDGE.md). Found by differential testing.
Documentation
- Measured limits (#30). WASI.md states the exit statuses wasmtime accepts (0–125) and the measured recursion depth on each runtime.
Testing (no change to how programs build or run)
- Model checking of the host bridge.
- A Lean model of the host-call protocol (
verification/host-bridge/) is checked over every interleaving up to its bounds: no request is lost or served twice, no deadlock, and progress under fairness. - Eight bugs reintroduced into the model, including the 0.3.0 hang, are all found.
- A Lean model of the host-call protocol (
- Traces checked against the model. Seeded schedule fuzzing of the real JavaScript runs on pull requests that touch the bridge and nightly on every OS. The traces it records are checked against the model.
- More differential oracles. Generated programs are also checked
against Lean's interpreter (
lean --run), against unoptimized (-O0) Lasm builds, and on three engines (V8, JavaScriptCore, SpiderMonkey). - Stress tests now require identical output on every run.
- The differential harness decodes program output once. A UTF-8 character split across pipe chunks had looked like a divergence.
Known and not yet fixed: awaiting an asynchronous operation inside a synchronous JavaScript callback still hangs.