[Based on #142] runtime/wasm: compose resumable contexts with bounded workers - #143
Draft
cpunion wants to merge 3 commits into
Draft
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. |
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 #142.
Implements the K3 worker-composition stage of xgo-dev#2152. The resumable backend remains opt-in through
LLGO_WASM_RESUME=1.Problem
K2 provides reusable resumable frame arenas for a single logical execution owner. The wasm worker scheduler still uses the Asyncify-specific continuation path, so resumable contexts cannot yet coexist with worker scheduling, stop-the-world GC, worker-local state, or worker teardown.
Design
Execution flow
Context.Runresumes the lowered continuation. A blocking operation returns to the worker scheduler without retaining a scheduler lock.Results
Five macOS arm64 runs of the worker hardening workload (10,000 channel handoffs, median):
The resumable worker path is functional but does not satisfy the proposal's default-backend performance gate.
Final artifact size for the same workload:
.mjs+.wasm).mjs+.wasm)Forced J32 build time was 30.99 s median versus 15.78 s for Asyncify workers (+96.4%), which is a second reason to keep the backend opt-in.
Validation
Resource bounds:
GOMAXPROCS=2,GOMEMLIMIT=4GiB,-p=1.internal/build77.4%,internal/wasmresume95.2%,ssa93.3%internal/gcroot94.4%,internal/wasmresume92.3%runtime.Goexit, 1,000 blocked goroutines, zero retained-root deltaruntime/internal/wasmcontextdependencyDiff against #142: 19 files, +674/-182 in three reviewable commits.