From 4eff4c22eea78da710471bce0cd8ef753c72056a Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 May 2026 14:53:41 +0200 Subject: [PATCH 01/15] Hints for equal zero rules. --- constraint-solver/src/constraint_system.rs | 25 ++++++++++++ .../src/rule_based_optimizer/environment.rs | 8 ++++ .../src/rule_based_optimizer/rules.rs | 39 ++++++++++++++++--- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/constraint-solver/src/constraint_system.rs b/constraint-solver/src/constraint_system.rs index c348970901..f57ee790df 100644 --- a/constraint-solver/src/constraint_system.rs +++ b/constraint-solver/src/constraint_system.rs @@ -134,6 +134,13 @@ pub enum ComputationMethod { /// The quotiont (using inversion in the field) of the first argument /// by the second argument, or zero if the latter is zero. QuotientOrZero(E, E), + /// If the first argument is zero, the variable is computed using the second argument, + /// otherwise it is computed using the third argument. + IfEqZero( + E, + Box>, + Box>, + ), } impl Display for ComputationMethod { @@ -141,6 +148,9 @@ impl Display for ComputationMethod { match self { ComputationMethod::Constant(c) => write!(f, "{c}"), ComputationMethod::QuotientOrZero(e1, e2) => write!(f, "QuotientOrZero({e1}, {e2})"), + ComputationMethod::IfEqZero(e, then_method, else_method) => { + write!(f, "IfEqZero({e}, {then_method}, {else_method})") + } } } } @@ -154,6 +164,11 @@ impl ComputationMethod> { e1.referenced_unknown_variables() .chain(e2.referenced_unknown_variables()), ), + ComputationMethod::IfEqZero(e, then_method, else_method) => Box::new( + e.referenced_unknown_variables() + .chain(then_method.referenced_unknown_variables()) + .chain(else_method.referenced_unknown_variables()), + ), } } } @@ -170,6 +185,11 @@ impl, V: Ord + Clone + Eq> e1.substitute_by_known(variable, substitution); e2.substitute_by_known(variable, substitution); } + ComputationMethod::IfEqZero(e, then_method, else_method) => { + e.substitute_by_known(variable, substitution); + then_method.substitute_by_known(variable, substitution); + else_method.substitute_by_known(variable, substitution); + } } } @@ -184,6 +204,11 @@ impl, V: Ord + Clone + Eq> e1.substitute_by_unknown(variable, substitution); e2.substitute_by_unknown(variable, substitution); } + ComputationMethod::IfEqZero(e, then_method, else_method) => { + e.substitute_by_unknown(variable, substitution); + then_method.substitute_by_unknown(variable, substitution); + else_method.substitute_by_unknown(variable, substitution); + } } } } diff --git a/constraint-solver/src/rule_based_optimizer/environment.rs b/constraint-solver/src/rule_based_optimizer/environment.rs index 660cb78dd9..8c5c3c0fff 100644 --- a/constraint-solver/src/rule_based_optimizer/environment.rs +++ b/constraint-solver/src/rule_based_optimizer/environment.rs @@ -31,6 +31,7 @@ pub struct Environment { /// (also only once in the constraint they occur in). single_occurrence_variables: HashSet, new_var_generator: RefCell>, + hints: HashMap>>, } impl PartialEq for Environment { @@ -75,6 +76,7 @@ impl Environment { var_to_string, single_occurrence_variables, new_var_generator: RefCell::new(new_var_generator), + hints: Default::default(), } } @@ -115,6 +117,12 @@ impl Environment { self.new_var_generator.borrow_mut().generate(prefix, method) } + /// Adds a hint about how to compute a variable. This is used if constraints are replaced by + /// other constraints that might make it difficult to recover the way to compute certain variables. + pub fn add_hint(&mut self, var: Var, method: ComputationMethod>) { + self.hints.insert(var, method); + } + pub fn single_occurrence_variables(&self) -> impl Iterator { self.single_occurrence_variables.iter() } diff --git a/constraint-solver/src/rule_based_optimizer/rules.rs b/constraint-solver/src/rule_based_optimizer/rules.rs index b4a07526f8..9b39293b1e 100644 --- a/constraint-solver/src/rule_based_optimizer/rules.rs +++ b/constraint-solver/src/rule_based_optimizer/rules.rs @@ -5,7 +5,7 @@ use crepe::crepe; use itertools::Itertools; -use num_traits::One; +use num_traits::{One, Zero}; use powdr_number::FieldElement; use crate::{ @@ -471,11 +471,12 @@ crepe! { PlusMinusResult(r, r2, result), AffineExpression(r2, T::from(-1), v, T::from(1)); - // EqualZeroCheck(constrs, result, vars) => + // EqualZeroCheck(constrs, result, vars, diff_markers, diff_vals) => // constrsexprs can be equivalently replaced by a constraint that models // result = 1 if all vars are zero, and result = 0 otherwise. - struct EqualZeroCheck([Expr; 10], Var, [Var; 4]); - EqualZeroCheck(constrs, result, vars) <- + // diff_markers and diff_vars are variables where we add hints because they might be removed. + struct EqualZeroCheck([Expr; 10], Var, [Var; 4], [Var; 4], [Var; 4]); + EqualZeroCheck(constrs, result, vars, diff_morkers, diff_vars) <- // (1 - diff_marker__3_0) * (a__3_0 * (2 * cmp_result_0 - 1)) = 0 NegatedDiffMarkerConstraint(constr_0, diff_marker_3, _, a_3, result, 0), // (1 - (diff_marker__2_0 + diff_marker__3_0)) * (a__2_0 * (2 * cmp_result_0 - 1)) = 0 @@ -517,11 +518,13 @@ crepe! { BooleanExpressionConstraint(constr_9, diff_marker_sum), AffinelyRelated(diff_marker_sum, T::from(-1), one_minus_diff_marker_sum, T::from(1)), let constrs = [constr_0, constr_1, constr_2, constr_3, constr_4, constr_5, constr_6, constr_7, constr_8, constr_9], - let vars = [a_0, a_1, a_2, a_3]; + let vars = [a_0, a_1, a_2, a_3], + let diff_markers = [diff_marker_0, diff_marker_1, diff_marker_2, diff_marker_3], + let diff_vals = [diff_val, diff_val, diff_val, diff_val]; ReplaceAlgebraicConstraintsBy(extend_by_none(constrs), extend_by_none(replacement)) <- Env(env), - EqualZeroCheck(constrs, result, vars), + EqualZeroCheck(constrs, result, vars, diff_markers, diff_vals), let replacement = { let result = GroupedExpression::from_unknown_variable(result); assert!(vars.len() == 4); @@ -530,6 +533,30 @@ crepe! { let sum_inv_var = GroupedExpression::from_unknown_variable( env.new_var("inv_of_sum", ComputationMethod::QuotientOrZero(One::one(), sum_of_vars.clone())) ); + // Hints for diff_markers and diff_vals: + // diff_markers: 1 at the most significant index i such that a[i] != 0, otherwise 0. If such + // an i exists, diff_val = c[i] - b[i] if c[i] > b[i] or b[i] - c[i] else. + // diff_marker_3 = if_eq_zero(a_3, 0, 1) + // diff_marker_2 = if_eq_zero(diff_marker_3, if_eq_zero(a_2, 0, 1), 0) + // diff_marker_1 = if_eq_zero(diff_marker_3, if_eq_zero(diff_marker_2, if_eq_zero(a_1, 0, 1), 0), 0) + // diff_marker_0 = if_eq_zero(diff_marker_3, if_eq_zero(diff_marker_2, if_eq_zero(diff_marker_1, if_eq_zero(a_0 - 1, 0, 1), 0), 0), 0) + // diff_val_3 = a_3 + // diff_val_2 = a_2 + // diff_val_1 = a_1 + // diff_val_0 = if_eq_zero(a_0, 1, a_0 - 1) + let zero = Box::new(ComputationMethod::Constant(Zero::zero())); + let one = Box::new(ComputationMethod::Constant(One::one())); + env.add_hint( + diff_markers[3], + ComputationMethod::IfEqZero(vars[3].clone(), zero.clone(), one.clone()) + ); + env.add_hint( + diff_markers[2], + ComputationMethod::IfEqZero( + vars[3].clone(), + Box::new(ComputationMethod::IfEqZero(vars[2].clone(), zero.clone(), one.clone())), zero.clone())); + + [ env.insert_owned(result.clone() * sum_of_vars.clone()), env.insert_owned(result + sum_inv_var * sum_of_vars - One::one()), From 286308ab4a7ec3f77f6c3040d752094af5e336ea Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 May 2026 15:47:06 +0200 Subject: [PATCH 02/15] More code for hints. --- autoprecompiles/src/constraint_optimizer.rs | 14 ++++ autoprecompiles/src/optimizer.rs | 1 + autoprecompiles/src/symbolic_machine.rs | 72 +++++++++++++------ .../src/symbolic_machine_generator.rs | 33 ++++++--- .../src/rule_based_optimizer/driver.rs | 18 +++++ .../src/rule_based_optimizer/environment.rs | 8 ++- .../src/rule_based_optimizer/rules.rs | 41 ++++++++++- .../trace_generator/cpu/mod.rs | 61 ++++++++++------ .../trace_generator/cuda/mod.rs | 1 + 9 files changed, 194 insertions(+), 55 deletions(-) diff --git a/autoprecompiles/src/constraint_optimizer.rs b/autoprecompiles/src/constraint_optimizer.rs index 47347ad8e1..ac25712f1d 100644 --- a/autoprecompiles/src/constraint_optimizer.rs +++ b/autoprecompiles/src/constraint_optimizer.rs @@ -80,6 +80,10 @@ pub fn optimize_constraints< export_options .export_optimizer_inner_constraint_system(constraint_system.system(), "remove_free"); + println!( + "Before disconnected:\n{}", + constraint_system.variables().format(", ") + ); let constraint_system = remove_disconnected_columns(constraint_system, solver, bus_interaction_handler.clone()); stats_logger.log("removing disconnected columns", &constraint_system); @@ -87,6 +91,10 @@ pub fn optimize_constraints< constraint_system.system(), "remove_disconnected", ); + println!( + "After disconnected:\n{}", + constraint_system.variables().format(", ") + ); let constraint_system = simplify_constraints_using_exhaustive_search(constraint_system, solver); stats_logger.log("simplifying using exhaustive search", &constraint_system); @@ -103,6 +111,11 @@ pub fn optimize_constraints< export_options .export_optimizer_inner_constraint_system(constraint_system.system(), "trivial_simp"); + println!( + "Running rule-based opt:\n{}", + constraint_system.variables().format(", ") + ); + let (constraint_system, assignments) = rule_based_optimization( constraint_system, &*solver, @@ -118,6 +131,7 @@ pub fn optimize_constraints< val.clone(), ) })); + println!("After:\n{}", constraint_system.variables().format(", ")); stats_logger.log("rule-based optimization", &constraint_system); export_options.register_substituted_variables(assignments); export_options diff --git a/autoprecompiles/src/optimizer.rs b/autoprecompiles/src/optimizer.rs index 7e4471ff7d..45da80155d 100644 --- a/autoprecompiles/src/optimizer.rs +++ b/autoprecompiles/src/optimizer.rs @@ -128,6 +128,7 @@ where "remove_disconnected", ); + println!("Running rule-based optimization:\n{}", constraint_system); let (constraint_system, _) = rule_based_optimization( constraint_system, &solver, diff --git a/autoprecompiles/src/symbolic_machine.rs b/autoprecompiles/src/symbolic_machine.rs index f71556ec20..01f6546f57 100644 --- a/autoprecompiles/src/symbolic_machine.rs +++ b/autoprecompiles/src/symbolic_machine.rs @@ -242,23 +242,36 @@ pub fn symbolic_machine_to_constraint_system( .derived_columns .iter() .map(|derived_variable| { - let method = match &derived_variable.computation_method { - ComputationMethod::Constant(c) => { - constraint_system::ComputationMethod::Constant(*c) - } - ComputationMethod::QuotientOrZero(e1, e2) => { - constraint_system::ComputationMethod::QuotientOrZero( - algebraic_to_grouped_expression(e1), - algebraic_to_grouped_expression(e2), - ) - } - }; + let method = convert_computation_method_to_grouped_expression( + &derived_variable.computation_method, + ); DerivedVariable::new(derived_variable.variable.clone(), method) }) .collect(), } } +fn convert_computation_method_to_grouped_expression( + method: &constraint_system::ComputationMethod>, +) -> constraint_system::ComputationMethod> { + match method { + ComputationMethod::Constant(c) => constraint_system::ComputationMethod::Constant(*c), + ComputationMethod::QuotientOrZero(e1, e2) => { + constraint_system::ComputationMethod::QuotientOrZero( + algebraic_to_grouped_expression(e1), + algebraic_to_grouped_expression(e2), + ) + } + ComputationMethod::IfEqZero(condition, then, else_) => { + constraint_system::ComputationMethod::IfEqZero( + algebraic_to_grouped_expression(condition), + Box::new(convert_computation_method_to_grouped_expression(then)), + Box::new(convert_computation_method_to_grouped_expression(else_)), + ) + } + } +} + pub fn constraint_system_to_symbolic_machine( constraint_system: ConstraintSystem, ) -> SymbolicMachine

{ @@ -277,23 +290,38 @@ pub fn constraint_system_to_symbolic_machine( .derived_variables .into_iter() .map(|derived_var| { - let method = match derived_var.computation_method { - constraint_system::ComputationMethod::Constant(c) => { - constraint_system::ComputationMethod::Constant(c) - } - constraint_system::ComputationMethod::QuotientOrZero(e1, e2) => { - constraint_system::ComputationMethod::QuotientOrZero( - grouped_expression_to_algebraic(e1), - grouped_expression_to_algebraic(e2), - ) - } - }; + let method = convert_computation_method_to_algebraic_expression( + derived_var.computation_method, + ); DerivedVariable::new(derived_var.variable, method) }) .collect(), } } +fn convert_computation_method_to_algebraic_expression( + method: constraint_system::ComputationMethod>, +) -> constraint_system::ComputationMethod> { + match method { + constraint_system::ComputationMethod::Constant(c) => { + constraint_system::ComputationMethod::Constant(c) + } + constraint_system::ComputationMethod::QuotientOrZero(e1, e2) => { + constraint_system::ComputationMethod::QuotientOrZero( + grouped_expression_to_algebraic(e1), + grouped_expression_to_algebraic(e2), + ) + } + constraint_system::ComputationMethod::IfEqZero(condition, then, else_) => { + constraint_system::ComputationMethod::IfEqZero( + grouped_expression_to_algebraic(condition.clone()), + Box::new(convert_computation_method_to_algebraic_expression(*then)), + Box::new(convert_computation_method_to_algebraic_expression(*else_)), + ) + } + } +} + pub fn symbolic_bus_interaction_to_bus_interaction( bus_interaction: &SymbolicBusInteraction

, ) -> BusInteraction> { diff --git a/autoprecompiles/src/symbolic_machine_generator.rs b/autoprecompiles/src/symbolic_machine_generator.rs index 65d5b2c13e..bf47b69f78 100644 --- a/autoprecompiles/src/symbolic_machine_generator.rs +++ b/autoprecompiles/src/symbolic_machine_generator.rs @@ -45,21 +45,36 @@ pub fn convert_machine_field_type( .derived_columns .into_iter() .map(|derived_variable| { - let method = match derived_variable.computation_method { - ComputationMethod::Constant(c) => { - ComputationMethod::Constant(convert_field_element(c)) - } - ComputationMethod::QuotientOrZero(e1, e2) => ComputationMethod::QuotientOrZero( - convert_expression(e1, convert_field_element), - convert_expression(e2, convert_field_element), + DerivedVariable::new( + derived_variable.variable, + convert_computation_method( + derived_variable.computation_method, + convert_field_element, ), - }; - DerivedVariable::new(derived_variable.variable, method) + ) }) .collect(), } } +fn convert_computation_method( + method: ComputationMethod>, + convert_field_element: &impl Fn(T) -> U, +) -> ComputationMethod> { + match method { + ComputationMethod::Constant(c) => ComputationMethod::Constant(convert_field_element(c)), + ComputationMethod::QuotientOrZero(e1, e2) => ComputationMethod::QuotientOrZero( + convert_expression(e1, convert_field_element), + convert_expression(e2, convert_field_element), + ), + ComputationMethod::IfEqZero(condition, then, else_) => ComputationMethod::IfEqZero( + convert_expression(condition, convert_field_element), + Box::new(convert_computation_method(*then, convert_field_element)), + Box::new(convert_computation_method(*else_, convert_field_element)), + ), + } +} + fn convert_symbolic_constraint( constraint: SymbolicConstraint, convert: &impl Fn(T) -> U, diff --git a/constraint-solver/src/rule_based_optimizer/driver.rs b/constraint-solver/src/rule_based_optimizer/driver.rs index ef2975ea08..cb32ff3b80 100644 --- a/constraint-solver/src/rule_based_optimizer/driver.rs +++ b/constraint-solver/src/rule_based_optimizer/driver.rs @@ -428,6 +428,11 @@ pub(crate) fn batch_replace_algebraic_constraints< ); } else { // No conflict, this replacement can proceed + println!( + "Replacing:\n{}\nby:\n{}", + replacement.replace.iter().format("\n -"), + replacement.replace_by.iter().format("\n +") + ); constraints_to_remove.extend(replacement.replace.iter()); replacement_constraints.extend(replacement.replace_by.iter().cloned()); } @@ -510,5 +515,18 @@ fn undo_variable_transform_in_computation_method< undo_variable_transform(denominator, var_mapper), ) } + ComputationMethod::IfEqZero(condition, then_branch, else_branch) => { + ComputationMethod::IfEqZero( + undo_variable_transform(condition, var_mapper), + Box::new(undo_variable_transform_in_computation_method( + then_branch, + var_mapper, + )), + Box::new(undo_variable_transform_in_computation_method( + else_branch, + var_mapper, + )), + ) + } } } diff --git a/constraint-solver/src/rule_based_optimizer/environment.rs b/constraint-solver/src/rule_based_optimizer/environment.rs index 8c5c3c0fff..524fedc7cc 100644 --- a/constraint-solver/src/rule_based_optimizer/environment.rs +++ b/constraint-solver/src/rule_based_optimizer/environment.rs @@ -31,7 +31,9 @@ pub struct Environment { /// (also only once in the constraint they occur in). single_occurrence_variables: HashSet, new_var_generator: RefCell>, - hints: HashMap>>, + /// Hints to compute variables whose constraints that define them are removed + /// during optimization. + hints: RefCell>>>, } impl PartialEq for Environment { @@ -119,8 +121,8 @@ impl Environment { /// Adds a hint about how to compute a variable. This is used if constraints are replaced by /// other constraints that might make it difficult to recover the way to compute certain variables. - pub fn add_hint(&mut self, var: Var, method: ComputationMethod>) { - self.hints.insert(var, method); + pub fn add_hint(&self, var: Var, method: ComputationMethod>) { + self.hints.borrow_mut().insert(var, method); } pub fn single_occurrence_variables(&self) -> impl Iterator { diff --git a/constraint-solver/src/rule_based_optimizer/rules.rs b/constraint-solver/src/rule_based_optimizer/rules.rs index 9b39293b1e..d51407df1b 100644 --- a/constraint-solver/src/rule_based_optimizer/rules.rs +++ b/constraint-solver/src/rule_based_optimizer/rules.rs @@ -476,7 +476,7 @@ crepe! { // result = 1 if all vars are zero, and result = 0 otherwise. // diff_markers and diff_vars are variables where we add hints because they might be removed. struct EqualZeroCheck([Expr; 10], Var, [Var; 4], [Var; 4], [Var; 4]); - EqualZeroCheck(constrs, result, vars, diff_morkers, diff_vars) <- + EqualZeroCheck(constrs, result, vars, diff_markers, diff_vals) <- // (1 - diff_marker__3_0) * (a__3_0 * (2 * cmp_result_0 - 1)) = 0 NegatedDiffMarkerConstraint(constr_0, diff_marker_3, _, a_3, result, 0), // (1 - (diff_marker__2_0 + diff_marker__3_0)) * (a__2_0 * (2 * cmp_result_0 - 1)) = 0 @@ -555,6 +555,45 @@ crepe! { ComputationMethod::IfEqZero( vars[3].clone(), Box::new(ComputationMethod::IfEqZero(vars[2].clone(), zero.clone(), one.clone())), zero.clone())); + env.add_hint( + diff_markers[1], + ComputationMethod::IfEqZero( + vars[3].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[2].clone(), + Box::new(ComputationMethod::IfEqZero(vars[1].clone(), zero.clone(), one.clone())), + zero.clone())), + zero.clone())); + env.add_hint( + diff_markers[0], + ComputationMethod::IfEqZero( + vars[3].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[2].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[1].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[0].clone() - One::one(), + zero.clone(), + one.clone())), + zero.clone())), + zero.clone())), + zero.clone())); + env.add_hint( + diff_vals[3], + ComputationMethod::QuotientOrZero(vars[3].clone(), One::one())); + env.add_hint( + diff_vals[2], + ComputationMethod::QuotientOrZero(vars[2].clone(), One::one())); + env.add_hint( + diff_vals[1], + ComputationMethod::QuotientOrZero(vars[1].clone(), One::one())); + env.add_hint( + diff_vals[0], + ComputationMethod::IfEqZero( + vars[0].clone(), + Box::new(ComputationMethod::Constant(One::one())), + Box::new(ComputationMethod::QuotientOrZero(vars[0].clone() - One::one(), One::one())))); [ diff --git a/openvm/src/powdr_extension/trace_generator/cpu/mod.rs b/openvm/src/powdr_extension/trace_generator/cpu/mod.rs index 4c4d0b6d2a..81e7c9dedc 100644 --- a/openvm/src/powdr_extension/trace_generator/cpu/mod.rs +++ b/openvm/src/powdr_extension/trace_generator/cpu/mod.rs @@ -1,4 +1,7 @@ -use std::{collections::HashMap, sync::Arc}; +use std::{ + collections::{BTreeMap, HashMap}, + sync::Arc, +}; use itertools::Itertools; use openvm_circuit::{arch::MatrixRecordArena, utils::next_power_of_two_or_zero}; @@ -9,8 +12,9 @@ use openvm_stark_backend::{ prover::{AirProvingContext, ProverBackend}, }; use openvm_stark_sdk::p3_baby_bear::BabyBear; -use powdr_autoprecompiles::trace_handler::TraceTrait; +use powdr_autoprecompiles::{expression::AlgebraicExpression, trace_handler::TraceTrait}; use powdr_constraint_solver::constraint_system::ComputationMethod; +use powdr_number::ExpressionConvertible; use crate::{ extraction_utils::{OriginalAirs, OriginalVmConfig}, @@ -181,24 +185,11 @@ impl PowdrTraceGeneratorCpu { // (these are either new columns or for example the "is_valid" column). for derived_column in columns_to_compute { let col_index = apc_poly_id_to_index[&derived_column.variable.id]; - row_slice[col_index] = match &derived_column.computation_method { - ComputationMethod::Constant(c) => *c, - ComputationMethod::QuotientOrZero(e1, e2) => { - use powdr_number::ExpressionConvertible; - - let divisor_val = e2.to_expression(&|n| *n, &|column_ref| { - row_slice[apc_poly_id_to_index[&column_ref.id]] - }); - if divisor_val.is_zero() { - BabyBear::ZERO - } else { - divisor_val.inverse() - * e1.to_expression(&|n| *n, &|column_ref| { - row_slice[apc_poly_id_to_index[&column_ref.id]] - }) - } - } - }; + row_slice[col_index] = evaluate_computation_method( + &derived_column.computation_method, + row_slice, + &apc_poly_id_to_index, + ); } let evaluator = MappingRowEvaluator::new(row_slice, &apc_poly_id_to_index); @@ -227,3 +218,33 @@ impl PowdrTraceGeneratorCpu { RowMajorMatrix::new(values, width) } } + +fn evaluate_computation_method( + method: &ComputationMethod>, + row_slice: &[BabyBear], + apc_poly_id_to_index: &BTreeMap, +) -> BabyBear { + let eval = |e: &AlgebraicExpression| { + e.to_expression(&|n| *n, &|column_ref| { + row_slice[apc_poly_id_to_index[&column_ref.id]] + }) + }; + match method { + ComputationMethod::Constant(c) => *c, + ComputationMethod::QuotientOrZero(e1, e2) => { + let divisor_val = eval(e2); + if divisor_val.is_zero() { + BabyBear::ZERO + } else { + divisor_val.inverse() * eval(e1) + } + } + ComputationMethod::IfEqZero(condition, then, else_) => { + if eval(condition).is_zero() { + evaluate_computation_method(then, row_slice, apc_poly_id_to_index) + } else { + evaluate_computation_method(else_, row_slice, apc_poly_id_to_index) + } + } + } +} diff --git a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs index 9464a452f3..3e5f29335f 100644 --- a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs +++ b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs @@ -129,6 +129,7 @@ fn compile_derived_to_gpu( emit_expr(&mut bytecode, e1, apc_poly_id_to_index, apc_height); bytecode.push(OpCode::Mul as u32); } + ComputationMethod::IfEqZero(_, _, _) => todo!(), } let len = (bytecode.len() as u32) - off; specs.push(DerivedExprSpec { From 25a8aec1faf6f469c625af29ebfe26817a820ed8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 May 2026 16:21:38 +0200 Subject: [PATCH 03/15] Finishing touches. --- autoprecompiles/src/constraint_optimizer.rs | 2 +- autoprecompiles/src/lib.rs | 1 + autoprecompiles/src/symbolic_machine.rs | 21 ++++++++- .../src/symbolic_machine_generator.rs | 1 + constraint-solver/src/constraint_system.rs | 21 +++++++-- .../src/indexed_constraint_system.rs | 2 + .../src/rule_based_optimizer/driver.rs | 46 ++++++++++++++++++- .../src/rule_based_optimizer/environment.rs | 9 +++- .../trace_generator/cpu/mod.rs | 14 +++--- 9 files changed, 100 insertions(+), 17 deletions(-) diff --git a/autoprecompiles/src/constraint_optimizer.rs b/autoprecompiles/src/constraint_optimizer.rs index ac25712f1d..68e264f432 100644 --- a/autoprecompiles/src/constraint_optimizer.rs +++ b/autoprecompiles/src/constraint_optimizer.rs @@ -748,7 +748,7 @@ fn remove_unreferenced_derived_variables>(); constraint_system.retain_derived_variables(|derived_var| { - referenced_variables.contains(&derived_var.variable) + !derived_var.is_new || referenced_variables.contains(&derived_var.variable) }); constraint_system } diff --git a/autoprecompiles/src/lib.rs b/autoprecompiles/src/lib.rs index cad5fe2c4f..bd1ce4a411 100644 --- a/autoprecompiles/src/lib.rs +++ b/autoprecompiles/src/lib.rs @@ -480,6 +480,7 @@ fn add_guards( let is_valid = AlgebraicExpression::Reference(is_valid_ref.clone()); machine.derived_columns.push(DerivedVariable::new( + true, is_valid_ref, ComputationMethod::Constant(T::one()), )); diff --git a/autoprecompiles/src/symbolic_machine.rs b/autoprecompiles/src/symbolic_machine.rs index 01f6546f57..bb542aa177 100644 --- a/autoprecompiles/src/symbolic_machine.rs +++ b/autoprecompiles/src/symbolic_machine.rs @@ -188,6 +188,19 @@ impl SymbolicMachine { output.push_str(&format!("{constraint} = 0\n")); } + if !self.derived_columns.is_empty() { + output.push_str("\n// Derived columns:\n"); + } + + for derived_column in &self.derived_columns { + output.push_str(&format!( + "{} ({}) = {}\n", + derived_column.variable, + if derived_column.is_new { "new" } else { "old" }, + &derived_column.computation_method + )); + } + output.trim().to_string() } } @@ -245,7 +258,11 @@ pub fn symbolic_machine_to_constraint_system( let method = convert_computation_method_to_grouped_expression( &derived_variable.computation_method, ); - DerivedVariable::new(derived_variable.variable.clone(), method) + DerivedVariable::new( + derived_variable.is_new, + derived_variable.variable.clone(), + method, + ) }) .collect(), } @@ -293,7 +310,7 @@ pub fn constraint_system_to_symbolic_machine( let method = convert_computation_method_to_algebraic_expression( derived_var.computation_method, ); - DerivedVariable::new(derived_var.variable, method) + DerivedVariable::new(derived_var.is_new, derived_var.variable, method) }) .collect(), } diff --git a/autoprecompiles/src/symbolic_machine_generator.rs b/autoprecompiles/src/symbolic_machine_generator.rs index bf47b69f78..3a5231818a 100644 --- a/autoprecompiles/src/symbolic_machine_generator.rs +++ b/autoprecompiles/src/symbolic_machine_generator.rs @@ -46,6 +46,7 @@ pub fn convert_machine_field_type( .into_iter() .map(|derived_variable| { DerivedVariable::new( + derived_variable.is_new, derived_variable.variable, convert_computation_method( derived_variable.computation_method, diff --git a/constraint-solver/src/constraint_system.rs b/constraint-solver/src/constraint_system.rs index f57ee790df..0448def115 100644 --- a/constraint-solver/src/constraint_system.rs +++ b/constraint-solver/src/constraint_system.rs @@ -45,9 +45,15 @@ impl Display for Constra ) .chain(self.derived_variables.iter().map( |DerivedVariable { + is_new, variable, computation_method, - }| { format!("{variable} := {computation_method}") } + }| { + format!( + "{variable} ({}) := {computation_method}", + if *is_new { "new" } else { "old" } + ) + } )) .format("\n") ) @@ -81,13 +87,17 @@ impl ConstraintSystem { #[derive(Clone, Debug)] pub struct DerivedVariable { + /// If true, this variable has been newly created. + /// If false, it is just a hint how to compute a pre-existing variable. + pub is_new: bool, pub variable: V, pub computation_method: ComputationMethod, } impl DerivedVariable { - pub fn new(variable: V, computation_method: ComputationMethod) -> Self { + pub fn new(is_new: bool, variable: V, computation_method: ComputationMethod) -> Self { Self { + is_new, variable, computation_method, } @@ -103,7 +113,7 @@ where where S: Serializer, { - (&self.variable, &self.computation_method).serialize(serializer) + (self.is_new, &self.variable, &self.computation_method).serialize(serializer) } } @@ -116,9 +126,10 @@ where where D: Deserializer<'de>, { - let (variable, computation_method) = - <(V, ComputationMethod)>::deserialize(deserializer)?; + let (is_new, variable, computation_method) = + <(bool, V, ComputationMethod)>::deserialize(deserializer)?; Ok(Self { + is_new, variable, computation_method, }) diff --git a/constraint-solver/src/indexed_constraint_system.rs b/constraint-solver/src/indexed_constraint_system.rs index 90b187d949..dcc6321c36 100644 --- a/constraint-solver/src/indexed_constraint_system.rs +++ b/constraint-solver/src/indexed_constraint_system.rs @@ -816,6 +816,7 @@ mod tests { bus_interactions: vec![], derived_variables: vec![ DerivedVariable::new( + true, "d1", ComputationMethod::QuotientOrZero( GroupedExpression::from_unknown_variable("x1"), @@ -823,6 +824,7 @@ mod tests { ), ), DerivedVariable::new( + true, "d2", ComputationMethod::QuotientOrZero( GroupedExpression::from_unknown_variable("y1"), diff --git a/constraint-solver/src/rule_based_optimizer/driver.rs b/constraint-solver/src/rule_based_optimizer/driver.rs index cb32ff3b80..1df08c054e 100644 --- a/constraint-solver/src/rule_based_optimizer/driver.rs +++ b/constraint-solver/src/rule_based_optimizer/driver.rs @@ -1,6 +1,7 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::{BTreeMap, HashMap, HashSet}; use std::fmt::Display; use std::hash::Hash; +use std::ops::Index; use itertools::Itertools; use powdr_number::FieldElement; @@ -148,7 +149,10 @@ pub fn rule_based_optimization( + system: &mut IndexedConstraintSystem, + hints: HashMap>>, + var_mapper: &ItemDB, +) { + let existing_hints = system + .system() + .derived_variables + .iter() + .map(|dv| dv.variable.clone()) + .collect::>(); + let new_hints = hints + .into_iter() + .filter_map(|(var, method)| { + let var = &var_mapper[var]; + if existing_hints.contains(&var) { + None + } else { + Some((var.clone(), method)) + } + }) + .collect::>(); + system.extend(ConstraintSystem { + derived_variables: new_hints + .into_iter() + .map(|(var, method)| DerivedVariable { + is_new: false, + variable: var, + computation_method: undo_variable_transform_in_computation_method( + &method, var_mapper, + ), + }) + .collect_vec(), + ..Default::default() + }); +} + /// Mainly transforms a `GroupedExpression` back into a `GroupedExpression`, but also re-creates /// any variables that were newly generated inside the expression and adds potential computation methods /// to the constraint system. @@ -275,6 +316,7 @@ fn undo_variable_transform_and_recreate_new_variables< ); system.extend(ConstraintSystem { derived_variables: vec![DerivedVariable { + is_new: true, variable: v.clone(), computation_method, }], diff --git a/constraint-solver/src/rule_based_optimizer/environment.rs b/constraint-solver/src/rule_based_optimizer/environment.rs index 524fedc7cc..112e070a00 100644 --- a/constraint-solver/src/rule_based_optimizer/environment.rs +++ b/constraint-solver/src/rule_based_optimizer/environment.rs @@ -83,10 +83,17 @@ impl Environment { } /// Re-extract re-usable components after the rules have run. - pub fn terminate(self) -> (ItemDB, Expr>, NewVarGenerator) { + pub fn terminate( + self, + ) -> ( + ItemDB, Expr>, + NewVarGenerator, + HashMap>>, + ) { ( self.expressions.into_inner(), self.new_var_generator.into_inner(), + self.hints.into_inner(), ) } diff --git a/openvm/src/powdr_extension/trace_generator/cpu/mod.rs b/openvm/src/powdr_extension/trace_generator/cpu/mod.rs index 81e7c9dedc..29c87e2c5a 100644 --- a/openvm/src/powdr_extension/trace_generator/cpu/mod.rs +++ b/openvm/src/powdr_extension/trace_generator/cpu/mod.rs @@ -184,12 +184,14 @@ impl PowdrTraceGeneratorCpu { // Fill in the columns we have to compute from other columns // (these are either new columns or for example the "is_valid" column). for derived_column in columns_to_compute { - let col_index = apc_poly_id_to_index[&derived_column.variable.id]; - row_slice[col_index] = evaluate_computation_method( - &derived_column.computation_method, - row_slice, - &apc_poly_id_to_index, - ); + if derived_column.is_new { + let col_index = apc_poly_id_to_index[&derived_column.variable.id]; + row_slice[col_index] = evaluate_computation_method( + &derived_column.computation_method, + row_slice, + &apc_poly_id_to_index, + ); + } } let evaluator = MappingRowEvaluator::new(row_slice, &apc_poly_id_to_index); From 6d53ac72164efd51ec3560af31e8ff43b7e2c172 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 May 2026 16:25:24 +0200 Subject: [PATCH 04/15] remove prints. --- autoprecompiles/src/constraint_optimizer.rs | 14 -------------- autoprecompiles/src/optimizer.rs | 1 - .../src/rule_based_optimizer/driver.rs | 5 ----- 3 files changed, 20 deletions(-) diff --git a/autoprecompiles/src/constraint_optimizer.rs b/autoprecompiles/src/constraint_optimizer.rs index 68e264f432..f0e4ecec12 100644 --- a/autoprecompiles/src/constraint_optimizer.rs +++ b/autoprecompiles/src/constraint_optimizer.rs @@ -80,10 +80,6 @@ pub fn optimize_constraints< export_options .export_optimizer_inner_constraint_system(constraint_system.system(), "remove_free"); - println!( - "Before disconnected:\n{}", - constraint_system.variables().format(", ") - ); let constraint_system = remove_disconnected_columns(constraint_system, solver, bus_interaction_handler.clone()); stats_logger.log("removing disconnected columns", &constraint_system); @@ -91,10 +87,6 @@ pub fn optimize_constraints< constraint_system.system(), "remove_disconnected", ); - println!( - "After disconnected:\n{}", - constraint_system.variables().format(", ") - ); let constraint_system = simplify_constraints_using_exhaustive_search(constraint_system, solver); stats_logger.log("simplifying using exhaustive search", &constraint_system); @@ -111,11 +103,6 @@ pub fn optimize_constraints< export_options .export_optimizer_inner_constraint_system(constraint_system.system(), "trivial_simp"); - println!( - "Running rule-based opt:\n{}", - constraint_system.variables().format(", ") - ); - let (constraint_system, assignments) = rule_based_optimization( constraint_system, &*solver, @@ -131,7 +118,6 @@ pub fn optimize_constraints< val.clone(), ) })); - println!("After:\n{}", constraint_system.variables().format(", ")); stats_logger.log("rule-based optimization", &constraint_system); export_options.register_substituted_variables(assignments); export_options diff --git a/autoprecompiles/src/optimizer.rs b/autoprecompiles/src/optimizer.rs index 45da80155d..7e4471ff7d 100644 --- a/autoprecompiles/src/optimizer.rs +++ b/autoprecompiles/src/optimizer.rs @@ -128,7 +128,6 @@ where "remove_disconnected", ); - println!("Running rule-based optimization:\n{}", constraint_system); let (constraint_system, _) = rule_based_optimization( constraint_system, &solver, diff --git a/constraint-solver/src/rule_based_optimizer/driver.rs b/constraint-solver/src/rule_based_optimizer/driver.rs index 1df08c054e..ea450afe58 100644 --- a/constraint-solver/src/rule_based_optimizer/driver.rs +++ b/constraint-solver/src/rule_based_optimizer/driver.rs @@ -470,11 +470,6 @@ pub(crate) fn batch_replace_algebraic_constraints< ); } else { // No conflict, this replacement can proceed - println!( - "Replacing:\n{}\nby:\n{}", - replacement.replace.iter().format("\n -"), - replacement.replace_by.iter().format("\n +") - ); constraints_to_remove.extend(replacement.replace.iter()); replacement_constraints.extend(replacement.replace_by.iter().cloned()); } From 85c0d71f101756358709d20c8e56f717cbdbc153 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 24 Jun 2026 15:33:26 +0200 Subject: [PATCH 05/15] fix clippy. --- constraint-solver/src/rule_based_optimizer/driver.rs | 3 +-- constraint-solver/src/rule_based_optimizer/environment.rs | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/constraint-solver/src/rule_based_optimizer/driver.rs b/constraint-solver/src/rule_based_optimizer/driver.rs index ea450afe58..edb9149acb 100644 --- a/constraint-solver/src/rule_based_optimizer/driver.rs +++ b/constraint-solver/src/rule_based_optimizer/driver.rs @@ -1,7 +1,6 @@ use std::collections::{BTreeMap, HashMap, HashSet}; use std::fmt::Display; use std::hash::Hash; -use std::ops::Index; use itertools::Itertools; use powdr_number::FieldElement; @@ -267,7 +266,7 @@ fn insert_new_hints( .into_iter() .filter_map(|(var, method)| { let var = &var_mapper[var]; - if existing_hints.contains(&var) { + if existing_hints.contains(var) { None } else { Some((var.clone(), method)) diff --git a/constraint-solver/src/rule_based_optimizer/environment.rs b/constraint-solver/src/rule_based_optimizer/environment.rs index 112e070a00..9fdfb54693 100644 --- a/constraint-solver/src/rule_based_optimizer/environment.rs +++ b/constraint-solver/src/rule_based_optimizer/environment.rs @@ -18,6 +18,8 @@ use crate::{ runtime_constant::VarTransformable, }; +// introduce a type def for + /// The Environment in the main method to access information about /// the constraint system. It allows rules to translate /// the opaque Expr identifiers into GroupedExpressions and perform @@ -33,6 +35,7 @@ pub struct Environment { new_var_generator: RefCell>, /// Hints to compute variables whose constraints that define them are removed /// during optimization. + #[allow(clippy::type_complexity)] hints: RefCell>>>, } @@ -83,6 +86,7 @@ impl Environment { } /// Re-extract re-usable components after the rules have run. + #[allow(clippy::type_complexity)] pub fn terminate( self, ) -> ( From 5e6e58a0c43a43256b8ff588cea84d03ddd816ec Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 24 Jun 2026 15:39:09 +0200 Subject: [PATCH 06/15] Remove stray comment. --- constraint-solver/src/rule_based_optimizer/environment.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/constraint-solver/src/rule_based_optimizer/environment.rs b/constraint-solver/src/rule_based_optimizer/environment.rs index 9fdfb54693..7a5bf9ce82 100644 --- a/constraint-solver/src/rule_based_optimizer/environment.rs +++ b/constraint-solver/src/rule_based_optimizer/environment.rs @@ -18,8 +18,6 @@ use crate::{ runtime_constant::VarTransformable, }; -// introduce a type def for - /// The Environment in the main method to access information about /// the constraint system. It allows rules to translate /// the opaque Expr identifiers into GroupedExpressions and perform From 4d1bf45fc3a9bb602a75fdedd111d7bfd6a00e39 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 24 Jun 2026 16:06:01 +0200 Subject: [PATCH 07/15] Skip old variables for gpu. --- openvm/src/powdr_extension/trace_generator/cuda/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs index 3e5f29335f..2a504b1e33 100644 --- a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs +++ b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs @@ -110,10 +110,14 @@ fn compile_derived_to_gpu( let mut bytecode = Vec::new(); for DerivedVariable { + is_new, variable, computation_method, } in derived_columns { + if !is_new { + continue; + } let apc_col_index = apc_poly_id_to_index[&variable.id]; let off = bytecode.len() as u32; match computation_method { From d5bb8689fef9361a1539299af743fdbe34aa7247 Mon Sep 17 00:00:00 2001 From: Georg Wiese Date: Thu, 25 Jun 2026 08:47:52 +0200 Subject: [PATCH 08/15] Update snapshot tests --- .../src/indexed_constraint_system.rs | 2 +- .../apc_snapshots/complex/aligned_memcpy.txt | 5 ++++- .../tests/apc_snapshots/complex/copy_byte.txt | 5 ++++- .../apc_snapshots/complex/guest_top_block.txt | 5 ++++- .../complex/load_two_bytes_compare.txt | 6 +++++- .../load_two_bytes_compare_unsigned.txt | 5 ++++- .../many_stores_relative_to_same_register.txt | 5 ++++- .../apc_snapshots/complex/memcpy_block.txt | 18 +++++++++++++++++- .../tests/apc_snapshots/complex/rotate.txt | 5 ++++- .../apc_snapshots/complex/stack_accesses.txt | 5 ++++- .../complex/store_to_same_memory_address.txt | 5 ++++- .../apc_snapshots/complex/unaligned_memcpy.txt | 6 +++++- .../apc_snapshots/pseudo_instructions/beqz.txt | 6 +++++- .../apc_snapshots/pseudo_instructions/bgez.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bgtz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/blez.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bltz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bnez.txt | 6 +++++- .../apc_snapshots/pseudo_instructions/j.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/jr.txt | 5 ++++- .../pseudo_instructions/load_immediate.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/mv.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/neg.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/not.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/ret.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/seqz.txt | 11 ++++++++++- .../apc_snapshots/pseudo_instructions/sgtz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/sltz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/snez.txt | 5 ++++- .../single_instructions/single_add_1.txt | 5 ++++- .../single_instructions/single_and_0.txt | 5 ++++- .../single_instructions/single_beq.txt | 6 +++++- .../single_instructions/single_bge.txt | 5 ++++- .../single_instructions/single_bgeu.txt | 5 ++++- .../single_instructions/single_blt.txt | 5 ++++- .../single_instructions/single_bltu.txt | 5 ++++- .../single_instructions/single_bne.txt | 6 +++++- .../single_instructions/single_div.txt | 5 ++++- .../single_instructions/single_divu.txt | 5 ++++- .../single_instructions/single_loadb.txt | 5 ++++- .../single_instructions/single_loadb_imm0.txt | 5 ++++- .../single_instructions/single_loadb_x0.txt | 5 ++++- .../single_instructions/single_loadbu.txt | 5 ++++- .../single_instructions/single_loadh.txt | 5 ++++- .../single_instructions/single_loadhu.txt | 5 ++++- .../single_instructions/single_loadw.txt | 5 ++++- .../single_instructions/single_mul.txt | 5 ++++- .../single_instructions/single_rem.txt | 5 ++++- .../single_instructions/single_remu.txt | 5 ++++- .../single_instructions/single_sll.txt | 5 ++++- .../single_instructions/single_sll_by_8.txt | 5 ++++- .../single_instructions/single_sra.txt | 5 ++++- .../single_instructions/single_srl.txt | 5 ++++- .../single_instructions/single_storeb.txt | 5 ++++- .../single_instructions/single_storeh.txt | 5 ++++- .../single_instructions/single_storew.txt | 5 ++++- .../single_instructions/single_sub.txt | 5 ++++- .../single_instructions/single_xor.txt | 5 ++++- .../superblocks/beq0_fallthrough.txt | 6 +++++- .../apc_snapshots/superblocks/beq0_jump.txt | 5 ++++- .../superblocks/beq_fallthrough.txt | 6 +++++- .../apc_snapshots/superblocks/beq_jump.txt | 5 ++++- .../apc_snapshots/superblocks/many_blocks.txt | 5 ++++- .../complex/keccak_permutation.txt | 5 ++++- .../keccak_permutation_initial_stores.txt | 5 ++++- .../complex/keccak_permutation_rot63.txt | 5 ++++- .../complex/keccak_permutation_xor_chain.txt | 5 ++++- .../apc_snapshots/complex/memory_optimizer.txt | 5 ++++- .../apc_snapshots/complex/stack_accesses.txt | 5 ++++- .../tests/apc_snapshots/complex/two_ld.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/beqz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bgez.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bgtz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/blez.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bltz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/bnez.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/j.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/jr.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/mv.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/neg.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/not.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/ret.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/seqz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/sgtz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/sltz.txt | 5 ++++- .../apc_snapshots/pseudo_instructions/snez.txt | 5 ++++- .../apc_snapshots/single_instructions/add.txt | 5 ++++- .../apc_snapshots/single_instructions/addi.txt | 5 ++++- .../apc_snapshots/single_instructions/and.txt | 5 ++++- .../single_instructions/auipc.txt | 5 ++++- .../apc_snapshots/single_instructions/beq.txt | 5 ++++- .../apc_snapshots/single_instructions/bge.txt | 5 ++++- .../apc_snapshots/single_instructions/bgeu.txt | 5 ++++- .../apc_snapshots/single_instructions/blt.txt | 5 ++++- .../apc_snapshots/single_instructions/bltu.txt | 5 ++++- .../apc_snapshots/single_instructions/bne.txt | 5 ++++- .../apc_snapshots/single_instructions/div.txt | 5 ++++- .../apc_snapshots/single_instructions/divu.txt | 5 ++++- .../apc_snapshots/single_instructions/jal.txt | 5 ++++- .../apc_snapshots/single_instructions/jalr.txt | 5 ++++- .../apc_snapshots/single_instructions/lb.txt | 5 ++++- .../apc_snapshots/single_instructions/lbu.txt | 5 ++++- .../apc_snapshots/single_instructions/lh.txt | 5 ++++- .../apc_snapshots/single_instructions/lhu.txt | 5 ++++- .../apc_snapshots/single_instructions/lui.txt | 5 ++++- .../apc_snapshots/single_instructions/lw.txt | 5 ++++- .../apc_snapshots/single_instructions/mul.txt | 5 ++++- .../apc_snapshots/single_instructions/mulh.txt | 5 ++++- .../single_instructions/mulhsu.txt | 5 ++++- .../single_instructions/mulhu.txt | 5 ++++- .../apc_snapshots/single_instructions/or.txt | 5 ++++- .../apc_snapshots/single_instructions/rem.txt | 5 ++++- .../apc_snapshots/single_instructions/remu.txt | 5 ++++- .../apc_snapshots/single_instructions/sb.txt | 5 ++++- .../apc_snapshots/single_instructions/sh.txt | 5 ++++- .../apc_snapshots/single_instructions/sll.txt | 5 ++++- .../apc_snapshots/single_instructions/slt.txt | 5 ++++- .../apc_snapshots/single_instructions/sltu.txt | 5 ++++- .../single_instructions/sltui.txt | 5 ++++- .../apc_snapshots/single_instructions/sra.txt | 5 ++++- .../apc_snapshots/single_instructions/srl.txt | 5 ++++- .../apc_snapshots/single_instructions/sub.txt | 5 ++++- .../apc_snapshots/single_instructions/sw.txt | 5 ++++- .../apc_snapshots/single_instructions/xor.txt | 5 ++++- 124 files changed, 520 insertions(+), 124 deletions(-) diff --git a/constraint-solver/src/indexed_constraint_system.rs b/constraint-solver/src/indexed_constraint_system.rs index dcc6321c36..98c09a3509 100644 --- a/constraint-solver/src/indexed_constraint_system.rs +++ b/constraint-solver/src/indexed_constraint_system.rs @@ -844,7 +844,7 @@ mod tests { system.substitute_by_known(&"x1", &1.into()); assert_eq!( format!("{system}"), - "d1 := QuotientOrZero(1, x2)\nd2 := QuotientOrZero(y1, 8)" + "d1 (new) := QuotientOrZero(1, x2)\nd2 (new) := QuotientOrZero(y1, 8)" ); } } diff --git a/openvm-riscv/tests/apc_snapshots/complex/aligned_memcpy.txt b/openvm-riscv/tests/apc_snapshots/complex/aligned_memcpy.txt index 4a252c3aa3..8e9401e395 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/aligned_memcpy.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/aligned_memcpy.txt @@ -293,4 +293,7 @@ diff_marker__0_11 * ((a__0_11 - a__0_9) * (2 * cmp_result_11 - 1) + diff_val_11) (diff_marker__0_11 + diff_marker__1_11 + diff_marker__2_11 + diff_marker__3_11) * (diff_marker__0_11 + diff_marker__1_11 + diff_marker__2_11 + diff_marker__3_11 - 1) = 0 (1 - (diff_marker__0_11 + diff_marker__1_11 + diff_marker__2_11 + diff_marker__3_11)) * cmp_result_11 = 0 (1 - is_valid) * (diff_marker__0_11 + diff_marker__1_11 + diff_marker__2_11 + diff_marker__3_11) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/copy_byte.txt b/openvm-riscv/tests/apc_snapshots/complex/copy_byte.txt index 4a5825272e..3ef8954eba 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/copy_byte.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/copy_byte.txt @@ -118,4 +118,7 @@ flags__3_1 * ((flags__3_1 - 1) * (flags__3_1 - 2)) = 0 flags__1_1 * (flags__1_1 - 1) + flags__2_1 * (flags__2_1 - 1) + 4 * flags__0_1 * flags__1_1 + 4 * flags__0_1 * flags__2_1 + 5 * flags__0_1 * flags__3_1 + 5 * flags__1_1 * flags__2_1 + 5 * flags__1_1 * flags__3_1 + 5 * flags__2_1 * flags__3_1 - (1006632960 * flags__3_1 * (flags__3_1 - 1) + flags__0_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + flags__1_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + flags__2_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 3 * flags__3_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 5 * is_valid) = 0 flags__2_1 * (flags__2_1 - 1) - (flags__0_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 2 * flags__1_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 3 * flags__2_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2)) = 0 opcode_loadb_flag0_0 * shifted_read_data__0_0 + (1 - opcode_loadb_flag0_0) * shifted_read_data__1_0 - read_data__0_1 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/guest_top_block.txt b/openvm-riscv/tests/apc_snapshots/complex/guest_top_block.txt index 0b5cb8d046..25b19d231e 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/guest_top_block.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/guest_top_block.txt @@ -70,4 +70,7 @@ mult=is_valid, args=[a__2_0, a__3_0, 0, 0] (943718400 * writes_aux__prev_data__0_0 + 120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 - (120 * writes_aux__prev_data__1_0 + 30720 * writes_aux__prev_data__2_0 + 7864320 * writes_aux__prev_data__3_0 + 943718400 * a__0_0 + 1006632952 * is_valid)) * (943718400 * writes_aux__prev_data__0_0 + 120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 - (120 * writes_aux__prev_data__1_0 + 30720 * writes_aux__prev_data__2_0 + 7864320 * writes_aux__prev_data__3_0 + 943718400 * a__0_0 + 1006632953)) = 0 (30720 * mem_ptr_limbs__0_1 - (30720 * a__0_0 + 7864320 * a__1_0 + 368640 * is_valid)) * (30720 * mem_ptr_limbs__0_1 - (30720 * a__0_0 + 7864320 * a__1_0 + 368641)) = 0 (943718400 * a__0_0 + 30720 * mem_ptr_limbs__1_1 - (120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 943718400 * mem_ptr_limbs__0_1 + 754974726 * is_valid)) * (943718400 * a__0_0 + 30720 * mem_ptr_limbs__1_1 - (120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 943718400 * mem_ptr_limbs__0_1 + 754974727)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare.txt b/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare.txt index b5ab765782..63dabe6820 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare.txt @@ -114,4 +114,8 @@ cmp_result_2 * (cmp_result_2 - 1) = 0 (1 - cmp_result_2) * ((opcode_loadb_flag0_1 - 1) * shifted_read_data__1_1 + opcode_loadb_flag0_0 * shifted_read_data__0_0 + (1 - opcode_loadb_flag0_0) * shifted_read_data__1_0 - opcode_loadb_flag0_1 * shifted_read_data__0_1) = 0 (1 - cmp_result_2) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) = 0 ((opcode_loadb_flag0_1 - 1) * shifted_read_data__1_1 + opcode_loadb_flag0_0 * shifted_read_data__0_0 + (1 - opcode_loadb_flag0_0) * shifted_read_data__1_0 - opcode_loadb_flag0_1 * shifted_read_data__0_1) * diff_inv_marker__0_2 + free_var_101 * ((255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) + (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) + (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1)) - cmp_result_2 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_101 (new) = QuotientOrZero((opcode_loadb_flag0_1 * shifted_read_data__0_1 + (1 - opcode_loadb_flag0_1) * shifted_read_data__1_1 + (opcode_loadb_flag0_0 - 1) * shifted_read_data__1_0 - opcode_loadb_flag0_0 * shifted_read_data__0_0) * diff_inv_marker__0_2 + cmp_result_2, (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) + (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) + (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1) * (255 * data_most_sig_bit_0 - 255 * data_most_sig_bit_1)) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare_unsigned.txt b/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare_unsigned.txt index 5bccfbc4db..89adf63b98 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare_unsigned.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/load_two_bytes_compare_unsigned.txt @@ -132,4 +132,7 @@ cmp_result_2 * (cmp_result_2 - 1) = 0 (write_data__0_0 - write_data__0_1) * diff_inv_marker__0_2 - cmp_result_2 = 0 flags__1_0 * flags__2_0 + 2 * flags__0_0 * flags__2_0 + 2 * flags__1_0 * flags__3_0 + 3 * flags__2_0 * flags__3_0 = 0 flags__1_1 * flags__2_1 + 2 * flags__0_1 * flags__2_1 + 2 * flags__1_1 * flags__3_1 + 3 * flags__2_1 * flags__3_1 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/many_stores_relative_to_same_register.txt b/openvm-riscv/tests/apc_snapshots/complex/many_stores_relative_to_same_register.txt index a41cfbda60..abbee35fe4 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/many_stores_relative_to_same_register.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/many_stores_relative_to_same_register.txt @@ -109,4 +109,7 @@ mult=is_valid, args=[15360 * write_base_aux__prev_timestamp_2 + 15360 * write_ba (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_1 + 1006632953 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_1)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_1 + 1006632952 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_1)) = 0 (30720 * mem_ptr_limbs__0_2 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 614400 * is_valid)) * (30720 * mem_ptr_limbs__0_2 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 614401)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_2 + 754974711 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_2)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_2 + 754974710 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_2)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt b/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt index 6a8669399a..8eda918a26 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt @@ -78,4 +78,20 @@ cmp_result_2 * (writes_aux__prev_data__0_2 + writes_aux__prev_data__1_2 + writes inv_of_sum_174 * (writes_aux__prev_data__0_2 + writes_aux__prev_data__1_2 + writes_aux__prev_data__2_2 + writes_aux__prev_data__3_2) + cmp_result_2 - is_valid = 0 (1 - cmp_result_4) * (cmp_result_1 + cmp_result_2 - cmp_result_1 * cmp_result_2) = 0 free_var_176 * (cmp_result_1 + cmp_result_2 - cmp_result_1 * cmp_result_2) - cmp_result_4 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +diff_marker__0_1 (old) = IfEqZero(0, IfEqZero(0, IfEqZero(0, IfEqZero(a__0_0 - 1, 0, 1), 0), 0), 0) +diff_marker__1_1 (old) = IfEqZero(0, IfEqZero(0, IfEqZero(0, 0, 1), 0), 0) +diff_marker__2_1 (old) = IfEqZero(0, IfEqZero(0, 0, 1), 0) +diff_marker__3_1 (old) = IfEqZero(0, 0, 1) +diff_val_1 (old) = IfEqZero(a__0_0, 1, QuotientOrZero(a__0_0 - 1, 1)) +diff_marker__0_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, IfEqZero(writes_aux__prev_data__1_2, IfEqZero(writes_aux__prev_data__0_2 - 1, 0, 1), 0), 0), 0) +diff_marker__1_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, IfEqZero(writes_aux__prev_data__1_2, 0, 1), 0), 0) +diff_marker__2_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, 0, 1), 0) +diff_marker__3_2 (old) = IfEqZero(writes_aux__prev_data__3_2, 0, 1) +diff_val_2 (old) = IfEqZero(writes_aux__prev_data__0_2, 1, QuotientOrZero(writes_aux__prev_data__0_2 - 1, 1)) +inv_of_sum_173 (new) = QuotientOrZero(1, a__0_0) +inv_of_sum_174 (new) = QuotientOrZero(1, writes_aux__prev_data__0_2 + writes_aux__prev_data__1_2 + writes_aux__prev_data__2_2 + writes_aux__prev_data__3_2) +free_var_176 (new) = QuotientOrZero(cmp_result_4, cmp_result_1 + cmp_result_2 - cmp_result_1 * cmp_result_2) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/rotate.txt b/openvm-riscv/tests/apc_snapshots/complex/rotate.txt index d6446cce2c..b2b7a956a6 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/rotate.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/rotate.txt @@ -67,4 +67,7 @@ mult=is_valid, args=[a__2_0, 0, 0, 0] (b__1_0 + 256 * b__2_0 + 65536 * b__3_0 - (2 * a__1_0 + 512 * a__2_0 + 131072 * a__3_0)) * (b__1_0 + 256 * b__2_0 + 65536 * b__3_0 - (2 * a__1_0 + 512 * a__2_0 + 131072 * a__3_0 + 1)) = 0 (b__2_0 + 256 * b__3_0 - (2 * a__2_0 + 512 * a__3_0)) * (b__2_0 + 256 * b__3_0 - (2 * a__2_0 + 512 * a__3_0 + 1)) = 0 (b__3_0 - 2 * a__3_0) * (b__3_0 - (2 * a__3_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/stack_accesses.txt b/openvm-riscv/tests/apc_snapshots/complex/stack_accesses.txt index 7b3508f221..387bcccac9 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/stack_accesses.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/stack_accesses.txt @@ -83,4 +83,7 @@ mult=is_valid, args=[15360 * write_base_aux__prev_timestamp_1 + 15360 * write_ba (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 754974711 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 754974710 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) = 0 (30720 * mem_ptr_limbs__0_1 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 737280 * is_valid)) * (30720 * mem_ptr_limbs__0_1 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 737281)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_1 + 503316469 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_1)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_1 + 503316468 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/store_to_same_memory_address.txt b/openvm-riscv/tests/apc_snapshots/complex/store_to_same_memory_address.txt index 0b6699e693..e199a244aa 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/store_to_same_memory_address.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/store_to_same_memory_address.txt @@ -117,4 +117,7 @@ flags__3_1 * ((flags__3_1 - 1) * (flags__3_1 - 2)) = 0 flags__1_1 * (flags__1_1 - 1) + flags__2_1 * (flags__2_1 - 1) + 4 * flags__0_1 * flags__1_1 + 4 * flags__0_1 * flags__2_1 + 5 * flags__0_1 * flags__3_1 + 5 * flags__1_1 * flags__2_1 + 5 * flags__1_1 * flags__3_1 + 5 * flags__2_1 * flags__3_1 - (1006632960 * flags__3_1 * (flags__3_1 - 1) + flags__0_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + flags__1_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + flags__2_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 3 * flags__3_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 5 * is_valid) = 0 flags__2_0 * (flags__2_0 - 1) - (flags__0_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 2 * flags__1_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 3 * flags__2_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2)) = 0 flags__2_1 * (flags__2_1 - 1) - (flags__0_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 2 * flags__1_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2) + 3 * flags__2_1 * (flags__0_1 + flags__1_1 + flags__2_1 + flags__3_1 - 2)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/complex/unaligned_memcpy.txt b/openvm-riscv/tests/apc_snapshots/complex/unaligned_memcpy.txt index 591b34c043..592a4f2951 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/unaligned_memcpy.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/unaligned_memcpy.txt @@ -258,4 +258,8 @@ opcode_loadb_flag0_0 * shifted_read_data__0_0 + (1 - opcode_loadb_flag0_0) * shi diff_val_6 * (diff_marker__1_6 + diff_marker__2_6 + diff_marker__3_6) = 0 (1 - is_valid) * (diff_marker__0_6 + diff_marker__1_6 + diff_marker__2_6 + diff_marker__3_6) = 0 (1 - is_valid) * (diff_marker__0_7 + diff_marker__1_7 + diff_marker__2_7 + diff_marker__3_7) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_467 (new) = QuotientOrZero(cmp_result_12, cmp_result_6 * cmp_result_7) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/beqz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/beqz.txt index 70f73b5054..e1e1e6da68 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/beqz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/beqz.txt @@ -40,4 +40,8 @@ mult=is_valid, args=[15360 * reads_aux__1__base__prev_timestamp_0 + 15360 * read cmp_result_0 * (cmp_result_0 - 1) = 0 cmp_result_0 * (a__0_0 + a__1_0 + a__2_0 + a__3_0) = 0 free_var_28 * (a__0_0 + a__1_0 + a__2_0 + a__3_0) + cmp_result_0 - is_valid = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_28 (new) = QuotientOrZero(1 - cmp_result_0, a__0_0 + a__1_0 + a__2_0 + a__3_0) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgez.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgez.txt index b3aff9e550..eeb0b4d4d4 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgez.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgez.txt @@ -63,4 +63,7 @@ diff_marker__0_0 * (a__0_0 * (1 - 2 * cmp_result_0) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (is_valid - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * (1 - cmp_result_0) = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgtz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgtz.txt index cfb2ea5612..915e88eb5a 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgtz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bgtz.txt @@ -63,4 +63,7 @@ diff_marker__0_0 * (diff_val_0 - b__0_0 * (2 * cmp_result_0 - 1)) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/blez.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/blez.txt index 22da24d5da..05bc54fe16 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/blez.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/blez.txt @@ -63,4 +63,7 @@ diff_marker__0_0 * (diff_val_0 - b__0_0 * (1 - 2 * cmp_result_0)) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (is_valid - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * (1 - cmp_result_0) = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bltz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bltz.txt index 3604f8a432..8fb2ea6e0f 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bltz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bltz.txt @@ -63,4 +63,7 @@ diff_marker__0_0 * (a__0_0 * (2 * cmp_result_0 - 1) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bnez.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bnez.txt index 618c38193f..6e3bffef7a 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bnez.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/bnez.txt @@ -40,4 +40,8 @@ mult=is_valid, args=[15360 * reads_aux__1__base__prev_timestamp_0 + 15360 * read cmp_result_0 * (cmp_result_0 - 1) = 0 (1 - cmp_result_0) * (a__0_0 + a__1_0 + a__2_0 + a__3_0) = 0 free_var_28 * (a__0_0 + a__1_0 + a__2_0 + a__3_0) - cmp_result_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_28 (new) = QuotientOrZero(cmp_result_0, a__0_0 + a__1_0 + a__2_0 + a__3_0) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/j.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/j.txt index 401a3860f4..f5560186ad 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/j.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/j.txt @@ -15,4 +15,7 @@ mult=-is_valid, args=[0, inner__from_state__timestamp_0] mult=is_valid, args=[8, inner__from_state__timestamp_0 + 1] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/jr.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/jr.txt index d9b3f0ce3c..b4e6c1a951 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/jr.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/jr.txt @@ -15,4 +15,7 @@ mult=-is_valid, args=[0, inner__from_state__timestamp_0] mult=is_valid, args=[8, inner__from_state__timestamp_0 + 1] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/load_immediate.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/load_immediate.txt index bce82626d9..3ccf0268c5 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/load_immediate.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/load_immediate.txt @@ -35,4 +35,7 @@ mult=is_valid, args=[writes_aux__base__timestamp_lt_aux__lower_decomp__0_0, 17] mult=is_valid, args=[15360 * writes_aux__base__prev_timestamp_0 + 15360 * writes_aux__base__timestamp_lt_aux__lower_decomp__0_0 - (15360 * from_state__timestamp_0 + 15360), 12] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/mv.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/mv.txt index 9b9024ab2b..15914efba3 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/mv.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/mv.txt @@ -39,4 +39,7 @@ mult=is_valid, args=[writes_aux__base__timestamp_lt_aux__lower_decomp__0_0, 17] mult=is_valid, args=[15360 * writes_aux__base__prev_timestamp_0 + 15360 * writes_aux__base__timestamp_lt_aux__lower_decomp__0_0 - (15360 * from_state__timestamp_0 + 15360), 12] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/neg.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/neg.txt index e7f25de429..34eb84d0e1 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/neg.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/neg.txt @@ -57,4 +57,7 @@ mult=is_valid, args=[a__2_0, a__3_0, 0, 0] (30720 * a__0_0 + 7864320 * a__1_0 + 30720 * c__0_0 + 7864320 * c__1_0) * (30720 * a__0_0 + 7864320 * a__1_0 + 30720 * c__0_0 + 7864320 * c__1_0 + 1) = 0 (120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 + 120 * c__0_0 + 30720 * c__1_0 + 7864320 * c__2_0) * (120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 + 120 * c__0_0 + 30720 * c__1_0 + 7864320 * c__2_0 + 1) = 0 (943718400 * a__0_0 + 943718400 * c__0_0 - (120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 120 * c__1_0 + 30720 * c__2_0 + 7864320 * c__3_0)) * (943718400 * a__0_0 + 943718400 * c__0_0 - (120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 120 * c__1_0 + 30720 * c__2_0 + 7864320 * c__3_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/not.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/not.txt index 14157cf3de..a8c9fd5aca 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/not.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/not.txt @@ -39,4 +39,7 @@ mult=is_valid, args=[writes_aux__base__timestamp_lt_aux__lower_decomp__0_0, 17] mult=is_valid, args=[15360 * writes_aux__base__prev_timestamp_0 + 15360 * writes_aux__base__timestamp_lt_aux__lower_decomp__0_0 - (15360 * from_state__timestamp_0 + 15360), 12] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/ret.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/ret.txt index f66e4b279c..6ff9ff31d3 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/ret.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/ret.txt @@ -37,4 +37,7 @@ mult=is_valid, args=[15360 * rs1_aux_cols__base__prev_timestamp_0 + 15360 * rs1_ to_pc_least_sig_bit_0 * (to_pc_least_sig_bit_0 - 1) = 0 (30720 * to_pc_least_sig_bit_0 + 61440 * to_pc_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0)) * (30720 * to_pc_least_sig_bit_0 + 61440 * to_pc_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 1)) = 0 (943718400 * rs1_data__0_0 + 125829121 * to_pc_limbs__0_0 + 30720 * to_pc_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * to_pc_least_sig_bit_0)) * (943718400 * rs1_data__0_0 + 125829121 * to_pc_limbs__0_0 + 30720 * to_pc_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * to_pc_least_sig_bit_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt index e4ad397770..60bf91d995 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt @@ -44,4 +44,13 @@ mult=is_valid, args=[15360 * writes_aux__base__prev_timestamp_0 + 15360 * writes cmp_result_0 * (cmp_result_0 - 1) = 0 cmp_result_0 * (b__0_0 + b__1_0 + b__2_0 + b__3_0) = 0 inv_of_sum_37 * (b__0_0 + b__1_0 + b__2_0 + b__3_0) + cmp_result_0 - is_valid = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +diff_marker__0_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, IfEqZero(b__1_0, IfEqZero(b__0_0 - 1, 0, 1), 0), 0), 0) +diff_marker__1_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, IfEqZero(b__1_0, 0, 1), 0), 0) +diff_marker__2_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, 0, 1), 0) +diff_marker__3_0 (old) = IfEqZero(b__3_0, 0, 1) +diff_val_0 (old) = IfEqZero(b__0_0, 1, QuotientOrZero(b__0_0 - 1, 1)) +inv_of_sum_37 (new) = QuotientOrZero(1, b__0_0 + b__1_0 + b__2_0 + b__3_0) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sgtz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sgtz.txt index b6d6e653fd..b29afbdb38 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sgtz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sgtz.txt @@ -73,4 +73,7 @@ diff_marker__0_0 * (diff_val_0 - c__0_0 * (2 * cmp_result_0 - 1)) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sltz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sltz.txt index 519f06f8e9..cbb2a86c6d 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sltz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/sltz.txt @@ -73,4 +73,7 @@ diff_marker__0_0 * (b__0_0 * (2 * cmp_result_0 - 1) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/snez.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/snez.txt index d3714e7ef7..a8bdef392c 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/snez.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/snez.txt @@ -70,4 +70,7 @@ diff_marker__0_0 * (diff_val_0 - c__0_0 * (2 * cmp_result_0 - 1)) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_add_1.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_add_1.txt index febff0adfc..4d1f9e56f9 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_add_1.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_add_1.txt @@ -41,4 +41,7 @@ mult=is_valid, args=[a__2_0, a__3_0, 0, 0] (30720 * a__0_0 + 7864320 * a__1_0 - (30720 * writes_aux__prev_data__0_0 + 7864320 * writes_aux__prev_data__1_0 + 30720 * is_valid)) * (30720 * a__0_0 + 7864320 * a__1_0 - (30720 * writes_aux__prev_data__0_0 + 7864320 * writes_aux__prev_data__1_0 + 30721)) = 0 (120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 - (120 * writes_aux__prev_data__0_0 + 30720 * writes_aux__prev_data__1_0 + 7864320 * writes_aux__prev_data__2_0 + 120 * is_valid)) * (120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 - (120 * writes_aux__prev_data__0_0 + 30720 * writes_aux__prev_data__1_0 + 7864320 * writes_aux__prev_data__2_0 + 121)) = 0 (943718400 * writes_aux__prev_data__0_0 + 120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 943718400 * is_valid - (120 * writes_aux__prev_data__1_0 + 30720 * writes_aux__prev_data__2_0 + 7864320 * writes_aux__prev_data__3_0 + 943718400 * a__0_0)) * (943718400 * writes_aux__prev_data__0_0 + 120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 943718399 - (120 * writes_aux__prev_data__1_0 + 30720 * writes_aux__prev_data__2_0 + 7864320 * writes_aux__prev_data__3_0 + 943718400 * a__0_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_and_0.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_and_0.txt index d9382580e1..adc5fbd7a9 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_and_0.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_and_0.txt @@ -35,4 +35,7 @@ mult=is_valid, args=[writes_aux__base__timestamp_lt_aux__lower_decomp__0_0, 17] mult=is_valid, args=[15360 * writes_aux__base__prev_timestamp_0 + 15360 * writes_aux__base__timestamp_lt_aux__lower_decomp__0_0 - (15360 * from_state__timestamp_0 + 15360), 12] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_beq.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_beq.txt index f28387d553..683511b248 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_beq.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_beq.txt @@ -47,4 +47,8 @@ cmp_result_0 * (a__1_0 - b__1_0) = 0 cmp_result_0 * (a__2_0 - b__2_0) = 0 cmp_result_0 * (a__3_0 - b__3_0) = 0 free_var_30 * ((a__0_0 - b__0_0) * (a__0_0 - b__0_0) + (a__1_0 - b__1_0) * (a__1_0 - b__1_0) + (a__2_0 - b__2_0) * (a__2_0 - b__2_0) + (a__3_0 - b__3_0) * (a__3_0 - b__3_0)) + cmp_result_0 - is_valid = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_30 (new) = QuotientOrZero(1 - cmp_result_0, (a__0_0 - b__0_0) * (a__0_0 - b__0_0) + (a__1_0 - b__1_0) * (a__1_0 - b__1_0) + (a__2_0 - b__2_0) * (a__2_0 - b__2_0) + (a__3_0 - b__3_0) * (a__3_0 - b__3_0)) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bge.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bge.txt index 9fc07d5e0d..7bfcd68d5e 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bge.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bge.txt @@ -69,4 +69,7 @@ diff_marker__0_0 * ((a__0_0 - b__0_0) * (1 - 2 * cmp_result_0) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (is_valid - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * (1 - cmp_result_0) = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bgeu.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bgeu.txt index 8079a65386..2fb14989cf 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bgeu.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bgeu.txt @@ -64,4 +64,7 @@ diff_marker__0_0 * ((a__0_0 - b__0_0) * (1 - 2 * cmp_result_0) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (is_valid - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * (1 - cmp_result_0) = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_blt.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_blt.txt index 42c33f8af7..0712a848ac 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_blt.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_blt.txt @@ -69,4 +69,7 @@ diff_marker__0_0 * ((a__0_0 - b__0_0) * (2 * cmp_result_0 - 1) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bltu.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bltu.txt index 19493d2c6c..c786762b02 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bltu.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bltu.txt @@ -64,4 +64,7 @@ diff_marker__0_0 * ((a__0_0 - b__0_0) * (2 * cmp_result_0 - 1) + diff_val_0) = 0 (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0 - 1) = 0 (1 - (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0)) * cmp_result_0 = 0 (1 - is_valid) * (diff_marker__0_0 + diff_marker__1_0 + diff_marker__2_0 + diff_marker__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bne.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bne.txt index 330dfd88a3..57d6cc584e 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_bne.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_bne.txt @@ -47,4 +47,8 @@ cmp_result_0 * (cmp_result_0 - 1) = 0 (1 - cmp_result_0) * (a__2_0 - b__2_0) = 0 (1 - cmp_result_0) * (a__3_0 - b__3_0) = 0 free_var_30 * ((a__0_0 - b__0_0) * (a__0_0 - b__0_0) + (a__1_0 - b__1_0) * (a__1_0 - b__1_0) + (a__2_0 - b__2_0) * (a__2_0 - b__2_0) + (a__3_0 - b__3_0) * (a__3_0 - b__3_0)) - cmp_result_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_30 (new) = QuotientOrZero(cmp_result_0, (a__0_0 - b__0_0) * (a__0_0 - b__0_0) + (a__1_0 - b__1_0) * (a__1_0 - b__1_0) + (a__2_0 - b__2_0) * (a__2_0 - b__2_0) + (a__3_0 - b__3_0) * (a__3_0 - b__3_0)) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_div.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_div.txt index 20f9001370..120e2985db 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_div.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_div.txt @@ -135,4 +135,7 @@ lt_marker__0_0 * (lt_marker__0_0 - 1) = 0 lt_marker__0_0 * (lt_diff_0 - (r_prime__0_0 * (2 * c_sign_0 - 1) + c__0_0 * (1 - 2 * c_sign_0))) = 0 zero_divisor_0 * (c__0_0 + c__1_0 + c__2_0 + c__3_0) = 0 r_zero_0 * (r__0_0 + r__1_0 + r__2_0 + r__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_divu.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_divu.txt index bd3b4d2d65..5e7ebed093 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_divu.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_divu.txt @@ -103,4 +103,7 @@ lt_marker__0_0 * (r__0_0 + lt_diff_0 - c__0_0) = 0 q_sign_0 * (1 - zero_divisor_0) = 0 zero_divisor_0 * (c__0_0 + c__1_0 + c__2_0 + c__3_0) = 0 r_zero_0 * (r__0_0 + r__1_0 + r__2_0 + r__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb.txt index a8e22fcf62..65370f43ff 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb.txt @@ -62,4 +62,7 @@ data_most_sig_bit_0 * (data_most_sig_bit_0 - 1) = 0 shift_most_sig_bit_0 * (shift_most_sig_bit_0 - 1) = 0 (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 92160 * is_valid)) * (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 92161)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 817889279 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 817889278 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_imm0.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_imm0.txt index 16a6c2b2cf..2903dc24b4 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_imm0.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_imm0.txt @@ -62,4 +62,7 @@ data_most_sig_bit_0 * (data_most_sig_bit_0 - 1) = 0 shift_most_sig_bit_0 * (shift_most_sig_bit_0 - 1) = 0 (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0)) * (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 1)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_x0.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_x0.txt index ce05b59e4d..1261cb3c71 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_x0.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadb_x0.txt @@ -52,4 +52,7 @@ data_most_sig_bit_0 * (data_most_sig_bit_0 - 1) = 0 shift_most_sig_bit_0 * (shift_most_sig_bit_0 - 1) = 0 (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 92160 * is_valid)) * (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 92161)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 817889279 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 817889278 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadbu.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadbu.txt index c8f79a8ef8..371982fdbe 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadbu.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadbu.txt @@ -72,4 +72,7 @@ flags__3_0 * ((flags__3_0 - 1) * (flags__3_0 - 2)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 314572810 * is_valid)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 314572811)) = 0 flags__1_0 * (flags__1_0 - 1) + flags__2_0 * (flags__2_0 - 1) + 4 * flags__0_0 * flags__1_0 + 4 * flags__0_0 * flags__2_0 + 5 * flags__0_0 * flags__3_0 + 5 * flags__1_0 * flags__2_0 + 5 * flags__1_0 * flags__3_0 + 5 * flags__2_0 * flags__3_0 - (1006632960 * flags__3_0 * (flags__3_0 - 1) + flags__0_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + flags__1_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + flags__2_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 3 * flags__3_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + is_valid) = 0 flags__1_0 * flags__2_0 + 2 * flags__0_0 * flags__2_0 + 2 * flags__1_0 * flags__3_0 + 3 * flags__2_0 * flags__3_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadh.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadh.txt index 340fb2d555..0aa37ba60d 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadh.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadh.txt @@ -60,4 +60,7 @@ data_most_sig_bit_0 * (data_most_sig_bit_0 - 1) = 0 shift_most_sig_bit_0 * (shift_most_sig_bit_0 - 1) = 0 (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 184320 * is_valid)) * (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 184321)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 377487363 * is_valid)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 377487364)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadhu.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadhu.txt index 13e7174516..20f78b10f0 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadhu.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadhu.txt @@ -53,4 +53,7 @@ flags__2_0 * ((flags__2_0 - 1) * (flags__2_0 - 2)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 629145590 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 629145589 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) = 0 flags__1_0 * (flags__1_0 - 1) + flags__2_0 * (flags__2_0 - 1) + 5 * flags__1_0 * flags__2_0 - (flags__1_0 * (flags__1_0 + flags__2_0 - 2) + flags__2_0 * (flags__1_0 + flags__2_0 - 2) + 2 * is_valid) = 0 flags__1_0 * flags__2_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadw.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadw.txt index 315cb0a852..818e5c765b 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadw.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_loadw.txt @@ -55,4 +55,7 @@ mult=is_valid, args=[15360 * write_base_aux__prev_timestamp_0 + 15360 * write_ba // Algebraic constraints: (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 614400 * is_valid)) * (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 614401)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 754974711 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 754974710 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_mul.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_mul.txt index ad30c3b369..1af5d41a56 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_mul.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_mul.txt @@ -59,4 +59,7 @@ mult=is_valid, args=[a__2_0, 120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 - mult=is_valid, args=[a__3_0, 943718400 * b__0_0 * c__0_0 + 120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 - (120 * b__0_0 * c__1_0 + 120 * b__1_0 * c__0_0 + 30720 * b__0_0 * c__2_0 + 30720 * b__1_0 * c__1_0 + 30720 * b__2_0 * c__0_0 + 7864320 * b__0_0 * c__3_0 + 7864320 * b__1_0 * c__2_0 + 7864320 * b__2_0 * c__1_0 + 7864320 * b__3_0 * c__0_0 + 943718400 * a__0_0)] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_rem.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_rem.txt index 6b9edef8bf..41ed963b24 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_rem.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_rem.txt @@ -135,4 +135,7 @@ lt_marker__0_0 * (lt_marker__0_0 - 1) = 0 lt_marker__0_0 * (lt_diff_0 - (r_prime__0_0 * (2 * c_sign_0 - 1) + c__0_0 * (1 - 2 * c_sign_0))) = 0 zero_divisor_0 * (c__0_0 + c__1_0 + c__2_0 + c__3_0) = 0 r_zero_0 * (r__0_0 + r__1_0 + r__2_0 + r__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_remu.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_remu.txt index 2b1da7eb76..a45897b857 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_remu.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_remu.txt @@ -103,4 +103,7 @@ lt_marker__0_0 * (r__0_0 + lt_diff_0 - c__0_0) = 0 q_sign_0 * (1 - zero_divisor_0) = 0 zero_divisor_0 * (c__0_0 + c__1_0 + c__2_0 + c__3_0) = 0 r_zero_0 * (r__0_0 + r__1_0 + r__2_0 + r__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll.txt index 46e3865d69..a0b7f8aaaf 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll.txt @@ -51,4 +51,7 @@ mult=is_valid, args=[a__0_0, a__1_0, 0, 0] mult=is_valid, args=[a__2_0, a__3_0, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll_by_8.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll_by_8.txt index de18be1a2a..12951fc84b 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll_by_8.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sll_by_8.txt @@ -39,4 +39,7 @@ mult=is_valid, args=[writes_aux__base__timestamp_lt_aux__lower_decomp__0_0, 17] mult=is_valid, args=[15360 * writes_aux__base__prev_timestamp_0 + 15360 * writes_aux__base__timestamp_lt_aux__lower_decomp__0_0 - (15360 * from_state__timestamp_0 + 15360), 12] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sra.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sra.txt index 0ca0112068..1f3b44e246 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sra.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sra.txt @@ -113,4 +113,7 @@ limb_shift_marker__2_0 * (a__1_0 * bit_multiplier_right_0 + bit_shift_carry__3_0 b_sign_0 * (b_sign_0 - 1) = 0 (a__2_0 - 255 * b_sign_0) * (1 - (limb_shift_marker__0_0 + limb_shift_marker__1_0)) = 0 (a__3_0 - 255 * b_sign_0) * (1 - limb_shift_marker__0_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_srl.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_srl.txt index f3e19919a8..8e261cb46a 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_srl.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_srl.txt @@ -44,4 +44,7 @@ mult=is_valid, args=[a__0_0, 0, 0, 0] // Algebraic constraints: (b__3_0 - 2 * a__0_0) * (b__3_0 - (2 * a__0_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeb.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeb.txt index 03a47c089c..7ed14fe7a4 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeb.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeb.txt @@ -75,4 +75,7 @@ flags__3_0 * ((flags__3_0 - 1) * (flags__3_0 - 2)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 817889279 * is_valid - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 + 817889278 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0)) = 0 flags__1_0 * (flags__1_0 - 1) + flags__2_0 * (flags__2_0 - 1) + 4 * flags__0_0 * flags__1_0 + 4 * flags__0_0 * flags__2_0 + 5 * flags__0_0 * flags__3_0 + 5 * flags__1_0 * flags__2_0 + 5 * flags__1_0 * flags__3_0 + 5 * flags__2_0 * flags__3_0 - (1006632960 * flags__3_0 * (flags__3_0 - 1) + flags__0_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + flags__1_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + flags__2_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 3 * flags__3_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 5 * is_valid) = 0 flags__2_0 * (flags__2_0 - 1) - (flags__0_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 2 * flags__1_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2) + 3 * flags__2_0 * (flags__0_0 + flags__1_0 + flags__2_0 + flags__3_0 - 2)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeh.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeh.txt index a5e77db7e6..8620a788ca 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeh.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_storeh.txt @@ -71,4 +71,7 @@ write_data__3_0 - (flags__2_0 * read_data__1_0 + (flags__1_0 * flags__2_0 + flag (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 377456642 * is_valid)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 377456643)) = 0 flags__1_0 * (flags__1_0 - 1) + flags__2_0 * (flags__2_0 - 1) + 5 * flags__1_0 * flags__2_0 + 3 * flags__1_0 + 3 * flags__2_0 - (flags__1_0 * (flags__1_0 + flags__2_0 - 1) + flags__2_0 * (flags__1_0 + flags__2_0 - 1) + 3 * is_valid) = 0 flags__2_0 * (flags__2_0 - 1) + is_valid - (2 * flags__1_0 * (flags__1_0 + flags__2_0 - 1) + 3 * flags__2_0 * (flags__1_0 + flags__2_0 - 1) + flags__1_0 + flags__2_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_storew.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_storew.txt index 2052371c07..1007f507e5 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_storew.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_storew.txt @@ -55,4 +55,7 @@ mult=is_valid, args=[15360 * write_base_aux__prev_timestamp_0 + 15360 * write_ba // Algebraic constraints: (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 122880 * is_valid)) * (30720 * mem_ptr_limbs__0_0 - (30720 * rs1_data__0_0 + 7864320 * rs1_data__1_0 + 122881)) = 0 (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 251627521 * is_valid)) * (943718400 * rs1_data__0_0 + 30720 * mem_ptr_limbs__1_0 - (120 * rs1_data__1_0 + 30720 * rs1_data__2_0 + 7864320 * rs1_data__3_0 + 943718400 * mem_ptr_limbs__0_0 + 251627522)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sub.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sub.txt index 1f075da859..6a5fe6ae0e 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_sub.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_sub.txt @@ -61,4 +61,7 @@ mult=is_valid, args=[a__2_0, a__3_0, 0, 0] (30720 * b__0_0 + 7864320 * b__1_0 - (30720 * a__0_0 + 7864320 * a__1_0 + 30720 * c__0_0 + 7864320 * c__1_0)) * (30720 * b__0_0 + 7864320 * b__1_0 - (30720 * a__0_0 + 7864320 * a__1_0 + 30720 * c__0_0 + 7864320 * c__1_0 + 1)) = 0 (120 * b__0_0 + 30720 * b__1_0 + 7864320 * b__2_0 - (120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 + 120 * c__0_0 + 30720 * c__1_0 + 7864320 * c__2_0)) * (120 * b__0_0 + 30720 * b__1_0 + 7864320 * b__2_0 - (120 * a__0_0 + 30720 * a__1_0 + 7864320 * a__2_0 + 120 * c__0_0 + 30720 * c__1_0 + 7864320 * c__2_0 + 1)) = 0 (943718400 * a__0_0 + 120 * b__1_0 + 30720 * b__2_0 + 7864320 * b__3_0 + 943718400 * c__0_0 - (120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 943718400 * b__0_0 + 120 * c__1_0 + 30720 * c__2_0 + 7864320 * c__3_0)) * (943718400 * a__0_0 + 120 * b__1_0 + 30720 * b__2_0 + 7864320 * b__3_0 + 943718400 * c__0_0 - (120 * a__1_0 + 30720 * a__2_0 + 7864320 * a__3_0 + 943718400 * b__0_0 + 120 * c__1_0 + 30720 * c__2_0 + 7864320 * c__3_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/single_instructions/single_xor.txt b/openvm-riscv/tests/apc_snapshots/single_instructions/single_xor.txt index 139565125a..6d273ff10a 100644 --- a/openvm-riscv/tests/apc_snapshots/single_instructions/single_xor.txt +++ b/openvm-riscv/tests/apc_snapshots/single_instructions/single_xor.txt @@ -59,4 +59,7 @@ mult=is_valid, args=[b__2_0, c__2_0, a__2_0, 1] mult=is_valid, args=[b__3_0, c__3_0, a__3_0, 1] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/superblocks/beq0_fallthrough.txt b/openvm-riscv/tests/apc_snapshots/superblocks/beq0_fallthrough.txt index 924b04beeb..a661d732ab 100644 --- a/openvm-riscv/tests/apc_snapshots/superblocks/beq0_fallthrough.txt +++ b/openvm-riscv/tests/apc_snapshots/superblocks/beq0_fallthrough.txt @@ -60,4 +60,8 @@ mult=is_valid, args=[a__2_1, a__3_1, 0, 0] (120 * a__0_1 + 30720 * a__1_1 + 7864320 * a__2_1 - (120 * writes_aux__prev_data__0_1 + 30720 * writes_aux__prev_data__1_1 + 7864320 * writes_aux__prev_data__2_1 + 120 * is_valid)) * (120 * a__0_1 + 30720 * a__1_1 + 7864320 * a__2_1 - (120 * writes_aux__prev_data__0_1 + 30720 * writes_aux__prev_data__1_1 + 7864320 * writes_aux__prev_data__2_1 + 121)) = 0 (943718400 * writes_aux__prev_data__0_1 + 120 * a__1_1 + 30720 * a__2_1 + 7864320 * a__3_1 + 943718400 * is_valid - (120 * writes_aux__prev_data__1_1 + 30720 * writes_aux__prev_data__2_1 + 7864320 * writes_aux__prev_data__3_1 + 943718400 * a__0_1)) * (943718400 * writes_aux__prev_data__0_1 + 120 * a__1_1 + 30720 * a__2_1 + 7864320 * a__3_1 + 943718399 - (120 * writes_aux__prev_data__1_1 + 30720 * writes_aux__prev_data__2_1 + 7864320 * writes_aux__prev_data__3_1 + 943718400 * a__0_1)) = 0 free_var_64 * (a__0_0 + a__1_0 + a__2_0 + a__3_0) - is_valid = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_64 (new) = QuotientOrZero(1, a__0_0 + a__1_0 + a__2_0 + a__3_0) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/superblocks/beq0_jump.txt b/openvm-riscv/tests/apc_snapshots/superblocks/beq0_jump.txt index 3d1f3efedb..7392b96212 100644 --- a/openvm-riscv/tests/apc_snapshots/superblocks/beq0_jump.txt +++ b/openvm-riscv/tests/apc_snapshots/superblocks/beq0_jump.txt @@ -54,4 +54,7 @@ mult=is_valid, args=[a__2_1, a__3_1, 0, 0] (30720 * a__0_1 + 7864320 * a__1_1 - (30720 * writes_aux__prev_data__0_1 + 7864320 * writes_aux__prev_data__1_1 + 30720 * is_valid)) * (30720 * a__0_1 + 7864320 * a__1_1 - (30720 * writes_aux__prev_data__0_1 + 7864320 * writes_aux__prev_data__1_1 + 30721)) = 0 (120 * a__0_1 + 30720 * a__1_1 + 7864320 * a__2_1 - (120 * writes_aux__prev_data__0_1 + 30720 * writes_aux__prev_data__1_1 + 7864320 * writes_aux__prev_data__2_1 + 120 * is_valid)) * (120 * a__0_1 + 30720 * a__1_1 + 7864320 * a__2_1 - (120 * writes_aux__prev_data__0_1 + 30720 * writes_aux__prev_data__1_1 + 7864320 * writes_aux__prev_data__2_1 + 121)) = 0 (943718400 * writes_aux__prev_data__0_1 + 120 * a__1_1 + 30720 * a__2_1 + 7864320 * a__3_1 + 943718400 * is_valid - (120 * writes_aux__prev_data__1_1 + 30720 * writes_aux__prev_data__2_1 + 7864320 * writes_aux__prev_data__3_1 + 943718400 * a__0_1)) * (943718400 * writes_aux__prev_data__0_1 + 120 * a__1_1 + 30720 * a__2_1 + 7864320 * a__3_1 + 943718399 - (120 * writes_aux__prev_data__1_1 + 30720 * writes_aux__prev_data__2_1 + 7864320 * writes_aux__prev_data__3_1 + 943718400 * a__0_1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/superblocks/beq_fallthrough.txt b/openvm-riscv/tests/apc_snapshots/superblocks/beq_fallthrough.txt index 08230d293b..c023ef2acb 100644 --- a/openvm-riscv/tests/apc_snapshots/superblocks/beq_fallthrough.txt +++ b/openvm-riscv/tests/apc_snapshots/superblocks/beq_fallthrough.txt @@ -71,4 +71,8 @@ mult=is_valid, args=[a__2_2, a__3_2, 0, 0] (120 * a__0_2 + 30720 * a__1_2 + 7864320 * a__2_2 - (120 * writes_aux__prev_data__0_2 + 30720 * writes_aux__prev_data__1_2 + 7864320 * writes_aux__prev_data__2_2 + 120 * is_valid)) * (120 * a__0_2 + 30720 * a__1_2 + 7864320 * a__2_2 - (120 * writes_aux__prev_data__0_2 + 30720 * writes_aux__prev_data__1_2 + 7864320 * writes_aux__prev_data__2_2 + 121)) = 0 (943718400 * writes_aux__prev_data__0_2 + 120 * a__1_2 + 30720 * a__2_2 + 7864320 * a__3_2 + 943718400 * is_valid - (120 * writes_aux__prev_data__1_2 + 30720 * writes_aux__prev_data__2_2 + 7864320 * writes_aux__prev_data__3_2 + 943718400 * a__0_2)) * (943718400 * writes_aux__prev_data__0_2 + 120 * a__1_2 + 30720 * a__2_2 + 7864320 * a__3_2 + 943718399 - (120 * writes_aux__prev_data__1_2 + 30720 * writes_aux__prev_data__2_2 + 7864320 * writes_aux__prev_data__3_2 + 943718400 * a__0_2)) = 0 free_var_103 * ((a__0_1 - 33) * (a__0_1 - 33) + a__1_1 + a__2_1 + a__3_1) - is_valid = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +free_var_103 (new) = QuotientOrZero(1, (a__0_1 - 33) * (a__0_1 - 33) + a__1_1 + a__2_1 + a__3_1) +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/superblocks/beq_jump.txt b/openvm-riscv/tests/apc_snapshots/superblocks/beq_jump.txt index eb5bb80fc9..066e0f4d0a 100644 --- a/openvm-riscv/tests/apc_snapshots/superblocks/beq_jump.txt +++ b/openvm-riscv/tests/apc_snapshots/superblocks/beq_jump.txt @@ -65,4 +65,7 @@ mult=is_valid, args=[a__2_2, a__3_2, 0, 0] (30720 * a__0_2 + 7864320 * a__1_2 - (30720 * writes_aux__prev_data__0_2 + 7864320 * writes_aux__prev_data__1_2 + 30720 * is_valid)) * (30720 * a__0_2 + 7864320 * a__1_2 - (30720 * writes_aux__prev_data__0_2 + 7864320 * writes_aux__prev_data__1_2 + 30721)) = 0 (120 * a__0_2 + 30720 * a__1_2 + 7864320 * a__2_2 - (120 * writes_aux__prev_data__0_2 + 30720 * writes_aux__prev_data__1_2 + 7864320 * writes_aux__prev_data__2_2 + 120 * is_valid)) * (120 * a__0_2 + 30720 * a__1_2 + 7864320 * a__2_2 - (120 * writes_aux__prev_data__0_2 + 30720 * writes_aux__prev_data__1_2 + 7864320 * writes_aux__prev_data__2_2 + 121)) = 0 (943718400 * writes_aux__prev_data__0_2 + 120 * a__1_2 + 30720 * a__2_2 + 7864320 * a__3_2 + 943718400 * is_valid - (120 * writes_aux__prev_data__1_2 + 30720 * writes_aux__prev_data__2_2 + 7864320 * writes_aux__prev_data__3_2 + 943718400 * a__0_2)) * (943718400 * writes_aux__prev_data__0_2 + 120 * a__1_2 + 30720 * a__2_2 + 7864320 * a__3_2 + 943718399 - (120 * writes_aux__prev_data__1_2 + 30720 * writes_aux__prev_data__2_2 + 7864320 * writes_aux__prev_data__3_2 + 943718400 * a__0_2)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/openvm-riscv/tests/apc_snapshots/superblocks/many_blocks.txt b/openvm-riscv/tests/apc_snapshots/superblocks/many_blocks.txt index 57bbb628e0..a1439fc819 100644 --- a/openvm-riscv/tests/apc_snapshots/superblocks/many_blocks.txt +++ b/openvm-riscv/tests/apc_snapshots/superblocks/many_blocks.txt @@ -83,4 +83,7 @@ mult=is_valid, args=[a__2_4, a__3_4, 0, 0] (30720 * a__0_4 + 7864320 * a__1_4 - (30720 * writes_aux__prev_data__0_4 + 7864320 * writes_aux__prev_data__1_4 + 30720 * is_valid)) * (30720 * a__0_4 + 7864320 * a__1_4 - (30720 * writes_aux__prev_data__0_4 + 7864320 * writes_aux__prev_data__1_4 + 30721)) = 0 (120 * a__0_4 + 30720 * a__1_4 + 7864320 * a__2_4 - (120 * writes_aux__prev_data__0_4 + 30720 * writes_aux__prev_data__1_4 + 7864320 * writes_aux__prev_data__2_4 + 120 * is_valid)) * (120 * a__0_4 + 30720 * a__1_4 + 7864320 * a__2_4 - (120 * writes_aux__prev_data__0_4 + 30720 * writes_aux__prev_data__1_4 + 7864320 * writes_aux__prev_data__2_4 + 121)) = 0 (943718400 * writes_aux__prev_data__0_4 + 120 * a__1_4 + 30720 * a__2_4 + 7864320 * a__3_4 + 943718400 * is_valid - (120 * writes_aux__prev_data__1_4 + 30720 * writes_aux__prev_data__2_4 + 7864320 * writes_aux__prev_data__3_4 + 943718400 * a__0_4)) * (943718400 * writes_aux__prev_data__0_4 + 120 * a__1_4 + 30720 * a__2_4 + 7864320 * a__3_4 + 943718399 - (120 * writes_aux__prev_data__1_4 + 30720 * writes_aux__prev_data__2_4 + 7864320 * writes_aux__prev_data__3_4 + 943718400 * a__0_4)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation.txt b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation.txt index 7f25fc145b..2f7bbba0ed 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation.txt @@ -5614,4 +5614,7 @@ lower_limb__0__2_111 * (lower_limb__0__2_111 - 1) = 0 (32512 * bitwise_operation__bitwise_operation__result__0_78 + 8323072 * bitwise_operation__bitwise_operation__result__1_78 - (16646145 * a__0__0_112 + 65024 * a__0__1_112)) * (32512 * bitwise_operation__bitwise_operation__result__0_78 + 8323072 * bitwise_operation__bitwise_operation__result__1_78 - (16646145 * a__0__0_112 + 65024 * a__0__1_112 + 1)) = 0 (127 * bitwise_operation__bitwise_operation__result__1_78 + 32512 * bitwise_operation__bitwise_operation__result__2_78 + 8323072 * bitwise_operation__bitwise_operation__result__3_78 + 32258 * a__0__0_112 - (1057030144 * bitwise_operation__bitwise_operation__result__0_78 + 16646145 * a__0__1_112 + 65024 * a__0__2_112)) * (127 * bitwise_operation__bitwise_operation__result__1_78 + 32512 * bitwise_operation__bitwise_operation__result__2_78 + 8323072 * bitwise_operation__bitwise_operation__result__3_78 + 32258 * a__0__0_112 - (1057030144 * bitwise_operation__bitwise_operation__result__0_78 + 16646145 * a__0__1_112 + 65024 * a__0__2_112 + 1)) = 0 (127 * bitwise_operation__bitwise_operation__result__3_78 + 32512 * bitwise_operation__bitwise_operation__result__4_78 + 8323072 * bitwise_operation__bitwise_operation__result__5_78 + 32258 * a__0__1_112 - (16129 * bitwise_operation__bitwise_operation__result__0_78 + 4129024 * bitwise_operation__bitwise_operation__result__1_78 + 1057030144 * bitwise_operation__bitwise_operation__result__2_78 + 1048772096 * a__0__0_112 + 16646145 * a__0__2_112 + 65024 * a__0__3_112)) * (127 * bitwise_operation__bitwise_operation__result__3_78 + 32512 * bitwise_operation__bitwise_operation__result__4_78 + 8323072 * bitwise_operation__bitwise_operation__result__5_78 + 32258 * a__0__1_112 - (16129 * bitwise_operation__bitwise_operation__result__0_78 + 4129024 * bitwise_operation__bitwise_operation__result__1_78 + 1057030144 * bitwise_operation__bitwise_operation__result__2_78 + 1048772096 * a__0__0_112 + 16646145 * a__0__2_112 + 65024 * a__0__3_112 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_initial_stores.txt b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_initial_stores.txt index 43adb2305b..951e702f0a 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_initial_stores.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_initial_stores.txt @@ -319,4 +319,7 @@ address_operation__top_two_limb_inv_6 * (address_operation__addr_operation__valu memory_access__access_timestamp__compare_low_6 * (memory_access__access_timestamp__compare_low_6 - 1) = 0 memory_access__access_timestamp__compare_low_6 * (state__clk_high_0 - memory_access__access_timestamp__prev_high_6) = 0 memory_access__access_timestamp__compare_low_6 * (65536 * state__clk_16_24_0 + state__clk_0_16_0 + 49) + (1 - memory_access__access_timestamp__compare_low_6) * state__clk_high_0 + (memory_access__access_timestamp__compare_low_6 - 1) * memory_access__access_timestamp__prev_high_6 - (memory_access__access_timestamp__compare_low_6 * memory_access__access_timestamp__prev_low_6 + memory_access__access_timestamp__diff_low_limb_6 + 65536 * memory_access__access_timestamp__diff_high_limb_6 + is_valid) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_rot63.txt b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_rot63.txt index fefd8933e2..b97d444363 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_rot63.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_rot63.txt @@ -92,4 +92,7 @@ a__0__0_0 * (a__0__0_0 - 1) = 0 (32512 * a__0__1_1 - (16646145 * adapter__op_b_memory__prev_value__0__0_0 + 65024 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * a__0__0_1)) * (32512 * a__0__1_1 - (16646145 * adapter__op_b_memory__prev_value__0__0_0 + 65024 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * a__0__0_1 + 1)) = 0 (32258 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * a__0__2_1 - (16646145 * adapter__op_b_memory__prev_value__0__1_0 + 65024 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * a__0__0_1 + 1057030144 * a__0__1_1)) * (32258 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * a__0__2_1 - (16646145 * adapter__op_b_memory__prev_value__0__1_0 + 65024 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * a__0__0_1 + 1057030144 * a__0__1_1 + 1)) = 0 (32258 * adapter__op_b_memory__prev_value__0__1_0 + 524386048 * a__0__0_1 + 32512 * a__0__3_1 - (1048772096 * adapter__op_b_memory__prev_value__0__0_0 + 16646145 * adapter__op_b_memory__prev_value__0__2_0 + 65024 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * a__0__1_1 + 1057030144 * a__0__2_1)) * (32258 * adapter__op_b_memory__prev_value__0__1_0 + 524386048 * a__0__0_1 + 32512 * a__0__3_1 - (1048772096 * adapter__op_b_memory__prev_value__0__0_0 + 16646145 * adapter__op_b_memory__prev_value__0__2_0 + 65024 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * a__0__1_1 + 1057030144 * a__0__2_1 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_xor_chain.txt b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_xor_chain.txt index 1345e863f8..a30f7f33db 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_xor_chain.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/keccak_permutation_xor_chain.txt @@ -196,4 +196,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 32, 16, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/memory_optimizer.txt b/sp1-benchmarks/tests/apc_snapshots/complex/memory_optimizer.txt index 9158bfad3d..54313eb504 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/memory_optimizer.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/memory_optimizer.txt @@ -57,4 +57,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (32512 * add_operation__value__0__1_1 - (16646145 * adapter__op_b_memory__prev_value__0__0_0 + 65024 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * add_operation__value__0__0_1)) * (32512 * add_operation__value__0__1_1 - (16646145 * adapter__op_b_memory__prev_value__0__0_0 + 65024 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * add_operation__value__0__0_1 + 1)) = 0 (32258 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * add_operation__value__0__2_1 - (16646145 * adapter__op_b_memory__prev_value__0__1_0 + 65024 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * add_operation__value__0__0_1 + 1057030144 * add_operation__value__0__1_1)) * (32258 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * add_operation__value__0__2_1 - (16646145 * adapter__op_b_memory__prev_value__0__1_0 + 65024 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * add_operation__value__0__0_1 + 1057030144 * add_operation__value__0__1_1 + 1)) = 0 (32258 * adapter__op_b_memory__prev_value__0__1_0 + 524386048 * add_operation__value__0__0_1 + 32512 * add_operation__value__0__3_1 - (1048772096 * adapter__op_b_memory__prev_value__0__0_0 + 16646145 * adapter__op_b_memory__prev_value__0__2_0 + 65024 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * add_operation__value__0__1_1 + 1057030144 * add_operation__value__0__2_1)) * (32258 * adapter__op_b_memory__prev_value__0__1_0 + 524386048 * add_operation__value__0__0_1 + 32512 * add_operation__value__0__3_1 - (1048772096 * adapter__op_b_memory__prev_value__0__0_0 + 16646145 * adapter__op_b_memory__prev_value__0__2_0 + 65024 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * add_operation__value__0__1_1 + 1057030144 * add_operation__value__0__2_1 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/stack_accesses.txt b/sp1-benchmarks/tests/apc_snapshots/complex/stack_accesses.txt index ce18c89330..9d05fea90c 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/stack_accesses.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/stack_accesses.txt @@ -117,4 +117,7 @@ memory_access__access_timestamp__compare_low_1 * (memory_access__access_timestam memory_access__access_timestamp__compare_low_1 * (state__clk_high_0 - memory_access__access_timestamp__prev_high_1) = 0 memory_access__access_timestamp__compare_low_1 * (65536 * state__clk_16_24_0 + state__clk_0_16_0 + 9) + (1 - memory_access__access_timestamp__compare_low_1) * state__clk_high_0 + (memory_access__access_timestamp__compare_low_1 - 1) * memory_access__access_timestamp__prev_high_1 - (memory_access__access_timestamp__compare_low_1 * memory_access__access_timestamp__prev_low_1 + memory_access__access_timestamp__diff_low_limb_1 + 65536 * memory_access__access_timestamp__diff_high_limb_1 + is_valid) = 0 address_operation__top_two_limb_inv_2 * (address_operation__addr_operation__value__1_1 + address_operation__addr_operation__value__2_1) - is_valid = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/complex/two_ld.txt b/sp1-benchmarks/tests/apc_snapshots/complex/two_ld.txt index 87541c4a19..6ff8f1d8ec 100644 --- a/sp1-benchmarks/tests/apc_snapshots/complex/two_ld.txt +++ b/sp1-benchmarks/tests/apc_snapshots/complex/two_ld.txt @@ -91,4 +91,7 @@ address_operation__top_two_limb_inv_1 * (address_operation__addr_operation__valu memory_access__access_timestamp__compare_low_1 * (memory_access__access_timestamp__compare_low_1 - 1) = 0 memory_access__access_timestamp__compare_low_1 * (state__clk_high_0 - memory_access__access_timestamp__prev_high_1) = 0 memory_access__access_timestamp__compare_low_1 * (65536 * state__clk_16_24_0 + state__clk_0_16_0 + 9) + (1 - memory_access__access_timestamp__compare_low_1) * state__clk_high_0 + (memory_access__access_timestamp__compare_low_1 - 1) * memory_access__access_timestamp__prev_high_1 - (memory_access__access_timestamp__compare_low_1 * memory_access__access_timestamp__prev_low_1 + memory_access__access_timestamp__diff_low_limb_1 + 65536 * memory_access__access_timestamp__diff_high_limb_1 + is_valid) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/beqz.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/beqz.txt index c2713a5c53..d34aaf334a 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/beqz.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/beqz.txt @@ -65,4 +65,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 66324482) * (524386048 * next_pc__ (is_valid - is_branching_0) * ((1057030144 * next_pc__0_0 + 33292290) * (1057030144 * next_pc__0_0 + 33292291)) = 0 (is_valid - is_branching_0) * ((64516 - 16129 * next_pc__0_0) * (64515 - 16129 * next_pc__0_0)) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241) * (524386048 * next_pc__0_0 + 33162240)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgez.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgez.txt index e100051cd6..13484e9d71 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgez.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgez.txt @@ -71,4 +71,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 66324482) * (524386048 * next_pc__ (is_valid - is_branching_0) * ((1057030144 * next_pc__0_0 + 33292290) * (1057030144 * next_pc__0_0 + 33292291)) = 0 (is_valid - is_branching_0) * ((64516 - 16129 * next_pc__0_0) * (64515 - 16129 * next_pc__0_0)) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241) * (524386048 * next_pc__0_0 + 33162240)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgtz.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgtz.txt index db6e6bd629..a7348fca71 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgtz.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bgtz.txt @@ -71,4 +71,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 66324482) * (524386048 * next_pc__ (is_valid - is_branching_0) * ((1057030144 * next_pc__0_0 + 33292290) * (1057030144 * next_pc__0_0 + 33292291)) = 0 (is_valid - is_branching_0) * ((64516 - 16129 * next_pc__0_0) * (64515 - 16129 * next_pc__0_0)) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241) * (524386048 * next_pc__0_0 + 33162240)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/blez.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/blez.txt index 3b0f56d04b..fd6467e981 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/blez.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/blez.txt @@ -71,4 +71,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 66324482) * (524386048 * next_pc__ (is_valid - is_branching_0) * ((1057030144 * next_pc__0_0 + 33292290) * (1057030144 * next_pc__0_0 + 33292291)) = 0 (is_valid - is_branching_0) * ((64516 - 16129 * next_pc__0_0) * (64515 - 16129 * next_pc__0_0)) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241) * (524386048 * next_pc__0_0 + 33162240)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bltz.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bltz.txt index 3772f67c85..4ccacb85e1 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bltz.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bltz.txt @@ -71,4 +71,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 66324482) * (524386048 * next_pc__ (is_valid - is_branching_0) * ((1057030144 * next_pc__0_0 + 33292290) * (1057030144 * next_pc__0_0 + 33292291)) = 0 (is_valid - is_branching_0) * ((64516 - 16129 * next_pc__0_0) * (64515 - 16129 * next_pc__0_0)) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241) * (524386048 * next_pc__0_0 + 33162240)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bnez.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bnez.txt index 438031dafb..3f13faafc1 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bnez.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/bnez.txt @@ -65,4 +65,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 66324482) * (524386048 * next_pc__ (is_valid - is_branching_0) * ((1057030144 * next_pc__0_0 + 33292290) * (1057030144 * next_pc__0_0 + 33292291)) = 0 (is_valid - is_branching_0) * ((64516 - 16129 * next_pc__0_0) * (64515 - 16129 * next_pc__0_0)) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241) * (524386048 * next_pc__0_0 + 33162240)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/j.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/j.txt index c5fb9b1070..87373fe7df 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/j.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/j.txt @@ -28,4 +28,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 0, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/jr.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/jr.txt index b3a319de58..d6b4ac8555 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/jr.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/jr.txt @@ -38,4 +38,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, adapter__op_b_memory__prev_value__0__0_0, adapter__op_b_memory__prev_value__0__1_0, adapter__op_b_memory__prev_value__0__2_0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/mv.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/mv.txt index 7cab5b42bf..fe13659a15 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/mv.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/mv.txt @@ -42,4 +42,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/neg.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/neg.txt index e16e42c5c2..4f1bd99be1 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/neg.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/neg.txt @@ -59,4 +59,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (32512 * adapter__op_c_memory__prev_value__0__1_0 + 32512 * sub_operation__value__0__1_0 + 1 - (1057030144 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * sub_operation__value__0__0_0)) * (32512 * adapter__op_c_memory__prev_value__0__1_0 + 32512 * sub_operation__value__0__1_0 - (1057030144 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * sub_operation__value__0__0_0)) = 0 (32512 * adapter__op_c_memory__prev_value__0__2_0 + 32512 * sub_operation__value__0__2_0 + 1 - (16129 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__1_0 + 16129 * sub_operation__value__0__0_0 + 1057030144 * sub_operation__value__0__1_0)) * (32512 * adapter__op_c_memory__prev_value__0__2_0 + 32512 * sub_operation__value__0__2_0 - (16129 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__1_0 + 16129 * sub_operation__value__0__0_0 + 1057030144 * sub_operation__value__0__1_0)) = 0 (524386048 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__3_0 + 524386048 * sub_operation__value__0__0_0 + 32512 * sub_operation__value__0__3_0 + 1 - (16129 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__2_0 + 16129 * sub_operation__value__0__1_0 + 1057030144 * sub_operation__value__0__2_0)) * (524386048 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__3_0 + 524386048 * sub_operation__value__0__0_0 + 32512 * sub_operation__value__0__3_0 - (16129 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__2_0 + 16129 * sub_operation__value__0__1_0 + 1057030144 * sub_operation__value__0__2_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/not.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/not.txt index 9339efe4ee..3e6572667f 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/not.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/not.txt @@ -50,4 +50,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/ret.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/ret.txt index f61cf98109..7a893c20a6 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/ret.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/ret.txt @@ -38,4 +38,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, adapter__op_b_memory__prev_value__0__0_0, adapter__op_b_memory__prev_value__0__1_0, adapter__op_b_memory__prev_value__0__2_0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/seqz.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/seqz.txt index 17941d5a39..9eb40db089 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/seqz.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/seqz.txt @@ -62,4 +62,7 @@ lt_operation__result__u16_flags__3_0 * (lt_operation__result__u16_flags__3_0 - 1 adapter__op_b_memory__prev_value__0__3_0 * lt_operation__result__u16_flags__3_0 + adapter__op_b_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_b_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_b_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__0_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * (lt_operation__result__comparison_limbs__0_0 - lt_operation__result__u16_flags__0_0) - 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sgtz.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sgtz.txt index 6fe6d46c4c..e3026c3ce7 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sgtz.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sgtz.txt @@ -70,4 +70,7 @@ lt_operation__result__u16_flags__3_0 * (lt_operation__result__u16_flags__3_0 - 1 (adapter__op_c_memory__prev_value__0__3_0 + 32768 - 65536 * lt_operation__c_msb__msb_0) * lt_operation__result__u16_flags__3_0 + adapter__op_c_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_c_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_c_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__1_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * (32768 * lt_operation__result__u16_flags__3_0 - lt_operation__result__comparison_limbs__1_0) - 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sltz.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sltz.txt index 8aafe0983f..591c2f285a 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sltz.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/sltz.txt @@ -70,4 +70,7 @@ lt_operation__result__u16_flags__3_0 * (lt_operation__result__u16_flags__3_0 - 1 (adapter__op_b_memory__prev_value__0__3_0 + 32768 - 65536 * lt_operation__b_msb__msb_0) * lt_operation__result__u16_flags__3_0 + adapter__op_b_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_b_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_b_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__0_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * (lt_operation__result__comparison_limbs__0_0 - 32768 * lt_operation__result__u16_flags__3_0) - 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/snez.txt b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/snez.txt index b1eb13b35f..19a05c7765 100644 --- a/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/snez.txt +++ b/sp1-benchmarks/tests/apc_snapshots/pseudo_instructions/snez.txt @@ -67,4 +67,7 @@ lt_operation__result__u16_flags__3_0 * (lt_operation__result__u16_flags__3_0 - 1 adapter__op_c_memory__prev_value__0__3_0 * lt_operation__result__u16_flags__3_0 + adapter__op_c_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_c_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_c_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__1_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * lt_operation__result__comparison_limbs__1_0 + 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/add.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/add.txt index cc556363c6..1fc613bdac 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/add.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/add.txt @@ -63,4 +63,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (1057030144 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * add_operation__value__0__1_0 - (32512 * adapter__op_b_memory__prev_value__0__1_0 + 32512 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * add_operation__value__0__0_0)) * (1057030144 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * add_operation__value__0__1_0 - (32512 * adapter__op_b_memory__prev_value__0__1_0 + 32512 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * add_operation__value__0__0_0 + 1)) = 0 (16129 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_b_memory__prev_value__0__1_0 + 16129 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__1_0 + 32512 * add_operation__value__0__2_0 - (32512 * adapter__op_b_memory__prev_value__0__2_0 + 32512 * adapter__op_c_memory__prev_value__0__2_0 + 16129 * add_operation__value__0__0_0 + 1057030144 * add_operation__value__0__1_0)) * (16129 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_b_memory__prev_value__0__1_0 + 16129 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__1_0 + 32512 * add_operation__value__0__2_0 - (32512 * adapter__op_b_memory__prev_value__0__2_0 + 32512 * adapter__op_c_memory__prev_value__0__2_0 + 16129 * add_operation__value__0__0_0 + 1057030144 * add_operation__value__0__1_0 + 1)) = 0 (16129 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__2_0 + 524386048 * add_operation__value__0__0_0 + 32512 * add_operation__value__0__3_0 - (524386048 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_b_memory__prev_value__0__3_0 + 524386048 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__3_0 + 16129 * add_operation__value__0__1_0 + 1057030144 * add_operation__value__0__2_0)) * (16129 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__2_0 + 524386048 * add_operation__value__0__0_0 + 32512 * add_operation__value__0__3_0 - (524386048 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_b_memory__prev_value__0__3_0 + 524386048 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__3_0 + 16129 * add_operation__value__0__1_0 + 1057030144 * add_operation__value__0__2_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/addi.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/addi.txt index 900a3c88b6..b4608bd85d 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/addi.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/addi.txt @@ -38,4 +38,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/and.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/and.txt index 3da438c500..819c2619cd 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/and.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/and.txt @@ -75,4 +75,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/auipc.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/auipc.txt index 9d3529b572..705916ed50 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/auipc.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/auipc.txt @@ -32,4 +32,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/beq.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/beq.txt index 5b99df98aa..00d2adfa3d 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/beq.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/beq.txt @@ -78,4 +78,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 829056025 - (16129 * next_pc__1_0 (is_valid - is_branching_0) * ((32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292290)) * (32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292291))) = 0 (is_valid - is_branching_0) * ((32512 * next_pc__2_0 + 64516 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0)) * (32512 * next_pc__2_0 + 64515 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0))) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0)) * (524386048 * next_pc__0_0 + 33162240 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0))) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bge.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bge.txt index b72424ab7c..3d5cb47658 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bge.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bge.txt @@ -84,4 +84,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 829056025 - (16129 * next_pc__1_0 (is_valid - is_branching_0) * ((32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292290)) * (32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292291))) = 0 (is_valid - is_branching_0) * ((32512 * next_pc__2_0 + 64516 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0)) * (32512 * next_pc__2_0 + 64515 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0))) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0)) * (524386048 * next_pc__0_0 + 33162240 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0))) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bgeu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bgeu.txt index 95eb9104dd..f03abf6ffb 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bgeu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bgeu.txt @@ -78,4 +78,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 829056025 - (16129 * next_pc__1_0 (is_valid - is_branching_0) * ((32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292290)) * (32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292291))) = 0 (is_valid - is_branching_0) * ((32512 * next_pc__2_0 + 64516 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0)) * (32512 * next_pc__2_0 + 64515 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0))) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0)) * (524386048 * next_pc__0_0 + 33162240 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0))) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/blt.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/blt.txt index b33f90e3d4..96e3f1edeb 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/blt.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/blt.txt @@ -84,4 +84,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 829056025 - (16129 * next_pc__1_0 (is_valid - is_branching_0) * ((32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292290)) * (32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292291))) = 0 (is_valid - is_branching_0) * ((32512 * next_pc__2_0 + 64516 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0)) * (32512 * next_pc__2_0 + 64515 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0))) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0)) * (524386048 * next_pc__0_0 + 33162240 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0))) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bltu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bltu.txt index 2a204a89bc..0385f10202 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bltu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bltu.txt @@ -78,4 +78,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 829056025 - (16129 * next_pc__1_0 (is_valid - is_branching_0) * ((32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292290)) * (32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292291))) = 0 (is_valid - is_branching_0) * ((32512 * next_pc__2_0 + 64516 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0)) * (32512 * next_pc__2_0 + 64515 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0))) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0)) * (524386048 * next_pc__0_0 + 33162240 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0))) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bne.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bne.txt index 1870d126ad..5c870ac55a 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/bne.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/bne.txt @@ -78,4 +78,7 @@ is_branching_0 * ((524386048 * next_pc__0_0 + 829056025 - (16129 * next_pc__1_0 (is_valid - is_branching_0) * ((32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292290)) * (32512 * next_pc__1_0 - (1057030144 * next_pc__0_0 + 33292291))) = 0 (is_valid - is_branching_0) * ((32512 * next_pc__2_0 + 64516 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0)) * (32512 * next_pc__2_0 + 64515 - (16129 * next_pc__0_0 + 1057030144 * next_pc__1_0))) = 0 (is_valid - is_branching_0) * ((524386048 * next_pc__0_0 + 33162241 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0)) * (524386048 * next_pc__0_0 + 33162240 - (16129 * next_pc__1_0 + 1057030144 * next_pc__2_0))) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/div.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/div.txt index 4a2b9a1176..a965f223c6 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/div.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/div.txt @@ -484,4 +484,7 @@ b_not_neg_not_overflow_0 * (b_not_neg_not_overflow_0 - 1) = 0 (1 - is_valid) * rem_msb__msb_0 = 0 (1 - is_valid) * rem_msb__msb_0 = 0 (1 - is_valid) * rem_msb__msb_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/divu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/divu.txt index ab894d1010..0b7487f989 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/divu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/divu.txt @@ -380,4 +380,7 @@ rem_msb__msb_0 * (rem_msb__msb_0 - 1) = 0 (524386048 * adapter__op_b_memory__prev_value__0__2_0 + 260144641 * remainder_comp__0__0_0 + 1057022143 * remainder_comp__0__1_0 + 16129 * remainder_comp__0__3_0 + 260144641 * c_times_quotient__0_0 + 1057022143 * c_times_quotient__1_0 + 16129 * c_times_quotient__3_0 + 1057030144 * c_times_quotient__4_0 - (260144641 * adapter__op_b_memory__prev_value__0__0_0 + 1057022143 * adapter__op_b_memory__prev_value__0__1_0 + 16129 * adapter__op_b_memory__prev_value__0__3_0 + 524386048 * remainder_comp__0__2_0 + 524386048 * c_times_quotient__2_0 + 32512 * c_times_quotient__5_0)) * (524386048 * adapter__op_b_memory__prev_value__0__2_0 + 260144641 * remainder_comp__0__0_0 + 1057022143 * remainder_comp__0__1_0 + 16129 * remainder_comp__0__3_0 + 260144641 * c_times_quotient__0_0 + 1057022143 * c_times_quotient__1_0 + 16129 * c_times_quotient__3_0 + 1057030144 * c_times_quotient__4_0 - (260144641 * adapter__op_b_memory__prev_value__0__0_0 + 1057022143 * adapter__op_b_memory__prev_value__0__1_0 + 16129 * adapter__op_b_memory__prev_value__0__3_0 + 524386048 * remainder_comp__0__2_0 + 524386048 * c_times_quotient__2_0 + 32512 * c_times_quotient__5_0 + 1)) = 0 (1048735615 * adapter__op_b_memory__prev_value__0__0_0 + 524386048 * adapter__op_b_memory__prev_value__0__3_0 + 260144641 * remainder_comp__0__1_0 + 1057022143 * remainder_comp__0__2_0 + 260144641 * c_times_quotient__1_0 + 1057022143 * c_times_quotient__2_0 + 16129 * c_times_quotient__4_0 + 1057030144 * c_times_quotient__5_0 - (260144641 * adapter__op_b_memory__prev_value__0__1_0 + 1057022143 * adapter__op_b_memory__prev_value__0__2_0 + 1048735615 * remainder_comp__0__0_0 + 524386048 * remainder_comp__0__3_0 + 1048735615 * c_times_quotient__0_0 + 524386048 * c_times_quotient__3_0 + 32512 * c_times_quotient__6_0)) * (1048735615 * adapter__op_b_memory__prev_value__0__0_0 + 524386048 * adapter__op_b_memory__prev_value__0__3_0 + 260144641 * remainder_comp__0__1_0 + 1057022143 * remainder_comp__0__2_0 + 260144641 * c_times_quotient__1_0 + 1057022143 * c_times_quotient__2_0 + 16129 * c_times_quotient__4_0 + 1057030144 * c_times_quotient__5_0 - (260144641 * adapter__op_b_memory__prev_value__0__1_0 + 1057022143 * adapter__op_b_memory__prev_value__0__2_0 + 1048735615 * remainder_comp__0__0_0 + 524386048 * remainder_comp__0__3_0 + 1048735615 * c_times_quotient__0_0 + 524386048 * c_times_quotient__3_0 + 32512 * c_times_quotient__6_0 + 1)) = 0 (1048735615 * adapter__op_b_memory__prev_value__0__1_0 + 927974014 * remainder_comp__0__0_0 + 260144641 * remainder_comp__0__2_0 + 1057022143 * remainder_comp__0__3_0 + 927974014 * c_times_quotient__0_0 + 260144641 * c_times_quotient__2_0 + 1057022143 * c_times_quotient__3_0 + 16129 * c_times_quotient__5_0 + 1057030144 * c_times_quotient__6_0 - (927974014 * adapter__op_b_memory__prev_value__0__0_0 + 260144641 * adapter__op_b_memory__prev_value__0__2_0 + 1057022143 * adapter__op_b_memory__prev_value__0__3_0 + 1048735615 * remainder_comp__0__1_0 + 1048735615 * c_times_quotient__1_0 + 524386048 * c_times_quotient__4_0 + 32512 * c_times_quotient__7_0)) * (1048735615 * adapter__op_b_memory__prev_value__0__1_0 + 927974014 * remainder_comp__0__0_0 + 260144641 * remainder_comp__0__2_0 + 1057022143 * remainder_comp__0__3_0 + 927974014 * c_times_quotient__0_0 + 260144641 * c_times_quotient__2_0 + 1057022143 * c_times_quotient__3_0 + 16129 * c_times_quotient__5_0 + 1057030144 * c_times_quotient__6_0 - (927974014 * adapter__op_b_memory__prev_value__0__0_0 + 260144641 * adapter__op_b_memory__prev_value__0__2_0 + 1057022143 * adapter__op_b_memory__prev_value__0__3_0 + 1048735615 * remainder_comp__0__1_0 + 1048735615 * c_times_quotient__1_0 + 524386048 * c_times_quotient__4_0 + 32512 * c_times_quotient__7_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/jal.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/jal.txt index 2b42c345aa..3a071c9ab0 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/jal.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/jal.txt @@ -32,4 +32,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 0, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/jalr.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/jalr.txt index 9a0fc7873a..7ff1e4eaa8 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/jalr.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/jalr.txt @@ -53,4 +53,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (1057030144 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * add_operation__value__0__1_0 - (32512 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * add_operation__value__0__0_0 + 832307250 * is_valid)) * (1057030144 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * add_operation__value__0__1_0 - (32512 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * add_operation__value__0__0_0 + 832307251)) = 0 (16129 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_b_memory__prev_value__0__1_0 + 32512 * add_operation__value__0__2_0 + 1612900 * is_valid - (32512 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * add_operation__value__0__0_0 + 1057030144 * add_operation__value__0__1_0)) * (16129 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_b_memory__prev_value__0__1_0 + 32512 * add_operation__value__0__2_0 + 1612899 - (32512 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * add_operation__value__0__0_0 + 1057030144 * add_operation__value__0__1_0)) = 0 (16129 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_b_memory__prev_value__0__2_0 + 524386048 * add_operation__value__0__0_0 + 829056025 * is_valid - (524386048 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * add_operation__value__0__1_0 + 1057030144 * add_operation__value__0__2_0)) * (16129 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_b_memory__prev_value__0__2_0 + 524386048 * add_operation__value__0__0_0 + 829056024 - (524386048 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * add_operation__value__0__1_0 + 1057030144 * add_operation__value__0__2_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lb.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lb.txt index ecfd16a18a..b1602bd44c 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lb.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lb.txt @@ -87,4 +87,7 @@ offset_bit__1_0 * ((offset_bit__2_0 - 1) * (selected_limb_0 - memory_access__pre (offset_bit__1_0 - 1) * (offset_bit__2_0 * (selected_limb_0 - memory_access__prev_value__0__2_0)) = 0 offset_bit__1_0 * (offset_bit__2_0 * (selected_limb_0 - memory_access__prev_value__0__3_0)) = 0 (offset_bit__0_0 - 1) * selected_limb_low_byte_0 + selected_byte_0 - offset_bit__0_0 * (8323072 * selected_limb_low_byte_0 - 8323072 * selected_limb_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lbu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lbu.txt index 2030716158..e33a2894b7 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lbu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lbu.txt @@ -85,4 +85,7 @@ offset_bit__1_0 * ((offset_bit__2_0 - 1) * (selected_limb_0 - memory_access__pre (offset_bit__1_0 - 1) * (offset_bit__2_0 * (selected_limb_0 - memory_access__prev_value__0__2_0)) = 0 offset_bit__1_0 * (offset_bit__2_0 * (selected_limb_0 - memory_access__prev_value__0__3_0)) = 0 (offset_bit__0_0 - 1) * selected_limb_low_byte_0 + selected_byte_0 - offset_bit__0_0 * (8323072 * selected_limb_low_byte_0 - 8323072 * selected_limb_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lh.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lh.txt index 71620a1bcc..8fe3c607ad 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lh.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lh.txt @@ -82,4 +82,7 @@ offset_bit__0_0 * ((offset_bit__1_0 - 1) * (selected_half_0 - memory_access__pre (offset_bit__0_0 - 1) * (offset_bit__1_0 * (selected_half_0 - memory_access__prev_value__0__2_0)) = 0 offset_bit__0_0 * (offset_bit__1_0 * (selected_half_0 - memory_access__prev_value__0__3_0)) = 0 msb__msb_0 * (msb__msb_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lhu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lhu.txt index 4cb6e9538b..edd134b303 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lhu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lhu.txt @@ -79,4 +79,7 @@ memory_access__access_timestamp__compare_low_0 * (65536 * state__clk_16_24_0 + s offset_bit__0_0 * ((offset_bit__1_0 - 1) * (selected_half_0 - memory_access__prev_value__0__1_0)) = 0 (offset_bit__0_0 - 1) * (offset_bit__1_0 * (selected_half_0 - memory_access__prev_value__0__2_0)) = 0 offset_bit__0_0 * (offset_bit__1_0 * (selected_half_0 - memory_access__prev_value__0__3_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lui.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lui.txt index 6e18b5f713..428fcd363f 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lui.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lui.txt @@ -32,4 +32,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lw.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lw.txt index ebc012b917..4b10730381 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/lw.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/lw.txt @@ -81,4 +81,7 @@ memory_access__access_timestamp__compare_low_0 * (65536 * state__clk_16_24_0 + s offset_bit_0 * (selected_word__0_0 - memory_access__prev_value__0__2_0) = 0 offset_bit_0 * (selected_word__1_0 - memory_access__prev_value__0__3_0) = 0 msb__msb_0 * (msb__msb_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mul.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mul.txt index 6ecd9b3667..34d53a438c 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mul.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mul.txt @@ -142,4 +142,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (8323072 * adapter__op_b_memory__prev_value__0__3_0 - 8323072 * mul_operation__b_lower_byte__low_bytes__3_0) * (8323072 * mul_operation__c_lower_byte__low_bytes__3_0 - 8323072 * adapter__op_c_memory__prev_value__0__3_0) + 256 * mul_operation__carry__14_0 + mul_operation__product__14_0 - mul_operation__carry__13_0 = 0 mul_operation__b_msb_0 * (mul_operation__b_msb_0 - 1) = 0 mul_operation__c_msb_0 * (mul_operation__c_msb_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulh.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulh.txt index 4a8fae8c94..652ea795c4 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulh.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulh.txt @@ -144,4 +144,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (8323072 * adapter__op_b_memory__prev_value__0__0_0 - 8323072 * mul_operation__b_lower_byte__low_bytes__0_0) * (255 * mul_operation__c_msb_0) + (8323072 * adapter__op_b_memory__prev_value__0__1_0 - 8323072 * mul_operation__b_lower_byte__low_bytes__1_0) * (255 * mul_operation__c_msb_0) + (8323072 * adapter__op_b_memory__prev_value__0__2_0 - 8323072 * mul_operation__b_lower_byte__low_bytes__2_0) * (255 * mul_operation__c_msb_0) + (8323072 * adapter__op_b_memory__prev_value__0__3_0 - 8323072 * mul_operation__b_lower_byte__low_bytes__3_0) * (255 * mul_operation__c_msb_0) + 256 * mul_operation__carry__15_0 + 8323072 * mul_operation__product__14_0 - (mul_operation__b_lower_byte__low_bytes__0_0 * (255 * mul_operation__c_msb_0) + mul_operation__b_lower_byte__low_bytes__1_0 * (255 * mul_operation__c_msb_0) + mul_operation__b_lower_byte__low_bytes__2_0 * (255 * mul_operation__c_msb_0) + mul_operation__b_lower_byte__low_bytes__3_0 * (255 * mul_operation__c_msb_0) + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__3_0 - 8323072 * adapter__op_c_memory__prev_value__0__3_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__3_0 + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__2_0 - 8323072 * adapter__op_c_memory__prev_value__0__2_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__2_0 + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__1_0 - 8323072 * adapter__op_c_memory__prev_value__0__1_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__1_0 + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__0_0 - 8323072 * adapter__op_c_memory__prev_value__0__0_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__0_0 + 8323072 * a__0__3_0 + mul_operation__carry__14_0) = 0 mul_operation__b_msb_0 * (mul_operation__b_msb_0 - 1) = 0 mul_operation__c_msb_0 * (mul_operation__c_msb_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhsu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhsu.txt index 719bc576a0..7a7ee86be7 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhsu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhsu.txt @@ -144,4 +144,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ 256 * mul_operation__carry__15_0 + 8323072 * mul_operation__product__14_0 - (255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__3_0 - 8323072 * adapter__op_c_memory__prev_value__0__3_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__3_0 + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__2_0 - 8323072 * adapter__op_c_memory__prev_value__0__2_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__2_0 + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__1_0 - 8323072 * adapter__op_c_memory__prev_value__0__1_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__1_0 + 255 * mul_operation__b_msb_0 * (8323072 * mul_operation__c_lower_byte__low_bytes__0_0 - 8323072 * adapter__op_c_memory__prev_value__0__0_0) + 255 * mul_operation__b_msb_0 * mul_operation__c_lower_byte__low_bytes__0_0 + 8323072 * a__0__3_0 + mul_operation__carry__14_0) = 0 mul_operation__b_msb_0 * (mul_operation__b_msb_0 - 1) = 0 mul_operation__c_msb_0 * (mul_operation__c_msb_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhu.txt index 8dae1d2ab1..acea59eb9a 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/mulhu.txt @@ -142,4 +142,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (8323072 * adapter__op_b_memory__prev_value__0__3_0 - 8323072 * mul_operation__b_lower_byte__low_bytes__3_0) * (8323072 * mul_operation__c_lower_byte__low_bytes__3_0 - 8323072 * adapter__op_c_memory__prev_value__0__3_0) + a__0__3_0 + 65536 * mul_operation__carry__15_0 - mul_operation__carry__13_0 = 0 mul_operation__b_msb_0 * (mul_operation__b_msb_0 - 1) = 0 mul_operation__c_msb_0 * (mul_operation__c_msb_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/or.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/or.txt index 0cb6e84eef..7d279b2cc1 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/or.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/or.txt @@ -75,4 +75,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/rem.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/rem.txt index e369082148..2f0ee94720 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/rem.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/rem.txt @@ -484,4 +484,7 @@ b_not_neg_not_overflow_0 * (b_not_neg_not_overflow_0 - 1) = 0 (1 - is_valid) * rem_msb__msb_0 = 0 (1 - is_valid) * rem_msb__msb_0 = 0 (1 - is_valid) * rem_msb__msb_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/remu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/remu.txt index 6b8f4cb628..622f9053b9 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/remu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/remu.txt @@ -380,4 +380,7 @@ rem_msb__msb_0 * (rem_msb__msb_0 - 1) = 0 (524386048 * adapter__op_b_memory__prev_value__0__2_0 + 260144641 * a__0__0_0 + 1057022143 * a__0__1_0 + 16129 * a__0__3_0 + 260144641 * c_times_quotient__0_0 + 1057022143 * c_times_quotient__1_0 + 16129 * c_times_quotient__3_0 + 1057030144 * c_times_quotient__4_0 - (260144641 * adapter__op_b_memory__prev_value__0__0_0 + 1057022143 * adapter__op_b_memory__prev_value__0__1_0 + 16129 * adapter__op_b_memory__prev_value__0__3_0 + 524386048 * a__0__2_0 + 524386048 * c_times_quotient__2_0 + 32512 * c_times_quotient__5_0)) * (524386048 * adapter__op_b_memory__prev_value__0__2_0 + 260144641 * a__0__0_0 + 1057022143 * a__0__1_0 + 16129 * a__0__3_0 + 260144641 * c_times_quotient__0_0 + 1057022143 * c_times_quotient__1_0 + 16129 * c_times_quotient__3_0 + 1057030144 * c_times_quotient__4_0 - (260144641 * adapter__op_b_memory__prev_value__0__0_0 + 1057022143 * adapter__op_b_memory__prev_value__0__1_0 + 16129 * adapter__op_b_memory__prev_value__0__3_0 + 524386048 * a__0__2_0 + 524386048 * c_times_quotient__2_0 + 32512 * c_times_quotient__5_0 + 1)) = 0 (1048735615 * adapter__op_b_memory__prev_value__0__0_0 + 524386048 * adapter__op_b_memory__prev_value__0__3_0 + 260144641 * a__0__1_0 + 1057022143 * a__0__2_0 + 260144641 * c_times_quotient__1_0 + 1057022143 * c_times_quotient__2_0 + 16129 * c_times_quotient__4_0 + 1057030144 * c_times_quotient__5_0 - (260144641 * adapter__op_b_memory__prev_value__0__1_0 + 1057022143 * adapter__op_b_memory__prev_value__0__2_0 + 1048735615 * a__0__0_0 + 524386048 * a__0__3_0 + 1048735615 * c_times_quotient__0_0 + 524386048 * c_times_quotient__3_0 + 32512 * c_times_quotient__6_0)) * (1048735615 * adapter__op_b_memory__prev_value__0__0_0 + 524386048 * adapter__op_b_memory__prev_value__0__3_0 + 260144641 * a__0__1_0 + 1057022143 * a__0__2_0 + 260144641 * c_times_quotient__1_0 + 1057022143 * c_times_quotient__2_0 + 16129 * c_times_quotient__4_0 + 1057030144 * c_times_quotient__5_0 - (260144641 * adapter__op_b_memory__prev_value__0__1_0 + 1057022143 * adapter__op_b_memory__prev_value__0__2_0 + 1048735615 * a__0__0_0 + 524386048 * a__0__3_0 + 1048735615 * c_times_quotient__0_0 + 524386048 * c_times_quotient__3_0 + 32512 * c_times_quotient__6_0 + 1)) = 0 (1048735615 * adapter__op_b_memory__prev_value__0__1_0 + 927974014 * a__0__0_0 + 260144641 * a__0__2_0 + 1057022143 * a__0__3_0 + 927974014 * c_times_quotient__0_0 + 260144641 * c_times_quotient__2_0 + 1057022143 * c_times_quotient__3_0 + 16129 * c_times_quotient__5_0 + 1057030144 * c_times_quotient__6_0 - (927974014 * adapter__op_b_memory__prev_value__0__0_0 + 260144641 * adapter__op_b_memory__prev_value__0__2_0 + 1057022143 * adapter__op_b_memory__prev_value__0__3_0 + 1048735615 * a__0__1_0 + 1048735615 * c_times_quotient__1_0 + 524386048 * c_times_quotient__4_0 + 32512 * c_times_quotient__7_0)) * (1048735615 * adapter__op_b_memory__prev_value__0__1_0 + 927974014 * a__0__0_0 + 260144641 * a__0__2_0 + 1057022143 * a__0__3_0 + 927974014 * c_times_quotient__0_0 + 260144641 * c_times_quotient__2_0 + 1057022143 * c_times_quotient__3_0 + 16129 * c_times_quotient__5_0 + 1057030144 * c_times_quotient__6_0 - (927974014 * adapter__op_b_memory__prev_value__0__0_0 + 260144641 * adapter__op_b_memory__prev_value__0__2_0 + 1057022143 * adapter__op_b_memory__prev_value__0__3_0 + 1048735615 * a__0__1_0 + 1048735615 * c_times_quotient__1_0 + 524386048 * c_times_quotient__4_0 + 32512 * c_times_quotient__7_0 + 1)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sb.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sb.txt index 764e22ee65..ed28f69d16 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sb.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sb.txt @@ -95,4 +95,7 @@ store_value__0__0_0 - (increment_0 * (1 - offset_bit__1_0) * (1 - offset_bit__2_ store_value__0__1_0 - (increment_0 * offset_bit__1_0 * (1 - offset_bit__2_0) + memory_access__prev_value__0__1_0) = 0 store_value__0__2_0 - (increment_0 * (1 - offset_bit__1_0) * offset_bit__2_0 + memory_access__prev_value__0__2_0) = 0 store_value__0__3_0 - (increment_0 * offset_bit__1_0 * offset_bit__2_0 + memory_access__prev_value__0__3_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sh.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sh.txt index 0f11c1dcef..807c2db239 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sh.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sh.txt @@ -82,4 +82,7 @@ memory_access__access_timestamp__compare_low_0 * (65536 * state__clk_16_24_0 + s (memory_access__prev_value__0__1_0 - adapter__op_a_memory__prev_value__0__0_0) * offset_bit__0_0 * (1 - offset_bit__1_0) + store_value__0__1_0 - memory_access__prev_value__0__1_0 = 0 (memory_access__prev_value__0__2_0 - adapter__op_a_memory__prev_value__0__0_0) * (1 - offset_bit__0_0) * offset_bit__1_0 + store_value__0__2_0 - memory_access__prev_value__0__2_0 = 0 (memory_access__prev_value__0__3_0 - adapter__op_a_memory__prev_value__0__0_0) * offset_bit__0_0 * offset_bit__1_0 + store_value__0__3_0 - memory_access__prev_value__0__3_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sll.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sll.txt index c31d812a9e..da349b4b20 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sll.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sll.txt @@ -116,4 +116,7 @@ shift_u16__2_0 * (a__0__3_0 - (lower_limb__0__1_0 * v_0123_0 + higher_limb__0__0 (1 - (shift_u16__0_0 + shift_u16__1_0 + shift_u16__2_0)) * (a__0__3_0 - lower_limb__0__0_0 * v_0123_0) = 0 a__0__1_0 * (1 - (shift_u16__0_0 + shift_u16__1_0)) = 0 a__0__0_0 * (1 - shift_u16__0_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/slt.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/slt.txt index 208246da2b..6ba2dcd75f 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/slt.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/slt.txt @@ -79,4 +79,7 @@ lt_operation__result__u16_flags__3_0 * (lt_operation__result__u16_flags__3_0 - 1 (adapter__op_c_memory__prev_value__0__3_0 + 32768 - 65536 * lt_operation__c_msb__msb_0) * lt_operation__result__u16_flags__3_0 + adapter__op_c_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_c_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_c_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__1_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * (lt_operation__result__comparison_limbs__0_0 - lt_operation__result__comparison_limbs__1_0) - 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltu.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltu.txt index f0d1251372..7d39cb8032 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltu.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltu.txt @@ -73,4 +73,7 @@ adapter__op_b_memory__prev_value__0__3_0 * lt_operation__result__u16_flags__3_0 adapter__op_c_memory__prev_value__0__3_0 * lt_operation__result__u16_flags__3_0 + adapter__op_c_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_c_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_c_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__1_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * (lt_operation__result__comparison_limbs__0_0 - lt_operation__result__comparison_limbs__1_0) - 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltui.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltui.txt index 1d036fdbb7..e09611c363 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltui.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sltui.txt @@ -62,4 +62,7 @@ lt_operation__result__u16_flags__3_0 * (lt_operation__result__u16_flags__3_0 - 1 adapter__op_b_memory__prev_value__0__3_0 * lt_operation__result__u16_flags__3_0 + adapter__op_b_memory__prev_value__0__2_0 * lt_operation__result__u16_flags__2_0 + adapter__op_b_memory__prev_value__0__1_0 * lt_operation__result__u16_flags__1_0 + adapter__op_b_memory__prev_value__0__0_0 * lt_operation__result__u16_flags__0_0 - lt_operation__result__comparison_limbs__0_0 = 0 (lt_operation__result__u16_flags__0_0 + lt_operation__result__u16_flags__1_0 + lt_operation__result__u16_flags__2_0 + lt_operation__result__u16_flags__3_0) * (lt_operation__result__not_eq_inv_0 * (lt_operation__result__comparison_limbs__0_0 - 3 * lt_operation__result__u16_flags__0_0) - 1) = 0 lt_operation__result__u16_compare_operation__bit_0 * (lt_operation__result__u16_compare_operation__bit_0 - 1) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sra.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sra.txt index 28d1e8dcea..caa8a7fcfa 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sra.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sra.txt @@ -119,4 +119,7 @@ shift_u16__2_0 * (b_msb__msb_0 * v_0123_0 + a__0__1_0 - (65536 * b_msb__msb_0 + (1 - (shift_u16__0_0 + shift_u16__1_0 + shift_u16__2_0)) * (a__0__1_0 - 65535 * b_msb__msb_0) = 0 (a__0__2_0 - 65535 * b_msb__msb_0) * (1 - (shift_u16__0_0 + shift_u16__1_0)) = 0 (a__0__3_0 - 65535 * b_msb__msb_0) * (1 - shift_u16__0_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/srl.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/srl.txt index ba85269acc..729e615bc2 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/srl.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/srl.txt @@ -116,4 +116,7 @@ shift_u16__2_0 * (a__0__1_0 - higher_limb__0__3_0) = 0 (1 - (shift_u16__0_0 + shift_u16__1_0 + shift_u16__2_0)) * a__0__1_0 = 0 a__0__2_0 * (1 - (shift_u16__0_0 + shift_u16__1_0)) = 0 a__0__3_0 * (1 - shift_u16__0_0) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sub.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sub.txt index a40c5df8c8..46d3ecd864 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sub.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sub.txt @@ -63,4 +63,7 @@ mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_ (1057030144 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__1_0 + 32512 * sub_operation__value__0__1_0 + 1 - (32512 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * sub_operation__value__0__0_0)) * (1057030144 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__1_0 + 32512 * sub_operation__value__0__1_0 - (32512 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * sub_operation__value__0__0_0)) = 0 (16129 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_b_memory__prev_value__0__1_0 + 32512 * adapter__op_c_memory__prev_value__0__2_0 + 32512 * sub_operation__value__0__2_0 + 1 - (32512 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__1_0 + 16129 * sub_operation__value__0__0_0 + 1057030144 * sub_operation__value__0__1_0)) * (16129 * adapter__op_b_memory__prev_value__0__0_0 + 1057030144 * adapter__op_b_memory__prev_value__0__1_0 + 32512 * adapter__op_c_memory__prev_value__0__2_0 + 32512 * sub_operation__value__0__2_0 - (32512 * adapter__op_b_memory__prev_value__0__2_0 + 16129 * adapter__op_c_memory__prev_value__0__0_0 + 1057030144 * adapter__op_c_memory__prev_value__0__1_0 + 16129 * sub_operation__value__0__0_0 + 1057030144 * sub_operation__value__0__1_0)) = 0 (16129 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_b_memory__prev_value__0__2_0 + 524386048 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__3_0 + 524386048 * sub_operation__value__0__0_0 + 32512 * sub_operation__value__0__3_0 + 1 - (524386048 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__2_0 + 16129 * sub_operation__value__0__1_0 + 1057030144 * sub_operation__value__0__2_0)) * (16129 * adapter__op_b_memory__prev_value__0__1_0 + 1057030144 * adapter__op_b_memory__prev_value__0__2_0 + 524386048 * adapter__op_c_memory__prev_value__0__0_0 + 32512 * adapter__op_c_memory__prev_value__0__3_0 + 524386048 * sub_operation__value__0__0_0 + 32512 * sub_operation__value__0__3_0 - (524386048 * adapter__op_b_memory__prev_value__0__0_0 + 32512 * adapter__op_b_memory__prev_value__0__3_0 + 16129 * adapter__op_c_memory__prev_value__0__1_0 + 1057030144 * adapter__op_c_memory__prev_value__0__2_0 + 16129 * sub_operation__value__0__1_0 + 1057030144 * sub_operation__value__0__2_0)) = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sw.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sw.txt index a493fb7731..6837227ea3 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/sw.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/sw.txt @@ -80,4 +80,7 @@ memory_access__access_timestamp__compare_low_0 * (65536 * state__clk_16_24_0 + s (memory_access__prev_value__0__1_0 - adapter__op_a_memory__prev_value__0__1_0) * (1 - offset_bit_0) + store_value__0__1_0 - memory_access__prev_value__0__1_0 = 0 (memory_access__prev_value__0__2_0 - adapter__op_a_memory__prev_value__0__0_0) * offset_bit_0 + store_value__0__2_0 - memory_access__prev_value__0__2_0 = 0 (memory_access__prev_value__0__3_0 - adapter__op_a_memory__prev_value__0__1_0) * offset_bit_0 + store_value__0__3_0 - memory_access__prev_value__0__3_0 = 0 -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file diff --git a/sp1-benchmarks/tests/apc_snapshots/single_instructions/xor.txt b/sp1-benchmarks/tests/apc_snapshots/single_instructions/xor.txt index cdfffc0c9e..b8d8fc33b5 100644 --- a/sp1-benchmarks/tests/apc_snapshots/single_instructions/xor.txt +++ b/sp1-benchmarks/tests/apc_snapshots/single_instructions/xor.txt @@ -75,4 +75,7 @@ mult=-is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk mult=is_valid, args=[state__clk_high_0, 65536 * state__clk_16_24_0 + state__clk_0_16_0 + 8, 4, 0, 0] // Algebraic constraints: -is_valid * (is_valid - 1) = 0 \ No newline at end of file +is_valid * (is_valid - 1) = 0 + +// Derived columns: +is_valid (new) = 1 \ No newline at end of file From 063d3f12d139568b1e6c077268acf5fae3358e41 Mon Sep 17 00:00:00 2001 From: Georg Wiese Date: Thu, 25 Jun 2026 09:05:50 +0200 Subject: [PATCH 09/15] Simplify expression conversion --- autoprecompiles/src/symbolic_machine.rs | 69 +++------------------- constraint-solver/src/constraint_system.rs | 21 +++++++ 2 files changed, 30 insertions(+), 60 deletions(-) diff --git a/autoprecompiles/src/symbolic_machine.rs b/autoprecompiles/src/symbolic_machine.rs index bb542aa177..dfa4c9fc70 100644 --- a/autoprecompiles/src/symbolic_machine.rs +++ b/autoprecompiles/src/symbolic_machine.rs @@ -6,7 +6,7 @@ use crate::expression_conversion::{ use crate::powdr::UniqueReferences; use itertools::Itertools; use powdr_constraint_solver::constraint_system::{ - self, AlgebraicConstraint, BusInteraction, ConstraintSystem, DerivedVariable, + AlgebraicConstraint, BusInteraction, ConstraintSystem, DerivedVariable, }; use powdr_constraint_solver::grouped_expression::GroupedExpression; use powdr_expression::AlgebraicUnaryOperator; @@ -123,9 +123,6 @@ pub struct SymbolicMachine { pub derived_columns: Vec>>, } -type ComputationMethod = - powdr_constraint_solver::constraint_system::ComputationMethod>; - impl SymbolicMachine { pub fn main_columns(&self) -> impl Iterator + use<'_, T> { self.unique_references() @@ -253,42 +250,17 @@ pub fn symbolic_machine_to_constraint_system( .collect(), derived_variables: symbolic_machine .derived_columns - .iter() + .into_iter() .map(|derived_variable| { - let method = convert_computation_method_to_grouped_expression( - &derived_variable.computation_method, - ); - DerivedVariable::new( - derived_variable.is_new, - derived_variable.variable.clone(), - method, - ) + let method = derived_variable + .computation_method + .convert_expression_type(&|expr| algebraic_to_grouped_expression(&expr)); + DerivedVariable::new(derived_variable.is_new, derived_variable.variable, method) }) .collect(), } } -fn convert_computation_method_to_grouped_expression( - method: &constraint_system::ComputationMethod>, -) -> constraint_system::ComputationMethod> { - match method { - ComputationMethod::Constant(c) => constraint_system::ComputationMethod::Constant(*c), - ComputationMethod::QuotientOrZero(e1, e2) => { - constraint_system::ComputationMethod::QuotientOrZero( - algebraic_to_grouped_expression(e1), - algebraic_to_grouped_expression(e2), - ) - } - ComputationMethod::IfEqZero(condition, then, else_) => { - constraint_system::ComputationMethod::IfEqZero( - algebraic_to_grouped_expression(condition), - Box::new(convert_computation_method_to_grouped_expression(then)), - Box::new(convert_computation_method_to_grouped_expression(else_)), - ) - } - } -} - pub fn constraint_system_to_symbolic_machine( constraint_system: ConstraintSystem, ) -> SymbolicMachine

{ @@ -307,38 +279,15 @@ pub fn constraint_system_to_symbolic_machine( .derived_variables .into_iter() .map(|derived_var| { - let method = convert_computation_method_to_algebraic_expression( - derived_var.computation_method, - ); + let method = derived_var + .computation_method + .convert_expression_type(&grouped_expression_to_algebraic); DerivedVariable::new(derived_var.is_new, derived_var.variable, method) }) .collect(), } } -fn convert_computation_method_to_algebraic_expression( - method: constraint_system::ComputationMethod>, -) -> constraint_system::ComputationMethod> { - match method { - constraint_system::ComputationMethod::Constant(c) => { - constraint_system::ComputationMethod::Constant(c) - } - constraint_system::ComputationMethod::QuotientOrZero(e1, e2) => { - constraint_system::ComputationMethod::QuotientOrZero( - grouped_expression_to_algebraic(e1), - grouped_expression_to_algebraic(e2), - ) - } - constraint_system::ComputationMethod::IfEqZero(condition, then, else_) => { - constraint_system::ComputationMethod::IfEqZero( - grouped_expression_to_algebraic(condition.clone()), - Box::new(convert_computation_method_to_algebraic_expression(*then)), - Box::new(convert_computation_method_to_algebraic_expression(*else_)), - ) - } - } -} - pub fn symbolic_bus_interaction_to_bus_interaction( bus_interaction: &SymbolicBusInteraction

, ) -> BusInteraction> { diff --git a/constraint-solver/src/constraint_system.rs b/constraint-solver/src/constraint_system.rs index 0448def115..b743c28f77 100644 --- a/constraint-solver/src/constraint_system.rs +++ b/constraint-solver/src/constraint_system.rs @@ -184,6 +184,27 @@ impl ComputationMethod> { } } +impl ComputationMethod { + pub fn convert_expression_type( + self, + converter: &impl Fn(E) -> E2, + ) -> ComputationMethod { + match self { + ComputationMethod::Constant(c) => ComputationMethod::Constant(c.clone()), + ComputationMethod::QuotientOrZero(e1, e2) => { + ComputationMethod::QuotientOrZero(converter(e1), converter(e2)) + } + ComputationMethod::IfEqZero(e, then_method, else_method) => { + ComputationMethod::IfEqZero( + converter(e), + Box::new(then_method.convert_expression_type(converter)), + Box::new(else_method.convert_expression_type(converter)), + ) + } + } + } +} + impl, V: Ord + Clone + Eq> ComputationMethod> { From de92a70dd9796716ddc42f428fd23721b31c5133 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 26 Jun 2026 11:16:30 +0200 Subject: [PATCH 10/15] Update openvm/src/powdr_extension/trace_generator/cuda/mod.rs Co-authored-by: Georg Wiese --- openvm/src/powdr_extension/trace_generator/cuda/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs index 2a504b1e33..ef9390e959 100644 --- a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs +++ b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs @@ -133,7 +133,7 @@ fn compile_derived_to_gpu( emit_expr(&mut bytecode, e1, apc_poly_id_to_index, apc_height); bytecode.push(OpCode::Mul as u32); } - ComputationMethod::IfEqZero(_, _, _) => todo!(), + ComputationMethod::IfEqZero(_, _, _) => unreachable!("IfEqZero not expected for new columns"), } let len = (bytecode.len() as u32) - off; specs.push(DerivedExprSpec { From aa049b608c68ea36f2fe7d6a96db06936da52bec Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 26 Jun 2026 11:53:50 +0200 Subject: [PATCH 11/15] Use only one diff_val. --- .../src/rule_based_optimizer/rules.rs | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/constraint-solver/src/rule_based_optimizer/rules.rs b/constraint-solver/src/rule_based_optimizer/rules.rs index d51407df1b..466e544055 100644 --- a/constraint-solver/src/rule_based_optimizer/rules.rs +++ b/constraint-solver/src/rule_based_optimizer/rules.rs @@ -474,9 +474,9 @@ crepe! { // EqualZeroCheck(constrs, result, vars, diff_markers, diff_vals) => // constrsexprs can be equivalently replaced by a constraint that models // result = 1 if all vars are zero, and result = 0 otherwise. - // diff_markers and diff_vars are variables where we add hints because they might be removed. - struct EqualZeroCheck([Expr; 10], Var, [Var; 4], [Var; 4], [Var; 4]); - EqualZeroCheck(constrs, result, vars, diff_markers, diff_vals) <- + // diff_markers and diff_var are variables where we add hints because they might be removed. + struct EqualZeroCheck([Expr; 10], Var, [Var; 4], [Var; 4], Var); + EqualZeroCheck(constrs, result, vars, diff_markers, diff_val) <- // (1 - diff_marker__3_0) * (a__3_0 * (2 * cmp_result_0 - 1)) = 0 NegatedDiffMarkerConstraint(constr_0, diff_marker_3, _, a_3, result, 0), // (1 - (diff_marker__2_0 + diff_marker__3_0)) * (a__2_0 * (2 * cmp_result_0 - 1)) = 0 @@ -519,12 +519,11 @@ crepe! { AffinelyRelated(diff_marker_sum, T::from(-1), one_minus_diff_marker_sum, T::from(1)), let constrs = [constr_0, constr_1, constr_2, constr_3, constr_4, constr_5, constr_6, constr_7, constr_8, constr_9], let vars = [a_0, a_1, a_2, a_3], - let diff_markers = [diff_marker_0, diff_marker_1, diff_marker_2, diff_marker_3], - let diff_vals = [diff_val, diff_val, diff_val, diff_val]; + let diff_markers = [diff_marker_0, diff_marker_1, diff_marker_2, diff_marker_3]; ReplaceAlgebraicConstraintsBy(extend_by_none(constrs), extend_by_none(replacement)) <- Env(env), - EqualZeroCheck(constrs, result, vars, diff_markers, diff_vals), + EqualZeroCheck(constrs, result, vars, diff_markers, diff_val), let replacement = { let result = GroupedExpression::from_unknown_variable(result); assert!(vars.len() == 4); @@ -533,7 +532,7 @@ crepe! { let sum_inv_var = GroupedExpression::from_unknown_variable( env.new_var("inv_of_sum", ComputationMethod::QuotientOrZero(One::one(), sum_of_vars.clone())) ); - // Hints for diff_markers and diff_vals: + // Hints for diff_markers and diff_val: // diff_markers: 1 at the most significant index i such that a[i] != 0, otherwise 0. If such // an i exists, diff_val = c[i] - b[i] if c[i] > b[i] or b[i] - c[i] else. // diff_marker_3 = if_eq_zero(a_3, 0, 1) @@ -543,7 +542,7 @@ crepe! { // diff_val_3 = a_3 // diff_val_2 = a_2 // diff_val_1 = a_1 - // diff_val_0 = if_eq_zero(a_0, 1, a_0 - 1) + // diff_val_0 = if_eq_zero(a_0, 1, a_0 - 1) // this is "our" diff_val. let zero = Box::new(ComputationMethod::Constant(Zero::zero())); let one = Box::new(ComputationMethod::Constant(One::one())); env.add_hint( @@ -580,16 +579,7 @@ crepe! { zero.clone())), zero.clone())); env.add_hint( - diff_vals[3], - ComputationMethod::QuotientOrZero(vars[3].clone(), One::one())); - env.add_hint( - diff_vals[2], - ComputationMethod::QuotientOrZero(vars[2].clone(), One::one())); - env.add_hint( - diff_vals[1], - ComputationMethod::QuotientOrZero(vars[1].clone(), One::one())); - env.add_hint( - diff_vals[0], + diff_val, ComputationMethod::IfEqZero( vars[0].clone(), Box::new(ComputationMethod::Constant(One::one())), From d066c4dfbca56fda3ecd6eb4acc9f10c8f95061c Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 26 Jun 2026 13:29:19 +0200 Subject: [PATCH 12/15] fmt --- openvm/src/powdr_extension/trace_generator/cuda/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs index ef9390e959..a9aba00d56 100644 --- a/openvm/src/powdr_extension/trace_generator/cuda/mod.rs +++ b/openvm/src/powdr_extension/trace_generator/cuda/mod.rs @@ -133,7 +133,9 @@ fn compile_derived_to_gpu( emit_expr(&mut bytecode, e1, apc_poly_id_to_index, apc_height); bytecode.push(OpCode::Mul as u32); } - ComputationMethod::IfEqZero(_, _, _) => unreachable!("IfEqZero not expected for new columns"), + ComputationMethod::IfEqZero(_, _, _) => { + unreachable!("IfEqZero not expected for new columns") + } } let len = (bytecode.len() as u32) - off; specs.push(DerivedExprSpec { From 1d5a85edf480ec57a9e9634c6f1bf5f292daa9b3 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 30 Jun 2026 16:31:23 +0200 Subject: [PATCH 13/15] fix hint --- constraint-solver/src/constraint_system.rs | 8 ++++++ .../src/rule_based_optimizer/rules.rs | 28 +++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/constraint-solver/src/constraint_system.rs b/constraint-solver/src/constraint_system.rs index b743c28f77..f18a425520 100644 --- a/constraint-solver/src/constraint_system.rs +++ b/constraint-solver/src/constraint_system.rs @@ -7,6 +7,7 @@ use crate::{ }; use derivative::Derivative; use itertools::Itertools; +use num_traits::One; use powdr_number::FieldElement; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::{fmt::Display, hash::Hash}; @@ -166,6 +167,13 @@ impl Display for ComputationMethod { } } +impl ComputationMethod> { + /// Creates a computation method that computes the variable as the value of the given expression. + pub fn expression(e: GroupedExpression) -> Self { + ComputationMethod::QuotientOrZero(e, GroupedExpression::one()) + } +} + impl ComputationMethod> { /// Returns the set of referenced unknown variables in the computation method. Might contain repetitions. pub fn referenced_unknown_variables(&self) -> Box + '_> { diff --git a/constraint-solver/src/rule_based_optimizer/rules.rs b/constraint-solver/src/rule_based_optimizer/rules.rs index 466e544055..2c78976d0d 100644 --- a/constraint-solver/src/rule_based_optimizer/rules.rs +++ b/constraint-solver/src/rule_based_optimizer/rules.rs @@ -542,7 +542,16 @@ crepe! { // diff_val_3 = a_3 // diff_val_2 = a_2 // diff_val_1 = a_1 - // diff_val_0 = if_eq_zero(a_0, 1, a_0 - 1) // this is "our" diff_val. + // diff_val_0 = + // if_eq_zero(a_3, + // if_eq_zero(a_2, + // if_eq_zero(a_1, + // if_eq_zero(a_0, + // 1, + // a_0 - 1), + // a_1), + // a_2), + // a_3) let zero = Box::new(ComputationMethod::Constant(Zero::zero())); let one = Box::new(ComputationMethod::Constant(One::one())); env.add_hint( @@ -581,11 +590,18 @@ crepe! { env.add_hint( diff_val, ComputationMethod::IfEqZero( - vars[0].clone(), - Box::new(ComputationMethod::Constant(One::one())), - Box::new(ComputationMethod::QuotientOrZero(vars[0].clone() - One::one(), One::one())))); - - + vars[3].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[2].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[1].clone(), + Box::new(ComputationMethod::IfEqZero( + vars[0].clone(), + one.clone(), + Box::new(ComputationMethod::expression(vars[0].clone() - One::one())))), + Box::new(ComputationMethod::expression(vars[1].clone())))), + Box::new(ComputationMethod::expression(vars[2].clone())))), + Box::new(ComputationMethod::expression(vars[3].clone())))); [ env.insert_owned(result.clone() * sum_of_vars.clone()), env.insert_owned(result + sum_inv_var * sum_of_vars - One::one()), From 59529cd55c8a5ae2aea4b9eb0be97d00a926dc95 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 30 Jun 2026 18:50:41 +0200 Subject: [PATCH 14/15] update tests. --- openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt b/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt index 8eda918a26..7442b71f6f 100644 --- a/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt +++ b/openvm-riscv/tests/apc_snapshots/complex/memcpy_block.txt @@ -85,12 +85,12 @@ diff_marker__0_1 (old) = IfEqZero(0, IfEqZero(0, IfEqZero(0, IfEqZero(a__0_0 - 1 diff_marker__1_1 (old) = IfEqZero(0, IfEqZero(0, IfEqZero(0, 0, 1), 0), 0) diff_marker__2_1 (old) = IfEqZero(0, IfEqZero(0, 0, 1), 0) diff_marker__3_1 (old) = IfEqZero(0, 0, 1) -diff_val_1 (old) = IfEqZero(a__0_0, 1, QuotientOrZero(a__0_0 - 1, 1)) +diff_val_1 (old) = IfEqZero(0, IfEqZero(0, IfEqZero(0, IfEqZero(a__0_0, 1, QuotientOrZero(a__0_0 - 1, 1)), QuotientOrZero(0, 1)), QuotientOrZero(0, 1)), QuotientOrZero(0, 1)) diff_marker__0_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, IfEqZero(writes_aux__prev_data__1_2, IfEqZero(writes_aux__prev_data__0_2 - 1, 0, 1), 0), 0), 0) diff_marker__1_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, IfEqZero(writes_aux__prev_data__1_2, 0, 1), 0), 0) diff_marker__2_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, 0, 1), 0) diff_marker__3_2 (old) = IfEqZero(writes_aux__prev_data__3_2, 0, 1) -diff_val_2 (old) = IfEqZero(writes_aux__prev_data__0_2, 1, QuotientOrZero(writes_aux__prev_data__0_2 - 1, 1)) +diff_val_2 (old) = IfEqZero(writes_aux__prev_data__3_2, IfEqZero(writes_aux__prev_data__2_2, IfEqZero(writes_aux__prev_data__1_2, IfEqZero(writes_aux__prev_data__0_2, 1, QuotientOrZero(writes_aux__prev_data__0_2 - 1, 1)), QuotientOrZero(writes_aux__prev_data__1_2, 1)), QuotientOrZero(writes_aux__prev_data__2_2, 1)), QuotientOrZero(writes_aux__prev_data__3_2, 1)) inv_of_sum_173 (new) = QuotientOrZero(1, a__0_0) inv_of_sum_174 (new) = QuotientOrZero(1, writes_aux__prev_data__0_2 + writes_aux__prev_data__1_2 + writes_aux__prev_data__2_2 + writes_aux__prev_data__3_2) free_var_176 (new) = QuotientOrZero(cmp_result_4, cmp_result_1 + cmp_result_2 - cmp_result_1 * cmp_result_2) From abb51f23185c014fdc001db6e0a2d30e51dc1b89 Mon Sep 17 00:00:00 2001 From: Georg Wiese Date: Tue, 7 Jul 2026 14:13:21 +0200 Subject: [PATCH 15/15] Update snapshot --- openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt index 60bf91d995..a5dfbe5e29 100644 --- a/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt +++ b/openvm-riscv/tests/apc_snapshots/pseudo_instructions/seqz.txt @@ -51,6 +51,6 @@ diff_marker__0_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, IfEqZero(b__1_0, IfEq diff_marker__1_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, IfEqZero(b__1_0, 0, 1), 0), 0) diff_marker__2_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, 0, 1), 0) diff_marker__3_0 (old) = IfEqZero(b__3_0, 0, 1) -diff_val_0 (old) = IfEqZero(b__0_0, 1, QuotientOrZero(b__0_0 - 1, 1)) +diff_val_0 (old) = IfEqZero(b__3_0, IfEqZero(b__2_0, IfEqZero(b__1_0, IfEqZero(b__0_0, 1, QuotientOrZero(b__0_0 - 1, 1)), QuotientOrZero(b__1_0, 1)), QuotientOrZero(b__2_0, 1)), QuotientOrZero(b__3_0, 1)) inv_of_sum_37 (new) = QuotientOrZero(1, b__0_0 + b__1_0 + b__2_0 + b__3_0) is_valid (new) = 1 \ No newline at end of file