diff --git a/triton-vm/src/stark.rs b/triton-vm/src/stark.rs index 78fb51037..47752dabd 100644 --- a/triton-vm/src/stark.rs +++ b/triton-vm/src/stark.rs @@ -176,15 +176,26 @@ impl Stark { prof_start!(maybe_profiler, "Fiat-Shamir", "hash"); proof_stream.enqueue(ProofItem::MerkleRoot(ext_merkle_tree.root())); + + // Get the weights with which to compress the many quotients into one. + let quotient_combination_weights = + proof_stream.sample_scalars(MasterExtTable::NUM_CONSTRAINTS); + let quotient_combination_weights = Array1::from(quotient_combination_weights); prof_stop!(maybe_profiler, "Fiat-Shamir"); prof_stop!(maybe_profiler, "ext tables"); + // low-degree extend the trace codewords so that the all quotient codewords + // obtained by element-wise evaluation of the AIR constraints prof_start!(maybe_profiler, "quotient-domain codewords"); let base_quotient_domain_codewords = master_base_table.quotient_domain_table(); let ext_quotient_domain_codewords = master_ext_table.quotient_domain_table(); prof_stop!(maybe_profiler, "quotient-domain codewords"); - prof_start!(maybe_profiler, "quotient codewords"); + prof_start!( + maybe_profiler, + "compute and combine quotient codewords", + "CC" + ); let master_quotient_table = all_quotients( base_quotient_domain_codewords, ext_quotient_domain_codewords, @@ -193,24 +204,14 @@ impl Stark { &challenges, maybe_profiler, ); - prof_stop!(maybe_profiler, "quotient codewords"); - - prof_start!(maybe_profiler, "linearly combine quotient codewords", "CC"); - // Create quotient codeword. This is a part of the combination codeword. To reduce the - // amount of hashing necessary, the quotient codeword is linearly summed instead of - // hashed prior to committing to it. - let quotient_combination_weights = - proof_stream.sample_scalars(MasterExtTable::NUM_CONSTRAINTS); - let quotient_combination_weights = Array1::from(quotient_combination_weights); assert_eq!( quotient_combination_weights.len(), master_quotient_table.ncols() ); - let quotient_codeword = Self::random_linear_sum(master_quotient_table.view(), quotient_combination_weights); assert_eq!(quotient_domain.length, quotient_codeword.len()); - prof_stop!(maybe_profiler, "linearly combine quotient codewords"); + prof_stop!(maybe_profiler, "compute and combine quotient codewords"); prof_start!(maybe_profiler, "commit to quotient codeword segments"); prof_start!(maybe_profiler, "LDE", "LDE"); diff --git a/triton-vm/src/table/extension_table.rs b/triton-vm/src/table/extension_table.rs index d8cb25ab4..f5b1a74a9 100644 --- a/triton-vm/src/table/extension_table.rs +++ b/triton-vm/src/table/extension_table.rs @@ -18,6 +18,9 @@ use crate::arithmetic_domain::ArithmeticDomain; use crate::table::challenges::Challenges; use crate::table::master_table::MasterExtTable; +/// The implementations of these functions are automatically generated using the +/// command `cargo run --bin constraint-evaluation-generator` and live in +/// `constraints.rs`. pub trait Evaluable { /// The code for this method must be generated by running /// `cargo run --bin constraint-evaluation-generator`