Stream: git-wasmtime

Topic: wasmtime / PR #12153 allow instance to be reentered while...


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

dicej requested alexcrichton for a review on PR #12153.

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

dicej opened PR #12153 from dicej:fix-12128 to bytecodealliance:main:

The spec says we should allow this, so now we do.

Thansk to Alex for the test case!

Fixes #12128

<!--
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 10 2025 at 22:36):

dicej requested wasmtime-core-reviewers for a review on PR #12153.

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

alexcrichton submitted PR review:

Code/test all look fine, but I'm trying to correlate this with the spec as well. I thought I remember that historically may_enter was a thing but it's no longer present in CanonicalABI.md. Can you clarify which point in the spec I should be looking at to double-check this? (and probably queue up some sort of rename/refactor to handle may_enter to align with the spec)

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

dicej commented on PR #12153:

Code/test all look fine, but I'm trying to correlate this with the spec as well. I thought I remember that historically may_enter was a thing but it's no longer present in CanonicalABI.md. Can you clarify which point in the spec I should be looking at to double-check this? (and probably queue up some sort of rename/refactor to handle may_enter to align with the spec)

Search for trap_of_on_the_stack in CanonicalABI.md and the prose that follows. I agree that some renaming and/or refactoring may be due.

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

dicej edited a comment on PR #12153:

Code/test all look fine, but I'm trying to correlate this with the spec as well. I thought I remember that historically may_enter was a thing but it's no longer present in CanonicalABI.md. Can you clarify which point in the spec I should be looking at to double-check this? (and probably queue up some sort of rename/refactor to handle may_enter to align with the spec)

Search for trap_if_on_the_stack in CanonicalABI.md and the prose that follows. I agree that some renaming and/or refactoring may be due.

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

dicej commented on PR #12153:

I'm investigating the test failure; looks like dropping a subtask while it's yielding in an infinite loop will require some extra care.

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

alexcrichton commented on PR #12153:

Joel and I discussed this and the conclusion is that the may_enter handling in Wasmtime is outdated and no longer in sync with the spec after component-model-async refactors. Effectively we need to rebuild the reentrance check from scratch throughout Wasmtime and avoid using may_enter for the triple-purpose of: preventing reentrance, requiring post_return, and lockdown-on-trap. This'll require refactors internally to use a new component-model-async helper but will have an impact on component adapter performance as well. This all corresponds to trap_if_on_the_stack in the spec (scroll down a bit)

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

dicej edited a comment on PR #12153:

I'm investigating the test failure; looks like dropping a subtask while it's yielding in an infinite loop will require some extra care. EDIT: the problem is more fundamental than that, and the refactoring Alex suggested above is going to be necessary in order to fix #12128 properly.

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

dicej requested wasmtime-compiler-reviewers for a review on PR #12153.

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

dicej requested cfallin for a review on PR #12153.

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

dicej updated PR #12153.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 16 2025 at 22:26):

dicej updated PR #12153.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 16 2025 at 22:39):

dicej updated PR #12153.

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

dicej updated PR #12153.

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

dicej updated PR #12153.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 22 2025 at 19:07):

alexcrichton commented on PR #12153:

Current thinking, assuming I'm remembering this all correctly:

In short, sync<->sync adapters will get faster on one axis (removing reentrance checks) but slower on another access (manipulating the can_block) flag. The can_block flag will live per-vm::ComponentInstance and will be as fast as the current reentrance check. In essence the sync<->sync adapter performance profile is not expected to change.

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

dicej updated PR #12153.

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

dicej updated PR #12153.

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

dicej updated PR #12153.

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

dicej updated PR #12153.

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

dicej updated PR #12153.

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

dicej updated PR #12153.

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

dicej commented on PR #12153:

@alexcrichton Would you mind taking another look at this when you have time? I'm also happy to walk through it with you synchronously if that helps.

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

dicej closed without merge PR #12153.

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

dicej commented on PR #12153:

After chatting with @alexcrichton about this, we decided to break this up into smaller PRs that address reentrance checks and may-block checks separately.


Last updated: Jan 10 2026 at 02:36 UTC