rollup of adam's and my fixes to the cse system and related stuff - #527
Merged
Conversation
aqk
previously approved these changes
Jul 17, 2026
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
prozacchiwawa
marked this pull request as draft
July 18, 2026 08:35
prozacchiwawa
marked this pull request as ready for review
July 20, 2026 10:40
aqk
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Medium Risk
Changes CSE optimization semantics for module builds (cse_dominance on), which can alter generated CLVM for programs with nested conditionals; cache key versioning limits stale hits but dependency downgrades (chia-bls) warrant release verification.
Overview
Fixes common subexpression elimination (CSE) so nested
if/iconditions no longer treat a subexpression as safe to hoist when inner branches are not actually dominated. A new dialect flagcse_dominancegates the correctedcse_is_coveringlogic; legacy behavior remains when the flag is off.Module-style compiles now route through shared
module_compile_opts(optimization on,int_fix, stepping floored to 26,cse_dominanceenabled).compile_pre_formsappliesdetect_chialisp_modulebefore the frontend so module dialect/settings are set consistently, and the duplicate stepping-based optimize toggle on the module path is removed..chialispdisk cache keys are bumped to v2: they hash dialect fields (includingcse_dominance) plus include fingerprints, so cached hex cannot be reused across the old vs new CSE behavior.Also pins
chia-blsto 0.42.0, dropsthiserror2.x from the lockfile, downgradessubprocess, tweaks CI action pins, and addscse-complex-4regression coverage.Reviewed by Cursor Bugbot for commit ff3a62f. Bugbot is set up for automated code reviews on this repo. Configure here.