Merge pull request #1041 from powdr-labs/continuations-dont-assume-early-pipeline-stage

Continuations: Don't assume the pipeline to be in an early stage
This commit is contained in:
Leo
2024-02-09 17:32:47 +00:00
committed by GitHub
2 changed files with 17 additions and 3 deletions

View File

@@ -739,7 +739,7 @@ impl<T: FieldElement> Pipeline<T> {
Ok(())
}
fn stage(&self) -> Stage {
pub fn stage(&self) -> Stage {
match self.artifact.as_ref().unwrap() {
Artifact::AsmFilePath(_) => Stage::AsmFilePath,
Artifact::AsmString(_, _) => Stage::AsmString,
@@ -824,6 +824,16 @@ impl<T: FieldElement> Pipeline<T> {
Ok(pil_with_constants)
}
pub fn pil_with_evaluated_fixed_cols_ref(
&mut self,
) -> Result<&PilWithEvaluatedFixedCols<T>, Vec<String>> {
self.advance_to(Stage::PilWithEvaluatedFixedCols)?;
match self.artifact.as_ref().unwrap() {
Artifact::PilWithEvaluatedFixedCols(pil_with_constants) => Ok(pil_with_constants),
_ => panic!(),
}
}
pub fn generated_witness(mut self) -> Result<GeneratedWitness<T>, Vec<String>> {
self.advance_to(Stage::GeneratedWitness)?;
let Artifact::GeneratedWitness(generated_witness) = self.artifact.unwrap() else {

View File

@@ -64,8 +64,6 @@ where
{
let num_chunks = bootloader_inputs.len();
let length = pipeline.optimized_pil_ref().unwrap().degree();
// Advance the pipeline to the PilWithEvaluatedFixedCols stage and then clone it
// for each chunk. This is more efficient, because we'll run all steps until then
// only once.
@@ -74,6 +72,12 @@ where
.advance_to(Stage::PilWithEvaluatedFixedCols)
.unwrap();
let length = pipeline
.pil_with_evaluated_fixed_cols_ref()
.unwrap()
.pil
.degree();
bootloader_inputs
.into_iter()
.enumerate()