Skip to content

[Cranelift] fix e-graph rewrite depth limit#13205

Merged
fitzgen merged 1 commit intobytecodealliance:mainfrom
myunbin:fix_e-graph_rewrite_depth_limit
Apr 27, 2026
Merged

[Cranelift] fix e-graph rewrite depth limit#13205
fitzgen merged 1 commit intobytecodealliance:mainfrom
myunbin:fix_e-graph_rewrite_depth_limit

Conversation

@myunbin
Copy link
Copy Markdown
Contributor

@myunbin myunbin commented Apr 27, 2026

Fix an off-by-one in the e-graph rewrite depth limit.

REWRITE_LIMIT is set to 5. Current check uses rewrite_depth > REWRITE_LIMIT before incrementing the depth. Since
rewrite_depth starts at 0, this allows rewrites to run at effective depth 6.

If the intended maximum rewrite depth is 5, this changes the check to rewrite_depth >= REWRITE_LIMIT.

Noticed while investigating #13204.

@myunbin myunbin requested a review from a team as a code owner April 27, 2026 04:35
@myunbin myunbin requested review from fitzgen and removed request for a team April 27, 2026 04:35
@myunbin myunbin force-pushed the fix_e-graph_rewrite_depth_limit branch from 0d300c1 to 8ae47ed Compare April 27, 2026 04:59
@myunbin myunbin requested a review from a team as a code owner April 27, 2026 04:59
@github-actions github-actions Bot added the cranelift Issues related to the Cranelift code generator label Apr 27, 2026
Copy link
Copy Markdown
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fitzgen fitzgen added this pull request to the merge queue Apr 27, 2026
Merged via the queue into bytecodealliance:main with commit ad2f37e Apr 27, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants