From 42d819164e9997a2b68db50140a8c366458ac4b3 Mon Sep 17 00:00:00 2001 From: luffykai Date: Fri, 10 Jan 2025 20:07:46 +0800 Subject: [PATCH 1/2] turn on first row check for setup --- Cargo.lock | 2 +- crates/circuits/mod-builder/src/builder.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a33b8bae3a..cc9d97f6fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3709,7 +3709,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] diff --git a/crates/circuits/mod-builder/src/builder.rs b/crates/circuits/mod-builder/src/builder.rs index c6173a2d26..613fa7b178 100644 --- a/crates/circuits/mod-builder/src/builder.rs +++ b/crates/circuits/mod-builder/src/builder.rs @@ -289,6 +289,8 @@ impl SubAir for FieldExpr { if self.builder.needs_setup() { let is_setup = flags.iter().fold(is_valid.into(), |acc, &x| acc - x); builder.assert_bool(is_setup.clone()); + // TODO: turn back on once we also support this in ecc and everywhere + builder.when_first_row().assert_one(is_setup.clone()); for i in 0..inputs[0].len().max(self.builder.prime_limbs.len()) { let lhs = if i < inputs[0].len() { inputs[0][i].into() @@ -318,9 +320,6 @@ impl SubAir for FieldExpr { }) .collect(); - // TODO: turn back on once we also support this in ecc and everywhere - // builder.when_first_row().assert_one(is_setup); - for flag in flags.iter() { builder.assert_bool(*flag); } From 0197c030eb08518721f5f0a67ac180b65c65ec16 Mon Sep 17 00:00:00 2001 From: luffykai Date: Fri, 10 Jan 2025 20:29:19 +0800 Subject: [PATCH 2/2] rm comment --- crates/circuits/mod-builder/src/builder.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/circuits/mod-builder/src/builder.rs b/crates/circuits/mod-builder/src/builder.rs index 613fa7b178..821fd62c5a 100644 --- a/crates/circuits/mod-builder/src/builder.rs +++ b/crates/circuits/mod-builder/src/builder.rs @@ -289,7 +289,6 @@ impl SubAir for FieldExpr { if self.builder.needs_setup() { let is_setup = flags.iter().fold(is_valid.into(), |acc, &x| acc - x); builder.assert_bool(is_setup.clone()); - // TODO: turn back on once we also support this in ecc and everywhere builder.when_first_row().assert_one(is_setup.clone()); for i in 0..inputs[0].len().max(self.builder.prime_limbs.len()) { let lhs = if i < inputs[0].len() {