Lasm 0.4.1
A bug-fix release. Upgrade with npm install -D @lasm/[email protected]. There are no breaking changes; ^0.4.0 picks it up.
Fixes
- Edge and browser: a C-stack overflow is reported as one (#115).
- The bug: when a program exhausted the edge build's 1 MiB C stack (for example deep recursion with large frames), the instance stopped with the trap that followed ("memory access out of bounds"; on Bun, "Out of bounds memory access"). This affected Workers, the other edge platforms, Bun, Deno and the browser.
- The fix: the instance now stops with "Stack overflow detected: Lean exhausted the edge profile's 1 MiB C stack (WebAssembly linear memory)". The same text reaches the rejection, the
[lasm] the Lean instance stopped:line and the browser'sonError. The original trap is the error'scause, and other traps keep their own message. Lasm reads the stack pointer only when Lean is entered and when the instance stops, so normal calls cost nothing extra. - Tests: unit tests of the controller and the overflow check. The differential's "Recursion depth" job also builds three recursions at
-O0for the edge on Node, Bun and the edge runtime, runs each just past its measured limit, and requires every stop to be named as a stack overflow. Found by the Bun and browser differential (PR #109).
Documentation
- The
Function.ofSyncFndocstring now matches JS_BINDINGS.md:- Console output works inside a synchronous callback.
- Waiting for a timer, DNS lookup or socket read started inside the callback never finishes. Starting one is fine.
- A synchronous callback cannot call another one.
Testing
- Mutation scores have a ratchet (PR #116). Each module's threshold is its score rounded down, at least 80 %, and it is never lowered. CI fails a PR, and the nightly run, when a module's score drops below its threshold. New tests kill mutants that survived before:
- the Apache-2.0 notice lines for Lean runtime patches;
- the object store's on-disk format;
- long UI texts;
- reused subscription ids.
- The example apps build against 0.4.0. Ledger, Porter, Tandem, Conduit and Folio now pin
@lasm/cli0.4.0, and their CI runs against it.