From d9673c274052c67bc25ee8a88cc94175e9e9dedd Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Fri, 13 Sep 2024 10:53:51 -0400 Subject: [PATCH 1/3] docs: fix decoder constraints --- docs/src/design/decoder/constraints.md | 10 ++++++++-- docs/src/design/decoder/main.md | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/src/design/decoder/constraints.md b/docs/src/design/decoder/constraints.md index bf12f217ca..61d5286c19 100644 --- a/docs/src/design/decoder/constraints.md +++ b/docs/src/design/decoder/constraints.md @@ -547,6 +547,12 @@ When `SPAN` or `RESPAN` operations is executed, one of the batch flags must be s (f_{span} + f_{respan}) - (f_{g1} + f_{g2} + f_{g4} + f_{g8}) = 0 \text{ | degree} = 5 $$ +When neither `SPAN` nor `RESPAN` is executed, all batch flags must be set to $0$. + +> $$ +(1 - (f_{span} + f_{respan})) \cdot (1 - bc_0) \cdot (1 - bc_1) \cdot (1 - bc_2) = 0 \text{ | degree} = 8 +$$ + When we have at most 4 groups in a batch, registers $h_4, ..., h_7$ should be set to $0$'s. > $$ @@ -592,7 +598,7 @@ In the above, the value of the group is computed as $(h_0' \cdot 2^7 + op') \cdo We also define a flag which is set to $1$ when a group needs to be removed from the op group table. $$ -f_{dg} = sp \cdot \Delta gc +f_{dg} = sp \cdot \Delta gc \text{ | degree} = 2 $$ The above says that we remove groups from the op group table whenever group count is decremented. We multiply by $sp$ to exclude the cases when the group count is decremented due to `SPAN` or `RESPAN` operations. @@ -600,7 +606,7 @@ The above says that we remove groups from the op group table whenever group coun Using the above variables together with flags $f_{g2}$, $f_{g4}$, $f_{g8}$ defined in the previous section, we describe the constraint for updating op group table as follows (note that we do not use $f_{g1}$ flag as when a batch consists of a single group, nothing is added to the op group table): > $$ -p_3' \cdot (f_{dg} \cdot u + 1 - f_{dg}) = p_3 \cdot (f_{g2} \cdot v_1 + f_{g4} \cdot \prod_{i=1}^3 v_i + f_{g8} \cdot \prod_{i=1}^7 v_i - 1 + (f_{span} + f_{respan})) +p_3' \cdot (f_{dg} \cdot u + 1 - f_{dg}) = p_3 \cdot (f_{g2} \cdot v_1 + f_{g4} \cdot \prod_{i=1}^3 v_i + f_{g8} \cdot (\prod_{i=1}^7 v_i) + 1 - (f_{span} + f_{respan})) $$ The above constraint specifies that: diff --git a/docs/src/design/decoder/main.md b/docs/src/design/decoder/main.md index af2020fe8d..d92a776864 100644 --- a/docs/src/design/decoder/main.md +++ b/docs/src/design/decoder/main.md @@ -511,7 +511,7 @@ In the above, the batch contains $3$ operation groups. To bring the count up to Operation batch flags (denoted as $c_0, c_1, c_2$), encode the number of groups and define how many groups are added to the op group table as follows: -* `(1, 0, 0)` - $8$ groups. Groups in $h_1, ... h_7$ are added to the op group table. +* `(1, -, -)` - $8$ groups. Groups in $h_1, ... h_7$ are added to the op group table. * `(0, 1, 0)` - $4$ groups. Groups in $h_1, ... h_3$ are added to the op group table * `(0, 0, 1)` - $2$ groups. Groups in $h_1$ is added to the op group table. * `(0, 1, 1)` - $1$ group. Nothing is added to the op group table From a058ae86dbaebfe148257eafe00032e7df9aef30 Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Fri, 13 Sep 2024 11:00:12 -0400 Subject: [PATCH 2/3] add clarification --- docs/src/design/decoder/constraints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/design/decoder/constraints.md b/docs/src/design/decoder/constraints.md index 61d5286c19..206120c076 100644 --- a/docs/src/design/decoder/constraints.md +++ b/docs/src/design/decoder/constraints.md @@ -610,8 +610,8 @@ p_3' \cdot (f_{dg} \cdot u + 1 - f_{dg}) = p_3 \cdot (f_{g2} \cdot v_1 + f_{g4} $$ The above constraint specifies that: -* When `SPAN` or `RESPAN` operations are executed, we add between $1$ and $7$ groups to the op group table. -* When group count is decremented inside a *span* block, we remove a group from the op group table. +* When `SPAN` or `RESPAN` operations are executed, we add between $1$ and $7$ groups to the op group table; else, leave $p3$ untouched. +* When group count is decremented inside a *span* block, we remove a group from the op group table; else, leave $p3'$ untouched. The degree of this constraint is $9$. From 2ec7fc3858bb2c352eca2565ab73d90c8c1e863e Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Mon, 16 Sep 2024 09:55:45 -0400 Subject: [PATCH 3/3] fix constraints --- docs/src/design/decoder/constraints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/design/decoder/constraints.md b/docs/src/design/decoder/constraints.md index 206120c076..63e2ec3588 100644 --- a/docs/src/design/decoder/constraints.md +++ b/docs/src/design/decoder/constraints.md @@ -549,8 +549,8 @@ $$ When neither `SPAN` nor `RESPAN` is executed, all batch flags must be set to $0$. -> $$ -(1 - (f_{span} + f_{respan})) \cdot (1 - bc_0) \cdot (1 - bc_1) \cdot (1 - bc_2) = 0 \text{ | degree} = 8 +$$ +(1 - (f_{span} + f_{respan})) \cdot (bc_0 + bc_1 + bc_2) = 0 \text{ | degree} = 6 $$ When we have at most 4 groups in a batch, registers $h_4, ..., h_7$ should be set to $0$'s.