From ff3c682c6e733201c07a9726fdad3bb135ba7256 Mon Sep 17 00:00:00 2001 From: dante <45801863+alexander-camuto@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:21:07 -0400 Subject: [PATCH] fix: dont forget to increment --- src/circuit/ops/layouts.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/circuit/ops/layouts.rs b/src/circuit/ops/layouts.rs index fd8f4f31f..2e6227144 100644 --- a/src/circuit/ops/layouts.rs +++ b/src/circuit/ops/layouts.rs @@ -4323,11 +4323,13 @@ pub fn floor( // set the last element to zero and then recompose let zero = create_constant_tensor(F::ZERO, 1); - let assigned_zero = region.assign(&config.custom_gates.inputs[1], &zero)?; + let assigned_zero = region.assign(&config.custom_gates.inputs[0], &zero)?; let assigned_zero = assigned_zero.get_inner_tensor()?[0].clone(); let negative_one = create_constant_tensor(integer_rep_to_felt(-1), 1); let assigned_negative_one = region.assign(&config.custom_gates.inputs[1], &negative_one)?; + region.increment(1); + let dims = decomposition.dims().to_vec(); let first_dims = decomposition.dims().to_vec()[..decomposition.dims().len() - 1].to_vec(); @@ -4435,11 +4437,13 @@ pub fn ceil( // set the last element to zero and then recompose let zero = create_constant_tensor(F::ZERO, 1); - let assigned_zero = region.assign(&config.custom_gates.inputs[1], &zero)?; + let assigned_zero = region.assign(&config.custom_gates.inputs[0], &zero)?; let assigned_zero = assigned_zero.get_inner_tensor()?[0].clone(); let one = create_constant_tensor(integer_rep_to_felt(1), 1); let assigned_one = region.assign(&config.custom_gates.inputs[1], &one)?; + region.increment(1); + let dims = decomposition.dims().to_vec(); let first_dims = decomposition.dims().to_vec()[..decomposition.dims().len() - 1].to_vec(); @@ -4547,12 +4551,14 @@ pub fn round( // set the last element to zero and then recompose let zero = create_constant_tensor(F::ZERO, 1); - let assigned_zero = region.assign(&config.custom_gates.inputs[1], &zero)?; + let assigned_zero = region.assign(&config.custom_gates.inputs[0], &zero)?; let assigned_zero = assigned_zero.get_inner_tensor()?[0].clone(); let one = create_constant_tensor(integer_rep_to_felt(1), 1); let assigned_one = region.assign(&config.custom_gates.inputs[1], &one)?; let negative_one = create_constant_tensor(integer_rep_to_felt(-1), 1); - let assigned_negative_one = region.assign(&config.custom_gates.inputs[1], &negative_one)?; + let assigned_negative_one = region.assign(&config.custom_gates.output, &negative_one)?; + + region.increment(1); // if scale is not exactly divisible by 2 we warn if scale.0 % 2.0 != 0.0 {