The Wire · Showcase
WASM RUNTIME SHRINKS 3.6% AS DOTNET HARDENS DEBUGGER EXPORTS
By RepoJournal · Filed · About .NET
The JIT compiler just cut 815 kilobytes from WebAssembly Core Library by folding address constants into load instructions, while the runtime fixed a silent failure in WASI debugging that would strip metadata from stripped binaries.
Andy Ayers landed an optimization [1] that saves 814,971 bytes (3.60%) of the System.Private.CoreLib wasm code section by containing relocatable address constants under loads and emitting relocations in the memarg offset instead of separate i32.const/i32.add sequences. This hits wasm R2R code where every byte counts. Separately, Larry Ewing fixed a critical gap in WASI debugging: the cDAC contract descriptor getter `GetDotNetRuntimeContractDescriptor` was not being exported on wasi-sdk builds, so linker `--gc-sections` stripped it entirely [2], leaving native hosts and cDAC readers unable to discover runtime data-contract descriptors. The emscripten path already had the fix via `EMSCRIPTEN_KEEPALIVE`, but WASI had no equivalent. Andrew Arnott also resurrected a long-stale PR in Nerdbank.Streams that reworks node.js stream utilities to fix two silent data hazards: `readAsync` was leaving streams permanently paused and broken for downstream consumers [3]. The fix rewrites the implementation to avoid node.js stream state traps that silently hung applications.
One email a day. Unsubscribe in one click.
Keep up with .NET in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review wasm optimization PRs before next CoreLib release dotnet/runtime [plan]
- → Update WASI builds with cDAC descriptor export fix dotnet/runtime [immediate]
- → Test Nerdbank.Streams node.js interop in your pipeline if you depend on it dotnet/Nerdbank.Streams [monitor]
References
- [1] JIT: fold wasm R2R address constants into load memarg offsets ↗ dotnet/runtime
- [2] [wasm] Export cDAC contract descriptor getter on non-emscripten wasm (wasi-sdk) (#131241) dotnet/runtime
- [3] Rework node.js stream utilities (readAsync, sliceStream, readSubstream, Splice) ↗ dotnet/Nerdbank.Streams