From f1e01a7b07a3cf7224540a737f8df31dabef2863 Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Tue, 31 Dec 2024 22:40:55 -0800 Subject: [PATCH] chore: clean up comments in native compiler --- extensions/native/compiler/src/ir/builder.rs | 4 +-- .../native/compiler/src/ir/instructions.rs | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/extensions/native/compiler/src/ir/builder.rs b/extensions/native/compiler/src/ir/builder.rs index fb5fd67f25..26fc2b3292 100644 --- a/extensions/native/compiler/src/ir/builder.rs +++ b/extensions/native/compiler/src/ir/builder.rs @@ -125,8 +125,8 @@ impl Builder { var_count: self.var_count, felt_count: self.felt_count, ext_count: self.ext_count, - // Witness counts are only used when the target is a gnark circuit. And sub-builders are - // not used when the target is a gnark circuit, so it's fine to set the witness counts to 0. + // Witness counts are only used when the target is a circuit. And sub-builders are + // not used when the target is a circuit, so it is fine to set the witness counts to 0. witness_var_count: 0, witness_felt_count: 0, witness_ext_count: 0, diff --git a/extensions/native/compiler/src/ir/instructions.rs b/extensions/native/compiler/src/ir/instructions.rs index d636b00ab0..8e31b46569 100644 --- a/extensions/native/compiler/src/ir/instructions.rs +++ b/extensions/native/compiler/src/ir/instructions.rs @@ -51,7 +51,7 @@ pub enum DslIr { SubFIN(Felt, C::F, Felt), /// Subtracts two extension field elements (ext = ext - ext). SubE(Ext, Ext, Ext), - /// Subtrancts an extension field element and an extension field immediate (ext = ext - ext field imm). + /// Subtracts an extension field element and an extension field immediate (ext = ext - ext field imm). SubEI(Ext, Ext, C::EF), /// Subtracts an extension field immediate and an extension field element (ext = ext field imm - ext). SubEIN(Ext, C::EF, Ext), @@ -190,9 +190,9 @@ pub enum DslIr { StoreHeapPtr(Ptr), // Bits. - /// Decompose a variable into size bits (bits = num2bits(var, size)). Should only be used when target is a gnark circuit. + /// Decompose a variable into size bits (bits = num2bits(var, size)). Should only be used when target is a circuit. CircuitNum2BitsV(Var, usize, Vec>), - /// Decompose a field element into bits (bits = num2bits(felt)). Should only be used when target is a gnark circuit. + /// Decompose a field element into bits (bits = num2bits(felt)). Should only be used when target is a circuit. CircuitNum2BitsF(Felt, Vec>), // Hashing. @@ -205,7 +205,7 @@ pub enum DslIr { Array>, ), /// Permutes an array of Bn254 elements using Poseidon2 (output = p2_permute(array)). Should only - /// be used when target is a gnark circuit. + /// be used when target is a circuit. CircuitPoseidon2Permute([Var; 3]), // Miscellaneous instructions. @@ -229,11 +229,11 @@ pub enum DslIr { StoreHintWord(Ptr, MemIndex), - /// Witness a variable. Should only be used when target is a gnark circuit. + /// Witness a variable. Should only be used when target is a circuit. WitnessVar(Var, u32), - /// Witness a field element. Should only be used when target is a gnark circuit. + /// Witness a field element. Should only be used when target is a circuit. WitnessFelt(Felt, u32), - /// Witness an extension field element. Should only be used when target is a gnark circuit. + /// Witness an extension field element. Should only be used when target is a circuit. WitnessExt(Ext, u32), /// Label a field element as the ith public input. Publish(Felt, Var), @@ -242,32 +242,32 @@ pub enum DslIr { // Public inputs for circuits. /// Asserts that the inputted var is equal the circuit's vkey hash public input. Should only be - /// used when target is a gnark circuit. + /// used when target is a circuit. CircuitCommitVkeyHash(Var), - /// Asserts that the inputted var is equal the circuit's commited values digest public input. Should - /// only be used when target is a gnark circuit. + /// Asserts that the inputted var is equal the circuit's committed values digest public input. Should + /// only be used when target is a circuit. CircuitCommitCommitedValuesDigest(Var), - /// Publish a field element as the ith public value. Should only be used when target is a halo2 circuit. + /// Publish a field element as the ith public value. Should only be used when target is a circuit. CircuitPublish(Var, usize), // FRI specific instructions. /// Select's a variable based on a condition. (select(cond, true_val, false_val) => output). - /// Should only be used when target is a gnark circuit. + /// Should only be used when target is a circuit. CircuitSelectV(Var, Var, Var, Var), /// Select's a field element based on a condition. (select(cond, true_val, false_val) => output). - /// Should only be used when target is a gnark circuit. + /// Should only be used when target is a circuit. CircuitSelectF(Var, Felt, Felt, Felt), /// Select's an extension field element based on a condition. (select(cond, true_val, false_val) => output). - /// Should only be used when target is a gnark circuit. + /// Should only be used when target is a circuit. CircuitSelectE( Var, Ext, Ext, Ext, ), - /// Converts an ext to a slice of felts. Should only be used when target is a gnark circuit. + /// Converts an ext to a slice of felts. Should only be used when target is a circuit. CircuitExt2Felt([Felt; 4], Ext), - /// Converts a slice of felts to an ext. Should only be used when target is a gnark circuit. + /// Converts a slice of felts to an ext. Should only be used when target is a circuit. CircuitFelts2Ext([Felt; 4], Ext), /// FriReducedOpening(alpha, curr_alpha_pow, at_x_array, at_z_array, result) FriReducedOpening(