Skip to content

Commit

Permalink
Simplify debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgoergens committed Dec 12, 2023
1 parent 1017c30 commit 6f28f82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 1 addition & 12 deletions starky/src/constraint_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use alloc::vec;
use alloc::vec::Vec;
use core::marker::PhantomData;

#[cfg(std)]
use backtrace::Backtrace;
use plonky2::field::extension::Extendable;
use plonky2::field::packed::PackedField;
use plonky2::field::types::Field;
Expand Down Expand Up @@ -33,7 +31,7 @@ pub struct ConstraintConsumer<P: PackedField> {
lagrange_basis_last: P,

/// debug constraints
debug_api: bool,
pub debug_api: bool,
}

impl<P: PackedField> ConstraintConsumer<P> {
Expand Down Expand Up @@ -67,15 +65,6 @@ impl<P: PackedField> ConstraintConsumer<P> {
/// Add one constraint on all rows.
#[allow(clippy::collapsible_if)]
pub fn constraint(&mut self, constraint: P) {
#[cfg(std)]
if std::intrinsics::unlikely(self.debug_api) {
if !constraint.is_zeros() {
println!(
"ConstraintConsumer - DEBUG trace (non-zero-constraint): {:?}",
Backtrace::new()
);
}
}
for (&alpha, acc) in self.alphas.iter().zip(&mut self.constraint_accs) {
*acc *= alpha;
*acc += constraint;
Expand Down
2 changes: 1 addition & 1 deletion starky/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(clippy::too_many_arguments)]
#![allow(clippy::type_complexity)]
#![cfg_attr(not(feature = "std"), no_std)]
#![feature(core_intrinsics)]

extern crate alloc;

mod get_challenges;
Expand Down

0 comments on commit 6f28f82

Please sign in to comment.