Skip to content

Commit 6018850

Browse files
committed
address comments.
1 parent 6a0ca82 commit 6018850

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

barretenberg/cpp/src/barretenberg/translator_vm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ We verify this by proving the equation holds:
9696
2. modulo $r$ (natively in $\mathbb{F}_r$)
9797
3. with range constraints on all limbs (prevents overflow/underflow)
9898

99-
By the Chinese Remainder Theorem, since $2^{272} \cdot r > 2^{514}$ exceeds the maximum possible value, the equation must hold in integers, and thus modulo $q$.
99+
By the Chinese Remainder Theorem, since $2^{272} \cdot r > 2^{514}$ exceeds the maximum possible value, the equation must hold in integers, and thus modulo $q$. More details on this relation are in [RELATIONS.md](RELATIONS.md#non-native-field-relations).
100100

101101
## Witness Trace Structure
102102

barretenberg/cpp/src/barretenberg/translator_vm/RELATIONS.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ The translator VM enforces several relations/constraints to ensure the correctne
44

55
Since we follow a two-row trace structure, some relations are only active on even rows, while others are only active on odd rows. Below is a summary of the relations and their activation patterns.
66

7-
| Constraint | No of subtrelations | Active on even rows | Active on odd rows |
8-
| ----------------------------- | ------------------- | ------------------- | ------------------ |
9-
| Non-Native Field Relation | 3 |||
10-
| Decomposition Relation | 48 |||
11-
| Permutation Relation | 2 |||
12-
| Delta Range Constraint | 10 |||
13-
| Opcode Constraint Relation | 5 |||
14-
| Accumulator Transfer Relation | 12 || ✓ (propagation) |
15-
| Zero Constraints Relation | 68 |||
7+
| Constraint | No of subrelations | Active on even rows | Active on odd rows |
8+
| ----------------------------- | ------------------ | ------------------- | ------------------ |
9+
| Non-Native Field Relation | 3 |||
10+
| Decomposition Relation | 48 |||
11+
| Permutation Relation | 2 |||
12+
| Delta Range Constraint | 10 |||
13+
| Opcode Constraint Relation | 5 |||
14+
| Accumulator Transfer Relation | 12 || ✓ (propagation) |
15+
| Zero Constraints Relation | 68 |||
1616

1717
Lagrange selectors for activation:
1818

@@ -112,8 +112,19 @@ If this equation holds:
112112
2. Modulo $r$ (native $\mathbb{F}_r$ computation), and
113113
3. All values are properly range-constrained
114114

115-
then it must hold in integers. This is because the Chinese Remainder Theorem guarantees that if an equation holds modulo two coprime moduli whose product exceeds the maximum possible value of the equation, then it holds over the integers. Here, the maximum possible value of the left-hand side is less than $2^{514}$, while the moduli product is $2^{272} \cdot r > 2^{525} > 2^{514}$.
116-
See [bigfield documentation](barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/README.md) for more details on non-native field arithmetic.
115+
then it must hold in integers. This is because the Chinese Remainder Theorem guarantees that if an equation holds modulo two coprime moduli whose product exceeds the maximum possible value of the equation, then it holds over the integers.
116+
Since all values are in $\mathbb{F}_q$, i.e., they are less than $q$, we have:
117+
118+
$$
119+
\begin{aligned}
120+
\textsf{max}(a^{\text{prev}} \cdot x + \texttt{op} + P_x \cdot v + P_y \cdot v^2 + z_1 \cdot v^3 + z_2 \cdot v^4) &< 5q^2 < 5 \cdot (2^{254})^2 < 2^{511}
121+
\\
122+
\textsf{max}(\mathcal{Q} \cdot q) &< q^2 < (2^{254})^2 < 2^{508}
123+
\end{aligned}
124+
$$
125+
126+
Therefore, the maximum possible value of the left-hand side is less than $2^{511}$, while the moduli product is $2^{272} \cdot r > 2^{525} > 2^{511}$.
127+
See [bigfield documentation](../stdlib/primitives/bigfield/README.md) for more details on non-native field arithmetic.
117128

118129
The non-native field relation is enforced through three separate subrelations:
119130

@@ -388,7 +399,7 @@ Subrelations 22-41 apply this pattern to:
388399
| Quotient | 4 | 12, 12, 12, 10 bits |
389400
| | | |
390401

391-
### Category 5: Transcript Value Composition (Subrelations 42-47)
402+
### Category 5: Transcript Value Reconstruction (Subrelations 42-47)
392403

393404
These prove that 68-bit limbs correctly reconstruct EccOpQueue transcript values.
394405
General pattern for composing two limbs into a transcript value:

0 commit comments

Comments
 (0)