-
Notifications
You must be signed in to change notification settings - Fork 331
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
feat: result instead of exit(1) on trap in recursion #1089
Conversation
@@ -482,7 +477,7 @@ impl<C: SP1ProverComponents> SP1Prover<C> { | |||
let batched_compress_inputs = | |||
compress_inputs.chunks(shard_batch_size).collect::<Vec<_>>(); | |||
reduce_proofs = batched_compress_inputs | |||
.into_iter() | |||
.into_par_iter() |
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.
this seems kind of free? Or is there a reason we chose to not do this concurrently? just lmk and I'll remove
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.
Ah no, good catch. That looks good :)
@@ -538,11 +533,15 @@ impl<C: SP1ProverComponents> SP1Prover<C> { | |||
witness_stream.extend(input.write()); | |||
|
|||
runtime.witness_stream = witness_stream.into(); | |||
runtime.run(); |
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.
more canonical way to do this would be to do runtime.run().map_err(..)?;
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.
updated
@@ -579,7 +580,11 @@ impl<C: SP1ProverComponents> SP1Prover<C> { | |||
witness_stream.extend(input.write()); | |||
|
|||
runtime.witness_stream = witness_stream.into(); | |||
runtime.run(); | |||
|
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.
same here
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.
updated
prover/src/lib.rs
Outdated
runtime.run(); | ||
|
||
if let Err(e) = runtime.run() { | ||
return Err(SP1RecursionProverError::RuntimeError(e.to_string())); |
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.
same
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.
updated
@@ -294,7 +294,7 @@ mod tests { | |||
let program = basic_program::<F>(); | |||
let config = SC::new(); | |||
let mut runtime = Runtime::<F, EF, DiffusionMatrixBabyBear>::new_no_perm(&program); | |||
runtime.run(); |
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.
unwrap
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.
updated
@@ -52,7 +52,7 @@ fn main() { | |||
|
|||
let config = SC::new(); | |||
let mut runtime = Runtime::<F, EF, _>::new(&program, config.perm.clone()); | |||
runtime.run(); |
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.
unwrap
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.
updated
@@ -326,7 +326,7 @@ mod tests { | |||
let program = builder.compile_program(); | |||
|
|||
let mut runtime = Runtime::<F, EF, _>::new(&program, config.perm.clone()); |
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.
unrwap
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.
updated
bubble up
SP1RecursionProverError
instead of exit(1)