Repository navigation
Commit 27ad523
fix(physical-expr): stop false infeasibility report from Eq+FALSE in cp_solver
propagate_comparison for Operator::Eq with parent == Interval::FALSE
returned Ok(None), which ExprIntervalGraph::propagate_constraints
interprets as infeasible. The correct semantics is that a = b being
certainly false means a != b, which excludes at most a single point
from each operand. Interval arithmetic cannot represent a hole, so
the children cannot be refined further, but the expression is not
infeasible.
This caused analyze() to return None for the column interval when
the predicate was NOT (a = 0.0) and the input domain contained 0.0
but was not equal to it (e.g. a in [-1, 1]). The None is documented
in ExprBoundaries::interval to mean "evaluating the given column
results in an empty set", but NOT (a = 0.0) is true for every
a != 0, so the correct result is the full input domain. This is a
contract violation of the public analyze() API, as reported in apache#19264
by an external user calling analyze() to infer bounds for pushdown
into another library.
The only case that should remain infeasible under Eq + FALSE is
when both children are the same single-point interval: then a = b
is certainly true, so NOT(a = b) is impossible. All other cases
return the children unchanged (Ok(Some((left, right)))) so
propagation completes with Success and the column interval is
preserved. This guard was agreed on during review of apache#20138 by
berkaysynnada and pepijnve.
This revives the fix from apache#20138, which was closed as stale after
review, and adds direct unit coverage for that guard. No
analyze()-level test can reach it: when both children are the same
single point the bounds evaluate to FALSE, so update_ranges
short-circuits to Infeasible before propagate_constraints runs.
Only a direct propagate_comparison call exercises the guard.
Tests:
- analysis.rs: E2E boundary pair via analyze(). Input [-1,1] is the
reported case and does reach the fixed branch; input [0,0] is the
nearest-invalid counterpart and must stay infeasible.
- cp_solver.rs: direct propagate_comparison unit tests for Eq + FALSE
covering identical singletons (infeasible), different singletons
(feasible), overlapping intervals, and the [-1,1] vs [0,0] case
from the issue.
Negative control on baseline a1f64e9 with the production arm
reverted to Ok(None): 3 of the 4 new tests fail, including the E2E
test_analyze_not_eq_around_zero. test_analyze_not_eq_clamped_at_zero
passes on baseline as well, so it is a boundary guard rather than
evidence of the fix.
Closes apache#19264.
Co-authored-by: evangelisilva <[email protected]>1 parent a1f64e9 commit 27ad523
2 files changed
Lines changed: 137 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| 347 | + | |
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
| |||
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
592 | 658 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
368 | 385 | | |
369 | 386 | | |
370 | 387 | | |
| |||
1621 | 1638 | | |
1622 | 1639 | | |
1623 | 1640 | | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
1624 | 1693 | | |
1625 | 1694 | | |
1626 | 1695 | | |
| |||
0 commit comments