-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: runtime sharding #181
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use std::panic::{catch_unwind, AssertUnwindSafe}; | ||
|
||
use p3_air::{ | ||
Air, AirBuilder, BaseAir, ExtensionBuilder, PairBuilder, PermutationAirBuilder, | ||
TwoRowMatrixView, | ||
|
@@ -75,7 +77,14 @@ pub fn debug_constraints<F: PrimeField, EF: ExtensionField<F>, A>( | |
builder.is_transition = F::zero(); | ||
} | ||
|
||
air.eval(&mut builder); | ||
let result = catch_unwind(AssertUnwindSafe(|| { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you mean to keep this in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah i think its useful |
||
air.eval(&mut builder); | ||
})); | ||
if result.is_err() { | ||
println!("local: {:?}", main_local); | ||
println!("next: {:?}", main_local); | ||
panic!("failed at row {} of chip {}", i, air.name()); | ||
} | ||
eval_permutation_constraints(air, &mut builder, cumulative_sum); | ||
}); | ||
} | ||
|
@@ -176,7 +185,11 @@ where | |
} | ||
|
||
fn assert_zero<I: Into<Self::Expr>>(&mut self, x: I) { | ||
assert_eq!(x.into(), F::zero(), "constraints must evaluate to zero"); | ||
let f: F = x.into(); | ||
if f != F::zero() { | ||
let backtrace = std::backtrace::Backtrace::force_capture(); | ||
panic!("constraint failed: {}", backtrace); | ||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you leave a comment as to why the
self.shard_size * 4
is the max_clk?