Stream: git-wasmtime

Topic: wasmtime / PR #12123 [coop-threading] Track concurrent st...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 10:15):

TartanLlama opened PR #12123 from TartanLlama:sy/sync-multithreading to bytecodealliance:main:

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 10:17):

TartanLlama edited PR #12123:

Threads are currently not created on sync->sync export calls, sync host->guest calls, and module-level start function calls. This PR adds support to this for all of these.

Fixes #11954

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 10:31):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 10:53):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 11:02):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 11:17):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 11:25):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 11:28):

TartanLlama edited PR #12123:

Threads are currently not created on sync->sync export calls, sync host->guest calls, and module-level start function calls. This PR adds support to this for all of these.

I added a component-model-async feature to wasmtime-environ so that sync->sync adapters are compiled as they were originally for wasip2 code, avoiding changing performance characteristics.

Fixes #11954

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 11:29):

TartanLlama edited PR #12123:

Threads are currently not created on sync->sync export calls, sync host->guest calls, and module-level start function calls. This PR adds support to this for all of these.

I added a component-model-async feature to wasmtime-environ so that sync->sync adapters are compiled as they were originally for wasip2 code, avoiding changing performance characteristics.

Rather than use the existing prepare_call + start_call machinery, I introduced sync_to_sync_enter/exit_call intrinsics to avoid adding additional host frames to the stack for sync calls

Fixes #11954

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 11:31):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 12:23):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 04 2025 at 12:28):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 14:56):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 15:09):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2025 at 13:06):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2025 at 13:09):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2025 at 13:41):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2025 at 13:54):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 13:13):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 13:30):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 13:31):

TartanLlama updated PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 13:33):

TartanLlama edited PR #12123:

Threads are currently not created on sync->sync export calls, sync host->guest calls, and module-level start function calls. This PR adds support to this for all of these.

I added a component-model-async feature to wasmtime-environ so that sync->sync adapters are compiled as they were originally for wasip2 code, avoiding changing performance characteristics.

Rather than use the existing prepare_call + start_call machinery, I introduced sync_to_sync_enter/exit_call intrinsics to avoid adding additional host frames to the stack for sync calls.

Currently, doing operations that require thread state inside post_return functions is unsupported. If we're happy merging this as-is and creating an issue to resolve this later, we can do so, or I can try and address it prior to merging.

Fixes #11954

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 15:05):

TartanLlama has marked PR #12123 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 15:05):

TartanLlama requested abrown for a review on PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 15:05):

TartanLlama requested wasmtime-compiler-reviewers for a review on PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 15:05):

TartanLlama requested pchickey for a review on PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2025 at 15:05):

TartanLlama requested wasmtime-core-reviewers for a review on PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2026 at 17:24):

dicej requested alexcrichton for a review on PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2026 at 17:24):

dicej requested dicej for a review on PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2026 at 17:37):

dicej commented on PR #12123:

I've only skimmed this so far; it looks generally reasonable, but I expect it will conflict with https://github.com/bytecodealliance/wasmtime/pull/12153, which I'm about to split into smaller PRs per @alexcrichton's request.

Given that the component-model-async feature is now enabled by default, we'll need to be conscious of the overhead of e.g. calling sync_to_sync_enter_call and sync_to_sync_exit_call per this Zulip topic. In https://github.com/bytecodealliance/wasmtime/pull/12153, I had to get creative and sometimes lazily push GuestTasks and GuestThreads as necessary to avoid pessimizing sync-to-sync adapters. @TartanLlama we should chat sometime about if (and if so, how) we could do a similar optimization here.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 14 2026 at 22:27):

dicej commented on PR #12123:

See https://github.com/bytecodealliance/wasmtime/issues/12311 for the latest plan. I'm planning to work on a new PR tomorrow that ensures we always push a task and thread on the stack when entering Wasm from the guest or host, at which point we can rebase this PR on top of that.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2026 at 17:31):

alexcrichton commented on PR #12123:

@dicej / @TartanLlama does https://github.com/bytecodealliance/wasmtime/pull/12379 subsume this? (my impression is "yes" but want to confirm)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2026 at 18:45):

TartanLlama closed without merge PR #12123.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 23 2026 at 18:45):

TartanLlama commented on PR #12123:

Yeah I believe it is. Closing for now, can always grab stuff from the branch if we need it


Last updated: Feb 24 2026 at 05:28 UTC