Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Variable bound propagators accessed range_l[-1] and range_l[0] without checking for empty domains, causing IndexError during constraint solving failures.

Changes

  • Fixed variable_bound_bounds_max_propagator.py: Guard range_l[-1] access, return -2^63 on empty domain to force constraint failure
  • Fixed variable_bound_bounds_min_propagator.py: Guard range_l[0] access, return 2^63 on empty domain to force constraint failure
  • Added test_constraint_rangelist_extended.py: 10 tests covering tuple syntax edge cases (empty domains, boundaries, mixed syntax, overlapping constraints)
  • Added test_variable_bound_propagators.py: 7 tests covering propagator behavior with empty domains (chained, offset, circular constraints)

Context

The propagators are called during constraint propagation via:

def propagate(self):
    max_v = self.max()  # Calls subclass max() which accessed range_l[-1] unsafely
    # ... rest of propagation logic

When constraint solving creates impossible conditions (e.g., a > 200 and a in rangelist((0,50))), domains can become empty before propagators run. The guards ensure SolveFailure is properly raised instead of crashing with IndexError.

Original prompt

Investigate, create tests, and confirm reported behavior. Correct issues, using context provided in the issue.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 3, 2026 04:32
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate and fix reported behavior with tests Add guards for empty domains in variable bound propagators Feb 3, 2026
Copilot AI requested a review from mballance February 3, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants