Stream: git-wasmtime

Topic: wasmtime / PR #12590 Make SCCs and graph traversals reusable


view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:12):

fitzgen requested cfallin for a review on PR #12590.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:12):

fitzgen opened PR #12590 from fitzgen:make-scc-reusable to bytecodealliance:main:

This moves our existing SCC computation and DFS graph traversals out of wasmtime::compile and into wasmtime_environ::graphs, where they can be reused elsewhere in the workspace. These functions and types were already generally generic over an iterator of nodes and/or an edge function to get a particular node's successors, but I've gone one step further and packaged up those two things together into a Graph trait.

In the process, I also moved the NonMaxU32 type to wasmtime_internal_core and made it so we have other non-max integer types as well.

This will let us reuse SCC computation in our GC ops fuzzer, where we need SCCs to figure out how to merge fuzzer-generated rec groups, if necessary, since cyclic type references are constrained to within the same rec group. The GC ops fuzzer can also reuse the DFS traversal code in its topological sorting of supertypes and subtypes as well.

This is mostly, but not quite completely, code motion and fixups of paths and such.

@cfallin, I'm flagging you for review on this one because you reviewed the initial PRs that landed this code.

<!--
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 (Feb 13 2026 at 21:12):

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

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:23):

fitzgen updated PR #12590.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:25):

cfallin submitted PR review:

Seems reasonable!

I was idly wondering whether it would make more sense to put the graph-related bits in crates/core/ since that is becoming a home for data structures in general, but I guess the focus there is more on foundational containers (with explicit OOM handling) than algorithms, and also the bits here are not adapted for OOM so we'd be mixing universes if we did that? I'm fine either way honestly.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 22:54):

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

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

fitzgen updated PR #12590.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2026 at 17:19):

fitzgen commented on PR #12590:

I was idly wondering whether it would make more sense to put the graph-related bits in crates/core/ since that is becoming a home for data structures in general, but I guess the focus there is more on foundational containers (with explicit OOM handling) than algorithms, and also the bits here are not adapted for OOM so we'd be mixing universes if we did that? I'm fine either way honestly.

Yeah I think probably in an ideal world it would be like wasmtime-internal-graph or something but too many crates has annoying administrative overheads. At this point, whether something goes in crates/core or crates/environ is like 75% whether anything in Cranelift's dep graph needs it or not in my mind.

Anyways, we can always move things around if we find that we need to down the line.

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

fitzgen added PR #12590 Make SCCs and graph traversals reusable to the merge queue.

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

github-merge-queue[bot] removed PR #12590 Make SCCs and graph traversals reusable from the merge queue.

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

fitzgen updated PR #12590.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2026 at 18:38):

fitzgen has enabled auto merge for PR #12590.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2026 at 18:52):

fitzgen added PR #12590 Make SCCs and graph traversals reusable to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2026 at 19:25):

fitzgen merged PR #12590.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2026 at 19:25):

fitzgen removed PR #12590 Make SCCs and graph traversals reusable from the merge queue.


Last updated: Feb 24 2026 at 04:36 UTC