[Based on #125] runtime/wasm: integrate Go-style resumable backend - #134
Closed
cpunion wants to merge 28 commits into
Closed
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
LLGo baseline benchmarks
Program measurements
Core language and compiler benchmarks
Compared only with the latest matching platform in the main series. Warning
|
This was referenced Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #125.
Summary
Integrate the experimental Go-style resumable ABI with the complete single-worker wasm runtime behavior already staged through B/C/D/S/H.
This carries the validated K core from #127 onto the hardening baseline and adds the runtime/compiler integration needed for:
After this PR is green, #127 can be closed as superseded by this complete integration branch.
Implementation
//go:wasmimportdeclarations synchronous while allowing same-name LLGo patch definitions to use the resumable ABI.llgo.wasm_resumeconfiguration.Cost comparison against #125
Same hardening fixture and default optimization, Apple M4 Max. Runtime values are medians from five alternating processes with 1,000 blocked Gs.
HeapSys. P1 Asyncify completes at about 1.316 GiB live heap; K uses about 25.5 MiB.-a -p=1J32 builds have medians of 16.364 s for Asyncify and 29.991 s for K (+83.27%).runtime.MemStatsinstrumentation around the J32 channel loop measures 20,739 B/op and 12.010 allocations/op for K versus 93 B/op and 2.001 allocations/op for Asyncify. A 100 us V8 sampling profile attributes about 65% of wasm samples to allocator/bitmap paths. The current 2 KiB frame arena therefore repeatedly allocates and drops overflow blocks on deep channel call paths; this is the primary measured runtime cost, rather thanContext.Rundispatch alone.Validation
Local resource limits:
GOMAXPROCS=2,GOMEMLIMIT=4GiB,-p=1.wasm-tools validate --features alland execute with Wasmtime 39.-O0,-O3, ThinLTO, and Full LTO.go test ./internal/wasmresume ./ssa ./clpasses; package coverage is 94.7%, 93.3%, and 97.4%.go test ./internal/buildpasses.gcroot,wasmresume, andwasmeventtests pass with 94.1%, 91.9%, and 94.4% coverage.