Stream: git-wasmtime

Topic: wasmtime / PR #15051 CM+GC: Add support for tuples of sca...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 20:27):

fitzgen requested pchickey for a review on PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 20:27):

fitzgen removed the review request for wasmtime-core-reviewers from PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 20:27):

fitzgen requested wasmtime-core-reviewers for a review on PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 20:27):

fitzgen opened PR #15051 from fitzgen:cm-gc-tuples-of-scalars to bytecodealliance:main:

The first bit of actually interacting with reference types in the CM+GC work. This forces us to build out a bunch of infrastructure, so I'm trying to keep this as minimal as possible by only supporting tuples of scalars. Follow up commits will introduce tuples of tuples and other reference-typed things like records and strings and arrays and all that.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 21:46):

pchickey requested alexcrichton for a review on PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 21:46):

pchickey removed the review request for pchickey from PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Might be worth pointing out that false is a lie here, but it kind of doesn't matter. Or perhaps alternatively, could there be a separate struct_get_{s,u} helper and then there's no param here at all? It's a bit odd to have that flag as well for floats for example.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Technically speaking one theoretical optimization here could be if in the GC ABI the src/destination are immutable and equal the exact struct could be plumbed through as-is, right? (fine to leave for a future PR/issue, just want to confirm my understanding)

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

In theory these are pretty easy, right? Mostly just abstract_(...)?

IIRC ConcreteExn won't show up here, although I'm not sure about continuations.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Instead of .unwrap() could this be let Ok(()) = ...?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

There's no max for the GC ABI, right?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Instead of duplicating this comment in all blocks, could there be an explanatory comment in one location and the others briefly redirect to that?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

This is a linear search in a loop which might lead to quadratic behavior I think -- could idx here, since it's a module-local thing, be compare to the first index in the rec group instead?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Not that it matters for this test, but technically the (rec ...) here isn't necessary right?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

FWIW I think that the concurrent code is going to need some relatively invasive changes to handle the GC ABI. Not only because of rooting everywhere but also because limits/maximums in params/results are pretty heavily baked in to the implementation on the host side. It might be best to just reject this for now and have a separate todo! or component-model-async integration being a big TODO item.

For example there's code like this which is definitely not correct for GC.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

I'm a bit confused by this, aren't all interface types representable with a single core wasm type in the GC ABI meaning that flat_val_types should always succeed for GC?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

This feels relatively confusing to me because GC tuples do indeed have a single flat type, so this method is kind of a lie in that respect. Could this method grow documentation about how it's supposed to be used or perhaps renamed to cater to the use case for how this works at call-sites?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

How come these extra vecs are made?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Should this previous types.flat_types method get deleted/renamed?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Could this contain documentation that this panics if ty's flat representation overflows the limits for linear memory?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Why use Destination::Struct here when Destination::Stack pretty much does the same thing? Could Destination::Struct be removed entirely?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

What's 525 here refer to?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

Could this be handled in the record_field_{srcs,dsts} helper instead? That'll probably be needed for structs anyway and it's already trying to handle some of this boilerplate

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 16:24):

:speech_balloon: alexcrichton created PR review comment:

I think this limitation is fixed as of https://github.com/bytecodealliance/wasmtime/pull/15044

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 19:56):

fitzgen updated PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:00):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:00):

:speech_balloon: fitzgen created PR review comment:

Good eye, fixed in latest commit.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:00):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:00):

:speech_balloon: fitzgen created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:01):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:01):

:speech_balloon: fitzgen created PR review comment:

Yep, done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:01):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:01):

:speech_balloon: fitzgen created PR review comment:

Correct, callers passed usize::MAX, but I just made the Some return unconditional.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:03):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:03):

:speech_balloon: fitzgen created PR review comment:

Yes, but FlatType cannot represent reference types. I renamed Options::flat_types to Options::scalar_flat_types to help clarify.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:05):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:05):

:speech_balloon: fitzgen created PR review comment:

Oof, yeah. Okay, I disabled CM-async + GC for now, filed https://github.com/bytecodealliance/wasmtime/issues/15080 to track this.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:06):

:speech_balloon: fitzgen created PR review comment:

Refactored to have struct_get_{s,u} helpers that do the signed or unsigned extension when operating on a packed field.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:06):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:06):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:06):

:speech_balloon: fitzgen created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:07):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:07):

:speech_balloon: fitzgen created PR review comment:

