diff --git a/triton-vm/src/cross_table_arguments.rs b/triton-vm/src/cross_table_arguments.rs index 0802771ea..254abcacd 100644 --- a/triton-vm/src/cross_table_arguments.rs +++ b/triton-vm/src/cross_table_arguments.rs @@ -45,15 +45,16 @@ pub trait CrossTableArg { &self, ext_codeword_tables: &ExtTableCollection, domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, ) -> Vec { let from_codeword = self.combined_from_codeword(ext_codeword_tables); let to_codeword = self.combined_to_codeword(ext_codeword_tables); + let trace_domain_generator_inverse = trace_domain_generator.inverse(); let zerofier = domain .domain_values() .into_iter() - .map(|x| x - omicron.inverse()) + .map(|x| x - trace_domain_generator_inverse) .collect(); let zerofier_inverse = BFieldElement::batch_inversion(zerofier); @@ -454,7 +455,7 @@ impl GrandCrossTableArg { &self, ext_codeword_tables: &ExtTableCollection, domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, ) -> Vec { let mut non_linear_sum_codeword = vec![XFieldElement::zero(); domain.length]; @@ -497,10 +498,11 @@ impl GrandCrossTableArg { XFieldElement::add, ); + let trace_domain_generator_inverse = trace_domain_generator.inverse(); let zerofier = domain .domain_values() .into_iter() - .map(|x| x - omicron.inverse()) + .map(|x| x - trace_domain_generator_inverse) .collect(); let zerofier_inverse = BFieldElement::batch_inversion(zerofier); diff --git a/triton-vm/src/stark.rs b/triton-vm/src/stark.rs index e7505359b..e8f734d26 100644 --- a/triton-vm/src/stark.rs +++ b/triton-vm/src/stark.rs @@ -31,7 +31,9 @@ use crate::proof_item::ProofItem; use crate::proof_stream::ProofStream; use crate::table::base_matrix::AlgebraicExecutionTrace; use crate::table::challenges::AllChallenges; -use crate::table::table_collection::{derive_omicron, BaseTableCollection, ExtTableCollection}; +use crate::table::table_collection::{ + derive_trace_domain_generator, BaseTableCollection, ExtTableCollection, +}; use super::table::base_matrix::BaseMatrices; @@ -279,7 +281,7 @@ impl Stark { .terminal_quotient_codeword( &full_arithmetic_domain_tables, &arithmetic_domain, - derive_omicron(full_arithmetic_domain_tables.padded_height as u64), + derive_trace_domain_generator(full_arithmetic_domain_tables.padded_height as u64), ); quotient_codewords.push(grand_cross_table_arg_quotient_codeword); @@ -360,7 +362,7 @@ impl Stark { prof_stop!(maybe_profiler, "FRI"); prof_start!(maybe_profiler, "open trace leafs"); - // the relation between the FRI domain and the omicron domain + // the relation between the FRI domain and the trace domain let unit_distance = self.fri.domain.length / base_trace_tables.padded_height; // Open leafs of zipped codewords at indicated positions let revealed_indices = @@ -762,7 +764,7 @@ impl Stark { prof_start!(maybe_profiler, "check leafs"); prof_start!(maybe_profiler, "get indices"); - // the relation between the FRI domain and the omicron domain + // the relation between the FRI domain and the trace domain let unit_distance = self.fri.domain.length / ext_table_collection.padded_height; // Open leafs of zipped codewords at indicated positions let revealed_indices = self.get_revealed_indices(unit_distance, &combination_check_indices); @@ -867,8 +869,8 @@ impl Stark { let base_offset = self.parameters.num_randomizer_polynomials; let ext_offset = base_offset + num_base_polynomials; let final_offset = ext_offset + num_extension_polynomials; - let omicron = derive_omicron(padded_height as u64); - let omicron_inverse = omicron.inverse(); + let trace_domain_generator = derive_trace_domain_generator(padded_height as u64); + let trace_domain_generator_inverse = trace_domain_generator.inverse(); for (combination_check_index, revealed_combination_leaf) in combination_check_indices .into_iter() .zip_eq(revealed_combination_leafs) @@ -1008,7 +1010,7 @@ impl Stark { { let shift = self.max_degree - degree_bound; let quotient = { - let numerator = current_fri_domain_value - omicron_inverse; + let numerator = current_fri_domain_value - trace_domain_generator_inverse; let denominator = current_fri_domain_value .mod_pow_u32(padded_height as u32) - BFieldElement::one(); @@ -1028,8 +1030,8 @@ impl Stark { .zip_eq(terminal_quotient_degree_bounds.iter()) { let shift = self.max_degree - degree_bound; - let quotient = - evaluated_termc / (current_fri_domain_value - omicron_inverse).lift(); + let quotient = evaluated_termc + / (current_fri_domain_value - trace_domain_generator_inverse).lift(); let quotient_shifted = quotient * current_fri_domain_value.mod_pow_u32(shift as u32); summands.push(quotient); @@ -1050,7 +1052,7 @@ impl Stark { let grand_cross_table_arg_evaluated = grand_cross_table_arg.evaluate_non_linear_sum_of_differences(&cross_slice_by_table); let grand_cross_table_arg_quotient = grand_cross_table_arg_evaluated - / (current_fri_domain_value - omicron_inverse).lift(); + / (current_fri_domain_value - trace_domain_generator_inverse).lift(); let grand_cross_table_arg_quotient_shifted = grand_cross_table_arg_quotient * current_fri_domain_value.mod_pow_u32(shift as u32); summands.push(grand_cross_table_arg_quotient); diff --git a/triton-vm/src/table/extension_table.rs b/triton-vm/src/table/extension_table.rs index b1c0160fe..11c51082b 100644 --- a/triton-vm/src/table/extension_table.rs +++ b/triton-vm/src/table/extension_table.rs @@ -258,13 +258,13 @@ pub trait Quotientable: ExtensionTable + Evaluable { domain: &Domain, transposed_codewords: &[Vec], challenges: &AllChallenges, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, padded_height: usize, ) -> Vec> { debug_assert_eq!(domain.length, transposed_codewords.len()); let one = XFieldElement::one(); - let omicron_inverse = omicron.inverse(); + let trace_domain_generator_inverse = trace_domain_generator.inverse(); let domain_values = domain.domain_values(); let subgroup_zerofier: Vec<_> = domain_values @@ -275,7 +275,9 @@ pub trait Quotientable: ExtensionTable + Evaluable { let zerofier_inverse: Vec<_> = domain_values .into_par_iter() .zip_eq(subgroup_zerofier_inverse.into_par_iter()) - .map(|(domain_value, sub_z_inv)| (domain_value - omicron_inverse) * sub_z_inv) + .map(|(domain_value, sub_z_inv)| { + (domain_value - trace_domain_generator_inverse) * sub_z_inv + }) .collect(); // the relation between the arithmetic domain and the trace domain let unit_distance = domain.length / padded_height; @@ -308,16 +310,16 @@ pub trait Quotientable: ExtensionTable + Evaluable { domain: &Domain, transposed_codewords: &[Vec], challenges: &AllChallenges, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, ) -> Vec> { debug_assert_eq!(domain.length, transposed_codewords.len()); // The zerofier for the terminal quotient has a root in the last - // value in the cyclical group generated from omicron. + // value in the cyclical group generated from the trace domain's generator. let zerofier_codeword = domain .domain_values() .into_iter() - .map(|x| x - omicron.inverse()) + .map(|x| x - trace_domain_generator.inverse()) .collect_vec(); let zerofier_inverse = BFieldElement::batch_inversion(zerofier_codeword); @@ -341,7 +343,7 @@ pub trait Quotientable: ExtensionTable + Evaluable { domain: &Domain, transposed_codewords: Vec>, challenges: &AllChallenges, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, padded_height: usize, maybe_profiler: &mut Option, ) -> Vec> { @@ -369,7 +371,7 @@ pub trait Quotientable: ExtensionTable + Evaluable { domain, &transposed_codewords, challenges, - omicron, + trace_domain_generator, padded_height, ); if let Some(p) = maybe_profiler.as_mut() { @@ -379,8 +381,12 @@ pub trait Quotientable: ExtensionTable + Evaluable { if let Some(p) = maybe_profiler.as_mut() { p.start("terminal quotients") } - let terminal_quotients = - self.terminal_quotients(domain, &transposed_codewords, challenges, omicron); + let terminal_quotients = self.terminal_quotients( + domain, + &transposed_codewords, + challenges, + trace_domain_generator, + ); if let Some(p) = maybe_profiler.as_mut() { p.stop("terminal quotients") } diff --git a/triton-vm/src/table/instruction_table.rs b/triton-vm/src/table/instruction_table.rs index 91d7b5301..29f1d0bef 100644 --- a/triton-vm/src/table/instruction_table.rs +++ b/triton-vm/src/table/instruction_table.rs @@ -348,14 +348,14 @@ impl InstructionTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let base_columns = 0..self.base_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, base_columns, ); @@ -489,14 +489,14 @@ impl ExtInstructionTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let ext_columns = self.base_width()..self.full_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ext_columns, ); diff --git a/triton-vm/src/table/jump_stack_table.rs b/triton-vm/src/table/jump_stack_table.rs index 119d22d99..7ea848ff1 100644 --- a/triton-vm/src/table/jump_stack_table.rs +++ b/triton-vm/src/table/jump_stack_table.rs @@ -334,14 +334,14 @@ impl JumpStackTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let base_columns = 0..self.base_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, base_columns, ); @@ -469,14 +469,14 @@ impl ExtJumpStackTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let ext_columns = self.base_width()..self.full_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ext_columns, ); diff --git a/triton-vm/src/table/op_stack_table.rs b/triton-vm/src/table/op_stack_table.rs index c1f11b883..583f841f7 100644 --- a/triton-vm/src/table/op_stack_table.rs +++ b/triton-vm/src/table/op_stack_table.rs @@ -292,14 +292,14 @@ impl OpStackTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let base_columns = 0..self.base_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, base_columns, ); @@ -414,14 +414,14 @@ impl ExtOpStackTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let ext_columns = self.base_width()..self.full_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ext_columns, ); diff --git a/triton-vm/src/table/processor_table.rs b/triton-vm/src/table/processor_table.rs index 7c1f5e923..544b5f744 100644 --- a/triton-vm/src/table/processor_table.rs +++ b/triton-vm/src/table/processor_table.rs @@ -66,14 +66,14 @@ impl ProcessorTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let base_columns = 0..self.base_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, base_columns, ); @@ -370,14 +370,14 @@ impl ExtProcessorTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let ext_columns = self.base_width()..self.full_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ext_columns, ); diff --git a/triton-vm/src/table/program_table.rs b/triton-vm/src/table/program_table.rs index 4515ff9db..c7543d8dd 100644 --- a/triton-vm/src/table/program_table.rs +++ b/triton-vm/src/table/program_table.rs @@ -199,14 +199,14 @@ impl ProgramTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let base_columns = 0..self.base_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, base_columns, ); @@ -311,14 +311,14 @@ impl ExtProgramTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let ext_columns = self.base_width()..self.full_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ext_columns, ); diff --git a/triton-vm/src/table/ram_table.rs b/triton-vm/src/table/ram_table.rs index 25cc4160f..227070b6c 100644 --- a/triton-vm/src/table/ram_table.rs +++ b/triton-vm/src/table/ram_table.rs @@ -92,14 +92,14 @@ impl RamTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let base_columns = 0..self.base_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, base_columns, ); @@ -234,14 +234,14 @@ impl ExtRamTable { &self, arithmetic_domain: &Domain, fri_domain: &Domain, - omicron: BFieldElement, + trace_domain_generator: BFieldElement, num_trace_randomizers: usize, ) -> (Self, Self) { let ext_columns = self.base_width()..self.full_width(); let (arithmetic_domain_table, fri_domain_table) = self.dual_low_degree_extension( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ext_columns, ); diff --git a/triton-vm/src/table/table_collection.rs b/triton-vm/src/table/table_collection.rs index bc97693d2..f4dd9edf6 100644 --- a/triton-vm/src/table/table_collection.rs +++ b/triton-vm/src/table/table_collection.rs @@ -78,7 +78,7 @@ pub fn interpolant_degree(padded_height: usize, num_trace_randomizers: usize) -> (padded_height + num_trace_randomizers - 1) as Degree } -pub fn derive_omicron(padded_height: u64) -> BFieldElement { +pub fn derive_trace_domain_generator(padded_height: u64) -> BFieldElement { debug_assert!( 0 == padded_height || is_power_of_two(padded_height), "The padded height was: {}", @@ -139,55 +139,55 @@ impl BaseTableCollection { num_trace_randomizers: usize, ) -> (Self, Self) { let padded_height = self.padded_height; - let omicron = derive_omicron(padded_height as u64); + let trace_domain_generator = derive_trace_domain_generator(padded_height as u64); let (program_table_arithmetic, program_table_fri) = self.program_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (instruction_table_arithmetic, instruction_table_fri) = self.instruction_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (processor_table_arithmetic, processor_table_fri) = self.processor_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (op_stack_table_arithmetic, op_stack_table_fri) = self.op_stack_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (ram_table_arithmetic, ram_table_fri) = self.ram_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (jump_stack_table_arithmetic, jump_stack_table_fri) = self.jump_stack_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (hash_table_arithmetic, hash_table_fri) = self.hash_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); @@ -395,55 +395,55 @@ impl ExtTableCollection { num_trace_randomizers: usize, ) -> (Self, Self) { let padded_height = self.padded_height; - let omicron = derive_omicron(padded_height as u64); + let trace_domain_generator = derive_trace_domain_generator(padded_height as u64); let (program_table_arithmetic, program_table_fri) = self.program_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (instruction_table_arithmetic, instruction_table_fri) = self.instruction_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (processor_table_arithmetic, processor_table_fri) = self.processor_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (op_stack_table_arithmetic, op_stack_table_fri) = self.op_stack_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (ram_table_arithmetic, ram_table_fri) = self.ram_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (jump_stack_table_arithmetic, jump_stack_table_fri) = self.jump_stack_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); let (hash_table_arithmetic, hash_table_fri) = self.hash_table.to_arithmetic_and_fri_domain_table( arithmetic_domain, fri_domain, - omicron, + trace_domain_generator, num_trace_randomizers, ); @@ -515,7 +515,7 @@ impl ExtTableCollection { maybe_profiler: &mut Option, ) -> Vec> { let padded_height = self.padded_height; - let omicron = derive_omicron(padded_height as u64); + let trace_domain_generator = derive_trace_domain_generator(padded_height as u64); self.into_iter() .map(|ext_codeword_table| { @@ -529,7 +529,7 @@ impl ExtTableCollection { domain, transposed_codewords, challenges, - omicron, + trace_domain_generator, padded_height, maybe_profiler, );