Skip to content

Commit 1b49df5

Browse files
authored
Powdr PIL runs witgen with mock backend by default (#2601)
Now that witgen depends on backend type, `powdr pil` requires a backend type to run through witgen. It only runs till optimized pil if `--prove-with` is not provided. To match the description, this PR defaults backend to Mock if `--prove-with` is not provided, so `powdr pil` can still run till witgen. To prove with any backend, `--prove-with` is still required.
1 parent 4399ae8 commit 1b49df5

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

cli/src/main.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ struct Cli {
105105
#[derive(Subcommand)]
106106
enum Commands {
107107
/// Runs compilation and witness generation for .pil and .asm files.
108+
/// Also runs backend if `--prove-with` is set.
108109
/// First converts .asm files to .pil, if needed.
109110
/// Then converts the .pil file to json and generates fixed and witness column data files.
110111
Pil {
@@ -711,21 +712,17 @@ fn run_pil<F: FieldElement>(
711712
}
712713

713714
fn run<F: FieldElement>(
714-
mut pipeline: Pipeline<F>,
715+
pipeline: Pipeline<F>,
715716
prove_with: Option<BackendType>,
716717
params: Option<String>,
717718
backend_options: Option<String>,
718719
) -> Result<(), Vec<String>> {
719-
pipeline = pipeline.with_setup_file(params.map(PathBuf::from));
720-
721-
pipeline.compute_optimized_pil().unwrap();
720+
pipeline
721+
.with_setup_file(params.map(PathBuf::from))
722+
.with_backend(prove_with.unwrap_or_default(), backend_options.clone())
723+
.compute_proof()
724+
.unwrap();
722725

723-
if let Some(backend) = prove_with {
724-
pipeline
725-
.with_backend(backend, backend_options.clone())
726-
.compute_proof()
727-
.unwrap();
728-
}
729726
Ok(())
730727
}
731728

0 commit comments

Comments
 (0)