[CSOptimizer] Always prefer a disjunction with a single active choice

Disjunctions with a single element are sometimes introduced after
disfavoring, so we need to make sure that they are always preferred
during disjunction selection.
This commit is contained in:
Pavel Yaskevich
2025-02-08 22:21:53 -08:00
parent b96139eb5b
commit 0e0b5f9a80

View File

@@ -1431,6 +1431,9 @@ ConstraintSystem::selectDisjunction() {
unsigned firstActive = first->countActiveNestedConstraints();
unsigned secondActive = second->countActiveNestedConstraints();
if (firstActive == 1 || secondActive == 1)
return secondActive != 1;
auto &[firstScore, firstFavoredChoices] = favorings[first];
auto &[secondScore, secondFavoredChoices] = favorings[second];