Skip to content

Conversation

@rohanku
Copy link
Contributor

@rohanku rohanku commented Dec 23, 2025

No description provided.


state.constraint_span_map.insert(
constraint,
Span {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use self.span instead of manually constructing the span.

@CONnor9029 CONnor9029 self-assigned this Dec 26, 2025
{
state.fallback_constraints_used.push(constraint.clone());
state.solver.constrain_eq0(constraint);
state.solver.constrain_eq0(constraint, None);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might still need to store the span in the FallbackConstraint struct if you aren't able to get the span otherwise here. We want to be able to debug fallback constraints as well.

});
}

let inconsistent_errors = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be necessary to collect everything into a new Vec, what error were you getting before? I know you mentioned it earlier, but didn't realize it should have been fixable.

});
} else {
state.solver.constrain_eq0(expr);
state.solver.constrain_eq0(expr, None);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this None?

/// Constrains the value of `expr` to 0.
/// TODO: Check if added constraints conflict with existing solution.
pub fn constrain_eq0(&mut self, expr: LinearExpr) -> ConstraintId {
pub fn constrain_eq0(&mut self, expr: LinearExpr, span: Option<Span>) -> ConstraintId {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to make you change this back, but I realized that it is probably a bad abstraction to have the solver know about Spans. The reason we made you change it is that it didn't seem elegant to put the Span in multiple structs, but it would be better for the ExecPass to simply have a ConstraintId to Span map.

@CONnor9029 CONnor9029 merged commit 5a3c340 into main Jan 3, 2026
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.

4 participants