Stream: git-wasmtime

Topic: wasmtime / PR #15228 GC: hold `MaybeRooted<T>` GC referen...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 06:56):

cfallin requested fitzgen for a review on PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 06:57):

cfallin opened PR #15228 from cfallin:gc-maybe-rooted to bytecodealliance:main:

This introduces MaybeRooted<T>, an enum of the ways that a Val or Ref may hold a reference to a GC object, and makes the GC-reference variants of Val (ExternRef, AnyRef, ExnRef) and of Ref (Extern, Any, Exn) hold Option<MaybeRooted<T>> instead of Option<Rooted<T>>.

For now MaybeRooted<T> has only one variant, MaybeRooted::Rooted, which wraps a Rooted<T> as before, so this is a pure refactor with no change in behavior. The point is to give Val room for other kinds of GC references, as we will soon do with a followup that adds unrooted references.

<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

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 (Nov 11 2026 at 06:57):

cfallin requested wasmtime-fuzz-reviewers for a review on PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 06:57):

cfallin requested wasmtime-core-reviewers for a review on PR #15228.

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

cfallin updated PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 09:44):

github-actions[bot] added the label fuzzing on PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 09:44):

github-actions[bot] added the label wasmtime:ref-types on PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 09:44):

github-actions[bot] added the label wasmtime:api on PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 09:44):

github-actions[bot] added the label wasmtime:c-api on PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 10:45):

github-actions[bot] commented on PR #15228:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:c-api", "wasmtime:ref-types"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:thumbs_up: fitzgen submitted PR review:

LGTM, modulo feedback below.

Apologies for the delayed review, somehow got lost in my github notifications.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:speech_balloon: fitzgen created PR review comment:

Same thing here

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:speech_balloon: fitzgen created PR review comment:

Can we name this ty_ instead, so that we don't in the future accidentally introduce dead code that doesn't get warned about being dead code due to the leading underscore? We've been slowly switching existing _-prefixes to suffixes due to this issue (which we didn't think of when we originally introduced all of these).

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:speech_balloon: fitzgen created PR review comment:

I think we probably also want to have these methods:

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:speech_balloon: fitzgen created PR review comment:

Should these become .to_rooted(store) or something for future compat so we don't accidentally get panics when introducing unrooted references? (I haven't looked at the next PR yet)

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:speech_balloon: fitzgen created PR review comment:

And then on Val and Ref, we probably also want

as well

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 17:50):

:speech_balloon: fitzgen created PR review comment:

(And similar for ~all the other unwrap_rooted() calls in this PR)

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

:memo: cfallin submitted PR review.

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

:speech_balloon: cfallin created PR review comment:

Good thought generally! But: these actually become .to_unrooted(store) in the next PR, which I think is probably the better option anyway (these are short-lived temporary references used to query the heap so no actual need for rooting); so to avoid rebase churn when this will change again anyway I'll leave these as-is.

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

:memo: cfallin submitted PR review.

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

:speech_balloon: cfallin created PR review comment:

Cool, these come in the followup when we have two variants, but I'll hoist them to this PR and then rebase.

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

cfallin updated PR #15228.

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

:memo: cfallin submitted PR review.

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

:speech_balloon: cfallin created PR review comment:

Done!

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

:memo: cfallin submitted PR review.

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

:speech_balloon: cfallin created PR review comment:

Done!

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

:memo: cfallin submitted PR review.

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

:speech_balloon: cfallin created PR review comment:

Done!

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

cfallin has enabled auto merge for PR #15228.

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

cfallin added PR #15228 GC: hold MaybeRooted<T> GC references in Val and Ref. to the merge queue

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 01:16):

:check: cfallin merged PR #15228.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 01:16):

cfallin removed PR #15228 GC: hold MaybeRooted<T> GC references in Val and Ref. from the merge queue


Last updated: Nov 19 2026 at 20:05 UTC