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 medianrealtime is0.17son plainmainand0.14son the restored version. For comparison, the historical slow configuration took about29.89smedianrealtime 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 asx - 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
plain_current: commitd5f1b973restored_current:d5f1b973plus the rules / expected outputs removed by#13081historical_1578325: historical commit1578325, where the rules were originally present
realTime Comparison
scenario commit / branch runs (s) median mean min max stdev stalled slow vs plain plain_current d5f1b9730.18, 0.14, 0.17, 0.15, 0.170.17 0.162 0.14 0.18 0.016 0 0 1.00x restored_current d5f1b973+restored-130810.14, 0.16, 0.14, 0.13, 0.130.14 0.140 0.13 0.16 0.012 0 0 0.82x historical_1578325 157832529.59, 29.89, 29.71, 30.65, 30.0829.89 29.984 29.59 30.65 0.416 5 5 175.82x
userTime Comparison
scenario commit / branch runs (s) median mean min max stdev plain_current d5f1b9730.17, 0.14, 0.17, 0.13, 0.160.16 0.154 0.13 0.17 0.018 restored_current d5f1b973+restored-130810.13, 0.15, 0.14, 0.13, 0.140.14 0.138 0.13 0.15 0.008 historical_1578325 157832528.87, 29.08, 29.00, 29.90, 29.3329.08 29.236 28.87 29.90 0.407
sysTime Comparison
scenario commit / branch runs (s) median mean min max stdev plain_current d5f1b9730.01, 0.00, 0.00, 0.02, 0.010.01 0.008 0.00 0.02 0.008 restored_current d5f1b973+restored-130810.01, 0.01, 0.00, 0.00, 0.000.00 0.004 0.00 0.01 0.005 historical_1578325 15783250.72, 0.81, 0.71, 0.76, 0.760.76 0.752 0.71 0.81 0.040 </details>
myunbin requested cfallin for a review on PR #13119.
myunbin requested wasmtime-core-reviewers for a review on PR #13119.
myunbin requested wasmtime-compiler-reviewers for a review on PR #13119.
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!
github-actions[bot] added the label cranelift on PR #13119.
github-actions[bot] added the label isle on PR #13119.
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:
- cfallin: isle
- fitzgen: isle
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