A borrow issue that was actually pretty easily avoidable. Gone in the latest commit.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:07):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:07):

:speech_balloon: fitzgen created PR review comment:

That is correct, and yes, I am leaving this for the future.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:09):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:09):

:speech_balloon: fitzgen created PR review comment:

Filed https://github.com/bytecodealliance/wasmtime/issues/15081 to track this.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:10):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:10):

:speech_balloon: fitzgen created PR review comment:

Done.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:18):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:18):

:speech_balloon: fitzgen created PR review comment:

Not really because Destination::Stack holds &[ValType] which doesn't work for i8/i16, but even if we turned it into &[StorageType] then we would also need to know the which field of the struct it is and at this point the sharing is not really that helpful. I think Destination::Struct starts making more sense as we start supporting nested tuples in https://github.com/bytecodealliance/wasmtime/pull/15054, e.g.:

https://github.com/fitzgen/wasmtime/blob/1706336c1f96c0ff5ffcb6a347511b3c339acb55/crates/environ/src/fact/trampoline.rs#L1242-L1248

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:speech_balloon: fitzgen created PR review comment:

Renamed, as mentioned above.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:speech_balloon: fitzgen created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:speech_balloon: fitzgen created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:19):

:speech_balloon: fitzgen created PR review comment:

Yep, unnecessary. Removed so it isn't a distraction.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:20):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:20):

:speech_balloon: fitzgen created PR review comment:

https://github.com/WebAssembly/component-model/issues/525

I just removed the reference, since it will just become out of date once CM+GC is actually spec'd.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 20:21):

fitzgen commented on PR #15051:

@alexcrichton I believe I have addressed all of your review feedback with the latest commit

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 22:07):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 22:07):

:speech_balloon: alexcrichton created PR review comment:

Could this return not a GcStruct but perhaps the internals of the type, such as a local/type? It feels a bit odd to need sentinel values for field and e.g. FIELD_UNSET in the next PR where I think it would be best to model this as the GcStruct destination is directly created in aggregate_field_srcs' iterator.

Also, to confirm, I'd expect in the next PR that this method would take &mut Compiler to fill out the struct todo! here by injecting a struct.get instruction to get a struct-from-a-struct

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 22:07):

:speech_balloon: alexcrichton created PR review comment:

I'm not totally sold on this myself just yet, it seems like this would ideally use Destination::Stack for GC types and translate_{tuple,record} would have custom follow-ups for the GC ABI which inserts a struct.new with the desired type. The Destination::Stack variant has all the types expected as well as Options which seems like a good fit for all of this.

Furthermore the handling of Destination::Struct already does nothing everywhere which is basically the same for stack_set when the types line up (which they always would for the GC ABI).

Did you have other plans in mind for Destination::Struct in the future though?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2026 at 22:07):

:speech_balloon: alexcrichton created PR review comment:

Question on this: why is this needed? I would naively expect that all GC structs are required to store a component-model u8 in a storage-type i8 field, so wouldn't this be dead code in such a situation? Or is this one where a storage of i32 matches a component model u8 type?

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

fitzgen updated PR #15051.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 21:38):

fitzgen commented on PR #15051:

@alexcrichton as we discussed offline, I folded the nested tuples case into this PR as well.

I also introduced {Source,Destination}::GcRef variants and an enum Lowering to avoid some of the if is_gc() guards on match arms and so that everything can be a simple exhaustive match, which I think overall cleans things up a bit.

Take another look and let me know what you think.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 21:42):

fitzgen requested alexcrichton for a review on PR #15051.

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

:memo: alexcrichton submitted PR review:

Overall I personally still feel lost on this. I feel like much of what's here is likely to be necessary in one shape or another, such as the fact/trampoline.rs handling of primitives and general infrastructure for structs/etc, but the ABI calculations and "what types are used" infrastructure seems possibly to pretty radically change. For example I feel that there's still two major open questions:

These are pretty fundamental pieces of the ABI which I feel are currently unresolved, and I feel that they pretty heavily influence the implementation and what we land here. I'm not opposed necessarily to landing this and moving on that later, but this is 2kloc of new code which is pretty intense IMO and it's only the tip of the iceberg. I find it really hard to retroactively reason about vast amounts of new code when the underlying primitives change, and we've been burned quite a few times by refactoring the design of component-model-async at the spec level and the PR to implement in Wasmtime leaves a lot of vestiges of things that bite us later.

