Fix hierarchical refinement fall-through into linear search - #166
Open
shaobo-he wants to merge 1 commit into
Open
Fix hierarchical refinement fall-through into linear search#166shaobo-he wants to merge 1 commit into
shaobo-he wants to merge 1 commit into
Conversation
When Z3 refinement is disabled, hierarchical search computed a valid tracked set then fell through into linear search and overwrote the result. Return after hierarchical so the two algorithms are mutually exclusive.
shaobo-he
force-pushed
the
fix/hierarchical-refinement-fallthrough
branch
from
August 11, 2026 04:03
0b0d829 to
2b64dfe
Compare
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.
Summary
When Z3-based variable refinement is disabled, Corral’s hierarchical refinement search was not used as the final refinement algorithm. Instead it:
ec;ecinrefinementState.trackedTokens;Corral therefore paid for hierarchical search plus linear search, and kept only the linear result.
This behavior has existed since the initial Corral check-in (2013) and is present on upstream
master.Root cause
In
GeneralRefinementScheme.doRefinement():The linear phase always restarts from
initialTrackedTokens, not fromec. Hierarchical results were only used for a debug progress assert before being discarded.When the fall-through occurs
useZ3Searchis forced off when:VariableSlicing.EncounteredParallelAssignmentis true; orGeneralRefinementSchemewithz3search=false.Evidence this was unintentional
doRefinement1()(labeled “For CADE 2011”) runs linear, hierarchical, and Z3 independently as timing alternatives and does not compose them.Change
Two lines after hierarchical assigns
trackedTokens = ec:Test plan
015/ParAssign1,ParAssign2): outcomes preserved; path queries drop (e.g. 12→9, 20→14)