Skip to content

Commit 4fd4f66

Browse files
author
notnotraju
committed
wip continued
1 parent 0d6f108 commit 4fd4f66

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
8787
const auto& msm_transition_shift = View(in.msm_transition_shift);
8888
const auto& round = View(in.msm_round);
8989
const auto& round_shift = View(in.msm_round_shift);
90-
const auto& q_add = View(in.msm_add);
90+
const auto& q_add = View(in.msm_add); // is 1 iff we are at an ADD row in Straus algorithm
9191
const auto& q_add_shift = View(in.msm_add_shift);
9292
const auto& q_skew = View(in.msm_skew);
9393
const auto& q_skew_shift = View(in.msm_skew_shift);
94-
const auto& q_double = View(in.msm_double);
94+
const auto& q_double = View(in.msm_double); // is 1 iff we are at an DOUBLE row in Straus algorithm
9595
const auto& q_double_shift = View(in.msm_double_shift);
9696
const auto& msm_size = View(in.msm_size_of_msm);
9797
// const auto& msm_size_shift = View(in.msm_size_of_msm_shift);
@@ -168,12 +168,12 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
168168
* @brief Addition relation
169169
*
170170
* All addition operations in ECCVMMSMRelationImpl are conditional additions, as we sometimes want to add values and
171-
* other times simply want to propagate values. (consider, e.g., when q_add2 == 0.) This method returns two
171+
* other times simply want to propagate values. (consider, e.g., when `q_add2 == 0`.) This method returns two
172172
* Accumulators that represent x/y coord of output. Output is either an addition of inputs (if `selector == 1`), or
173173
* xa/ya (if `selector == 0`). Additionally, we require `lambda = 0` if `selector = 0`. The `collision_relation`
174174
* accumulator tracks a subrelation that validates xb != xa. Repeated calls to this method will increase the max
175-
* degree of the Accumulator output Degree of x_out, y_out = max degree of x_a/x_b + 1 4 Iterations will produce an
176-
* output degree of 6
175+
* degree of the Accumulator output: degree of x_out, y_out = max degree of x_a/x_b + 1. 4 Iterations will produce
176+
* an output degree of 5.
177177
*/
178178
auto add = [&](auto& xb,
179179
auto& yb,
@@ -183,9 +183,9 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
183183
auto& selector,
184184
auto& relation,
185185
auto& collision_relation) {
186-
// L * (1 - s) = 0
187-
// (combine) (L * (xb - xa - 1) - yb - ya) * s + L = 0
188-
// i.e., computation of lambda is valid.
186+
// computation of lambda is valid: if s == 1, then L == (yb - ya) / (xb - xa)
187+
// if s == 0, then L == 0. combining these into a single constraint yields:
188+
// s * (L * (xb - xa - 1) - (yb - ya)) + L = 0
189189
relation += selector * (lambda * (xb - xa - 1) - (yb - ya)) + lambda;
190190
collision_relation += selector * (xb - xa);
191191
// x3 = L.L + (-xb - xa) * q + (1 - q) xa

0 commit comments

Comments
 (0)