From c7625818de71641336a7a4a384c99eebbcf7daef Mon Sep 17 00:00:00 2001 From: "Pedro A. Fabri" Date: Tue, 7 Jan 2025 11:45:36 -0300 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20Fixed=20docume?= =?UTF-8?q?ntation=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed broken links and escaped characters to remove warnings while generating documentation ✅ Closes: #1126 --- crates/circuits/primitives/src/lib.rs | 4 ++-- crates/circuits/primitives/src/sub_air.rs | 2 +- crates/sdk/src/commit.rs | 2 +- crates/sdk/src/verifier/root/types.rs | 2 +- crates/toolchain/transpiler/src/extension.rs | 4 ++-- crates/vm/src/arch/execution.rs | 2 +- crates/vm/src/arch/integration_api.rs | 2 +- crates/vm/src/arch/testing/memory/mod.rs | 2 +- crates/vm/src/system/memory/manager/memory.rs | 4 ++-- .../system/memory/offline_checker/bridge.rs | 6 +++--- .../system/memory/offline_checker/columns.rs | 2 +- crates/vm/src/system/poseidon2/mod.rs | 2 +- extensions/keccak256/circuit/src/air.rs | 2 +- extensions/keccak256/circuit/src/columns.rs | 18 +++++++++--------- extensions/native/compiler/src/ir/bits.rs | 8 ++++---- extensions/native/compiler/src/ir/poseidon.rs | 10 +++++----- extensions/native/compiler/src/ir/utils.rs | 4 ++-- .../native/recursion/src/challenger/duplex.rs | 2 +- .../native/recursion/src/challenger/mod.rs | 6 +++--- extensions/native/recursion/src/fri/domain.rs | 2 +- extensions/native/recursion/src/fri/mod.rs | 10 +++++----- extensions/native/recursion/src/halo2/utils.rs | 2 +- extensions/native/recursion/src/stark/mod.rs | 4 ++-- extensions/native/recursion/src/utils.rs | 4 ++-- extensions/pairing/guest/src/pairing/mod.rs | 2 +- extensions/rv32im/circuit/src/adapters/alu.rs | 2 +- .../rv32im/circuit/src/adapters/branch.rs | 2 +- extensions/rv32im/circuit/src/adapters/mul.rs | 2 +- .../rv32im/circuit/src/adapters/rdwrite.rs | 4 ++-- 29 files changed, 59 insertions(+), 59 deletions(-) diff --git a/crates/circuits/primitives/src/lib.rs b/crates/circuits/primitives/src/lib.rs index 90dd810771..761e6693d6 100644 --- a/crates/circuits/primitives/src/lib.rs +++ b/crates/circuits/primitives/src/lib.rs @@ -1,7 +1,7 @@ //! This crate contains a collection of primitives for use when building circuits. -//! The primitives are separated into two types: standalone [Air](p3_air::Air)s and [SubAir]s. +//! The primitives are separated into two types: standalone [Air](openvm_stark_backend::p3_air::Air)s and [SubAir]s. //! -//! The following modules contain standalone [Air]s: +//! The following modules contain standalone [Air](openvm_stark_backend::p3_air::Air)s: //! - [range] //! - [range_gate] //! - [range_tuple] diff --git a/crates/circuits/primitives/src/sub_air.rs b/crates/circuits/primitives/src/sub_air.rs index 0ba83ad604..52966b88bb 100644 --- a/crates/circuits/primitives/src/sub_air.rs +++ b/crates/circuits/primitives/src/sub_air.rs @@ -3,7 +3,7 @@ use openvm_stark_backend::p3_air::AirBuilder; /// Trait with associated types intended to allow re-use of constraint logic /// inside other AIRs. /// -/// A `SubAir` is **not** an [`Air`](p3_air::Air) itself. +/// A `SubAir` is **not** an [Air](openvm_stark_backend::p3_air::Air) itself. /// A `SubAir` is a struct that holds the means to generate a particular set of constraints, /// meant to be re-usable within other AIRs. /// diff --git a/crates/sdk/src/commit.rs b/crates/sdk/src/commit.rs index 7ce9b01959..58482e24c2 100644 --- a/crates/sdk/src/commit.rs +++ b/crates/sdk/src/commit.rs @@ -38,7 +38,7 @@ pub struct AppExecutionCommit { /// ), /// hash(right_pad(pc_start, 0)) /// ) - /// `right_pad` example, if pc_start = 123, right_pad(pc_start, 0) = [123,0,0,0,0,0,0,0] + /// `right_pad` example, if pc_start = 123, right_pad(pc_start, 0) = \[123,0,0,0,0,0,0,0\] pub exe_commit: [T; DIGEST_SIZE], } diff --git a/crates/sdk/src/verifier/root/types.rs b/crates/sdk/src/verifier/root/types.rs index 86f584d1c5..d1b8988276 100644 --- a/crates/sdk/src/verifier/root/types.rs +++ b/crates/sdk/src/verifier/root/types.rs @@ -25,7 +25,7 @@ pub struct RootVmVerifierPvs { /// Input for the root VM verifier. /// Note: Root verifier is proven in Root SC, but it usually verifies proofs in SC. So -/// usually only RootVmVerifierInput is needed. +/// usually only RootVmVerifierInput\ is needed. #[derive(Serialize, Deserialize, Derivative)] #[serde(bound = "")] #[derivative(Clone(bound = "Com: Clone"))] diff --git a/crates/toolchain/transpiler/src/extension.rs b/crates/toolchain/transpiler/src/extension.rs index 8163301fff..805c50a33f 100644 --- a/crates/toolchain/transpiler/src/extension.rs +++ b/crates/toolchain/transpiler/src/extension.rs @@ -3,10 +3,10 @@ use openvm_instructions::instruction::Instruction; /// Trait to add custom RISC-V instruction transpilation to OpenVM instruction format. /// RISC-V instructions always come in 32-bit chunks. /// An important feature is that multiple 32-bit RISC-V instructions can be transpiled into a single OpenVM instruction. -/// See `process_custom` for details. +/// See [process_custom](Self::process_custom) for details. pub trait TranspilerExtension { /// The `instruction_stream` provides a view of the remaining RISC-V instructions to be processed, - /// presented as 32-bit chunks. The [`CustomInstructionProcessor`] should determine if it knows how to transpile + /// presented as 32-bit chunks. The [process_custom](Self::process_custom) should determine if it knows how to transpile /// the next contiguous section of RISC-V instructions into an [`Instruction`]. /// It returns `None` if it cannot transpile. Otherwise it returns `(instruction, how_many_u32s)` to indicate that /// `instruction_stream[..how_many_u32s]` should be transpiled into `instruction`. diff --git a/crates/vm/src/arch/execution.rs b/crates/vm/src/arch/execution.rs index a3746a1ab3..6852fc4e25 100644 --- a/crates/vm/src/arch/execution.rs +++ b/crates/vm/src/arch/execution.rs @@ -284,7 +284,7 @@ impl From<(u32, Option)> for PcIncOrSet { } /// Phantom sub-instructions affect the runtime of the VM and the trace matrix values. -/// However they all have no AIR constraints besides advancing the pc by [DEFAULT_PC_STEP](super::program::DEFAULT_PC_STEP). +/// However they all have no AIR constraints besides advancing the pc by [DEFAULT_PC_STEP](openvm_instructions::program::DEFAULT_PC_STEP). /// /// They should not mutate memory, but they can mutate the input & hint streams. /// diff --git a/crates/vm/src/arch/integration_api.rs b/crates/vm/src/arch/integration_api.rs index ed56cdaff5..bc55981a61 100644 --- a/crates/vm/src/arch/integration_api.rs +++ b/crates/vm/src/arch/integration_api.rs @@ -89,7 +89,7 @@ pub trait VmAdapterChip { pub trait VmAdapterAir: BaseAir { type Interface: VmAdapterInterface; - /// [Air](p3_air::Air) constraints owned by the adapter. + /// [Air](openvm_stark_backend::p3_air::Air) constraints owned by the adapter. /// The `interface` is given as abstract expressions so it can be directly used in other AIR constraints. /// /// Adapters should document the max constraint degree as a function of the constraint degrees of `reads, writes, instruction`. diff --git a/crates/vm/src/arch/testing/memory/mod.rs b/crates/vm/src/arch/testing/memory/mod.rs index be77a6fe5a..426d4a53e6 100644 --- a/crates/vm/src/arch/testing/memory/mod.rs +++ b/crates/vm/src/arch/testing/memory/mod.rs @@ -43,7 +43,7 @@ impl MemoryTester { } } - /// Returns the cell value at the current timestamp according to [MemoryController]. + /// Returns the cell value at the current timestamp according to [MemoryControllerRef]. pub fn read_cell(&mut self, address_space: usize, pointer: usize) -> F { let [addr_space, pointer] = [address_space, pointer].map(F::from_canonical_usize); // core::BorrowMut confuses compiler diff --git a/crates/vm/src/system/memory/manager/memory.rs b/crates/vm/src/system/memory/manager/memory.rs index b7d2b1860d..4eb281c60b 100644 --- a/crates/vm/src/system/memory/manager/memory.rs +++ b/crates/vm/src/system/memory/manager/memory.rs @@ -9,7 +9,7 @@ use crate::system::memory::{ }; /// Represents a single or batch memory write operation. -/// Can be used to generate [MemoryWriteAuxCols]. +/// Can be used to generate [MemoryWriteAuxCols](crate::system::memory::offline_checker::MemoryWriteAuxCols). #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct MemoryWriteRecord { pub address_space: T, @@ -29,7 +29,7 @@ impl MemoryWriteRecord { /// Represents a single or batch memory read operation. /// /// Also used for "reads" from address space 0 (immediates). -/// Can be used to generate [MemoryReadAuxCols] or [MemoryReadOrImmediateAuxCols]. +/// Can be used to generate [MemoryReadAuxCols](crate::system::memory::offline_checker::MemoryWriteAuxCols) or [MemoryReadOrImmediateAuxCols](crate::system::memory::offline_checker::MemoryReadOrImmediateAuxCols). #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct MemoryReadRecord { pub address_space: T, diff --git a/crates/vm/src/system/memory/offline_checker/bridge.rs b/crates/vm/src/system/memory/offline_checker/bridge.rs index d8094e8655..571b01072b 100644 --- a/crates/vm/src/system/memory/offline_checker/bridge.rs +++ b/crates/vm/src/system/memory/offline_checker/bridge.rs @@ -115,7 +115,7 @@ pub struct MemoryReadOperation<'a, T, V, const N: usize> { /// The max degree of constraints is: /// eval_timestamps: deg(enabled) + max(1, deg(self.timestamp)) -/// eval_bulk_access: refer to [MemoryOfflineChecker::eval_bulk_access] +/// eval_bulk_access: refer to private function MemoryOfflineChecker::eval_bulk_access impl, const N: usize> MemoryReadOperation<'_, F, V, N> { /// Evaluate constraints and send/receive interactions. pub fn eval(self, builder: &mut AB, enabled: impl Into) @@ -169,7 +169,7 @@ pub struct MemoryReadOrImmediateOperation<'a, T, V> { /// deg(address.address_space) + deg(aux.is_zero_aux)) /// is_immediate check: deg(aux.is_immediate) + max(deg(data), deg(address.pointer)) /// eval_timestamps: deg(enabled) + max(1, deg(self.timestamp)) -/// eval_bulk_access: refer to [MemoryOfflineChecker::eval_bulk_access] +/// eval_bulk_access: refer to private function MemoryOfflineChecker::eval_bulk_access impl> MemoryReadOrImmediateOperation<'_, F, V> { /// Evaluate constraints and send/receive interactions. pub fn eval(self, builder: &mut AB, enabled: impl Into) @@ -229,7 +229,7 @@ pub struct MemoryWriteOperation<'a, T, V, const N: usize> { /// The max degree of constraints is: /// eval_timestamps: deg(enabled) + max(1, deg(self.timestamp)) -/// eval_bulk_access: refer to [MemoryOfflineChecker::eval_bulk_access] +/// eval_bulk_access: refer to private function MemoryOfflineChecker::eval_bulk_access impl, const N: usize> MemoryWriteOperation<'_, T, V, N> { /// Evaluate constraints and send/receive interactions. `enabled` must be boolean. pub fn eval(self, builder: &mut AB, enabled: impl Into) diff --git a/crates/vm/src/system/memory/offline_checker/columns.rs b/crates/vm/src/system/memory/offline_checker/columns.rs index 09e7c87f3c..d72bc4f951 100644 --- a/crates/vm/src/system/memory/offline_checker/columns.rs +++ b/crates/vm/src/system/memory/offline_checker/columns.rs @@ -22,7 +22,7 @@ pub struct MemoryBaseAuxCols { } impl MemoryBaseAuxCols { - /// TODO[arayi]: Since we have AlignedBorrow, should remove all from_slice, from_iterator, and flatten in a future PR. + /// TODO\[arayi\]: Since we have AlignedBorrow, should remove all from_slice, from_iterator, and flatten in a future PR. pub fn from_slice(slc: &[T]) -> Self { let base_aux_cols: &MemoryBaseAuxCols = slc.borrow(); base_aux_cols.clone() diff --git a/crates/vm/src/system/poseidon2/mod.rs b/crates/vm/src/system/poseidon2/mod.rs index 3d8aa84a90..f24dd496ed 100644 --- a/crates/vm/src/system/poseidon2/mod.rs +++ b/crates/vm/src/system/poseidon2/mod.rs @@ -1,5 +1,5 @@ //! Chip to handle **native kernel** instructions for Poseidon2 `compress` and `permute`. -//! This chip is put in [intrinsics](crate::intrinsics) for organizational convenience, but +//! This chip is put in `intrinsics` for organizational convenience, but //! it is used as a system chip for persistent memory and as a native kernel chip for aggregation. //! //! Note that neither `compress` nor `permute` on its own diff --git a/extensions/keccak256/circuit/src/air.rs b/extensions/keccak256/circuit/src/air.rs index 3d69498d1d..4f2ea4289e 100644 --- a/extensions/keccak256/circuit/src/air.rs +++ b/extensions/keccak256/circuit/src/air.rs @@ -164,7 +164,7 @@ impl KeccakVmAir { } /// Keccak follows the 10*1 padding rule. - /// See Section 5.1 of https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf + /// See Section 5.1 of /// Note this is the ONLY difference between Keccak and SHA-3 /// /// Constrains padding constraints and length between rounds and diff --git a/extensions/keccak256/circuit/src/columns.rs b/extensions/keccak256/circuit/src/columns.rs index 03e7ce4f79..edb28fa8ed 100644 --- a/extensions/keccak256/circuit/src/columns.rs +++ b/extensions/keccak256/circuit/src/columns.rs @@ -37,7 +37,7 @@ pub struct KeccakInstructionCols { /// False on dummy rows only used to pad the height. pub is_enabled: T, /// Is enabled and first round of block. Used to lower constraint degree. - /// is_enabled * inner.step_flags[0] + /// is_enabled * inner.step_flags\[0\] pub is_enabled_first_round: T, /// The starting timestamp to use for memory access in this row. /// A single row will do multiple memory accesses. @@ -51,17 +51,17 @@ pub struct KeccakInstructionCols { /// Memory address space pub e: T, // Register values - /// dst <- [dst_ptr:4]_1 + /// dst <- \[dst_ptr:4\]_1 pub dst: [T; RV32_REGISTER_NUM_LIMBS], - /// src <- [src_ptr:4]_1 - /// We store src_limbs[i] = [src_ptr + i + 1]_1 and src = u32([src_ptr:4]_1) from which [src_ptr]_1 + /// src <- \[src_ptr:4\]_1 + /// We store src_limbs\[i\] = \[src_ptr + i + 1\]_1 and src = u32(\[src_ptr:4\]_1) from which \[src_ptr\]_1 /// can be recovered by linear combination. /// We do this because `src` needs to be incremented between keccak-f permutations. pub src_limbs: [T; RV32_REGISTER_NUM_LIMBS - 1], pub src: T, - /// len <- [len_ptr:4]_1 - /// We store len_limbs[i] = [len_ptr + i + 1]_1 and remaining_len = u32([len_ptr:4]_1) - /// from which [len_ptr]_1 can be recovered by linear combination. + /// len <- \[len_ptr:4\]_1 + /// We store len_limbs\[i\] = \[len_ptr + i + 1\]_1 and remaining_len = u32(\[len_ptr:4\]_1) + /// from which \[len_ptr\]_1 can be recovered by linear combination. /// We do this because `remaining_len` needs to be decremented between keccak-f permutations. pub len_limbs: [T; RV32_REGISTER_NUM_LIMBS - 1], /// The remaining length of the unpadded input, in bytes. @@ -99,8 +99,8 @@ pub struct KeccakMemoryCols { pub register_aux: [MemoryReadAuxCols; KECCAK_REGISTER_READS], pub absorb_reads: [MemoryReadAuxCols; KECCAK_ABSORB_READS], pub digest_writes: [MemoryWriteAuxCols; KECCAK_DIGEST_WRITES], - /// The input bytes are batch read in blocks of [KECCAK_WORD_SIZE] bytes. However - /// if the input length is not a multiple of [KECCAK_WORD_SIZE], we read into + /// The input bytes are batch read in blocks of private constant KECCAK_WORD_SIZE bytes. However + /// if the input length is not a multiple of KECCAK_WORD_SIZE, we read into /// `partial_block` more bytes than we need. On the other hand `block_bytes` expects /// only the partial block of bytes and then the correctly padded bytes. /// We will select between `partial_block` and `block_bytes` for what to read from memory. diff --git a/extensions/native/compiler/src/ir/bits.rs b/extensions/native/compiler/src/ir/bits.rs index ea5ecdb391..40cebc371e 100644 --- a/extensions/native/compiler/src/ir/bits.rs +++ b/extensions/native/compiler/src/ir/bits.rs @@ -120,10 +120,10 @@ impl Builder { /// Reverse a list of bits. /// - /// SAFETY: calling this function with `bit_len` greater [`NUM_BITS`] will result in undefined + /// SAFETY: calling this function with `bit_len` greater `NUM_BITS` will result in undefined /// behavior. /// - /// Reference: [p3_util::reverse_bits_len] + /// Reference: [`openvm_stark_backend::p3_util`] pub fn reverse_bits_len( &mut self, index_bits: &Array>, @@ -149,10 +149,10 @@ impl Builder { /// Reverse a list of bits inside a circuit. /// - /// SAFETY: calling this function with `bit_len` greater [`NUM_BITS`] will result in undefined + /// SAFETY: calling this function with `bit_len` greater `NUM_BITS` will result in undefined /// behavior. /// - /// Reference: [p3_util::reverse_bits_len] + /// Reference: [`openvm_stark_backend::p3_util`] pub fn reverse_bits_len_circuit( &mut self, index_bits: Vec>, diff --git a/extensions/native/compiler/src/ir/poseidon.rs b/extensions/native/compiler/src/ir/poseidon.rs index d887575b14..329461dae9 100644 --- a/extensions/native/compiler/src/ir/poseidon.rs +++ b/extensions/native/compiler/src/ir/poseidon.rs @@ -9,7 +9,7 @@ pub const PERMUTATION_WIDTH: usize = 16; impl Builder { /// Applies the Poseidon2 permutation to the given array. /// - /// Reference: [p3_poseidon2::Poseidon2] + /// [Reference](https://docs.rs/p3-poseidon2/latest/p3_poseidon2/struct.Poseidon2.html) pub fn poseidon2_permute(&mut self, array: &Array>) -> Array> { let output = match array { Array::Fixed(values) => { @@ -27,7 +27,7 @@ impl Builder { /// Applies the Poseidon2 permutation to the given array. /// - /// Reference: [p3_poseidon2::Poseidon2] + /// [Reference](https://docs.rs/p3-poseidon2/latest/p3_poseidon2/struct.Poseidon2.html) pub fn poseidon2_permute_mut(&mut self, array: &Array>) { if let Array::Fixed(_) = array { panic!("Poseidon2 permutation is not allowed on fixed arrays"); @@ -40,7 +40,7 @@ impl Builder { /// Applies the Poseidon2 compression function to the given array. /// - /// Reference: [p3_symmetric::TruncatedPermutation] + /// [Reference](https://docs.rs/p3-symmetric/latest/p3_symmetric/struct.TruncatedPermutation.html) pub fn poseidon2_compress( &mut self, left: &Array>, @@ -60,7 +60,7 @@ impl Builder { /// Applies the Poseidon2 compression to the given array. /// - /// Reference: [p3_symmetric::TruncatedPermutation] + /// [Reference](https://docs.rs/p3-symmetric/latest/p3_symmetric/struct.TruncatedPermutation.html) pub fn poseidon2_compress_x( &mut self, result: &Array>, @@ -76,7 +76,7 @@ impl Builder { /// Applies the Poseidon2 permutation to the given array. /// - /// Reference: [p3_symmetric::PaddingFreeSponge] + /// [Reference](https://docs.rs/p3-symmetric/latest/p3_symmetric/struct.PaddingFreeSponge.html) pub fn poseidon2_hash(&mut self, array: &Array>) -> Array> { let perm_width = PERMUTATION_WIDTH; let state: Array> = self.dyn_array(perm_width); diff --git a/extensions/native/compiler/src/ir/utils.rs b/extensions/native/compiler/src/ir/utils.rs index 92efdf3075..9a29a82b9b 100644 --- a/extensions/native/compiler/src/ir/utils.rs +++ b/extensions/native/compiler/src/ir/utils.rs @@ -23,7 +23,7 @@ pub fn prime_field_to_usize(x: F) -> usize { impl Builder { /// The generator for the field. /// - /// Reference: [p3_baby_bear::BabyBear] + /// Reference: [`openvm_stark_sdk::p3_baby_bear::BabyBear`] pub fn generator(&mut self) -> Felt { self.eval(C::F::from_canonical_u32(31)) } @@ -141,7 +141,7 @@ impl Builder { /// Exponentiates a variable to a list of reversed bits with a given length. /// - /// Reference: [p3_util::reverse_bits_len] + /// Reference: [`openvm_stark_backend::p3_util::reverse_bits_len`] pub fn exp_reverse_bits_len( &mut self, x: V, diff --git a/extensions/native/recursion/src/challenger/duplex.rs b/extensions/native/recursion/src/challenger/duplex.rs index 38b7383fad..7b2da723a5 100644 --- a/extensions/native/recursion/src/challenger/duplex.rs +++ b/extensions/native/recursion/src/challenger/duplex.rs @@ -12,7 +12,7 @@ use crate::{ digest::DigestVariable, }; -/// Reference: [p3_challenger::DuplexChallenger] +/// Reference: [`openvm_stark_backend::p3_challenger::DuplexChallenger`] #[derive(Clone)] pub struct DuplexChallengerVariable { pub sponge_state: Array>, diff --git a/extensions/native/recursion/src/challenger/mod.rs b/extensions/native/recursion/src/challenger/mod.rs index 26eccfc3fb..78488ad498 100644 --- a/extensions/native/recursion/src/challenger/mod.rs +++ b/extensions/native/recursion/src/challenger/mod.rs @@ -8,14 +8,14 @@ use crate::digest::DigestVariable; pub mod duplex; pub mod multi_field32; -/// Reference: [p3_challenger::CanObserve]. +/// Reference: [`openvm_stark_backend::p3_challenger::CanObserve`] pub trait CanObserveVariable { fn observe(&mut self, builder: &mut Builder, value: V); fn observe_slice(&mut self, builder: &mut Builder, values: Array); } -/// Reference: [p3_challenger::CanObserve]. +/// Reference: [`openvm_stark_backend::p3_challenger::CanObserve`] pub trait CanObserveDigest { fn observe_digest(&mut self, builder: &mut Builder, value: DigestVariable); } @@ -25,7 +25,7 @@ pub trait CanSampleVariable { fn sample(&mut self, builder: &mut Builder) -> V; } -/// Reference: [p3_challenger::FieldChallenger]. +/// Reference: [`openvm_stark_backend::p3_challenger::FieldChallenger`] pub trait FeltChallenger: CanObserveVariable> + CanSampleVariable> + CanSampleBitsVariable { diff --git a/extensions/native/recursion/src/fri/domain.rs b/extensions/native/recursion/src/fri/domain.rs index 28147a8f8a..531f3b0d76 100644 --- a/extensions/native/recursion/src/fri/domain.rs +++ b/extensions/native/recursion/src/fri/domain.rs @@ -7,7 +7,7 @@ use openvm_stark_backend::{ use super::types::FriConfigVariable; use crate::commit::PolynomialSpaceVariable; -/// Reference: [p3_commit::TwoAdicMultiplicativeCoset] +/// Reference: [`openvm_stark_backend::p3_commit::TwoAdicMultiplicativeCoset`] #[derive(DslVariable, Clone)] pub struct TwoAdicMultiplicativeCosetVariable { pub log_n: Usize, diff --git a/extensions/native/recursion/src/fri/mod.rs b/extensions/native/recursion/src/fri/mod.rs index da364f1397..387727b717 100644 --- a/extensions/native/recursion/src/fri/mod.rs +++ b/extensions/native/recursion/src/fri/mod.rs @@ -27,7 +27,7 @@ pub mod two_adic_pcs; pub mod types; pub mod witness; -/// Reference: https://github.com/Plonky3/Plonky3/blob/4809fa7bedd9ba8f6f5d3267b1592618e3776c57/fri/src/verifier.rs#L27 +/// Reference: pub fn verify_shape_and_sample_challenges( builder: &mut Builder, config: &FriConfigVariable, @@ -73,7 +73,7 @@ pub fn verify_shape_and_sample_challenges( /// Verifies a set of FRI challenges. /// -/// Reference: https://github.com/Plonky3/Plonky3/blob/4809fa7bedd9ba8f6f5d3267b1592618e3776c57/fri/src/verifier.rs#L67 +/// Reference: #[allow(clippy::type_complexity)] pub fn verify_challenges( builder: &mut Builder, @@ -113,7 +113,7 @@ pub fn verify_challenges( /// /// Currently assumes the index that is accessed is constant. /// -/// Reference: https://github.com/Plonky3/Plonky3/blob/4809fa7bedd9ba8f6f5d3267b1592618e3776c57/fri/src/verifier.rs#L101 +/// Reference: #[allow(clippy::too_many_arguments)] #[allow(unused_variables)] pub fn verify_query( @@ -224,7 +224,7 @@ pub enum NestedOpenedValues { /// /// Assumes the dimensions have already been sorted by tallest first. /// -/// Reference: https://github.com/Plonky3/Plonky3/blob/4809fa7bedd9ba8f6f5d3267b1592618e3776c57/merkle-tree/src/mmcs.rs#L92 +/// Reference: #[allow(clippy::type_complexity)] #[allow(unused_variables)] pub fn verify_batch( @@ -341,7 +341,7 @@ pub fn verify_batch( /// /// Assumes the dimensions have already been sorted by tallest first. /// -/// Reference: https://github.com/Plonky3/Plonky3/blob/4809fa7bedd9ba8f6f5d3267b1592618e3776c57/merkle-tree/src/mmcs.rs#L92 +/// Reference: #[allow(clippy::type_complexity)] #[allow(unused_variables)] pub fn verify_batch_static( diff --git a/extensions/native/recursion/src/halo2/utils.rs b/extensions/native/recursion/src/halo2/utils.rs index 986295ee23..59ed3b009c 100644 --- a/extensions/native/recursion/src/halo2/utils.rs +++ b/extensions/native/recursion/src/halo2/utils.rs @@ -148,7 +148,7 @@ fn read_params(k: u32) -> Arc { /// Sort AIRs by their trace height in descending order. This should not be used outside /// static-verifier because a dynamic verifier should support any AIR order. /// This is related to an implementation detail of FieldMerkleTreeMMCS which is used in most configs. -/// Reference: https://github.com/Plonky3/Plonky3/blob/27b3127dab047e07145c38143379edec2960b3e1/merkle-tree/src/merkle_tree.rs#L53 +/// Reference: pub fn sort_chips( mut air_proof_inputs: Vec>, ) -> Vec> { diff --git a/extensions/native/recursion/src/stark/mod.rs b/extensions/native/recursion/src/stark/mod.rs index 4922fee103..b2319bbae6 100644 --- a/extensions/native/recursion/src/stark/mod.rs +++ b/extensions/native/recursion/src/stark/mod.rs @@ -48,7 +48,7 @@ pub struct VerifierProgram { } impl VerifierProgram { - /// Create a new instance of the program for the [BabyBearPoseidon2] config. + /// Create a new instance of the program for the [`openvm_stark_sdk::config::baby_bear_poseidon2`] pub fn build( constants: MultiStarkVerificationAdvice, fri_params: &FriParameters, @@ -60,7 +60,7 @@ impl VerifierProgram { Self::build_with_options(constants, fri_params, options) } - /// Create a new instance of the program for the [BabyBearPoseidon2] config. + /// Create a new instance of the program for the [`openvm_stark_sdk::config::baby_bear_poseidon2`] pub fn build_with_options( constants: MultiStarkVerificationAdvice, fri_params: &FriParameters, diff --git a/extensions/native/recursion/src/utils.rs b/extensions/native/recursion/src/utils.rs index 3132144a0c..12a10ee7a6 100644 --- a/extensions/native/recursion/src/utils.rs +++ b/extensions/native/recursion/src/utils.rs @@ -37,7 +37,7 @@ pub fn const_fri_config( } } -/// Reference: https://github.com/Plonky3/Plonky3/blob/622375885320ac6bf3c338001760ed8f2230e3cb/field/src/helpers.rs#L136 +/// Reference: pub fn reduce_32(builder: &mut Builder, vals: &[Felt]) -> Var { let mut power = C::N::ONE; let result: Var = builder.eval(C::N::ZERO); @@ -49,7 +49,7 @@ pub fn reduce_32(builder: &mut Builder, vals: &[Felt]) -> Va result } -/// Reference: https://github.com/Plonky3/Plonky3/blob/622375885320ac6bf3c338001760ed8f2230e3cb/field/src/helpers.rs#L149 +/// Reference: pub fn split_32(builder: &mut Builder, val: Var, n: usize) -> Vec> { let bits = builder.num2bits_v_circuit(val, 256); let mut results = Vec::new(); diff --git a/extensions/pairing/guest/src/pairing/mod.rs b/extensions/pairing/guest/src/pairing/mod.rs index f1dadf93f6..25530fefde 100644 --- a/extensions/pairing/guest/src/pairing/mod.rs +++ b/extensions/pairing/guest/src/pairing/mod.rs @@ -30,7 +30,7 @@ pub trait PairingIntrinsics { /// The sextic extension `Fp12` is `Fp2[X] / (X^6 - \xi)`, where `\xi` is a non-residue. const XI: Self::Fp2; /// Multiplication constants for the Frobenius map for coefficients in Fp2 c1..=c5 for powers 0..12 - /// FROBENIUS_COEFFS[i][j] = \xi^{(j + 1) * (p^i - 1)/6} when p = 1 (mod 6) + /// FROBENIUS_COEFFS\[i\]\[j\] = \xi^{(j + 1) * (p^i - 1)/6} when p = 1 (mod 6) const FROBENIUS_COEFFS: [[Self::Fp2; 5]; 12]; } diff --git a/extensions/rv32im/circuit/src/adapters/alu.rs b/extensions/rv32im/circuit/src/adapters/alu.rs index 5fbd98ada6..e6e7bc4c32 100644 --- a/extensions/rv32im/circuit/src/adapters/alu.rs +++ b/extensions/rv32im/circuit/src/adapters/alu.rs @@ -33,7 +33,7 @@ use openvm_stark_backend::{ use super::{RV32_CELL_BITS, RV32_REGISTER_NUM_LIMBS}; -/// Reads instructions of the form OP a, b, c, d, e where [a:4]_d = [b:4]_d op [c:4]_e. +/// Reads instructions of the form OP a, b, c, d, e where \[a:4\]_d = \[b:4\]_d op \[c:4\]_e. /// Operand d can only be 1, and e can be either 1 (for register reads) or 0 (when c /// is an immediate). #[derive(Debug)] diff --git a/extensions/rv32im/circuit/src/adapters/branch.rs b/extensions/rv32im/circuit/src/adapters/branch.rs index c5a0dff6de..d35530e86b 100644 --- a/extensions/rv32im/circuit/src/adapters/branch.rs +++ b/extensions/rv32im/circuit/src/adapters/branch.rs @@ -29,7 +29,7 @@ use openvm_stark_backend::{ use super::RV32_REGISTER_NUM_LIMBS; -/// Reads instructions of the form OP a, b, c, d, e where if([a:4]_d op [b:4]_e) pc += c. +/// Reads instructions of the form OP a, b, c, d, e where if(\[a:4\]_d op \[b:4\]_e) pc += c. /// Operands d and e can only be 1. #[derive(Debug)] pub struct Rv32BranchAdapterChip { diff --git a/extensions/rv32im/circuit/src/adapters/mul.rs b/extensions/rv32im/circuit/src/adapters/mul.rs index a9b61e96d5..1c6bb6d906 100644 --- a/extensions/rv32im/circuit/src/adapters/mul.rs +++ b/extensions/rv32im/circuit/src/adapters/mul.rs @@ -29,7 +29,7 @@ use openvm_stark_backend::{ use super::RV32_REGISTER_NUM_LIMBS; -/// Reads instructions of the form OP a, b, c, d where [a:4]_d = [b:4]_d op [c:4]_d. +/// Reads instructions of the form OP a, b, c, d where \[a:4\]_d = \[b:4\]_d op \[c:4\]_d. /// Operand d can only be 1, and there is no immediate support. #[derive(Debug)] pub struct Rv32MultAdapterChip { diff --git a/extensions/rv32im/circuit/src/adapters/rdwrite.rs b/extensions/rv32im/circuit/src/adapters/rdwrite.rs index 4e833e8ad1..6ed62a1478 100644 --- a/extensions/rv32im/circuit/src/adapters/rdwrite.rs +++ b/extensions/rv32im/circuit/src/adapters/rdwrite.rs @@ -30,14 +30,14 @@ use openvm_stark_backend::{ use super::RV32_REGISTER_NUM_LIMBS; -/// This adapter doesn't read anything, and writes to [a:4]_d, where d == 1 +/// This adapter doesn't read anything, and writes to \[a:4\]_d, where d == 1 #[derive(Debug)] pub struct Rv32RdWriteAdapterChip { pub air: Rv32RdWriteAdapterAir, _marker: PhantomData, } -/// This adapter doesn't read anything, and **maybe** writes to [a:4]_d, where d == 1 +/// This adapter doesn't read anything, and **maybe** writes to \[a:4\]_d, where d == 1 #[derive(Debug)] pub struct Rv32CondRdWriteAdapterChip { /// Do not use the inner air directly, use `air` instead. From 2b1ff8e5cc2a678728be01ab409b0838e419e1c3 Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:51:24 -0800 Subject: [PATCH 2/2] Apply suggestions from code review --- crates/vm/src/arch/testing/memory/mod.rs | 2 +- crates/vm/src/system/memory/offline_checker/columns.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/vm/src/arch/testing/memory/mod.rs b/crates/vm/src/arch/testing/memory/mod.rs index 5473bb5ab0..71e4cf9275 100644 --- a/crates/vm/src/arch/testing/memory/mod.rs +++ b/crates/vm/src/arch/testing/memory/mod.rs @@ -40,7 +40,7 @@ impl MemoryTester { } } - /// Returns the cell value at the current timestamp according to `MemoryControllerRef`. + /// Returns the cell value at the current timestamp according to `MemoryController`. pub fn read_cell(&mut self, address_space: usize, pointer: usize) -> F { let [addr_space, pointer] = [address_space, pointer].map(F::from_canonical_usize); // core::BorrowMut confuses compiler diff --git a/crates/vm/src/system/memory/offline_checker/columns.rs b/crates/vm/src/system/memory/offline_checker/columns.rs index 1b5612fea3..ba851a22ee 100644 --- a/crates/vm/src/system/memory/offline_checker/columns.rs +++ b/crates/vm/src/system/memory/offline_checker/columns.rs @@ -22,7 +22,7 @@ pub struct MemoryBaseAuxCols { } impl MemoryBaseAuxCols { - /// TODO\[arayi\]: Since we have AlignedBorrow, should remove all from_slice, from_iterator, and flatten in a future PR. + // TODO[arayi]: Since we have AlignedBorrow, should remove all from_slice, from_iterator, and flatten in a future PR. pub fn from_slice(slc: &[T]) -> Self { let base_aux_cols: &MemoryBaseAuxCols = slc.borrow(); base_aux_cols.clone()