mcsat: fall back to model cache when target cache value is infeasible#634
Open
ahmed-irfan wants to merge 1 commit into
Open
mcsat: fall back to model cache when target cache value is infeasible#634ahmed-irfan wants to merge 1 commit into
ahmed-irfan wants to merge 1 commit into
Conversation
When deciding a value, the feasibility-aware plugins (na, ff, bv, uf) used a single cached hint (target cache preferred, else model cache). If that value was infeasible they went straight to a fresh pick, discarding the model cache's saved phase. Try both cached tiers in priority order instead: tier 1 (target cache), then tier 2 (model cache), each checked against the variable's feasible set, before falling back to a fresh pick. The new behavior only fires when the target value is present but infeasible and the model value is present, feasible, and different - every other path is unchanged. Add trail_get_cached_candidates() to own the priority ordering, NULL-stripping, and dedup (skip tier 2 when identical to tier 1) in one place; each plugin's decide path is now a plain loop over the returned candidates with only its own feasibility predicate. bool_plugin keeps the original combined getter (it has no feasible set). Also fix a latent copy-paste assert in mcsat_value_eq (VALUE_LIBPOLY vs VALUE_RATIONAL comparison asserted v1->type instead of v2->type). Full regression suite: 1726/1726 pass.
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.
When deciding a value, the feasibility-aware plugins (na, ff, bv, uf) used a single cached hint (target cache preferred, else model cache). If that value was infeasible they went straight to a fresh pick, discarding the model cache's saved phase.
Try both cached tiers in priority order instead: tier 1 (target cache), then tier 2 (model cache), each checked against the variable's feasible set, before falling back to a fresh pick. The new behavior only fires when the target value is present but infeasible and the model value is present, feasible, and different - every other path is unchanged.
Add trail_get_cached_candidates() to own the priority ordering, NULL-stripping, and dedup (skip tier 2 when identical to tier 1) in one place; each plugin's decide path is now a plain loop over the returned candidates with only its own feasibility predicate. bool_plugin keeps the original combined getter (it has no feasible set).
Also fix a latent copy-paste assert in mcsat_value_eq (VALUE_LIBPOLY vs VALUE_RATIONAL comparison asserted v1->type instead of v2->type).
Full regression suite: 1726/1726 pass.