From 0a59c738ea8eb8bc1e4827296c12209c1e19a0f5 Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Tue, 20 Jul 2021 09:27:18 -0700 Subject: [PATCH] Add a context for each gate evaluation (#108) To give logs like [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | 2373 gates to evaluate the vanishing polynomial at our challenge point, zeta. [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | 1284 gates to evaluate gate constraints [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 79 gates to evaluate ArithmeticExtensionGate constraints [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 1073 gates to evaluate GMiMCGate {...} constraints [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 4 gates to evaluate NoopGate constraints [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 4 gates to evaluate ConstantGate constraints --- src/vanishing_poly.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vanishing_poly.rs b/src/vanishing_poly.rs index b82a23c1..540ab86b 100644 --- a/src/vanishing_poly.rs +++ b/src/vanishing_poly.rs @@ -236,10 +236,13 @@ pub fn evaluate_gate_constraints_recursively, const D: usize>( ) -> Vec> { let mut constraints = vec![builder.zero_extension(); num_gate_constraints]; for gate in gates { - let gate_constraints = gate - .gate - .0 - .eval_filtered_recursively(builder, vars, &gate.prefix); + let gate_constraints = context!( + builder, + &format!("evaluate {} constraints", gate.gate.0.id()), + gate.gate + .0 + .eval_filtered_recursively(builder, vars, &gate.prefix) + ); for (i, c) in gate_constraints.into_iter().enumerate() { constraints[i] = builder.add_extension(constraints[i], c); }