From d29c561c73acacd3a1f1ff8e9411e26524d8fdc4 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Mon, 13 May 2024 11:00:24 +0000 Subject: [PATCH] fmt --- asm_to_pil/src/vm_to_constrained.rs | 2 +- ast/src/parsed/mod.rs | 7 ++++- bberg/src/circuit_builder.rs | 7 +++-- bberg/src/vm_builder.rs | 7 ++--- pil_analyzer/src/statement_processor.rs | 34 ++++++++++++++++++------- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/asm_to_pil/src/vm_to_constrained.rs b/asm_to_pil/src/vm_to_constrained.rs index 9d85a785a4..c5f837e451 100644 --- a/asm_to_pil/src/vm_to_constrained.rs +++ b/asm_to_pil/src/vm_to_constrained.rs @@ -1082,7 +1082,7 @@ fn witness_column, T>( start: usize, name: S, def: Option>, - is_public: bool + is_public: bool, ) -> PilStatement { PilStatement::PolynomialCommitDeclaration( start, diff --git a/ast/src/parsed/mod.rs b/ast/src/parsed/mod.rs index 83533a2b9a..671ba865ee 100644 --- a/ast/src/parsed/mod.rs +++ b/ast/src/parsed/mod.rs @@ -33,7 +33,12 @@ pub enum PilStatement { ), PolynomialConstantDeclaration(usize, Vec>), PolynomialConstantDefinition(usize, String, FunctionDefinition), - PolynomialCommitDeclaration(usize, Vec>, Option>, /*public=*/ bool), + PolynomialCommitDeclaration( + usize, + Vec>, + Option>, + /*public=*/ bool, + ), PolynomialIdentity(usize, Option, Expression), PlookupIdentity( usize, diff --git a/bberg/src/circuit_builder.rs b/bberg/src/circuit_builder.rs index 595f21dd1b..7c99854e37 100644 --- a/bberg/src/circuit_builder.rs +++ b/bberg/src/circuit_builder.rs @@ -105,7 +105,7 @@ impl CircuitBuilder for BBFiles { ) }; - // When we are running natively, we want check circuit to run as futures; however, futures are not supported in wasm, so we must provide an + // When we are running natively, we want check circuit to run as futures; however, futures are not supported in wasm, so we must provide an // alternative codepath that will execute the closures in serial let emplace_future_transformation = |relation_name: &String| { format!( @@ -131,11 +131,11 @@ impl CircuitBuilder for BBFiles { map_with_newline(relations, check_circuit_transformation); let check_circuit_for_each_lookup = map_with_newline(permutations, check_lookup_transformation); - + // With futures let emplace_future_relations = map_with_newline(relations, emplace_future_transformation); let emplace_future_lookups = map_with_newline(permutations, emplace_future_transformation); - + // With threads let serial_relations = map_with_newline(relations, execute_serial_transformation); let serial_lookups = map_with_newline(permutations, execute_serial_transformation); @@ -151,7 +151,6 @@ impl CircuitBuilder for BBFiles { "".to_owned() }; - let circuit_hpp = format!(" {includes} diff --git a/bberg/src/vm_builder.rs b/bberg/src/vm_builder.rs index bb68d01842..b5c46f0636 100644 --- a/bberg/src/vm_builder.rs +++ b/bberg/src/vm_builder.rs @@ -211,13 +211,10 @@ fn get_all_col_names( /// The compiler automatically suffixes the public input columns with "__is_public" /// This function removes the suffix and collects the columns into their own container pub fn extract_public_input_columns(witness_columns: Vec) -> (Vec, Vec) { - let witness_names: Vec = witness_columns - .clone(); + let witness_names: Vec = witness_columns.clone(); let public_input_column_names: Vec = witness_columns .into_iter() - .filter(|name| - name.ends_with("__is_public") - ) + .filter(|name| name.ends_with("__is_public")) .collect(); assert!( diff --git a/pil_analyzer/src/statement_processor.rs b/pil_analyzer/src/statement_processor.rs index a4855a9c5a..2e7e2a22df 100644 --- a/pil_analyzer/src/statement_processor.rs +++ b/pil_analyzer/src/statement_processor.rs @@ -109,9 +109,13 @@ where PilStatement::PublicDeclaration(start, name, polynomial, array_index, index) => { self.handle_public_declaration(start, name, polynomial, array_index, index) } - PilStatement::PolynomialConstantDeclaration(start, polynomials) => { - self.handle_polynomial_declarations(start, polynomials, PolynomialType::Constant, false) - } + PilStatement::PolynomialConstantDeclaration(start, polynomials) => self + .handle_polynomial_declarations( + start, + polynomials, + PolynomialType::Constant, + false, + ), PilStatement::PolynomialConstantDefinition(start, name, definition) => self .handle_symbol_definition( start, @@ -120,10 +124,19 @@ where SymbolKind::Poly(PolynomialType::Constant), Some(definition), ), - PilStatement::PolynomialCommitDeclaration(start, polynomials, None, is_public) => { - self.handle_polynomial_declarations(start, polynomials, PolynomialType::Committed, is_public) - } - PilStatement::PolynomialCommitDeclaration(start, mut polynomials, Some(definition), _) => { + PilStatement::PolynomialCommitDeclaration(start, polynomials, None, is_public) => self + .handle_polynomial_declarations( + start, + polynomials, + PolynomialType::Committed, + is_public, + ), + PilStatement::PolynomialCommitDeclaration( + start, + mut polynomials, + Some(definition), + _, + ) => { assert!(polynomials.len() == 1); let name = polynomials.pop().unwrap(); self.handle_symbol_definition( @@ -272,9 +285,12 @@ where polynomials .into_iter() .flat_map(|PolynomialName { name, array_size }| { - // hack(https://github.com/AztecProtocol/aztec-packages/issues/6359): add an is_public modifier to the end of a committed polynomial - let name = if is_public { format!("{name}__is_public")} else {name}; + let name = if is_public { + format!("{name}__is_public") + } else { + name + }; self.handle_symbol_definition( start,