From bd3faff82660122d3b5a5d08e7be4e22f804c721 Mon Sep 17 00:00:00 2001 From: Robert Remen Date: Wed, 25 Feb 2026 17:41:10 +0100 Subject: [PATCH] chore: fix repository typos and extend typos config --- _typos.toml | 14 +++- blake2s_u32/src/lib.rs | 6 +- blake2s_u32/src/vectorized_impls/arm_neon.rs | 16 ++--- .../bigint_with_control/verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../keccak_special5/verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../risc_v_cycles/verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../inits_and_teardowns/verifier/src/tests.rs | 4 +- .../jump_branch_slt/verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- .../mul_div/verifier/src/tests.rs | 4 +- .../mul_div_unsigned/verifier/src/tests.rs | 4 +- .../shift_binary_csr/verifier/src/tests.rs | 4 +- .../verifier/src/tests.rs | 4 +- cs/src/cs/cs_reference.rs | 6 +- cs/src/cs/utils.rs | 4 +- cs/src/definitions/stage2.rs | 4 +- .../blake2_round_with_extended_control/mod.rs | 4 +- .../ops/unrolled/add_sub_lui_auipc_mop.rs | 4 +- .../ops/unrolled/decoder/decoder_circuit.rs | 2 +- .../ops/unrolled/decoder/decoder_table.md | 2 +- cs/src/machine/ops/unrolled/decoder/mod.rs | 2 +- .../unrolled/decoder/reduced_machine_ops.rs | 6 +- .../machine/ops/unrolled/shift_binary_csr.rs | 2 +- cs/src/machine/utils.rs | 2 +- .../bytecode_preprocessed_executor.rs | 2 +- .../compile_init_and_teardown_circuit.rs | 2 +- .../one_row_compiler/decoder_compilation.rs | 2 +- .../one_row_compiler/executor_compilation.rs | 2 +- cs/src/one_row_compiler/layout_utils.rs | 40 +++++------ docs/philosophy_and_logic.md | 2 +- docs/tutorial.md | 2 +- execution_utils/src/unrolled.rs | 4 +- .../src/unified_circuit_statement.rs | 2 +- .../src/unrolled_proof_statement.rs | 2 +- gpu_prover/src/prover/stage_1.rs | 4 +- .../prover/unrolled_prover/stage_2_kernels.rs | 2 +- .../quotient_parts/every_row_except_last.rs | 66 +++++++++---------- .../prover_stages/unrolled_prover/stage2.rs | 2 +- .../prover_stages/unrolled_prover/stage3.rs | 2 +- .../unrolled_prover/stage_2_ram_shared.rs | 42 ++++++------ prover/src/tests/unrolled/mod.rs | 2 +- .../tracers/oracles/transpiler_oracles/mod.rs | 2 +- prover/src/tracers/unrolled/tracer.rs | 6 +- .../unrolled/word_specialized_tracer.rs | 10 +-- risc_v_simulator/src/sim/diag.rs | 2 +- risc_v_simulator/src/sim/mod.rs | 2 +- riscv_common/src/memcpy.rs | 2 +- riscv_transpiler/src/jit/impls.rs | 8 +-- riscv_transpiler/src/jit/mod.rs | 2 +- riscv_transpiler/src/jit/structs.rs | 2 +- riscv_transpiler/src/jit/tests.rs | 12 ++-- riscv_transpiler/src/replayer/mod.rs | 2 +- riscv_transpiler/src/witness/mod.rs | 4 +- tools/cli/README.md | 2 +- tools/pow_config_generator/README.md | 4 +- verifier/src/tests.rs | 4 +- .../src/inlining_generator/mod.rs | 2 +- 64 files changed, 200 insertions(+), 188 deletions(-) diff --git a/_typos.toml b/_typos.toml index fd20c80f6..53ee57255 100644 --- a/_typos.toml +++ b/_typos.toml @@ -2,6 +2,12 @@ extend-exclude = [ "*.json", "*.lock", + "*.bin", + "*.elf", + "*.pdf", + "*.png", + "*.text", + "*.bak", "*.svg", ".git/", "SECURITY.md" @@ -16,4 +22,10 @@ sie = "sie" Sie = "Sie" tou = "tou" leafs = "leafs" -LEAFS = "LEAFS" \ No newline at end of file +LEAFS = "LEAFS" +INOT = "INOT" +inot = "inot" + +[type.asm.extend-words] +Wich = "Wich" +TRE = "TRE" diff --git a/blake2s_u32/src/lib.rs b/blake2s_u32/src/lib.rs index e42008614..d6c1259d9 100644 --- a/blake2s_u32/src/lib.rs +++ b/blake2s_u32/src/lib.rs @@ -54,7 +54,7 @@ pub const CONFIGURED_IV: [u32; 8] = const { result }; -pub const EXNTENDED_CONFIGURED_IV: [u32; BLAKE2S_EXTENDED_STATE_WIDTH_IN_U32_WORDS] = const { +pub const EXTENDED_CONFIGURED_IV: [u32; BLAKE2S_EXTENDED_STATE_WIDTH_IN_U32_WORDS] = const { let mut result = [0u32; BLAKE2S_EXTENDED_STATE_WIDTH_IN_U32_WORDS]; let mut i = 0; while i < 8 { @@ -78,7 +78,7 @@ pub use self::state_with_extended_control::Blake2RoundFunctionEvaluator as Deleg pub mod state_with_extended_control_flags { use crate::BLAKE2S_BLOCK_SIZE_BYTES; - use crate::EXNTENDED_CONFIGURED_IV; + use crate::EXTENDED_CONFIGURED_IV; pub const REDUCE_ROUNDS_BIT_IDX: usize = 0; pub const INPUT_IS_RIGHT_NODE_BIT_IDX: usize = 1; @@ -89,7 +89,7 @@ pub mod state_with_extended_control_flags { pub const TEST_IF_COMPRESSION_MODE_MASK: u32 = 1 << COMPRESSION_MODE_BIT_IDX; pub const COMPRESSION_MODE_EXTENDED_CONFIGURED_IV: [u32; 16] = const { - let mut result = EXNTENDED_CONFIGURED_IV; + let mut result = EXTENDED_CONFIGURED_IV; result[12] ^= BLAKE2S_BLOCK_SIZE_BYTES as u32; result[14] ^= 0xffffffff; diff --git a/blake2s_u32/src/vectorized_impls/arm_neon.rs b/blake2s_u32/src/vectorized_impls/arm_neon.rs index d5203d37f..a2dcce72b 100644 --- a/blake2s_u32/src/vectorized_impls/arm_neon.rs +++ b/blake2s_u32/src/vectorized_impls/arm_neon.rs @@ -128,25 +128,25 @@ impl State { use core::arch::aarch64::vld1q_u32; Self([ - vld1q_u32(&EXNTENDED_CONFIGURED_IV[0] as *const u32), - vld1q_u32(&EXNTENDED_CONFIGURED_IV[4] as *const u32), - vld1q_u32(&EXNTENDED_CONFIGURED_IV[8] as *const u32), - vld1q_u32(&EXNTENDED_CONFIGURED_IV[12] as *const u32), + vld1q_u32(&EXTENDED_CONFIGURED_IV[0] as *const u32), + vld1q_u32(&EXTENDED_CONFIGURED_IV[4] as *const u32), + vld1q_u32(&EXTENDED_CONFIGURED_IV[8] as *const u32), + vld1q_u32(&EXTENDED_CONFIGURED_IV[12] as *const u32), ]) } #[inline(always)] unsafe fn partial_reset(&mut self) { use core::arch::aarch64::vld1q_u32; - self.0[0] = vld1q_u32(&EXNTENDED_CONFIGURED_IV[0] as *const u32); - self.0[1] = vld1q_u32(&EXNTENDED_CONFIGURED_IV[4] as *const u32); + self.0[0] = vld1q_u32(&EXTENDED_CONFIGURED_IV[0] as *const u32); + self.0[1] = vld1q_u32(&EXTENDED_CONFIGURED_IV[4] as *const u32); } #[inline(always)] unsafe fn reset_for_round(&mut self, t: u32, is_last_round: bool) { use core::arch::aarch64::vld1q_u32; - self.0[2] = vld1q_u32(&EXNTENDED_CONFIGURED_IV[8] as *const u32); - let el = vld1q_u32(&EXNTENDED_CONFIGURED_IV[12] as *const u32); + self.0[2] = vld1q_u32(&EXTENDED_CONFIGURED_IV[8] as *const u32); + let el = vld1q_u32(&EXTENDED_CONFIGURED_IV[12] as *const u32); let xor_in = vld1q_u32(&[t, 0, (is_last_round as u32) * 0xffffffff, 0] as *const u32); use core::arch::aarch64::veorq_u32; let el = veorq_u32(el, xor_in); diff --git a/circuit_defs/bigint_with_control/verifier/src/tests.rs b/circuit_defs/bigint_with_control/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/bigint_with_control/verifier/src/tests.rs +++ b/circuit_defs/bigint_with_control/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/blake2_with_compression/verifier/src/tests.rs b/circuit_defs/blake2_with_compression/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/blake2_with_compression/verifier/src/tests.rs +++ b/circuit_defs/blake2_with_compression/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/final_reduced_risc_v_machine/verifier/src/tests.rs b/circuit_defs/final_reduced_risc_v_machine/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/final_reduced_risc_v_machine/verifier/src/tests.rs +++ b/circuit_defs/final_reduced_risc_v_machine/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/keccak_special5/verifier/src/tests.rs b/circuit_defs/keccak_special5/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/keccak_special5/verifier/src/tests.rs +++ b/circuit_defs/keccak_special5/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/machine_without_signed_mul_div/verifier/src/tests.rs b/circuit_defs/machine_without_signed_mul_div/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/machine_without_signed_mul_div/verifier/src/tests.rs +++ b/circuit_defs/machine_without_signed_mul_div/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/reduced_risc_v_log_23_machine/verifier/src/tests.rs b/circuit_defs/reduced_risc_v_log_23_machine/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/reduced_risc_v_log_23_machine/verifier/src/tests.rs +++ b/circuit_defs/reduced_risc_v_log_23_machine/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/reduced_risc_v_machine/verifier/src/tests.rs b/circuit_defs/reduced_risc_v_machine/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/reduced_risc_v_machine/verifier/src/tests.rs +++ b/circuit_defs/reduced_risc_v_machine/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/risc_v_cycles/verifier/src/tests.rs b/circuit_defs/risc_v_cycles/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/risc_v_cycles/verifier/src/tests.rs +++ b/circuit_defs/risc_v_cycles/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/add_sub_lui_auipc_mop/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/add_sub_lui_auipc_mop/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/add_sub_lui_auipc_mop/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/add_sub_lui_auipc_mop/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/inits_and_teardowns/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/inits_and_teardowns/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/inits_and_teardowns/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/inits_and_teardowns/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/jump_branch_slt/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/jump_branch_slt/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/jump_branch_slt/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/jump_branch_slt/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/load_store_subword_only/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/load_store_subword_only/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/load_store_subword_only/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/load_store_subword_only/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/load_store_word_only/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/load_store_word_only/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/load_store_word_only/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/load_store_word_only/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/mul_div/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/mul_div/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/mul_div/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/mul_div/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/mul_div_unsigned/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/mul_div_unsigned/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/mul_div_unsigned/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/mul_div_unsigned/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/shift_binary_csr/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/shift_binary_csr/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/shift_binary_csr/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/shift_binary_csr/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/circuit_defs/unrolled_circuits/unified_reduced_machine/verifier/src/tests.rs b/circuit_defs/unrolled_circuits/unified_reduced_machine/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/circuit_defs/unrolled_circuits/unified_reduced_machine/verifier/src/tests.rs +++ b/circuit_defs/unrolled_circuits/unified_reduced_machine/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/cs/src/cs/cs_reference.rs b/cs/src/cs/cs_reference.rs index 408678ca9..865824053 100644 --- a/cs/src/cs/cs_reference.rs +++ b/cs/src/cs/cs_reference.rs @@ -708,7 +708,7 @@ impl> Circuit for BasicAssembly { rs1_index: self.add_variable(), rs2_index: self.add_variable(), rd_index: self.add_variable(), - rd_is_zero: self.add_variable(), // boolean in nature, but constrainted by prover directly + rd_is_zero: self.add_variable(), // boolean in nature, but constrained by prover directly imm: std::array::from_fn(|_| self.add_variable()), funct3: self.add_variable(), funct7: Some(self.add_variable()), @@ -782,7 +782,7 @@ impl> Circuit for BasicAssembly { rs1_index: self.add_variable(), rs2_index: self.add_variable(), rd_index: self.add_variable(), - rd_is_zero: self.add_variable(), // boolean in nature, but constrainted by prover directly + rd_is_zero: self.add_variable(), // boolean in nature, but constrained by prover directly imm: std::array::from_fn(|_| self.add_variable()), funct3: self.add_variable(), funct7: if ASSUME_PREPROCESSED_DECODER_TABLE { @@ -852,7 +852,7 @@ impl> Circuit for BasicAssembly { todo!(); } - // not make a final state - opcode family circuit is reponsible to create a PC, + // not make a final state - opcode family circuit is responsible to create a PC, // and timestamps bump comes from compiler let pc: [Variable; 2] = std::array::from_fn(|_| self.add_variable()); diff --git a/cs/src/cs/utils.rs b/cs/src/cs/utils.rs index ff802b8ed..360d5f6b8 100644 --- a/cs/src/cs/utils.rs +++ b/cs/src/cs/utils.rs @@ -218,14 +218,14 @@ pub struct PreprocessedConstraintForEval { impl PreprocessedConstraintForEval { pub fn from_constraint(constraint: Constraint) -> Self { - let (quatratic_terms, linear_terms, constant_term) = + let (quadratic_terms, linear_terms, constant_term) = constraint.clone().split_max_quadratic(); // split quadratic terms and linear terms into cases where coefficient is 1 or not let mut quadratic_trivial_additions = vec![]; let mut quadratic_trivial_subtractions = vec![]; let mut quadratic_nontrivial = vec![]; - for (c, a, b) in quatratic_terms.into_iter() { + for (c, a, b) in quadratic_terms.into_iter() { assert!(c != F::ZERO); if c == F::ONE { quadratic_trivial_additions.push((a, b)); diff --git a/cs/src/definitions/stage2.rs b/cs/src/definitions/stage2.rs index 382dc145d..78c47a363 100644 --- a/cs/src/definitions/stage2.rs +++ b/cs/src/definitions/stage2.rs @@ -377,7 +377,7 @@ impl LookupAndMemoryArgumentLayout { memory_layout.batched_ram_accesses.is_empty() && memory_layout.register_and_indirect_accesses.is_empty() ); - // itermediate accumulators per access + // intermediate accumulators per access let num_set_polys_for_memory_shuffle = memory_layout.shuffle_ram_access_sets.len(); AlignedColumnSet::layout_at(&mut offset, num_set_polys_for_memory_shuffle) @@ -393,7 +393,7 @@ impl LookupAndMemoryArgumentLayout { num_intermediate_polys_for_register_or_indirect_accesses += el.indirect_accesses.len(); } - // itermediate accumulators per access + // intermediate accumulators per access let num_set_polys_for_memory_shuffle = num_intermediate_polys_for_batched_ram + num_intermediate_polys_for_register_or_indirect_accesses; diff --git a/cs/src/delegation/blake2_round_with_extended_control/mod.rs b/cs/src/delegation/blake2_round_with_extended_control/mod.rs index d29f3afe5..e5b373cc4 100644 --- a/cs/src/delegation/blake2_round_with_extended_control/mod.rs +++ b/cs/src/delegation/blake2_round_with_extended_control/mod.rs @@ -12,7 +12,7 @@ use crate::types::Num; use blake2s_u32::state_with_extended_control_flags::*; use blake2s_u32::BLAKE2S_BLOCK_SIZE_U32_WORDS; use blake2s_u32::CONFIGURED_IV; -use blake2s_u32::EXNTENDED_CONFIGURED_IV; +use blake2s_u32::EXTENDED_CONFIGURED_IV; use blake2s_u32::SIGMAS; use common_constants::delegation_types::blake2s_with_control::*; @@ -292,7 +292,7 @@ pub fn define_blake2_with_extended_control_delegation_circuit>( // Witness function let out_vars = out.0.map(|el| el.get_variable()); - let intemediate_vars = intermediate_tmp.0.map(|el| el.get_variable()); + let intermediate_vars = intermediate_tmp.0.map(|el| el.get_variable()); let imm_vars = inputs.decoder_data.imm; let pc_vars = inputs.cycle_start_state.pc; let rs1_vars = rs1_reg.0.map(|el| el.get_variable()); @@ -420,7 +420,7 @@ fn apply_add_sub_lui_auipc_mop>( // actually assign placer.assign_u32_from_u16_parts(out_vars, &out_value); - placer.assign_u32_from_u16_parts(intemediate_vars, &intermediate_value); + placer.assign_u32_from_u16_parts(intermediate_vars, &intermediate_value); placer.assign_mask(of_var, &of_value); }; cs.set_values(value_fn); diff --git a/cs/src/machine/ops/unrolled/decoder/decoder_circuit.rs b/cs/src/machine/ops/unrolled/decoder/decoder_circuit.rs index a48b7c4f3..fe2118798 100644 --- a/cs/src/machine/ops/unrolled/decoder/decoder_circuit.rs +++ b/cs/src/machine/ops/unrolled/decoder/decoder_circuit.rs @@ -38,7 +38,7 @@ pub fn describe_decoder_cycle< // instruction set of variables: low: [15:0], high: [31:16] // the most shredded instruction type is B-type (with additional splitting of rs_2, required for J-type): // all other instruction types can be constructed from - // chunks of splitted instruction are: + // chunks of split instruction are: // opcode [6:0], imm11: [7], imm[4-1]: [11:8], func3: [14:12], rs1: [19:15], // rs2_low: [20], rs2_high: [24:21], imm[10-5]: [30:25], imm12: [31] // rs1 crosses the border of register, so we will allocate an extra boolean variable diff --git a/cs/src/machine/ops/unrolled/decoder/decoder_table.md b/cs/src/machine/ops/unrolled/decoder/decoder_table.md index 315305da9..d7b4e1459 100644 --- a/cs/src/machine/ops/unrolled/decoder/decoder_table.md +++ b/cs/src/machine/ops/unrolled/decoder/decoder_table.md @@ -43,4 +43,4 @@ Total of 5 bits Decoder table takes a combination of `opcode` (7 bits) + `funct3` (3 bits) + `funct7` (7 bits) pieces as the input, and outputs 2 values: - opcode family. It's a variable that will participate directly in the permutation argument over states -- linear combination of bitmask of `invalid || opcode_format_bits` to select immediate - this part will be bit-decomposed by the decoder for it's work - and 8 bit coarsely constrainted bitmask that will be a variable named `circuit_family_extra_mask` in the permutation argument over states +- linear combination of bitmask of `invalid || opcode_format_bits` to select immediate - this part will be bit-decomposed by the decoder for it's work - and 8 bit coarsely constrained bitmask that will be a variable named `circuit_family_extra_mask` in the permutation argument over states diff --git a/cs/src/machine/ops/unrolled/decoder/mod.rs b/cs/src/machine/ops/unrolled/decoder/mod.rs index cbda85c0d..cfaaa617d 100644 --- a/cs/src/machine/ops/unrolled/decoder/mod.rs +++ b/cs/src/machine/ops/unrolled/decoder/mod.rs @@ -49,7 +49,7 @@ pub trait InstructionFamilyBitmaskCircuitParser: 'static + std::fmt::Debug { } pub const INVALID_OPCODE_DEFAULTS: (bool, InstructionType, InstructionFamilyBitmaskRepr) = - (false, InstructionType::RType, 0); // We do not need info about instruciton being R-type for decoder + (false, InstructionType::RType, 0); // We do not need info about instruction being R-type for decoder #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct ExecutorFamilyDecoderExtendedData { diff --git a/cs/src/machine/ops/unrolled/decoder/reduced_machine_ops.rs b/cs/src/machine/ops/unrolled/decoder/reduced_machine_ops.rs index 1e7403545..28818dbe9 100644 --- a/cs/src/machine/ops/unrolled/decoder/reduced_machine_ops.rs +++ b/cs/src/machine/ops/unrolled/decoder/reduced_machine_ops.rs @@ -117,7 +117,7 @@ impl OpcodeFamilyDecoder for ReducedMachineDecoder { }; let mut validate_csr = false; - let mut avoid_sign_ext_immedaite = false; + let mut avoid_sign_ext_immediate = false; for supported_opcode in self.cached_all_opcodes.iter() { if let Ok((instr_format, major_key, minor_keys)) = @@ -126,11 +126,11 @@ impl OpcodeFamilyDecoder for ReducedMachineDecoder { if op == OPERATION_SYSTEM && func3 == 0b001 { // CSRRW only in system space, not MOP one // only if opcode is supported - avoid_sign_ext_immedaite = true; + avoid_sign_ext_immediate = true; validate_csr = true; } - let imm = instr_format.parse_imm(opcode, avoid_sign_ext_immedaite); + let imm = instr_format.parse_imm(opcode, avoid_sign_ext_immediate); let mut mask = 0u32; diff --git a/cs/src/machine/ops/unrolled/shift_binary_csr.rs b/cs/src/machine/ops/unrolled/shift_binary_csr.rs index e89b499d4..202306308 100644 --- a/cs/src/machine/ops/unrolled/shift_binary_csr.rs +++ b/cs/src/machine/ops/unrolled/shift_binary_csr.rs @@ -3,7 +3,7 @@ use crate::cs::witness_placer::*; use super::*; // NOTE: this circuit should specify non-dummy CSR table in proving/setup. while compilation in tests -// takes case of properly computing offsets by using dummy talbe +// takes case of properly computing offsets by using dummy table pub fn shift_binop_csrrw_tables() -> Vec { vec![ diff --git a/cs/src/machine/utils.rs b/cs/src/machine/utils.rs index 55b73e15c..7de81569b 100644 --- a/cs/src/machine/utils.rs +++ b/cs/src/machine/utils.rs @@ -135,7 +135,7 @@ pub fn bump_pc_no_range_checks_explicit>( ) { // Input invariant: PC % 4 == 0, preserved as: // - initial PC is valid % 4 - // - jumps and branches check for alignemnts + // - jumps and branches check for alignments // check if PC_LOW + 4 is exactly 2^16, and then select diff --git a/cs/src/one_row_compiler/bytecode_preprocessed_executor.rs b/cs/src/one_row_compiler/bytecode_preprocessed_executor.rs index 7af472ad0..54869d3f4 100644 --- a/cs/src/one_row_compiler/bytecode_preprocessed_executor.rs +++ b/cs/src/one_row_compiler/bytecode_preprocessed_executor.rs @@ -410,7 +410,7 @@ impl OneRowCompiler { let mut compiled_quadratic_terms = vec![]; let mut compiled_linear_terms = vec![]; - // Now we will pause and place boolean variables, as those can have their contraints special-handled in quotient + // Now we will pause and place boolean variables, as those can have their constraints special-handled in quotient // normalize again just in case for (el, _) in constraints.iter_mut() { el.normalize(); diff --git a/cs/src/one_row_compiler/compile_init_and_teardown_circuit.rs b/cs/src/one_row_compiler/compile_init_and_teardown_circuit.rs index a6fa5f4a3..11ffed78f 100644 --- a/cs/src/one_row_compiler/compile_init_and_teardown_circuit.rs +++ b/cs/src/one_row_compiler/compile_init_and_teardown_circuit.rs @@ -194,7 +194,7 @@ impl OneRowCompiler { // no generic lookup let multiplicities_columns_for_generic_lookup = ColumnSet::empty(); - // Now we will pause and place boolean variables, as those can have their contraints special-handled in quotient + // Now we will pause and place boolean variables, as those can have their constraints special-handled in quotient // now we should just place boolean variables, and then everything from scratch space diff --git a/cs/src/one_row_compiler/decoder_compilation.rs b/cs/src/one_row_compiler/decoder_compilation.rs index 6e18d71c2..d4a623014 100644 --- a/cs/src/one_row_compiler/decoder_compilation.rs +++ b/cs/src/one_row_compiler/decoder_compilation.rs @@ -127,7 +127,7 @@ impl OneRowCompiler { num_required_tuples_for_generic_lookup_setup, ); - // Now we will pause and place boolean variables, as those can have their contraints special-handled in quotient + // Now we will pause and place boolean variables, as those can have their constraints special-handled in quotient let mut constraints = constraints; // normalize again just in case diff --git a/cs/src/one_row_compiler/executor_compilation.rs b/cs/src/one_row_compiler/executor_compilation.rs index 08750c8e2..ebab2002e 100644 --- a/cs/src/one_row_compiler/executor_compilation.rs +++ b/cs/src/one_row_compiler/executor_compilation.rs @@ -382,7 +382,7 @@ impl OneRowCompiler { let mut compiled_quadratic_terms = vec![]; let mut compiled_linear_terms = vec![]; - // Now we will pause and place boolean variables, as those can have their contraints special-handled in quotient + // Now we will pause and place boolean variables, as those can have their constraints special-handled in quotient // normalize again just in case for (el, _) in constraints.iter_mut() { diff --git a/cs/src/one_row_compiler/layout_utils.rs b/cs/src/one_row_compiler/layout_utils.rs index fe0a18948..286bef2a6 100644 --- a/cs/src/one_row_compiler/layout_utils.rs +++ b/cs/src/one_row_compiler/layout_utils.rs @@ -631,7 +631,7 @@ pub(crate) fn allocate_range_check_expressions( } // range checks 16 deserve their own treatment and own table, and for lookups over explicit variables - // we just layout those continously in the row. We will also declare formal lookup expressions over them, + // we just layout those continuously in the row. We will also declare formal lookup expressions over them, // as below we will declare less-trivial range-check 16 expressions let mut range_check_16_lookup_expressions = vec![]; @@ -806,7 +806,7 @@ pub(crate) fn compile_timestamp_range_check_expressions< setup_layout: &SetupLayout, cycle_timestamp: Option>, ) -> (usize, std::vec::Vec>) { - let mut compiled_timestamp_comparion_expressions = vec![]; + let mut compiled_timestamp_comparison_expressions = vec![]; // we already have enough information to compile range check expressions that are left from memory accesses layout for input in timestamp_range_check_expressions_to_compile.into_iter() { @@ -831,7 +831,7 @@ pub(crate) fn compile_timestamp_range_check_expressions< constant_term: constant_coeff, }; let lookup_expr = LookupExpression::Expression(compiled_constraint); - compiled_timestamp_comparion_expressions.push(lookup_expr); + compiled_timestamp_comparison_expressions.push(lookup_expr); } // timestamps deserve separate range checks for shuffle RAM in the main circuit, @@ -841,7 +841,7 @@ pub(crate) fn compile_timestamp_range_check_expressions< // that comes during the proving only let offset_for_special_shuffle_ram_timestamps_range_check_expressions = - compiled_timestamp_comparion_expressions.len(); + compiled_timestamp_comparison_expressions.len(); for data in shuffle_ram_timestamp_range_check_partial_sets.into_iter() { let ShuffleRamTimestampComparisonPartialData { @@ -882,7 +882,7 @@ pub(crate) fn compile_timestamp_range_check_expressions< constant_term: constant_coeff, }; let lookup_expr = LookupExpression::Expression(compiled_constraint); - compiled_timestamp_comparion_expressions.push(lookup_expr); + compiled_timestamp_comparison_expressions.push(lookup_expr); } // and almost the same for high part { @@ -909,23 +909,23 @@ pub(crate) fn compile_timestamp_range_check_expressions< constant_term: constant_coeff, }; let lookup_expr = LookupExpression::Expression(compiled_constraint); - compiled_timestamp_comparion_expressions.push(lookup_expr); + compiled_timestamp_comparison_expressions.push(lookup_expr); } } let offset_for_special_shuffle_ram_timestamps_range_check_expressions = if USE_CIRCUIT_SEQ { offset_for_special_shuffle_ram_timestamps_range_check_expressions } else { - compiled_timestamp_comparion_expressions.len() + compiled_timestamp_comparison_expressions.len() }; let total_timestamp_range_check_lookups = - compiled_timestamp_comparion_expressions.len() as u64 * trace_len as u64; + compiled_timestamp_comparison_expressions.len() as u64 * trace_len as u64; assert!(total_timestamp_range_check_lookups < F::CHARACTERISTICS, "total number of timestamp range check lookups in circuit is {} that is larger that field characteristics {}", total_timestamp_range_check_lookups, F::CHARACTERISTICS); ( offset_for_special_shuffle_ram_timestamps_range_check_expressions, - compiled_timestamp_comparion_expressions, + compiled_timestamp_comparison_expressions, ) } @@ -953,7 +953,7 @@ pub(crate) fn optimize_out_linear_constraints( // we need // - some "defining" constraint where variable comes as the first degree - // - potentially other constraints that contant such variable + // - potentially other constraints that contain such variable let mut defining_constraints = vec![]; for (constraint_id, (constraint, prevent_optimizations)) in @@ -988,21 +988,21 @@ pub(crate) fn optimize_out_linear_constraints( } if defining_constraints.len() > 0 { - let mut occurances = vec![]; + let mut occurrences = vec![]; for (constraint_id, (constraint, _)) in constraints.iter().enumerate() { if constraint.contains_var(variable) && constraint.degree_for_var(variable) < 2 { - occurances.push((constraint_id, constraint)); + occurrences.push((constraint_id, constraint)); } } - if occurances.len() > 1 { + if occurrences.len() > 1 { // defining constraint will be here too to_remove = Some(( *variable, defining_constraints.iter().map(|el| el.0).collect(), - occurances.iter().map(|el| el.0).collect(), + occurrences.iter().map(|el| el.0).collect(), )); break; } @@ -1013,7 +1013,7 @@ pub(crate) fn optimize_out_linear_constraints( break 'outer; } - let Some((variable_to_optimize_out, defining_constraints, occurances)) = to_remove else { + let Some((variable_to_optimize_out, defining_constraints, occurrences)) = to_remove else { panic!(); }; @@ -1046,12 +1046,12 @@ pub(crate) fn optimize_out_linear_constraints( let mut can_be_optimized_out = true; let mut replacement_constraints = vec![]; // now we should walk over other constraints and rewrite them - for occurance_constraint_idx in occurances.iter().copied() { - if occurance_constraint_idx == defining_constraint_idx { + for occurrence_constraint_idx in occurrences.iter().copied() { + if occurrence_constraint_idx == defining_constraint_idx { continue; } - let existing_constraint = constraints[occurance_constraint_idx].0.clone(); + let existing_constraint = constraints[occurrence_constraint_idx].0.clone(); let rewritten_constraint = existing_constraint .clone() .substitute_variable(variable_to_optimize_out, expression.clone()); @@ -1076,7 +1076,7 @@ pub(crate) fn optimize_out_linear_constraints( can_be_optimized_out = false; break; } else { - replacement_constraints.push((occurance_constraint_idx, rewritten_constraint)); + replacement_constraints.push((occurrence_constraint_idx, rewritten_constraint)); } } @@ -1097,7 +1097,7 @@ pub(crate) fn optimize_out_linear_constraints( #[cfg(feature = "debug_logs")] { println!( - "Succesfully removed variable {:?}", + "Successfully removed variable {:?}", variable_to_optimize_out ); } diff --git a/docs/philosophy_and_logic.md b/docs/philosophy_and_logic.md index 5154b58e1..c169720e5 100644 --- a/docs/philosophy_and_logic.md +++ b/docs/philosophy_and_logic.md @@ -28,7 +28,7 @@ So, we have three programming models that we want to support, that rely on diffe ## Limitations over programs -While the following limitations apply to all programs executed on top of our RiscV cpu, it should be noted that in practice ZKsync user-provided programs will not run directly on the "bare-metal" cpu and instead will be processed by the ZKsync OS kernel program and any VM interpreter (including EVM interepreter) contained therein. It is, then, the primary responsibility of the trusted EVM/VM interpreter (in combination with ZKsync OS) to guarantee memory and resource safety by offering a layer of protection between the cpu and user-provided (potentially unsafe) programs, as well as between each other. Resource control, such as preventing costly infinite loop attacks, is also part of this intermediate layer. As such, ZKsync users are unlikely to be especially affected by or concerned with the following limitations, which are primarily of interest to the technical reader. +While the following limitations apply to all programs executed on top of our RiscV cpu, it should be noted that in practice ZKsync user-provided programs will not run directly on the "bare-metal" cpu and instead will be processed by the ZKsync OS kernel program and any VM interpreter (including EVM interpreter) contained therein. It is, then, the primary responsibility of the trusted EVM/VM interpreter (in combination with ZKsync OS) to guarantee memory and resource safety by offering a layer of protection between the cpu and user-provided (potentially unsafe) programs, as well as between each other. Resource control, such as preventing costly infinite loop attacks, is also part of this intermediate layer. As such, ZKsync users are unlikely to be especially affected by or concerned with the following limitations, which are primarily of interest to the technical reader. - No support of the bytecode in generic RAM. We assume that bytecode is placed in memory subrange that is modeled as ROM - No support runtime-loaded bytecode diff --git a/docs/tutorial.md b/docs/tutorial.md index 4e1344eb2..29afbc5fc 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -6,7 +6,7 @@ To run the Airbender, you need three things: * a cli tool (tools/cli) * your compiled program (app.bin) -* opitonally - file with inputs to your program. +* optionally - file with inputs to your program. The TL;DR of creating a proof is (run this from tools/cli directory): diff --git a/execution_utils/src/unrolled.rs b/execution_utils/src/unrolled.rs index 40ebd7ec7..eaafd0f93 100644 --- a/execution_utils/src/unrolled.rs +++ b/execution_utils/src/unrolled.rs @@ -514,7 +514,7 @@ mod test { &worker, ); - println!("Proving completed, prepairing to verify"); + println!("Proving completed, preparing to verify"); let is_valid = verify_unrolled_base_layer_for_machine_configuration::< IMStandardIsaConfigWithUnsignedMulDiv, @@ -547,7 +547,7 @@ mod test { &worker, ); - println!("Proving completed, prepairing to verify"); + println!("Proving completed, preparing to verify"); let is_valid = verify_unrolled_base_layer_for_machine_configuration::< IMStandardIsaConfigWithUnsignedMulDiv, diff --git a/full_statement_verifier/src/unified_circuit_statement.rs b/full_statement_verifier/src/unified_circuit_statement.rs index 6005104c0..0ba1143f6 100644 --- a/full_statement_verifier/src/unified_circuit_statement.rs +++ b/full_statement_verifier/src/unified_circuit_statement.rs @@ -427,7 +427,7 @@ pub fn verify_unrolled_or_unified_circuit_recursion_layer() -> [u32; 16] { verify_unified_circuit_recursion_layer() } _ => { - panic!("Uknown op"); + panic!("Unknown op"); } } } diff --git a/full_statement_verifier/src/unrolled_proof_statement.rs b/full_statement_verifier/src/unrolled_proof_statement.rs index e343b3b68..cd86e4976 100644 --- a/full_statement_verifier/src/unrolled_proof_statement.rs +++ b/full_statement_verifier/src/unrolled_proof_statement.rs @@ -721,7 +721,7 @@ pub fn verify_base_or_recursion_unrolled_circuits() -> [u32; 16] { OP_VERIFY_BASE_LAYER_IN_UNROLLED_CIRCUITS => verify_unrolled_base_layer(), OP_VERIFY_RECURSIVE_LAYER_IN_UNROLLED_CIRCUITS => verify_unrolled_recursion_layer(), _ => { - panic!("Uknown op"); + panic!("Unknown op"); } } } diff --git a/gpu_prover/src/prover/stage_1.rs b/gpu_prover/src/prover/stage_1.rs index fad290af0..be4d1e3bc 100644 --- a/gpu_prover/src/prover/stage_1.rs +++ b/gpu_prover/src/prover/stage_1.rs @@ -484,7 +484,7 @@ impl StageOneOutput { )?; let mut public_inputs = unsafe { context.alloc_host_uninit_slice(circuit.public_inputs.len()) }; - let unsage_public_inputs = public_inputs.get_mut_accessor(); + let unsafe_public_inputs = public_inputs.get_mut_accessor(); let circuit_clone = circuit.clone(); let function = move || unsafe { let mut first_row_public_inputs = vec![]; @@ -506,7 +506,7 @@ impl StageOneOutput { } } } - let public_inputs = unsage_public_inputs.get_mut(); + let public_inputs = unsafe_public_inputs.get_mut(); let mut iter = public_inputs.iter_mut(); iter.set_from(first_row_public_inputs); iter.set_from(one_before_last_row_public_inputs); diff --git a/gpu_prover/src/prover/unrolled_prover/stage_2_kernels.rs b/gpu_prover/src/prover/unrolled_prover/stage_2_kernels.rs index 3c634a58a..519c8c8b6 100644 --- a/gpu_prover/src/prover/unrolled_prover/stage_2_kernels.rs +++ b/gpu_prover/src/prover/unrolled_prover/stage_2_kernels.rs @@ -1154,7 +1154,7 @@ mod tests { #[serial] fn test_standalone_stage_2_unrolled_with_transpiler_for_main_and_blake() { let ctx = DeviceContext::create(12).unwrap(); - // Tells the CPU test to use this file's comparison_hook for unrolled ciruits, + // Tells the CPU test to use this file's comparison_hook for unrolled circuits, // and comparison_hook from non-unrolled stage_2_kernels for delegation circuits. run_basic_unrolled_test_in_transpiler_with_word_specialization_impl( Some(Box::new(comparison_hook)), diff --git a/prover/src/prover_stages/unrolled_prover/quotient_parts/every_row_except_last.rs b/prover/src/prover_stages/unrolled_prover/quotient_parts/every_row_except_last.rs index 306158a4e..a34912ce6 100644 --- a/prover/src/prover_stages/unrolled_prover/quotient_parts/every_row_except_last.rs +++ b/prover/src/prover_stages/unrolled_prover/quotient_parts/every_row_except_last.rs @@ -166,8 +166,8 @@ pub(crate) unsafe fn evaluate_delegation_processing_conventions( // We require that on unused rows in delegation circuits prover // can only substitute 0s for: // - delegation data itself - so write timestamp is 0 - // - all memory reads values/read timestamps - so that they do not contribute to RAM permutaiton (cancel immediatelly with writes) - // - all memory writes created by circuits are masked/default 0s - same, so that they do not contribute to RAM permutaiton (cancel immediatelly with reads) + // - all memory reads values/read timestamps - so that they do not contribute to RAM permutaiton (cancel immediately with writes) + // - all memory writes created by circuits are masked/default 0s - same, so that they do not contribute to RAM permutaiton (cancel immediately with reads) let predicate = *memory_trace_view_row.get_unchecked(delegation_processor_layout.multiplicity.start()); let mut t = *tau_in_domain_by_half; @@ -1356,19 +1356,19 @@ pub(crate) unsafe fn evaluate_memory_queries_accumulation( let read_value_columns = memory_access_columns.get_read_value_columns(); let read_timestamp_columns = memory_access_columns.get_read_timestamp_columns(); - let address_contibution = match memory_access_columns.get_address() { + let address_contribution = match memory_access_columns.get_address() { ShuffleRamAddress::RegisterOnly(RegisterOnlyAccessAddress { register_index }) => { let address_low = *memory_trace_view_row.get_unchecked(register_index.start()); - let mut address_contibution = memory_argument_challenges + let mut address_contribution = memory_argument_challenges .memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_ADDRESS_LOW_IDX]; - address_contibution.mul_assign_by_base(&address_low); + address_contribution.mul_assign_by_base(&address_low); // considered is register always // to we need to add literal 1, so we cancel multiplication by tau^H/2 below - address_contibution.add_assign_base(tau_in_domain_by_half_inv); + address_contribution.add_assign_base(tau_in_domain_by_half_inv); - address_contibution + address_contribution } ShuffleRamAddress::RegisterOrRam(RegisterOrRamAccessAddress { @@ -1378,65 +1378,65 @@ pub(crate) unsafe fn evaluate_memory_queries_accumulation( debug_assert_eq!(address.width(), 2); let address_low = *memory_trace_view_row.get_unchecked(address.start()); - let mut address_contibution = memory_argument_challenges + let mut address_contribution = memory_argument_challenges .memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_ADDRESS_LOW_IDX]; - address_contibution.mul_assign_by_base(&address_low); + address_contribution.mul_assign_by_base(&address_low); let address_high = *memory_trace_view_row.get_unchecked(address.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_ADDRESS_HIGH_IDX]; t.mul_assign_by_base(&address_high); - address_contibution.add_assign(&t); + address_contribution.add_assign(&t); debug_assert_eq!(is_register.width(), 1); let is_reg = *memory_trace_view_row.get_unchecked(is_register.start()); - address_contibution.add_assign_base(&is_reg); + address_contribution.add_assign_base(&is_reg); - address_contibution + address_contribution } }; debug_assert_eq!(read_value_columns.width(), 2); let read_value_low = *memory_trace_view_row.get_unchecked(read_value_columns.start()); - let mut read_value_contibution = memory_argument_challenges + let mut read_value_contribution = memory_argument_challenges .memory_argument_linearization_challenges[MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_LOW_IDX]; - read_value_contibution.mul_assign_by_base(&read_value_low); + read_value_contribution.mul_assign_by_base(&read_value_low); let read_value_high = *memory_trace_view_row.get_unchecked(read_value_columns.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_HIGH_IDX]; t.mul_assign_by_base(&read_value_high); - read_value_contibution.add_assign(&t); + read_value_contribution.add_assign(&t); debug_assert_eq!(read_timestamp_columns.width(), 2); let read_timestamp_low = *memory_trace_view_row.get_unchecked(read_timestamp_columns.start()); - let mut read_timestamp_contibution = memory_argument_challenges + let mut read_timestamp_contribution = memory_argument_challenges .memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_LOW_IDX]; - read_timestamp_contibution.mul_assign_by_base(&read_timestamp_low); + read_timestamp_contribution.mul_assign_by_base(&read_timestamp_low); let read_timestamp_high = *memory_trace_view_row.get_unchecked(read_timestamp_columns.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_HIGH_IDX]; t.mul_assign_by_base(&read_timestamp_high); - read_timestamp_contibution.add_assign(&t); + read_timestamp_contribution.add_assign(&t); // NOTE on write timestamp: it has literal constants in contribution, so we add it AFTER // scaling by tau^H/2 - let mut write_timestamp_contibution = memory_argument_challenges + let mut write_timestamp_contribution = memory_argument_challenges .memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_LOW_IDX]; - write_timestamp_contibution.mul_assign_by_base(&write_timestamp_low); + write_timestamp_contribution.mul_assign_by_base(&write_timestamp_low); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_HIGH_IDX]; t.mul_assign_by_base(&write_timestamp_high); - write_timestamp_contibution.add_assign(&t); + write_timestamp_contribution.add_assign(&t); let mut extra_write_timestamp_low = memory_argument_challenges .memory_argument_linearization_challenges @@ -1460,14 +1460,14 @@ pub(crate) unsafe fn evaluate_memory_queries_accumulation( match memory_access_columns { ShuffleRamQueryColumns::Readonly(_) => { - let mut numerator = address_contibution; - numerator.add_assign(&read_value_contibution); + let mut numerator = address_contribution; + numerator.add_assign(&read_value_contribution); let mut denom = numerator; // read and write set only differ in timestamp contribution - numerator.add_assign(&write_timestamp_contibution); - denom.add_assign(&read_timestamp_contibution); + numerator.add_assign(&write_timestamp_contribution); + denom.add_assign(&read_timestamp_contribution); // scale all previous terms that are linear in witness numerator.mul_assign_by_base(tau_in_domain_by_half); @@ -1514,27 +1514,27 @@ pub(crate) unsafe fn evaluate_memory_queries_accumulation( let write_value_low = *memory_trace_view_row.get_unchecked(columns.write_value.start()); - let mut write_value_contibution = memory_argument_challenges + let mut write_value_contribution = memory_argument_challenges .memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_LOW_IDX]; - write_value_contibution.mul_assign_by_base(&write_value_low); + write_value_contribution.mul_assign_by_base(&write_value_low); let write_value_high = *memory_trace_view_row.get_unchecked(columns.write_value.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_HIGH_IDX]; t.mul_assign_by_base(&write_value_high); - write_value_contibution.add_assign(&t); + write_value_contribution.add_assign(&t); - let mut numerator = address_contibution; + let mut numerator = address_contribution; let mut denom = numerator; // read and write set differ in timestamp and value - numerator.add_assign(&write_value_contibution); - denom.add_assign(&read_value_contibution); + numerator.add_assign(&write_value_contribution); + denom.add_assign(&read_value_contribution); - numerator.add_assign(&write_timestamp_contibution); - denom.add_assign(&read_timestamp_contibution); + numerator.add_assign(&write_timestamp_contribution); + denom.add_assign(&read_timestamp_contribution); // scale all previous terms that are linear in witness numerator.mul_assign_by_base(tau_in_domain_by_half); diff --git a/prover/src/prover_stages/unrolled_prover/stage2.rs b/prover/src/prover_stages/unrolled_prover/stage2.rs index f2a35e40e..5dcfe73a9 100644 --- a/prover/src/prover_stages/unrolled_prover/stage2.rs +++ b/prover/src/prover_stages/unrolled_prover/stage2.rs @@ -251,7 +251,7 @@ pub fn prover_stage_2_for_unrolled_circuit< // now for self-check we should compute how many batch inverses we will want, // and define ranges when numerators that are part of batch inverses are 1, so we can skip those - // batch inverses are only requried for delegation linkage poly and memory grand product accumulators + // batch inverses are only required for delegation linkage poly and memory grand product accumulators let mut num_batch_inverses = 0; if let Some(el) = compiled_circuit diff --git a/prover/src/prover_stages/unrolled_prover/stage3.rs b/prover/src/prover_stages/unrolled_prover/stage3.rs index c17f17b08..982a0e043 100644 --- a/prover/src/prover_stages/unrolled_prover/stage3.rs +++ b/prover/src/prover_stages/unrolled_prover/stage3.rs @@ -232,7 +232,7 @@ pub fn prover_stage_3_for_unrolled_circuit< // by our selected divisor, where "value" == negate(our sum over all other domain), and we also require that sum over // all the domain is 0 - // interpolant is literaly 1/omega^-1 * value * X (as one can see it's 0 at 0 and `value` at omega^-1) + // interpolant is literally 1/omega^-1 * value * X (as one can see it's 0 at 0 and `value` at omega^-1) let mut delegation_accumulator_interpolant_prefactor = stage_2_output.sum_over_delegation_poly; delegation_accumulator_interpolant_prefactor.mul_assign_by_base(&omega); delegation_accumulator_interpolant_prefactor.negate(); diff --git a/prover/src/prover_stages/unrolled_prover/stage_2_ram_shared.rs b/prover/src/prover_stages/unrolled_prover/stage_2_ram_shared.rs index 94a5bf2aa..63c741e4b 100644 --- a/prover/src/prover_stages/unrolled_prover/stage_2_ram_shared.rs +++ b/prover/src/prover_stages/unrolled_prover/stage_2_ram_shared.rs @@ -15,30 +15,30 @@ pub(crate) unsafe fn stage_2_shuffle_ram_add_timestamp_contributions_in_executor // Numerator is write set, denom is read set let read_timestamp_low = *memory_trace_row.get_unchecked(read_timestamp.start()); - let mut read_timestamp_contibution = memory_argument_challenges + let mut read_timestamp_contribution = memory_argument_challenges .memory_argument_linearization_challenges[MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_LOW_IDX]; - read_timestamp_contibution.mul_assign_by_base(&read_timestamp_low); + read_timestamp_contribution.mul_assign_by_base(&read_timestamp_low); let read_timestamp_high = *memory_trace_row.get_unchecked(read_timestamp.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_HIGH_IDX]; t.mul_assign_by_base(&read_timestamp_high); - read_timestamp_contibution.add_assign(&t); + read_timestamp_contribution.add_assign(&t); let mut write_timestamp_low = *memory_trace_row.get_unchecked(cycle_timestamp_columns.start()); write_timestamp_low.add_assign(&Mersenne31Field::from_u64_unchecked(access_idx as u64)); - let mut write_timestamp_contibution = memory_argument_challenges + let mut write_timestamp_contribution = memory_argument_challenges .memory_argument_linearization_challenges[MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_LOW_IDX]; - write_timestamp_contibution.mul_assign_by_base(&write_timestamp_low); + write_timestamp_contribution.mul_assign_by_base(&write_timestamp_low); let write_timestamp_high = *memory_trace_row.get_unchecked(cycle_timestamp_columns.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_TIMESTAMP_HIGH_IDX]; t.mul_assign_by_base(&write_timestamp_high); - write_timestamp_contibution.add_assign(&t); + write_timestamp_contribution.add_assign(&t); - numerator.add_assign(&write_timestamp_contibution); - denom.add_assign(&read_timestamp_contibution); + numerator.add_assign(&write_timestamp_contribution); + denom.add_assign(&read_timestamp_contribution); } #[inline(always)] @@ -56,19 +56,19 @@ pub(crate) unsafe fn stage_2_shuffle_ram_assemble_read_contribution_in_executor_ debug_assert_eq!(columns.read_value.width(), 2); let value_low = *memory_trace_row.get_unchecked(columns.read_value.start()); - let mut value_contibution = memory_argument_challenges.memory_argument_linearization_challenges - [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_LOW_IDX]; - value_contibution.mul_assign_by_base(&value_low); + let mut value_contribution = memory_argument_challenges + .memory_argument_linearization_challenges[MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_LOW_IDX]; + value_contribution.mul_assign_by_base(&value_low); let value_high = *memory_trace_row.get_unchecked(columns.read_value.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_HIGH_IDX]; t.mul_assign_by_base(&value_high); - value_contibution.add_assign(&t); + value_contribution.add_assign(&t); let mut numerator = memory_argument_challenges.memory_argument_gamma; numerator.add_assign(&address_contribution); - numerator.add_assign(&value_contibution); + numerator.add_assign(&value_contribution); let mut denom = numerator; @@ -101,36 +101,36 @@ pub(crate) unsafe fn stage_2_shuffle_ram_assemble_write_contribution_in_executor debug_assert_eq!(columns.read_value.width(), 2); let read_value_low = *memory_trace_row.get_unchecked(columns.read_value.start()); - let mut read_value_contibution = memory_argument_challenges + let mut read_value_contribution = memory_argument_challenges .memory_argument_linearization_challenges[MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_LOW_IDX]; - read_value_contibution.mul_assign_by_base(&read_value_low); + read_value_contribution.mul_assign_by_base(&read_value_low); let read_value_high = *memory_trace_row.get_unchecked(columns.read_value.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_HIGH_IDX]; t.mul_assign_by_base(&read_value_high); - read_value_contibution.add_assign(&t); + read_value_contribution.add_assign(&t); debug_assert_eq!(columns.write_value.width(), 2); let write_value_low = *memory_trace_row.get_unchecked(columns.write_value.start()); - let mut write_value_contibution = memory_argument_challenges + let mut write_value_contribution = memory_argument_challenges .memory_argument_linearization_challenges[MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_LOW_IDX]; - write_value_contibution.mul_assign_by_base(&write_value_low); + write_value_contribution.mul_assign_by_base(&write_value_low); let write_value_high = *memory_trace_row.get_unchecked(columns.write_value.start() + 1); let mut t = memory_argument_challenges.memory_argument_linearization_challenges [MEM_ARGUMENT_CHALLENGE_POWERS_VALUE_HIGH_IDX]; t.mul_assign_by_base(&write_value_high); - write_value_contibution.add_assign(&t); + write_value_contribution.add_assign(&t); let mut numerator = memory_argument_challenges.memory_argument_gamma; numerator.add_assign(&address_contribution); let mut denom = numerator; - numerator.add_assign(&write_value_contibution); - denom.add_assign(&read_value_contibution); + numerator.add_assign(&write_value_contribution); + denom.add_assign(&read_value_contribution); stage_2_shuffle_ram_add_timestamp_contributions_in_executor_circuit( memory_trace_row, diff --git a/prover/src/tests/unrolled/mod.rs b/prover/src/tests/unrolled/mod.rs index abecb47e9..f33cabec1 100644 --- a/prover/src/tests/unrolled/mod.rs +++ b/prover/src/tests/unrolled/mod.rs @@ -1012,7 +1012,7 @@ pub fn run_basic_unrolled_test_impl( let oracle = NonMemoryCircuitOracle { inner: &family_data[0].data, decoder_table: witness_gen_data, - default_pc_value_in_padding: 0, // we conditionally manupulate PC, and if no opcodes are applied in padding - it would end up in 0 + default_pc_value_in_padding: 0, // we conditionally manipulate PC, and if no opcodes are applied in padding - it would end up in 0 }; // println!( diff --git a/prover/src/tracers/oracles/transpiler_oracles/mod.rs b/prover/src/tracers/oracles/transpiler_oracles/mod.rs index 75b54c186..269a3aec4 100644 --- a/prover/src/tracers/oracles/transpiler_oracles/mod.rs +++ b/prover/src/tracers/oracles/transpiler_oracles/mod.rs @@ -1,5 +1,5 @@ // Oracles for mem and non-mem families are just the same as in the baseline -// case of unrolled cirucits, so we need to only handle the case of delegaitons, +// case of unrolled circuits, so we need to only handle the case of delegaitons, // and of unified cycle pub mod delegation; diff --git a/prover/src/tracers/unrolled/tracer.rs b/prover/src/tracers/unrolled/tracer.rs index b30c1b497..8940b6101 100644 --- a/prover/src/tracers/unrolled/tracer.rs +++ b/prover/src/tracers/unrolled/tracer.rs @@ -191,7 +191,7 @@ impl< #[inline] #[allow(dead_code)] - fn update_ram_access_timestmap( + fn update_ram_access_timestamp( &mut self, phys_address: u64, is_write: bool, @@ -300,7 +300,7 @@ impl< // debug_assert_eq!(data.rd_value, 0); // } // self.update_reg_access_timestamp::(rs1, &mut rs1_read_timestamp); - // self.update_ram_access_timestmap::( + // self.update_ram_access_timestamp::( // data.aligned_ram_address as u64, // false, // &mut rs2_or_ram_read_timestamp, @@ -335,7 +335,7 @@ impl< // let (rs1, rs2, _) = formally_parse_rs1_rs2_rd_props_for_tracer(data.opcode); // self.update_reg_access_timestamp::(rs1, &mut rs1_read_timestamp); // self.update_reg_access_timestamp::(rs2, &mut rs2_or_ram_read_timestamp); - // self.update_ram_access_timestmap::( + // self.update_ram_access_timestamp::( // data.aligned_ram_address as u64, // true, // &mut rd_or_ram_read_timestamp, diff --git a/prover/src/tracers/unrolled/word_specialized_tracer.rs b/prover/src/tracers/unrolled/word_specialized_tracer.rs index 0198f1790..376af4174 100644 --- a/prover/src/tracers/unrolled/word_specialized_tracer.rs +++ b/prover/src/tracers/unrolled/word_specialized_tracer.rs @@ -126,7 +126,7 @@ impl< } #[inline] - fn update_ram_access_timestmap( + fn update_ram_access_timestamp( &mut self, phys_address: u64, is_write: bool, @@ -229,7 +229,7 @@ impl< debug_assert_eq!(data.rd_value, 0); } self.update_reg_access_timestamp::(rs1, &mut rs1_read_timestamp); - self.update_ram_access_timestmap::( + self.update_ram_access_timestamp::( data.aligned_ram_address as u64, false, &mut rs2_or_ram_read_timestamp, @@ -269,7 +269,7 @@ impl< debug_assert_eq!(data.rd_value, 0); } self.update_reg_access_timestamp::(rs1, &mut rs1_read_timestamp); - self.update_ram_access_timestmap::( + self.update_ram_access_timestamp::( data.aligned_ram_address as u64, false, &mut rs2_or_ram_read_timestamp, @@ -306,7 +306,7 @@ impl< let (rs1, rs2, _) = formally_parse_rs1_rs2_rd_props_for_tracer(data.opcode); self.update_reg_access_timestamp::(rs1, &mut rs1_read_timestamp); self.update_reg_access_timestamp::(rs2, &mut rs2_or_ram_read_timestamp); - self.update_ram_access_timestmap::( + self.update_ram_access_timestamp::( data.aligned_ram_address as u64, true, &mut rd_or_ram_read_timestamp, @@ -343,7 +343,7 @@ impl< let (rs1, rs2, _) = formally_parse_rs1_rs2_rd_props_for_tracer(data.opcode); self.update_reg_access_timestamp::(rs1, &mut rs1_read_timestamp); self.update_reg_access_timestamp::(rs2, &mut rs2_or_ram_read_timestamp); - self.update_ram_access_timestmap::( + self.update_ram_access_timestamp::( data.aligned_ram_address as u64, true, &mut rd_or_ram_read_timestamp, diff --git a/risc_v_simulator/src/sim/diag.rs b/risc_v_simulator/src/sim/diag.rs index ad03de9e8..288562dfc 100644 --- a/risc_v_simulator/src/sim/diag.rs +++ b/risc_v_simulator/src/sim/diag.rs @@ -468,7 +468,7 @@ impl Profiler { // first we need to count all encountered PCs, even if stack frames below them are different let mut mapped = Vec::with_capacity(frames.len()); - println!("Counting frame populaiton"); + println!("Counting frame population"); 'outer: for (i, (pc, callsites)) in frames.iter_mut().enumerate() { if i > 0 && i % 10_000_000 == 0 { println!("{} frames counted", i); diff --git a/risc_v_simulator/src/sim/mod.rs b/risc_v_simulator/src/sim/mod.rs index 71b1c38a8..420a1f338 100644 --- a/risc_v_simulator/src/sim/mod.rs +++ b/risc_v_simulator/src/sim/mod.rs @@ -120,7 +120,7 @@ where // } if let Some(profiler) = self.profiler.as_mut() { - println!("Beging stack tracing"); + println!("Beginning stack tracing"); println!("Computing caches"); let binary = profiler.symbol_info.buffer.clone(); diff --git a/riscv_common/src/memcpy.rs b/riscv_common/src/memcpy.rs index 67535126a..870b82eb3 100644 --- a/riscv_common/src/memcpy.rs +++ b/riscv_common/src/memcpy.rs @@ -199,7 +199,7 @@ pub(crate) unsafe fn memcpy_impl(dest: *mut u8, src: *const u8, n: usize) -> *mu // For simplicity we will stick to reading u32s, and will not unroll that much - // NOTE: on bounds: we have somewhat "strage" bounds like 20 and 17/18/19 below - this way + // NOTE: on bounds: we have somewhat "strange" bounds like 20 and 17/18/19 below - this way // we ensure that we do not access out of bounds of src/dest if n >= 20 { // NOTE: source is aligned diff --git a/riscv_transpiler/src/jit/impls.rs b/riscv_transpiler/src/jit/impls.rs index 2f13023c0..a6272b647 100644 --- a/riscv_transpiler/src/jit/impls.rs +++ b/riscv_transpiler/src/jit/impls.rs @@ -31,7 +31,7 @@ unsafe impl Sync for JittedCode {} // register writes go via rax and reads via rdx // rcx also doesn't contain a register because it must be used for bitshifts // -// x10 - x15 are assiged to r10 - r15 +// x10 - x15 are assigned to r10 - r15 // rbx is for x9 // Registers that are placed not in the GPR are instead placed into 128-bit vector registers, and loaded using PEXTRD and stored using PINSRD. @@ -187,7 +187,7 @@ macro_rules! save_machine_state { ; mov [rdx + (14 * 4 as i32)], r14d // x14 -> R14 ; mov [rdx + (15 * 4 as i32)], r15d // x15 -> R15 - // put current timestamp (without asumptions about mod 4) + // put current timestamp (without assumptions about mod 4) ; mov [rdx + (MachineState::TIMESTAMP_OFFSET as i32)], r8 ) } @@ -844,7 +844,7 @@ impl JittedCode { // Instructions that just compute a result are NOPs if they write to x0, and formally touch x0 twice on read if rd == 0 { println!( - "Skipping instuction {:?} (0x{:08x}) at PC = 0x{:08x}", + "Skipping instruction {:?} (0x{:08x}) at PC = 0x{:08x}", instruction, raw_instruction, pc ); pre_bump_timestamp_and_touch!(ops, 2, 0); @@ -1165,7 +1165,7 @@ impl JittedCode { issue_snapshot = true; } Instruction::Lw(parts) => { - // NOTE: here address is exactly couting in 4 bytes, so we do not need extra word counter and + // NOTE: here address is exactly counting in 4 bytes, so we do not need extra word counter and // use RDX for bookkeeping // TODO: exception on misalignment let address = load(&mut ops, parts.rs1()); diff --git a/riscv_transpiler/src/jit/mod.rs b/riscv_transpiler/src/jit/mod.rs index efad9ddda..7cf23c27a 100644 --- a/riscv_transpiler/src/jit/mod.rs +++ b/riscv_transpiler/src/jit/mod.rs @@ -26,7 +26,7 @@ pub use self::impls::*; #[cfg(all(target_arch = "x86_64", feature = "jit", test))] mod tests; -const MAX_RAM_SIZE: usize = 1 << 30; // 1 Gb, as we want to avoid having separate pointers to RAM (that we want to have continuous to perform very simple read/writes), and timestamp bookkeping space +const MAX_RAM_SIZE: usize = 1 << 30; // 1 Gb, as we want to avoid having separate pointers to RAM (that we want to have continuous to perform very simple read/writes), and timestamp bookkeeping space pub const RAM_SIZE: usize = 1 << 30; const NUM_RAM_WORDS: usize = RAM_SIZE / core::mem::size_of::(); diff --git a/riscv_transpiler/src/jit/structs.rs b/riscv_transpiler/src/jit/structs.rs index c0e52cd7b..ed6d4339d 100644 --- a/riscv_transpiler/src/jit/structs.rs +++ b/riscv_transpiler/src/jit/structs.rs @@ -166,7 +166,7 @@ impl<'a> RAM for ReplayerMemChunks<'a> { debug_assert_eq!(*address % 4, 0); if (*address as usize) < common_constants::rom::ROM_BYTE_SIZE { // NOTE: we no longer mask an address, just a value as it's only initialized to - // 0 via inits, and can not be writen over by circuits + // 0 via inits, and can not be written over by circuits // *address = 0u32; *value = 0u32; } diff --git a/riscv_transpiler/src/jit/tests.rs b/riscv_transpiler/src/jit/tests.rs index 36158dfdc..5870ead2b 100644 --- a/riscv_transpiler/src/jit/tests.rs +++ b/riscv_transpiler/src/jit/tests.rs @@ -40,13 +40,13 @@ fn test_jit_recursive_verifier() { let mut responses = std::fs::File::open("examples/recursive_verifier/responses.bin").unwrap(); let mut buff = vec![]; responses.read_to_end(&mut buff).unwrap(); - let resposnes: Vec = buff + let responses: Vec = buff .as_chunks::<4>() .0 .iter() .map(|el| u32::from_le_bytes(*el)) .collect(); - let mut source = QuasiUARTSource::new_with_reads(resposnes); + let mut source = QuasiUARTSource::new_with_reads(responses); JittedCode::<_>::run_alternative_simulator(&text, &mut source, &binary, None); } @@ -68,13 +68,13 @@ fn test_ensure_proof_correctness() { let mut responses = std::fs::File::open("examples/recursive_verifier/responses.bin").unwrap(); let mut buff = vec![]; responses.read_to_end(&mut buff).unwrap(); - let resposnes: Vec = buff + let responses: Vec = buff .as_chunks::<4>() .0 .iter() .map(|el| u32::from_le_bytes(*el)) .collect(); - let mut source = QuasiUARTSource::new_with_reads(resposnes); + let mut source = QuasiUARTSource::new_with_reads(responses); let instructions: Vec = preprocess_bytecode::(&text); let tape = SimpleTape::new(&instructions); @@ -502,13 +502,13 @@ fn run_recursion_and_compare() { let mut responses = std::fs::File::open("examples/recursive_verifier/responses.bin").unwrap(); let mut buff = vec![]; responses.read_to_end(&mut buff).unwrap(); - let resposnes: Vec = buff + let responses: Vec = buff .as_chunks::<4>() .0 .iter() .map(|el| u32::from_le_bytes(*el)) .collect(); - let mut source = QuasiUARTSource::new_with_reads(resposnes); + let mut source = QuasiUARTSource::new_with_reads(responses); let step = 1 << 16; let initial_step = 836694; diff --git a/riscv_transpiler/src/replayer/mod.rs b/riscv_transpiler/src/replayer/mod.rs index 2a7831dd3..35ce36a98 100644 --- a/riscv_transpiler/src/replayer/mod.rs +++ b/riscv_transpiler/src/replayer/mod.rs @@ -68,7 +68,7 @@ impl<'a, const ROM_BOUND_SECOND_WORD_BITS: usize> RAM debug_assert_eq!(*address % 4, 0); if *address < 1 << (16 + ROM_BOUND_SECOND_WORD_BITS) { // NOTE: we no longer mask an address, just a value as it's only initialized to - // 0 via inits, and can not be writen over by circuits + // 0 via inits, and can not be written over by circuits // *address = 0u32; *value = 0u32; } diff --git a/riscv_transpiler/src/witness/mod.rs b/riscv_transpiler/src/witness/mod.rs index 14815d728..a27fd10ea 100644 --- a/riscv_transpiler/src/witness/mod.rs +++ b/riscv_transpiler/src/witness/mod.rs @@ -662,7 +662,7 @@ impl<'a> WitnessTracer for UninitUnifiedDestinationHolder<'a> { .as_mut_ptr() .as_mut_unchecked() .write(UnifiedOpcodeTracingDataWithTimestamp::NonMem(data)); - // For some reason truncating the buffer doesn't work - livetime analysis complains + // For some reason truncating the buffer doesn't work - lifetime analysis complains *first = core::mem::transmute(first.get_unchecked_mut(1..)); if first.is_empty() { self.buffers = core::mem::transmute(self.buffers.get_unchecked_mut(1..)); @@ -685,7 +685,7 @@ impl<'a> WitnessTracer for UninitUnifiedDestinationHolder<'a> { .as_mut_ptr() .as_mut_unchecked() .write(UnifiedOpcodeTracingDataWithTimestamp::Mem(data)); - // For some reason truncating the buffer doesn't work - livetime analysis complains + // For some reason truncating the buffer doesn't work - lifetime analysis complains *first = core::mem::transmute(first.get_unchecked_mut(1..)); if first.is_empty() { self.buffers = core::mem::transmute(self.buffers.get_unchecked_mut(1..)); diff --git a/tools/cli/README.md b/tools/cli/README.md index c30fca395..1f9bb5694 100644 --- a/tools/cli/README.md +++ b/tools/cli/README.md @@ -44,7 +44,7 @@ cargo run --release prove --bin ../../examples/basic_fibonacci/app.bin --output where the .bin file is the riscV compiled file. You can see more instructions on how to create such file in the basic_fibonacci dir. -**Compilation times** - you might want to use `--profile cli` to minimise the compilation time, as --release might take a long time to compile the veirfication code, and --dev might be generating a proof for a really long time. +**Compilation times** - you might want to use `--profile cli` to minimise the compilation time, as --release might take a long time to compile the verification code, and --dev might be generating a proof for a really long time. ### Proofs You will get one or more proofs as the result - depending on the length of your program (proofs in format `proof_XX.json`) and the amount of delegations (precompiles) that you used (proofs in format `delegation_PRECOMPILE-ID_XX.json`) diff --git a/tools/pow_config_generator/README.md b/tools/pow_config_generator/README.md index d18299522..1465a68d2 100644 --- a/tools/pow_config_generator/README.md +++ b/tools/pow_config_generator/README.md @@ -39,7 +39,7 @@ We can bound $\frac{|H|+2}{|D|}$ by $\frac{|H|}{|D|} = \frac{1}{lde \textundersc ```math e \leq 4\sqrt{lde \textunderscore factor} \cdot \frac{C}{|F|} ``` -Then secutity bits can be computed as: +Then security bits can be computed as: ```math security \textunderscore bits = -log_2(e) = -log_2(4) - \frac{1}{2}log_2(lde \textunderscore factor) - log_2(C) + log_2(|F|) ``` @@ -49,7 +49,7 @@ We can use error bound from https://eprint.iacr.org/2022/1216.pdf: ```math e \leq L^{+} \cdot \frac{d(|H|+1) + (|H|-1)}{|F| - |H \cup D|} ``` -Where $d$ is the maximum constraint degree and the rest are the same. We can bound $|F| - |H \cup D|$ as $\frac{|F|}{2}$, $d(|H|+1) + (|H|-1)$ as $2d|H|$ and $L^{+}$ as previousely then: +Where $d$ is the maximum constraint degree and the rest are the same. We can bound $|F| - |H \cup D|$ as $\frac{|F|}{2}$, $d(|H|+1) + (|H|-1)$ as $2d|H|$ and $L^{+}$ as previously then: ```math security \textunderscore bits = -log_2(e) = -log_2(4) - \frac{1}{2}log_2(lde \textunderscore factor) - 1 - log_2(d) - log_2(|H|) + log_2(|F|) - 1 ``` diff --git a/verifier/src/tests.rs b/verifier/src/tests.rs index 29f165b6a..891502e61 100644 --- a/verifier/src/tests.rs +++ b/verifier/src/tests.rs @@ -73,7 +73,7 @@ fn test_unified_cycle_or_delegation() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } @@ -133,7 +133,7 @@ fn test_unrolled_circuit() { match result { Ok(..) => {} Err(err) => { - panic!("Verifier thread failes with {}", err); + panic!("Verifier thread fails with {}", err); } } } diff --git a/verifier_generator/src/inlining_generator/mod.rs b/verifier_generator/src/inlining_generator/mod.rs index 83258a7a2..d5d22bb13 100644 --- a/verifier_generator/src/inlining_generator/mod.rs +++ b/verifier_generator/src/inlining_generator/mod.rs @@ -403,7 +403,7 @@ pub fn generate_inlined_configured( let pc_1 = ColumnAddress::MemorySubtree(pc.start() + 1); let rs1_index = ColumnAddress::MemorySubtree(rs1_index.start()); - // rs2 and rd are column addresses explicily + // rs2 and rd are column addresses explicitly // then we need to make it conditionally let [rd_is_zero, imm_0, imm_1, funct3] = [