diff --git a/air/src/constraints/range.rs b/air/src/constraints/range.rs index 76829acf78..0ad7ce7b00 100644 --- a/air/src/constraints/range.rs +++ b/air/src/constraints/range.rs @@ -19,7 +19,7 @@ use crate::{ pub const NUM_ASSERTIONS: usize = 2; /// The number of transition constraints required by the Range Checker. pub const NUM_CONSTRAINTS: usize = 1; -/// The degrees of the range checker's constraints, in the order they'll be added to the the result +/// The degrees of the range checker's constraints, in the order they'll be added to the result /// array when a transition is evaluated. pub const CONSTRAINT_DEGREES: [usize; NUM_CONSTRAINTS] = [ 9, // Enforce values of column v transition. diff --git a/assembly/src/assembler/mast_forest_builder.rs b/assembly/src/assembler/mast_forest_builder.rs index 96e7d51b52..b00cb0f56d 100644 --- a/assembly/src/assembler/mast_forest_builder.rs +++ b/assembly/src/assembler/mast_forest_builder.rs @@ -489,7 +489,7 @@ impl IndexMut for MastForestBuilder { /// Determines if we want to merge a block with other blocks. Currently, this works as follows: /// - If the block is a procedure, we merge it only if the number of operation batches is smaller -/// then the threshold (currently set at 32). The reasoning is based on an estimate of the the +/// then the threshold (currently set at 32). The reasoning is based on an estimate of the /// runtime penalty of not inlining the procedure. We assume that this penalty is roughly 3 extra /// nodes in the MAST and so would require 3 additional hashes at runtime. Since hashing each /// operation batch requires 1 hash, this basically implies that if the runtime penalty is more diff --git a/assembly/src/ast/attribute/meta/kv.rs b/assembly/src/ast/attribute/meta/kv.rs index 69ed38936b..156f1765c4 100644 --- a/assembly/src/ast/attribute/meta/kv.rs +++ b/assembly/src/ast/attribute/meta/kv.rs @@ -89,7 +89,7 @@ impl MetaKeyValue { self.items.entry(key) } - /// Get an iterator over the the key-value items of this metadata + /// Get an iterator over the key-value items of this metadata #[inline] pub fn iter(&self) -> impl Iterator { self.items.iter() diff --git a/assembly/src/tests.rs b/assembly/src/tests.rs index 0cc537e3a2..c570ff9898 100644 --- a/assembly/src/tests.rs +++ b/assembly/src/tests.rs @@ -2209,7 +2209,7 @@ fn program_with_reexported_proc_in_another_library() -> TestResult { let dummy_library = Assembler::new(source_manager).with_module(ref_ast)?.assemble_library([ast])?; - // Now we want to use the the library we've compiled + // Now we want to use the library we've compiled context.add_library(&dummy_library)?; let source = source_file!( diff --git a/processor/src/chiplets/memory/segment.rs b/processor/src/chiplets/memory/segment.rs index 60fc667475..fb423dc49a 100644 --- a/processor/src/chiplets/memory/segment.rs +++ b/processor/src/chiplets/memory/segment.rs @@ -44,7 +44,7 @@ impl MemorySegmentTrace { // since we record memory state at the end of a given cycle, to get memory state at the end // of a cycle, we need to look at the previous cycle. that is, memory state at the end of - // the previous cycle is the same as memory state the the beginning of the current cycle. + // the previous cycle is the same as memory state the beginning of the current cycle. let search_clk: u64 = (clk - 1).into(); for (&addr, addr_trace) in self.0.iter() { diff --git a/processor/src/operations/comb_ops.rs b/processor/src/operations/comb_ops.rs index e0b68af198..f1082a992a 100644 --- a/processor/src/operations/comb_ops.rs +++ b/processor/src/operations/comb_ops.rs @@ -44,7 +44,7 @@ where /// /// Here: /// - /// 1. Ti for i in 0..=7 stands for the the value of the i-th trace polynomial for the current + /// 1. Ti for i in 0..=7 stands for the value of the i-th trace polynomial for the current /// query i.e. T_i(x). /// 2. (p0, p1) stands for an extension field element accumulating the values for the quotients /// with common denominator (x - z). diff --git a/stdlib/asm/crypto/stark/deep_queries.masm b/stdlib/asm/crypto/stark/deep_queries.masm index ce8ef49e30..3d26bde903 100644 --- a/stdlib/asm/crypto/stark/deep_queries.masm +++ b/stdlib/asm/crypto/stark/deep_queries.masm @@ -28,7 +28,7 @@ use.std::crypto::stark::constants #! #! #! Here: -#! 1- Ti for i in 0..=7 stands for the the value of the i-th trace polynomial for the current query i.e. T_i(x). +#! 1- Ti for i in 0..=7 stands for the value of the i-th trace polynomial for the current query i.e. T_i(x). #! 2- (p0, p1) stands for an extension field element accumulating the values for the quotients with common denominator (x - gz). #! 3- (r0, r1) stands for an extension field element accumulating the values for the quotients with common denominator (x - z). #! 4- x_addr is the memory address from which we are loading the Ti's using the MSTREAM instruction. @@ -149,7 +149,7 @@ end #! #! #! Here: -#! 1- Tij for i in 0..=3 and j=0,1 stands for the the value of the j-th coordinate in the quadratic extension field +#! 1- Tij for i in 0..=3 and j=0,1 stands for the value of the j-th coordinate in the quadratic extension field #! of the i-th auxiliary trace polynomial for the current query i.e. $T_i(x)$. #! 2- (p0, p1) stands for an extension field element accumulating the values for the quotients with common denominator (x - gz). #! 3- (r0, r1) stands for an extension field element accumulating the values for the quotients with common denominator (x - z). diff --git a/stdlib/docs/crypto/stark/deep_queries.md b/stdlib/docs/crypto/stark/deep_queries.md index 2ab20dee83..b1e5428103 100644 --- a/stdlib/docs/crypto/stark/deep_queries.md +++ b/stdlib/docs/crypto/stark/deep_queries.md @@ -2,6 +2,6 @@ ## std::crypto::stark::deep_queries | Procedure | Description | | ----------- | ------------- | -| combine_main | Computes a single step of the random linear combination defining the DEEP composition polynomial
that is the input to the FRI protocol. More precisely, the sum in question is:
$$
\sum_{i=0}^k{\alpha_i \cdot \left(\frac{T_i(x) - T_i(z)}{x - z} +
\frac{T_i(x) - T_i(z \cdot g)}{x - z \cdot g} \right)}
$$

and the following instruction computes the denominators $\alpha_i \cdot (T_i(x) - T_i(z))$ and
$\alpha_i \cdot (T_i(x) - T_i(z \cdot g))$ and stores the values in two accumulators $r$ and $p$,
respectively. This instruction is specialized to main trace columns i.e. the values $T_i(x)$ are
base field elements.

The stack transition of the instruction can be visualized as follows:

+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+---+
\| T7 \| T6 \| T5 \| T4 \| T3 \| T2 \| T1 \| T0 \| p1 \| p0 \| r1 \| r0 \|x_addr\|z_addr\|a_addr\| - \|
+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+---+

\|\|
\/

+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+--------+---+
\| T0 \| T7 \| T6 \| T5 \| T4 \| T3 \| T2 \| T1 \| p1' \| p0' \| r1' \| r0' \|x_addr\|z_addr+1\|a_addr+1\| - \|
+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+--------+---+


Here:
1- Ti for i in 0..=7 stands for the the value of the i-th trace polynomial for the current query i.e. T_i(x).
2- (p0, p1) stands for an extension field element accumulating the values for the quotients with common denominator (x - gz).
3- (r0, r1) stands for an extension field element accumulating the values for the quotients with common denominator (x - z).
4- x_addr is the memory address from which we are loading the Ti's using the MSTREAM instruction.
5- z_addr is the memory address to the i-th OOD evaluation frame at z and gz i.e. T_i(z):= (T_i(z)0, T_i(z)1)
and T_i(gz):= (T_i(gz)0, T_i(gz)1)
6- a_addr is the memory address of the i-th random element used in batching the trace polynomial quotients.
The random elements a := (a0, a1) are stored in memory as [0, 0, a0, a1].

Input: [T7, T6, T5, T4, T3, T2, T1, T0, p1, p0, r1, r0, x_addr, z_addr, a_addr, 0]
Output: [T0, T7, T6, T5, T4, T3, T2, T1, p1', p0', r1', r0', x_addr, z_addr+1, a_addr+1, 0]
| -| combine_aux | Computes a single step of the random linear combination defining the DEEP composition polynomial
that is the input to the FRI protocol. More precisely, the sum in question is:
$$
\sum_{i=0}^k{\alpha_i \cdot \left(\frac{T_i(x) - T_i(z)}{x - z} +
\frac{T_i(x) - T_i(z \cdot g)}{x - z \cdot g} \right)}
$$

and the following instruction computes the denominators $\alpha_i \cdot (T_i(x) - T_i(z))$ and
$\alpha_i \cdot (T_i(x) - T_i(z \cdot g))$ and stores the values in two accumulators $r$ and $p$,
respectively. This instruction is specialized to auxiliary trace columns i.e. the values $T_i(x)$
are field elements in a quadratic extension field.

The stack transition of the instruction can be visualized as follows:

+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+------+------+---+
\| T31 \| T30 \| T21 \| T20 \| T11 \| T10 \| T01 \| T00 \| p1 \| p0 \| r1 \| r0 \|x_addr\|z_addr\|a_addr\| - \|
+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+------+------+---+

\|\|
\/

+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+--------+--------+-----+
\| T31 \| T30 \| T21 \| T20 \| T11 \| T10 \| T01 \| T00 \| p1' \| p0' \| r1' \| r0' \|x_addr\|z_addr+1\|a_addr+b\| - \|
+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+--------+--------------+


Here:
1- Tij for i in 0..=3 and j=0,1 stands for the the value of the j-th coordinate in the quadratic extension field
of the i-th auxiliary trace polynomial for the current query i.e. $T_i(x)$.
2- (p0, p1) stands for an extension field element accumulating the values for the quotients with common denominator (x - gz).
3- (r0, r1) stands for an extension field element accumulating the values for the quotients with common denominator (x - z).
4- x_addr is the memory address from which we are loading the Ti's using the MSTREAM instruction.
5- z_addr is the memory address to the i-th OOD evaluation frame at z and gz i.e. T_i(z):= (T_i(z)0, T_i(z)1) and T_i(gz):= (T_i(gz)0, T_i(gz)1)
6- a_addr is the memory address of the i-th random element used in batching the trace polynomial quotients.
The random elements a := (a0, a1) are stored in memory as [0, 0, a0, a1].

Input: [T31, T30, T21, T20, T11, T10, T01, T00, p1, p0, r1, r0, x_addr, z_addr, a_addr, 0]
Output: [T01, T00, T31, T30, T21, T20, T11, T10, p1', p0', r1', r0', x_addr, z_addr', a_addr', 0]
| +| combine_main | Computes a single step of the random linear combination defining the DEEP composition polynomial
that is the input to the FRI protocol. More precisely, the sum in question is:
$$
\sum_{i=0}^k{\alpha_i \cdot \left(\frac{T_i(x) - T_i(z)}{x - z} +
\frac{T_i(x) - T_i(z \cdot g)}{x - z \cdot g} \right)}
$$

and the following instruction computes the denominators $\alpha_i \cdot (T_i(x) - T_i(z))$ and
$\alpha_i \cdot (T_i(x) - T_i(z \cdot g))$ and stores the values in two accumulators $r$ and $p$,
respectively. This instruction is specialized to main trace columns i.e. the values $T_i(x)$ are
base field elements.

The stack transition of the instruction can be visualized as follows:

+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+---+
\| T7 \| T6 \| T5 \| T4 \| T3 \| T2 \| T1 \| T0 \| p1 \| p0 \| r1 \| r0 \|x_addr\|z_addr\|a_addr\| - \|
+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+---+

\|\|
\/

+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+--------+---+
\| T0 \| T7 \| T6 \| T5 \| T4 \| T3 \| T2 \| T1 \| p1' \| p0' \| r1' \| r0' \|x_addr\|z_addr+1\|a_addr+1\| - \|
+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+--------+---+


Here:
1- Ti for i in 0..=7 stands for the value of the i-th trace polynomial for the current query i.e. T_i(x).
2- (p0, p1) stands for an extension field element accumulating the values for the quotients with common denominator (x - gz).
3- (r0, r1) stands for an extension field element accumulating the values for the quotients with common denominator (x - z).
4- x_addr is the memory address from which we are loading the Ti's using the MSTREAM instruction.
5- z_addr is the memory address to the i-th OOD evaluation frame at z and gz i.e. T_i(z):= (T_i(z)0, T_i(z)1)
and T_i(gz):= (T_i(gz)0, T_i(gz)1)
6- a_addr is the memory address of the i-th random element used in batching the trace polynomial quotients.
The random elements a := (a0, a1) are stored in memory as [0, 0, a0, a1].

Input: [T7, T6, T5, T4, T3, T2, T1, T0, p1, p0, r1, r0, x_addr, z_addr, a_addr, 0]
Output: [T0, T7, T6, T5, T4, T3, T2, T1, p1', p0', r1', r0', x_addr, z_addr+1, a_addr+1, 0]
| +| combine_aux | Computes a single step of the random linear combination defining the DEEP composition polynomial
that is the input to the FRI protocol. More precisely, the sum in question is:
$$
\sum_{i=0}^k{\alpha_i \cdot \left(\frac{T_i(x) - T_i(z)}{x - z} +
\frac{T_i(x) - T_i(z \cdot g)}{x - z \cdot g} \right)}
$$

and the following instruction computes the denominators $\alpha_i \cdot (T_i(x) - T_i(z))$ and
$\alpha_i \cdot (T_i(x) - T_i(z \cdot g))$ and stores the values in two accumulators $r$ and $p$,
respectively. This instruction is specialized to auxiliary trace columns i.e. the values $T_i(x)$
are field elements in a quadratic extension field.

The stack transition of the instruction can be visualized as follows:

+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+------+------+---+
\| T31 \| T30 \| T21 \| T20 \| T11 \| T10 \| T01 \| T00 \| p1 \| p0 \| r1 \| r0 \|x_addr\|z_addr\|a_addr\| - \|
+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+------+------+---+

\|\|
\/

+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+--------+--------+-----+
\| T31 \| T30 \| T21 \| T20 \| T11 \| T10 \| T01 \| T00 \| p1' \| p0' \| r1' \| r0' \|x_addr\|z_addr+1\|a_addr+b\| - \|
+-------+-------+-------+-------+-------+-------+-------+-------+------+------+------+------+------+--------+--------------+


Here:
1- Tij for i in 0..=3 and j=0,1 stands for the value of the j-th coordinate in the quadratic extension field
of the i-th auxiliary trace polynomial for the current query i.e. $T_i(x)$.
2- (p0, p1) stands for an extension field element accumulating the values for the quotients with common denominator (x - gz).
3- (r0, r1) stands for an extension field element accumulating the values for the quotients with common denominator (x - z).
4- x_addr is the memory address from which we are loading the Ti's using the MSTREAM instruction.
5- z_addr is the memory address to the i-th OOD evaluation frame at z and gz i.e. T_i(z):= (T_i(z)0, T_i(z)1) and T_i(gz):= (T_i(gz)0, T_i(gz)1)
6- a_addr is the memory address of the i-th random element used in batching the trace polynomial quotients.
The random elements a := (a0, a1) are stored in memory as [0, 0, a0, a1].

Input: [T31, T30, T21, T20, T11, T10, T01, T00, p1, p0, r1, r0, x_addr, z_addr, a_addr, 0]
Output: [T01, T00, T31, T30, T21, T20, T11, T10, p1', p0', r1', r0', x_addr, z_addr', a_addr', 0]
| | compute_deep_composition_polynomial_queries | Compute the DEEP composition polynomial FRI queries.

Input: [query_ptr, ...]
Output: [...]
Cycles: 6 + num_queries * 463
|