diff --git a/stwo_cairo_prover/crates/prover/src/cairo_air/debug_tools.rs b/stwo_cairo_prover/crates/prover/src/cairo_air/debug_tools.rs index 1ffc9ed9..75540c9b 100644 --- a/stwo_cairo_prover/crates/prover/src/cairo_air/debug_tools.rs +++ b/stwo_cairo_prover/crates/prover/src/cairo_air/debug_tools.rs @@ -66,7 +66,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -82,7 +82,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -98,7 +98,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -114,7 +114,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -130,7 +130,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -146,7 +146,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -162,7 +162,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -178,7 +178,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -193,7 +193,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -209,7 +209,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ) @@ -225,7 +225,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -241,7 +241,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -257,7 +257,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -275,7 +275,7 @@ where range_check_19_lookup_elements: relations::RangeCheck_19::dummy(), range_check_9_9_lookup_elements: relations::RangeCheck_9_9::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -291,7 +291,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -307,7 +307,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -323,7 +323,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -339,7 +339,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -355,7 +355,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -371,7 +371,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -387,7 +387,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -403,7 +403,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -420,7 +420,7 @@ where verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), range_check_19_lookup_elements: relations::RangeCheck_19::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -437,7 +437,7 @@ where verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), range_check_19_lookup_elements: relations::RangeCheck_19::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); @@ -453,7 +453,7 @@ where opcodes_lookup_elements: relations::Opcodes::dummy(), verify_instruction_lookup_elements: relations::VerifyInstruction::dummy(), }, - claim.n_calls, + claim.n_rows, ) .entries(trace), ); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/component.rs index 43dbefb7..13f351e2 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 10]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/prover.rs index fd37183d..1b369150 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -323,7 +323,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -338,7 +338,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -376,13 +376,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/component.rs index 32ecd314..bb0bf931 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 10]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/prover.rs index 1f2167a0..e56ad82f 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_f_op_1_base_fp_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -323,7 +323,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -338,7 +338,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -376,13 +376,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/component.rs index aaf45e9f..eb432bd6 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 9]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/prover.rs index e942e77f..f44eb708 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_ap_opcode_is_imm_t_op_1_base_fp_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -301,7 +301,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -316,7 +316,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -354,13 +354,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/component.rs index 46cc082b..3671f5be 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 102]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/prover.rs index 9c315e62..a1f121e2 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -686,7 +686,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -701,7 +701,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -765,13 +765,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/component.rs index 17f9cd17..f47b85c1 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 98]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/prover.rs index cee68e23..63dac056 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_f_is_imm_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -643,7 +643,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -658,7 +658,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -722,13 +722,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/component.rs index 8d63904d..44b4d9bf 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 32]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/prover.rs index 16d08586..1b785719 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -563,7 +563,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -578,7 +578,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -642,13 +642,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/component.rs index 11d889ce..84c945ac 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 28]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/prover.rs index 930b46e4..e1151298 100644 --- a/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/add_opcode_is_small_t_is_imm_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -520,7 +520,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -535,7 +535,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -599,13 +599,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/component.rs index 8e2a0719..d21e4d55 100644 --- a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/component.rs @@ -25,11 +25,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 12]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -41,7 +41,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -64,7 +64,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/prover.rs index 2c5490e7..569f13f6 100644 --- a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,21 +77,21 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -339,7 +339,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -353,7 +353,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -391,13 +391,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/component.rs index 4dd15cdd..169a3952 100644 --- a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/component.rs @@ -25,11 +25,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 8]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -41,7 +41,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -64,7 +64,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/prover.rs index 91a199cb..09f08783 100644 --- a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_f_is_imm_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,21 +77,21 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -295,7 +295,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -309,7 +309,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -347,13 +347,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/component.rs index 617aa56d..4023fbce 100644 --- a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 16]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 4]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/prover.rs index 1b08df09..45dd5bfa 100644 --- a/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/assert_eq_opcode_is_double_deref_t_is_imm_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -418,7 +418,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -433,7 +433,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -484,13 +484,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/component.rs index 9fd121cf..1210b34b 100644 --- a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 16]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/prover.rs index c5d73497..8508b7c6 100644 --- a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -417,7 +417,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -432,7 +432,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -496,13 +496,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/component.rs index b2ebe801..0194b0b6 100644 --- a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 16]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/prover.rs index e01059e3..124b5430 100644 --- a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_f_op_1_base_fp_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -417,7 +417,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -432,7 +432,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -496,13 +496,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/component.rs index ed5fecf5..94d986b5 100644 --- a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 17]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 5]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/prover.rs index dc81e4c6..a5d174fb 100644 --- a/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/call_opcode_is_rel_t_op_1_base_fp_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -417,7 +417,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -432,7 +432,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -496,13 +496,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/generic_opcode/component.rs b/stwo_cairo_prover/crates/prover/src/components/generic_opcode/component.rs index 88b6474f..9b1f7394 100644 --- a/stwo_cairo_prover/crates/prover/src/components/generic_opcode/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/generic_opcode/component.rs @@ -28,11 +28,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 229]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 33]; let preprocessed_log_sizes = vec![log_size]; @@ -44,7 +44,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -67,7 +67,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs b/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs index 9debefae..b656eb19 100644 --- a/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs @@ -54,10 +54,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -72,25 +72,25 @@ impl ClaimGenerator { sub_components_inputs.bit_reverse_coset_to_circle_domain_order(); } sub_components_inputs.memory_address_to_id_inputs.iter().for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); });sub_components_inputs.memory_id_to_big_inputs.iter().for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); });sub_components_inputs.range_check_19_inputs.iter().for_each(|inputs| { - range_check_19_state.add_inputs(&inputs[..n_calls]); + range_check_19_state.add_inputs(&inputs[..n_rows]); });sub_components_inputs.range_check_9_9_inputs.iter().for_each(|inputs| { - range_check_9_9_state.add_inputs(&inputs[..n_calls]); + range_check_9_9_state.add_inputs(&inputs[..n_rows]); });sub_components_inputs.verify_instruction_inputs.iter().for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( Claim { - n_calls + n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -1260,7 +1260,7 @@ struct LookupData {memory_address_to_id_0: Vec<[PackedM31; 2]>,memory_address_to_id_1: Vec<[PackedM31; 2]>,memory_address_to_id_2: Vec<[PackedM31; 2]>,memory_id_to_big_0: Vec<[PackedM31; 29]>,memory_id_to_big_1: Vec<[PackedM31; 29]>,memory_id_to_big_2: Vec<[PackedM31; 29]>,opcodes_0: Vec<[PackedM31; 3]>,opcodes_1: Vec<[PackedM31; 3]>,range_check_19_0: Vec<[PackedM31; 1]>,range_check_19_1: Vec<[PackedM31; 1]>,range_check_19_2: Vec<[PackedM31; 1]>,range_check_19_3: Vec<[PackedM31; 1]>,range_check_19_4: Vec<[PackedM31; 1]>,range_check_19_5: Vec<[PackedM31; 1]>,range_check_19_6: Vec<[PackedM31; 1]>,range_check_19_7: Vec<[PackedM31; 1]>,range_check_19_8: Vec<[PackedM31; 1]>,range_check_19_9: Vec<[PackedM31; 1]>,range_check_19_10: Vec<[PackedM31; 1]>,range_check_19_11: Vec<[PackedM31; 1]>,range_check_19_12: Vec<[PackedM31; 1]>,range_check_19_13: Vec<[PackedM31; 1]>,range_check_19_14: Vec<[PackedM31; 1]>,range_check_19_15: Vec<[PackedM31; 1]>,range_check_19_16: Vec<[PackedM31; 1]>,range_check_19_17: Vec<[PackedM31; 1]>,range_check_19_18: Vec<[PackedM31; 1]>,range_check_19_19: Vec<[PackedM31; 1]>,range_check_19_20: Vec<[PackedM31; 1]>,range_check_19_21: Vec<[PackedM31; 1]>,range_check_19_22: Vec<[PackedM31; 1]>,range_check_19_23: Vec<[PackedM31; 1]>,range_check_19_24: Vec<[PackedM31; 1]>,range_check_19_25: Vec<[PackedM31; 1]>,range_check_19_26: Vec<[PackedM31; 1]>,range_check_19_27: Vec<[PackedM31; 1]>,range_check_9_9_0: Vec<[PackedM31; 2]>,range_check_9_9_1: Vec<[PackedM31; 2]>,range_check_9_9_2: Vec<[PackedM31; 2]>,range_check_9_9_3: Vec<[PackedM31; 2]>,range_check_9_9_4: Vec<[PackedM31; 2]>,range_check_9_9_5: Vec<[PackedM31; 2]>,range_check_9_9_6: Vec<[PackedM31; 2]>,range_check_9_9_7: Vec<[PackedM31; 2]>,range_check_9_9_8: Vec<[PackedM31; 2]>,range_check_9_9_9: Vec<[PackedM31; 2]>,range_check_9_9_10: Vec<[PackedM31; 2]>,range_check_9_9_11: Vec<[PackedM31; 2]>,range_check_9_9_12: Vec<[PackedM31; 2]>,range_check_9_9_13: Vec<[PackedM31; 2]>,range_check_9_9_14: Vec<[PackedM31; 2]>,range_check_9_9_15: Vec<[PackedM31; 2]>,range_check_9_9_16: Vec<[PackedM31; 2]>,range_check_9_9_17: Vec<[PackedM31; 2]>,range_check_9_9_18: Vec<[PackedM31; 2]>,range_check_9_9_19: Vec<[PackedM31; 2]>,range_check_9_9_20: Vec<[PackedM31; 2]>,range_check_9_9_21: Vec<[PackedM31; 2]>,range_check_9_9_22: Vec<[PackedM31; 2]>,range_check_9_9_23: Vec<[PackedM31; 2]>,range_check_9_9_24: Vec<[PackedM31; 2]>,range_check_9_9_25: Vec<[PackedM31; 2]>,range_check_9_9_26: Vec<[PackedM31; 2]>,range_check_9_9_27: Vec<[PackedM31; 2]>,verify_instruction_0: Vec<[PackedM31; 19]>,} pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -1284,7 +1284,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); //Sum logup terms in pairs. @@ -1778,13 +1778,13 @@ let mut col_gen = logup_gen.new_col(); } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/component.rs index 6fd99188..081cd12e 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 34]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/prover.rs index eec5e8da..e9654237 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -375,7 +375,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -390,7 +390,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -428,13 +428,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/component.rs index 54835d55..f244322c 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 34]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/prover.rs index a3aab442..2f499df0 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_f_dst_base_fp_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -375,7 +375,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -390,7 +390,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -428,13 +428,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/component.rs index ef20fe94..ca4b97fd 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 42]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 4]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/prover.rs index 5542bdbb..0308de5f 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -520,7 +520,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -535,7 +535,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -586,13 +586,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/component.rs index ac045aec..61614c6c 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 42]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 4]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/prover.rs index 16543d31..43a224f8 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jnz_opcode_is_taken_t_dst_base_fp_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -520,7 +520,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -535,7 +535,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -586,13 +586,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/component.rs index e02fc860..f6f47d2a 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 12]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/prover.rs index 6600cf5d..49691077 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -356,7 +356,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -371,7 +371,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -409,13 +409,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/component.rs index 2a9b761f..8781eaf2 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 16]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 4]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/prover.rs index 8ee41c08..1a606546 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_f_is_imm_f_is_double_deref_t/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -431,7 +431,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -446,7 +446,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -497,13 +497,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/component.rs index df26b490..dcd7f224 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 14]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/prover.rs index e0b612ee..3acfcbb7 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_f_is_double_deref_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -374,7 +374,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -389,7 +389,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -427,13 +427,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/component.rs index 5cc022cd..09885f51 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 10]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 3]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/prover.rs index aa133612..f8f53b84 100644 --- a/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/jump_opcode_is_rel_t_is_imm_t_is_double_deref_f/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -328,7 +328,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -343,7 +343,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -381,13 +381,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/component.rs b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/component.rs index d86437d5..f871c81c 100644 --- a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/component.rs @@ -27,11 +27,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 129]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 19]; let preprocessed_log_sizes = vec![log_size]; @@ -43,7 +43,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -66,7 +66,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/prover.rs b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/prover.rs index 3aec8641..91cb9853 100644 --- a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_f/prover.rs @@ -56,10 +56,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -80,33 +80,33 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .range_check_19_inputs .iter() .for_each(|inputs| { - range_check_19_state.add_inputs(&inputs[..n_calls]); + range_check_19_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -2027,7 +2027,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -2043,7 +2043,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -2289,13 +2289,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/component.rs b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/component.rs index 68f5b527..3d52b08b 100644 --- a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/component.rs @@ -27,11 +27,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 125]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 19]; let preprocessed_log_sizes = vec![log_size]; @@ -43,7 +43,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -66,7 +66,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/prover.rs b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/prover.rs index bb8b6199..f2f7d2cc 100644 --- a/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/mul_opcode_is_small_f_is_imm_t/prover.rs @@ -56,10 +56,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -80,33 +80,33 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .range_check_19_inputs .iter() .for_each(|inputs| { - range_check_19_state.add_inputs(&inputs[..n_calls]); + range_check_19_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -1980,7 +1980,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -1996,7 +1996,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -2242,13 +2242,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/ret_opcode/component.rs b/stwo_cairo_prover/crates/prover/src/components/ret_opcode/component.rs index 20b8e2a9..402da96b 100644 --- a/stwo_cairo_prover/crates/prover/src/components/ret_opcode/component.rs +++ b/stwo_cairo_prover/crates/prover/src/components/ret_opcode/component.rs @@ -26,11 +26,11 @@ pub struct Eval { #[derive(Copy, Clone, Serialize, Deserialize, CairoSerialize)] pub struct Claim { - pub n_calls: usize, + pub n_rows: usize, } impl Claim { pub fn log_sizes(&self) -> TreeVec> { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let trace_log_sizes = vec![log_size; 11]; let interaction_log_sizes = vec![log_size; SECURE_EXTENSION_DEGREE * 4]; let preprocessed_log_sizes = vec![log_size]; @@ -42,7 +42,7 @@ impl Claim { } pub fn mix_into(&self, channel: &mut impl Channel) { - channel.mix_u64(self.n_calls as u64); + channel.mix_u64(self.n_rows as u64); } } @@ -65,7 +65,7 @@ pub type Component = FrameworkComponent; impl FrameworkEval for Eval { fn log_size(&self) -> u32 { - std::cmp::max(self.claim.n_calls.next_power_of_two().ilog2(), LOG_N_LANES) + std::cmp::max(self.claim.n_rows.next_power_of_two().ilog2(), LOG_N_LANES) } fn max_constraint_log_degree_bound(&self) -> u32 { diff --git a/stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs b/stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs index 966b25fc..b7c24a00 100644 --- a/stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs @@ -53,10 +53,10 @@ impl ClaimGenerator { where SimdBackend: BackendForChannel, { - let n_calls = self.inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); - let need_padding = n_calls != size; + let n_rows = self.inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); + let need_padding = n_rows != size; if need_padding { self.inputs.resize(size, *self.inputs.first().unwrap()); @@ -77,27 +77,27 @@ impl ClaimGenerator { .memory_address_to_id_inputs .iter() .for_each(|inputs| { - memory_address_to_id_state.add_inputs(&inputs[..n_calls]); + memory_address_to_id_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .memory_id_to_big_inputs .iter() .for_each(|inputs| { - memory_id_to_big_state.add_inputs(&inputs[..n_calls]); + memory_id_to_big_state.add_inputs(&inputs[..n_rows]); }); sub_components_inputs .verify_instruction_inputs .iter() .for_each(|inputs| { - verify_instruction_state.add_inputs(&inputs[..n_calls]); + verify_instruction_state.add_inputs(&inputs[..n_rows]); }); tree_builder.extend_evals(trace.to_evals()); ( - Claim { n_calls }, + Claim { n_rows }, InteractionClaimGenerator { - n_calls, + n_rows, lookup_data, }, ) @@ -338,7 +338,7 @@ struct LookupData { } pub struct InteractionClaimGenerator { - n_calls: usize, + n_rows: usize, lookup_data: LookupData, } impl InteractionClaimGenerator { @@ -353,7 +353,7 @@ impl InteractionClaimGenerator { where SimdBackend: BackendForChannel, { - let log_size = std::cmp::max(self.n_calls.next_power_of_two().ilog2(), LOG_N_LANES); + let log_size = std::cmp::max(self.n_rows.next_power_of_two().ilog2(), LOG_N_LANES); let mut logup_gen = LogupTraceGenerator::new(log_size); // Sum logup terms in pairs. @@ -404,13 +404,13 @@ impl InteractionClaimGenerator { } col_gen.finalize_col(); - let (trace, total_sum, claimed_sum) = if self.n_calls == 1 << log_size { + let (trace, total_sum, claimed_sum) = if self.n_rows == 1 << log_size { let (trace, claimed_sum) = logup_gen.finalize_last(); (trace, claimed_sum, None) } else { let (trace, [total_sum, claimed_sum]) = - logup_gen.finalize_at([(1 << log_size) - 1, self.n_calls - 1]); - (trace, total_sum, Some((claimed_sum, self.n_calls - 1))) + logup_gen.finalize_at([(1 << log_size) - 1, self.n_rows - 1]); + (trace, total_sum, Some((claimed_sum, self.n_rows - 1))) }; tree_builder.extend_evals(trace); diff --git a/stwo_cairo_prover/crates/prover/src/components/verify_instruction/prover.rs b/stwo_cairo_prover/crates/prover/src/components/verify_instruction/prover.rs index bd06624f..0b720c04 100644 --- a/stwo_cairo_prover/crates/prover/src/components/verify_instruction/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/verify_instruction/prover.rs @@ -85,11 +85,11 @@ impl ClaimGenerator { ((pc, offsets, flags), multiplicity) }) .unzip::<_, _, Vec<_>, Vec<_>>(); - let n_calls = inputs.len(); - assert_ne!(n_calls, 0); - let size = std::cmp::max(n_calls.next_power_of_two(), N_LANES); + let n_rows = inputs.len(); + assert_ne!(n_rows, 0); + let size = std::cmp::max(n_rows.next_power_of_two(), N_LANES); let log_size = size.ilog2(); - let need_padding = n_calls != size; + let need_padding = n_rows != size; if need_padding { inputs.resize(size, *inputs.first().unwrap());