So question for you: what would you like the plan to be on this? Land this now as-is and possibly refactor later? If so what would be the main purpose of landing this in-tree?

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

:speech_balloon: alexcrichton created PR review comment:

Why would StorageType need to be used though? Wouldn't Destination::Stack list the desired value type as ValType::I32 for i8 and i16 fields, matching what core wasm typing rules would otherwise want?

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

:speech_balloon: alexcrichton created PR review comment:

Personally I think it'd be best to leave tests like this to the fuzzers rather than hardcoding things here. Fuzzing should already uncover what happens in "large types" and so this'll naturally pick up coverage once that's done. In the meantime I think it'd be reasonable to remove this and rely on *.wast testing

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

:speech_balloon: alexcrichton created PR review comment:

(bump on this)

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

fitzgen commented on PR #15051:

So question for you: what would you like the plan to be on this? Land this now as-is and possibly refactor later? If so what would be the main purpose of landing this in-tree?

My goal is to fill out the lifting/lowering from GC objects paths, which I think are the most critical things to shake out and are actually going to look pretty similar regardless anything I can imagine changing about the CM+GC proposal.

It is true that the rec group cloning would largely go away with an "everything has a single canonical type" potential future, but (a) I think that is actually the simplest and most self-contained code here, and (b) it would be replaced by "generate the canonical core types for this CM type" code that actually would be somewhat similar, and similarly self-contained.

I would say there are two primary motivations for landing it in tree, rather than e.g. a bytecodealliance/wasmtime-cm-gc fork:

  1. To make it easier for toolchains to start playing with it and giving us implementation and spec feedback.
  2. To do incremental reviews and build a shared understanding/theory of the code, rather than for me to go off on my own for a while and then come back with a giant code dump. (This approach has never worked well for the project IMO).

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

fitzgen commented on PR #15051:

And regarding variants needing to change or whether to flatten more, I don't think that really changes much about the GC source/destination changes, which, as I said, are the most fundamental changes to shake out here. Variants aren't even implemented in this PR and are still the same todo! they already were, and the flattening feels like a bridge we can cross if/when we get to it.

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

alexcrichton commented on PR #15051:

Personally the lifting/lowering paths are what I'm extremely worried about. That's already full of tons of subtle code which requires a broad agreement amongst a bunch of points in the system, and getting it wrong on lifting/lowering is typically a CVE. I'm also personally quite worried about the piecemeal implementation with an incomplete spec as it increases the likelihood that by the end of things we have inconsistent implementations (accidentally) internally which reflect older versions of the specification or were just temporary artifacts that were forgotten to remove.

This approach has never worked well for the project IMO

