Skip to content
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

Merged
merged 4 commits into from
Jul 12, 2024

Conversation

mattstam
Copy link
Contributor

@mattstam mattstam commented Jul 11, 2024

bubble up SP1RecursionProverError instead of exit(1)

@@ -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()
Copy link
Contributor Author

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

Copy link
Contributor

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 :)

@mattstam mattstam marked this pull request as ready for review July 11, 2024 23:23
@@ -538,11 +533,15 @@ impl<C: SP1ProverComponents> SP1Prover<C> {
witness_stream.extend(input.write());

runtime.witness_stream = witness_stream.into();
runtime.run();
Copy link
Contributor

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(..)?;

Copy link
Contributor Author

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();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

runtime.run();

if let Err(e) = runtime.run() {
return Err(SP1RecursionProverError::RuntimeError(e.to_string()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Contributor Author

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrap

Copy link
Contributor Author

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrap

Copy link
Contributor Author

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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrwap

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@mattstam mattstam merged commit 612ae21 into dev Jul 12, 2024
5 checks passed
@mattstam mattstam deleted the mattstam/result-on-trap branch July 12, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants