From fd6c848f67c49cde26f7a97f24ef17a7bc3d0b0d Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Wed, 24 Jan 2024 11:58:02 -0800 Subject: [PATCH] Fix shadowing bug --- cpu/src/lib.rs | 4 ++-- cpu/src/stark.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/src/lib.rs b/cpu/src/lib.rs index b26ec69e..af4d4758 100644 --- a/cpu/src/lib.rs +++ b/cpu/src/lib.rs @@ -263,12 +263,12 @@ impl CpuChip { let word_1 = CPU_COL_MAP.mem_channels[0] .value .into_iter() - .map(|i| rows[i][i]) + .map(|j| rows[i][j]) .collect::>(); let word_2 = CPU_COL_MAP.mem_channels[1] .value .into_iter() - .map(|i| rows[i][i]) + .map(|j| rows[i][j]) .collect::>(); for (a, b) in word_1.into_iter().zip(word_2) { diff[i] += (a - b).square(); diff --git a/cpu/src/stark.rs b/cpu/src/stark.rs index 80b85a6b..86302554 100644 --- a/cpu/src/stark.rs +++ b/cpu/src/stark.rs @@ -257,7 +257,7 @@ impl CpuChip { .read_value_1() .into_iter() .zip(local.read_value_2()) - .map(|(a, b)| (a - b) * (a - b)) + .map(|(a, b)| (a - b).square()) .sum::(), ); builder.assert_bool(local.not_equal);