Conversation
…stack 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] Fix IndexError when using tuple syntax in rangelist
Fix IndexError in rangelist with tuple syntax during constraint solving failures
Jan 15, 2026
Member
|
@copilot Have a look at the failures and address |
…aint solving Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
Contributor
Author
Fixed in b62b958. The root cause was in variable_bound_min_propagator.py where after trimming range_l on line 39, the code still referenced the old local variable instead of the updated list, causing IndexError on empty lists. Updated both min and max propagators to maintain proper local references after list modifications. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
Fix IndexError in rangelist with tuple syntax during constraint solving failures
Fix IndexError in variable bound propagators during constraint solving failures
Jan 15, 2026
mballance
approved these changes
Feb 1, 2026
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 using
vsc.rangelist()with tuple syntax inrandomize_withcontexts, unsolvable constraints triggerIndexError: list index out of rangeinstead of the expectedSolveFailure.Root Cause
The bug occurred in the variable bound propagators during constraint solving. In
variable_bound_min_propagator.py, after trimmingself.target.domain.range_lon line 39, the local variablerange_lstill referenced the old list. When constraints were unsolvable and the list became empty, subsequent attempts to accessrange_l[0][0]raisedIndexError.Changes
_safe_to_expr_model()helper intypes.py: Extracts expression models directly via.emattribute and wrapspop_expr()in try-except to handle stack corruption gracefullyrangelist.__init__,append,__contains__: Use the helper instead of directto_expr()/pop_expr()callsvariable_bound_min_propagator.py: Update localrange_lreference after trimming and add safety check before accessing array elementsvariable_bound_max_propagator.py: Add safety check and update local reference after trimming for consistencySolveFailureconsistentlyThe fix ensures correct exception propagation throughout the constraint solving pipeline, from expression model creation through variable bound propagation.
Original prompt
<issue_description>### Description
When using
vsc.rangelist()with tuple syntax to specify a range constraint that conflicts with other constraints, PyVSC throws anIndexErrorinstead of the expectedSolveFailureexception. The same constraint using multi-argument syntax correctly throwsSolveFailure.Minimal Reproducible Example
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.