Skip to content

Commit

Permalink
Also print code generated so far.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Jan 14, 2025
1 parent 524ae00 commit faf14f5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions executor/src/witgen/jit/witgen_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use powdr_number::FieldElement;

use crate::witgen::{
data_structures::mutable_state::MutableState, global_constraints::RangeConstraintSet,
range_constraints::RangeConstraint, FixedData, QueryCallback,
jit::effect::format_code, range_constraints::RangeConstraint, FixedData, QueryCallback,
};

use super::{
Expand Down Expand Up @@ -230,7 +230,11 @@ impl<'a, T: FieldElement, FixedEval: FixedEvaluator<T>> WitgenInference<'a, T, F
let result = (lhs_evaluated - rhs_evaluated)
.solve()
.map_err(|e| {
panic!("Error solving equality constraint: {lhs} = {rhs} on row {offset}: {e}");
panic!(
"Error solving equality constraint: {lhs} = {rhs} on row {offset}: {e}\n\
Code generated since the previous branching point:\n{}",
format_code(&self.code)
);
})
.unwrap();
if result.complete && result.effects.is_empty() {
Expand Down Expand Up @@ -266,7 +270,11 @@ impl<'a, T: FieldElement, FixedEval: FixedEvaluator<T>> WitgenInference<'a, T, F
(lhs_evaluated - rhs_evaluated)
.solve()
.map_err(|e| {
panic!("Error solving equality constraint: {lhs} = {rhs} on row {offset}: {e}");
panic!(
"Error solving equality constraint: {lhs} = {rhs} on row {offset}: {e}\n\
Code generated since the previous branching point:\n{}",
format_code(&self.code)
);
})
.unwrap()
}
Expand Down

0 comments on commit faf14f5

Please sign in to comment.