Stream: git-wasmtime

Topic: wasmtime / PR #13119 [Cranelift] rule restore from #13081


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

myunbin opened PR #13119 from myunbin:compare-three-restored to bytecodealliance:main:

This PR restores the rules that were reverted in #13081.

Those rules were reverted because #13068 reported a significant compile-time slowdown. However, after commit f2807a1 (#13063), that severe slowdown no longer reproduces.

On the current commit, d5f1b973, the median real time is 0.17s on plain main and 0.14s on the restored version. For comparison, the historical slow configuration took about 29.89s median real time on the same input. Full benchmark results are included below.

One likely factor is the vector-heavy section of foo.clif, especially around lines 199-242. The original slowdown was observed before vector constant support landed in #13063, so vector self-subtraction patterns such as x - x -> 0, as well as related rewrite rules like (x - z) - (x - y) -> y - z, may have interacted poorly in the earlier configuration. This does not fully explain the entire e-graph blowup, and we're working on to figure it out.

At least from the current measurements, restoring the rules on top of the current codebase does not bring back the compile-time regression. Based on that result, this PR proposes restoring the deleted rules.

<details>
<summary>Benchmark results</summary>

Environments

real Time Comparison

scenario commit / branch runs (s) median mean min max stdev stalled slow vs plain
plain_current d5f1b973 0.18, 0.14, 0.17, 0.15, 0.17 0.17 0.162 0.14 0.18 0.016 0 0 1.00x
restored_current d5f1b973+restored-13081 0.14, 0.16, 0.14, 0.13, 0.13 0.14 0.140 0.13 0.16 0.012 0 0 0.82x
historical_1578325 1578325 29.59, 29.89, 29.71, 30.65, 30.08 29.89 29.984 29.59 30.65 0.416 5 5 175.82x

user Time Comparison

scenario commit / branch runs (s) median mean min max stdev
plain_current d5f1b973 0.17, 0.14, 0.17, 0.13, 0.16 0.16 0.154 0.13 0.17 0.018
restored_current d5f1b973+restored-13081 0.13, 0.15, 0.14, 0.13, 0.14 0.14 0.138 0.13 0.15 0.008
historical_1578325 1578325 28.87, 29.08, 29.00, 29.90, 29.33 29.08 29.236 28.87 29.90 0.407

sys Time Comparison

scenario commit / branch runs (s) median mean min max stdev
plain_current d5f1b973 0.01, 0.00, 0.00, 0.02, 0.01 0.01 0.008 0.00 0.02 0.008
restored_current d5f1b973+restored-13081 0.01, 0.01, 0.00, 0.00, 0.00 0.00 0.004 0.00 0.01 0.005
historical_1578325 1578325 0.72, 0.81, 0.71, 0.76, 0.76 0.76 0.752 0.71 0.81 0.040

</details>

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

myunbin requested cfallin for a review on PR #13119.

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

myunbin requested wasmtime-core-reviewers for a review on PR #13119.

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

myunbin requested wasmtime-compiler-reviewers for a review on PR #13119.

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

cfallin commented on PR #13119:

Thanks! As mentioned in the revert, I think I'd like to see us understand fully what blew up before putting the rules back in -- in general we prefer affirmative understanding of bugs (to make sure we've fixed them) rather than no-longer-reproduces. (We can fall back on the latter eventually if needed, but in this case, since the blowup is deterministic at a certain commit, it should be possible to work out what rule interaction is happening). Once you've got that, I'm happy to put these back in!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2026 at 03:50):

github-actions[bot] added the label cranelift on PR #13119.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2026 at 03:50):

github-actions[bot] added the label isle on PR #13119.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2026 at 05:33):

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

Subscribe to Label Action

cc @cfallin, @fitzgen

<details>
This issue or pull request has been labeled: "cranelift", "isle"

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>


Last updated: May 03 2026 at 22:13 UTC