I might feel a bit different on this -- I feel that the approach with the WASIp2 implementation and component-model-async implementation both worked quite well. The implementation was fully developed out-of-tree, yes, but the crucial part was that it landed piecemeal. This enabled being able to validate everything works end-to-end (the fork's CI), while still making everything reviewable (incremental landing in-tree). Personally I find it much easier to review incremental pieces with an end-state to refer to, and I also like to review high-level decisions on the end state before going too deep on the smaller decisions.

I understand the desire to empower toolchains to give feedback, but I'm hesitant of the strategy of "build everything in Wasmtime" and then ask for feedback. Rather I think it would be best for this to be more interactive with high-level feedback before an implementation and then in close coordination throughout the implementation. Without feedback during the implementation we risk spending a lot of time reviewing, auditing, etc, code that ultimately ends up all getting thrown away. To me this is sort of the poster child for development in a fork where we want to enable rapid experimentation with low overhead on review/implementation.

Which is all to say, I wasn't thinking of a fork when originally reviewing this, but now I'm feeling that a fork might be the best course of action. The fork would be similar to WASIp2 and component-model-async where development all happens externally and then is landed here in the main repo incrementally, so it's not just one giant code dump. The review would also probably originally be done at a high-level on the fork first before peeling things off here.

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

cfallin commented on PR #15051:

(To the degree that there is a bit of a project-approach philosophical discussion here, I'll weigh in if it helps with anecdata)

The implementation was fully developed out-of-tree, yes, but the crucial part was that it landed piecemeal.

This has also worked pretty well for several "speculative" projects I've taken on which may or may not have worked out on the objective perf metrics: regalloc2, egraphs, weval, record-replay (landing in progress!), all of which had several-month-to-year implementation phases then, once proven, had/are having full review (with particular chunk size depending on the reviewer's preference). I imagine e.g. fitzgen's regicide will have a similar path if it works out -- side-excursion then coming back with the goods.

Maybe a good disambiguating line is: is the problem space uncertain enough that the path may require backtracking or adjustment? (All of the above, yes: the exact implementation strategy is unclear, need to try several things, may have been a complete dead-end.) If yes, the build-the-thing-and-then-slough-off-layers-to-review both (i) saves reviewer time by whatever "rework factor" the initial path took, and (ii) as Alex says, gives a north star. "This little detail may not make sense here but I promise, it's essential in four steps". That sort of discussion is much harder to have speculatively and, I think, if we have a rule that an excursion should not go too far ahead of the review frontier, we may end up in local maxima -- one could never explore a speculative idea to see if it works.

The important thing to make it work I think is the attitude about rework/adjustment once the review phase does come; the existing proven-path-to-the-goal should be seen as speculative still, as the review frontier scans over it and adjusts design with more input. But having the working artifact is very, very valuable: even during review, one can rebase the rest-of-the-path on the existing thing to see if the review suggestions actually work in the end, or not (also avoiding later rework if a conflict is discovered!).

As a counterexample, proof-carrying-code was developed "in-tree" (with almost daily PRs!) but ended up not being quite the right shape once we got further along and discovered some issues; a decent amount of review overhead was spent there, and we ended up deleting it later.

I think other kinds of work are definitely suited to in-tree development, probably actually most work -- any kind of incremental improvement or migration. The above isn't meant to say we should have lots of long-running forks; only that they do have their place when the idea itself is speculative or subject to change, IMHO.

I only have weakly-held opinions about CM+GC and it seems plausible to me that it could go either way; just thought the above framework might be useful...

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

cfallin edited a comment on PR #15051:

(To the degree that there is a bit of a project-approach philosophical discussion here, I'll weigh in if it helps with anecdata)

The implementation was fully developed out-of-tree, yes, but the crucial part was that it landed piecemeal.

This has also worked pretty well for several "speculative" projects I've taken on which may or may not have worked out on the objective perf metrics: regalloc2, egraphs, weval, record-replay (landing in progress!), all of which had several-month-to-year implementation phases then, once proven, had/are having full review (with particular chunk size depending on the reviewer's preference). I imagine e.g. fitzgen's regicide will have a similar path if it works out -- side-excursion then coming back with the goods.

Maybe a good disambiguating line is: is the problem space uncertain enough that the path may require backtracking or adjustment? (All of the above, yes: the exact implementation strategy is unclear, need to try several things, may have been a complete dead-end.) If yes, the build-the-thing-and-then-slough-off-layers-to-review both (i) saves reviewer time by whatever "rework factor" the initial path took, and (ii) as Alex says, gives a north star. "This little detail may not make sense here but I promise, it's essential in four steps". That sort of discussion is much harder to have speculatively and, I think, if we have a rule that an excursion should not go too far ahead of the review frontier, we may end up in local maxima -- one could never explore a speculative idea to see if it works.

The important thing to make it work I think is the attitude about rework/adjustment once the review phase does come; the existing proven-path-to-the-goal should be seen as speculative still, as the review frontier scans over it and adjusts design with more input. But having the working artifact is very, very valuable: even during review, one can rebase the rest-of-the-path on the existing thing to see if the review suggestions actually work in the end, or not (also avoiding later rework if a conflict is discovered!).

As a counterexample, proof-carrying-code was developed "in-tree" (with almost daily PRs!) but ended up not being quite the right shape once we got further along and discovered some issues; a decent amount of review overhead was spent there, and we ended up deleting it later.

I think other kinds of work are definitely suited to in-tree development, probably actually most work -- any kind of incremental improvement or migration. The above isn't meant to say we should have lots of long-running forks or dev branches; only that they do have their place when the idea itself is speculative or subject to change, IMHO.

I only have weakly-held opinions about CM+GC and it seems plausible to me that it could go either way; just thought the above framework might be useful...

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

cfallin edited a comment on PR #15051:

(To the degree that there is a bit of a project-approach philosophical discussion here, I'll weigh in if it helps with anecdata)

The implementation was fully developed out-of-tree, yes, but the crucial part was that it landed piecemeal.

This has also worked pretty well for several "speculative" projects I've taken on which may or may not have worked out on the objective perf metrics: regalloc2, egraphs, weval, ISLE, record-replay (landing in progress!), all of which had several-month-to-year implementation phases then, once proven, had/are having full review (with particular chunk size depending on the reviewer's preference). I imagine e.g. fitzgen's regicide will have a similar path if it works out -- side-excursion then coming back with the goods.

Maybe a good disambiguating line is: is the problem space uncertain enough that the path may require backtracking or adjustment? (All of the above, yes: the exact implementation strategy is unclear, need to try several things, may have been a complete dead-end.) If yes, the build-the-thing-and-then-slough-off-layers-to-review both (i) saves reviewer time by whatever "rework factor" the initial path took, and (ii) as Alex says, gives a north star. "This little detail may not make sense here but I promise, it's essential in four steps". That sort of discussion is much harder to have speculatively and, I think, if we have a rule that an excursion should not go too far ahead of the review frontier, we may end up in local maxima -- one could never explore a speculative idea to see if it works.

The important thing to make it work I think is the attitude about rework/adjustment once the review phase does come; the existing proven-path-to-the-goal should be seen as speculative still, as the review frontier scans over it and adjusts design with more input. But having the working artifact is very, very valuable: even during review, one can rebase the rest-of-the-path on the existing thing to see if the review suggestions actually work in the end, or not (also avoiding later rework if a conflict is discovered!).

As a counterexample, proof-carrying-code was developed "in-tree" (with almost daily PRs!) but ended up not being quite the right shape once we got further along and discovered some issues; a decent amount of review overhead was spent there, and we ended up deleting it later.

I think other kinds of work are definitely suited to in-tree development, probably actually most work -- any kind of incremental improvement or migration. The above isn't meant to say we should have lots of long-running forks or dev branches; only that they do have their place when the idea itself is speculative or subject to change, IMHO.

I only have weakly-held opinions about CM+GC and it seems plausible to me that it could go either way; just thought the above framework might be useful...

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

cfallin edited a comment on PR #15051:

(To the degree that there is a bit of a project-approach philosophical discussion here, I'll weigh in if it helps with anecdata)

The implementation was fully developed out-of-tree, yes, but the crucial part was that it landed piecemeal.

This has also worked pretty well for several "speculative" projects I've taken on which may or may not have worked out on the objective perf metrics: regalloc2, egraphs, weval, ISLE, record-replay (landing in progress!), all of which had several-month-to-year implementation phases then, once proven, had/are having full review (with particular chunk size depending on the reviewer's preference). I imagine e.g. fitzgen's regicide will have a similar path if it works out -- side-excursion then coming back with the goods.

Maybe a good disambiguating line is: is the problem space uncertain enough that the path may require backtracking or adjustment? (All of the above, yes: the exact implementation strategy is unclear, need to try several things, may have been a complete dead-end.) If yes, the build-the-thing-and-then-slough-off-layers-to-review both (i) saves reviewer time by whatever "rework factor" the initial path took, and (ii) as Alex says, gives a north star. "This little detail may not make sense here but I promise, it's essential in four steps". That sort of discussion is much harder to have speculatively and, I think, if we have a rule that an excursion should not go too far ahead of the review frontier, we may end up in local maxima -- one could never explore a speculative idea to see if it works.

The important thing to make it work I think is the attitude about rework/adjustment once the review phase does come; the existing proven-path-to-the-goal should be seen as speculative still, as the review frontier scans over it and adjusts design with more input. But having the working artifact is very, very valuable: even during review, one can rebase the rest-of-the-path on the existing thing to see if the review suggestions actually work in the end, or not (also avoiding later rework if a conflict is discovered!).

As a counterexample, proof-carrying-code was developed "in-tree" (with almost daily PRs!) but ended up not being quite the right shape once we got further along and discovered some issues; a decent amount of review overhead was spent there, and we ended up deleting it later.

I think other kinds of work are definitely suited to in-tree development, probably actually most work -- any kind of incremental improvement or migration. (Two examples from my end: exception support and initial guest debugging both had a pretty clear path and were built + landed in pieces.)The above isn't meant to say we should have lots of long-running forks or dev branches; only that they do have their place when the idea itself is speculative or subject to change, IMHO.

I only have weakly-held opinions about CM+GC and it seems plausible to me that it could go either way; just thought the above framework might be useful...


Last updated: Nov 19 2026 at 20:05 UTC