Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings and remove unneeded code #145

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions basic/src/bin/test_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ extern crate core;

use p3_baby_bear::BabyBear;
use p3_fri::{TwoAdicFriPcs, TwoAdicFriPcsConfig};
use valida_alu_u32::add::{Add32Instruction, MachineWithAdd32Chip};
use valida_alu_u32::add::Add32Instruction;
use valida_basic::BasicMachine;
use valida_cpu::{
BeqInstruction, BneInstruction, Imm32Instruction, JalInstruction, JalvInstruction,
MachineWithCpuChip, StopInstruction,
};
use valida_machine::{
FixedAdviceProvider, Instruction, InstructionWord, Machine, MachineProof, Operands, ProgramROM,
Word,
};

use valida_memory::MachineWithMemoryChip;
use valida_opcodes::BYTES_PER_INSTR;
use valida_program::MachineWithProgramChip;

Expand Down
2 changes: 1 addition & 1 deletion basic/src/bin/valida.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use p3_baby_bear::BabyBear;

use p3_fri::{FriConfig, TwoAdicFriPcs, TwoAdicFriPcsConfig};
use valida_cpu::MachineWithCpuChip;
use valida_machine::{Machine, MachineProof, ProgramROM, StdinAdviceProvider};
use valida_machine::{Machine, MachineProof, StdinAdviceProvider};

use valida_elf::{load_executable_file, Program};
use valida_program::MachineWithProgramChip;
Expand Down
4 changes: 2 additions & 2 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use syn::parse::{Parse, ParseStream};
use syn::{spanned::Spanned, Data, Field, Fields, Ident, Type, TypePath};
use syn::{spanned::Spanned, Data, Field, Fields, Ident};

// TODO: now trivial with a single field
struct MachineFields {
Expand Down Expand Up @@ -162,7 +162,7 @@ fn run_method(
.collect::<TokenStream2>();

let init_static_data: TokenStream2 = match static_data_chip {
Some(static_data_chip) => quote! {
Some(_static_data_chip) => quote! {
self.initialize_memory();
},
None => quote! {},
Expand Down
25 changes: 11 additions & 14 deletions elf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,20 @@ pub fn load_elf_object_file(file: Vec<u8>) -> Program {
&& section_header.sh_flags == (abi::SHF_ALLOC | abi::SHF_WRITE).into();
let is_text: bool = section_header.sh_type == abi::SHT_PROGBITS
&& section_header.sh_flags == (abi::SHF_ALLOC | abi::SHF_EXECINSTR).into();
let is_useful: bool = is_data || is_bss || is_text;
if is_useful {
if is_data || is_text {
let section_data = file.section_data(&section_header).unwrap();
match section_data {
(section_data, None) => {
if is_data {
data_sections.push((section_header, section_data));
} else if is_text {
text_sections.push((section_header, section_data));
}
if is_data || is_text {
let section_data = file.section_data(&section_header).unwrap();
match section_data {
(section_data, None) => {
if is_data {
data_sections.push((section_header, section_data));
} else if is_text {
text_sections.push((section_header, section_data));
}
_ => panic!("unsupported: compressed ELF section data"),
}
} else if is_bss {
bss_sections.push(section_header);
_ => panic!("unsupported: compressed ELF section data"),
}
} else if is_bss {
bss_sections.push(section_header);
}
}
let code_size = text_sections
Expand Down
5 changes: 1 addition & 4 deletions memory/src/stark.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use crate::columns::{MemoryCols, NUM_MEM_COLS};
use crate::columns::NUM_MEM_COLS;
use crate::MemoryChip;
use core::borrow::Borrow;

use p3_air::{Air, AirBuilder, BaseAir};
use p3_field::AbstractField;
use p3_matrix::MatrixRowSlices;

impl<F> BaseAir<F> for MemoryChip {
fn width(&self) -> usize {
Expand Down
5 changes: 2 additions & 3 deletions program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

extern crate alloc;

use crate::columns::{COL_MAP, NUM_PROGRAM_COLS, PREPROCESSED_COL_MAP};
use crate::columns::NUM_PROGRAM_COLS;
use alloc::vec;
use alloc::vec::Vec;
use valida_bus::MachineWithProgramBus;
use valida_machine::{Chip, Interaction, Machine, ProgramROM};
use valida_util::pad_to_power_of_two;

use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field};
use p3_matrix::dense::RowMajorMatrix;
use valida_machine::StarkConfig;
Expand Down Expand Up @@ -48,7 +47,7 @@ where
RowMajorMatrix::new(values, NUM_PROGRAM_COLS)
}

fn global_receives(&self, machine: &M) -> Vec<Interaction<SC::Val>> {
fn global_receives(&self, _machine: &M) -> Vec<Interaction<SC::Val>> {
// let pc = VirtualPairCol::single_preprocessed(PREPROCESSED_COL_MAP.pc);
// let opcode = VirtualPairCol::single_preprocessed(PREPROCESSED_COL_MAP.opcode);
// let mut fields = vec![pc, opcode];
Expand Down
6 changes: 3 additions & 3 deletions static_data/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field};
use p3_matrix::dense::RowMajorMatrix;
use valida_bus::MachineWithMemBus;
use valida_machine::{BusArgument, Chip, Interaction, Machine, StarkConfig, Word};
use valida_memory::{MachineWithMemoryChip, MemoryChip};
use valida_machine::{Chip, Interaction, StarkConfig, Word};
use valida_memory::MachineWithMemoryChip;

pub mod columns;
pub mod stark;
Expand Down Expand Up @@ -57,7 +57,7 @@ where
M: MachineWithMemBus<SC::Val>,
SC: StarkConfig,
{
fn generate_trace(&self, machine: &M) -> RowMajorMatrix<SC::Val> {
fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let mut rows = self
.cells
.iter()
Expand Down