From c1cc6703cd08ee159ddfebf1212a4597b9ac6f85 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 16 Jan 2024 14:43:10 +0100 Subject: [PATCH 1/2] Derive some more debugs. --- executor/src/constant_evaluator/mod.rs | 2 +- executor/src/witgen/query_processor.rs | 2 +- pil_analyzer/src/condenser.rs | 2 +- pil_analyzer/src/evaluator.rs | 9 +++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/executor/src/constant_evaluator/mod.rs b/executor/src/constant_evaluator/mod.rs index cf86fded05..091d71edd2 100644 --- a/executor/src/constant_evaluator/mod.rs +++ b/executor/src/constant_evaluator/mod.rs @@ -129,7 +129,7 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T, FixedColumnRef<'a>> for Symbols<'a } } -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Debug)] pub struct FixedColumnRef<'a> { pub name: &'a str, } diff --git a/executor/src/witgen/query_processor.rs b/executor/src/witgen/query_processor.rs index c4bfa2aa28..e7e4861d2b 100644 --- a/executor/src/witgen/query_processor.rs +++ b/executor/src/witgen/query_processor.rs @@ -143,7 +143,7 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T, Reference<'a>> for Symbols<'a, T> } } -#[derive(Clone)] +#[derive(Clone, Debug)] struct Reference<'a> { name: &'a str, poly_id: PolyID, diff --git a/pil_analyzer/src/condenser.rs b/pil_analyzer/src/condenser.rs index 0cd8c8edeb..19e3d4c56c 100644 --- a/pil_analyzer/src/condenser.rs +++ b/pil_analyzer/src/condenser.rs @@ -355,7 +355,7 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T, Condensate> for &'a Condenser { Expression(AlgebraicExpression), Identity(AlgebraicExpression, AlgebraicExpression), diff --git a/pil_analyzer/src/evaluator.rs b/pil_analyzer/src/evaluator.rs index fd39642f52..ff9331848b 100644 --- a/pil_analyzer/src/evaluator.rs +++ b/pil_analyzer/src/evaluator.rs @@ -1,3 +1,4 @@ +use std::fmt; use std::{collections::HashMap, fmt::Display, rc::Rc}; use ast::{ @@ -76,7 +77,7 @@ pub enum EvalError { DataNotAvailable, } -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Debug)] pub enum Value<'a, T, C> { Number(T), String(String), @@ -103,7 +104,7 @@ impl<'a, T: FieldElement, C: Custom> Value<'a, T, C> { } } -pub trait Custom: Display + Clone + PartialEq {} +pub trait Custom: Display + fmt::Debug + Clone + PartialEq {} impl<'a, T: Display, C: Custom> Display for Value<'a, T, C> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -118,7 +119,7 @@ impl<'a, T: Display, C: Custom> Display for Value<'a, T, C> { } } -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Debug)] pub enum NoCustom {} impl Custom for NoCustom {} @@ -129,7 +130,7 @@ impl Display for NoCustom { } } -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Closure<'a, T, C> { pub lambda: &'a LambdaExpression, pub environment: Vec>>, From 91ccb0bfd875e1e3fcd81c395378aa9f8b350995 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 16 Jan 2024 14:51:05 +0100 Subject: [PATCH 2/2] Some more explanation. --- executor/src/witgen/query_processor.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/executor/src/witgen/query_processor.rs b/executor/src/witgen/query_processor.rs index e7e4861d2b..9400021686 100644 --- a/executor/src/witgen/query_processor.rs +++ b/executor/src/witgen/query_processor.rs @@ -51,7 +51,10 @@ impl<'a, 'b, T: FieldElement, QueryCallback: super::QueryCallback> Ok(EvalValue::incomplete(IncompleteCause::DataNotYetAvailable)) } // All other errors are non-recoverable - e => Err(super::EvalError::ProverQueryError(format!("{e:?}"))), + e => Err(super::EvalError::ProverQueryError(format!( + "Error occurred when evaluating prover query {query} on {}:\n{e:?}", + rows.current_row_index + ))), }; } };