Skip to content

Commit

Permalink
Flatter namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubarov committed Jan 24, 2024
1 parent 9f2f634 commit 9018f01
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion alu_u32/src/add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::pad_to_power_of_two;

pub mod columns;
Expand Down
2 changes: 1 addition & 1 deletion alu_u32/src/bitwise/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::pad_to_power_of_two;

pub mod columns;
Expand Down
4 changes: 2 additions & 2 deletions alu_u32/src/div/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use columns::{Div32Cols, DIV_COL_MAP, NUM_DIV_COLS};
use core::mem::transmute;
use valida_bus::MachineWithGeneralBus;
use valida_cpu::MachineWithCpuChip;
use valida_machine::config::StarkConfig;
use valida_machine::core::SDiv;
use valida_machine::SDiv;
use valida_machine::StarkConfig;
use valida_machine::{instructions, Chip, Instruction, Interaction, Operands, Word};
use valida_opcodes::{DIV32, SDIV32};
use valida_range::MachineWithRangeChip;
Expand Down
2 changes: 1 addition & 1 deletion alu_u32/src/lt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;

use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::pad_to_power_of_two;
pub mod columns;
pub mod stark;
Expand Down
2 changes: 1 addition & 1 deletion alu_u32/src/mul/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use core::borrow::BorrowMut;
use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;

pub mod columns;
pub mod stark;
Expand Down
2 changes: 1 addition & 1 deletion alu_u32/src/shift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::pad_to_power_of_two;

pub mod columns;
Expand Down
2 changes: 1 addition & 1 deletion alu_u32/src/sub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::pad_to_power_of_two;

pub mod columns;
Expand Down
7 changes: 3 additions & 4 deletions basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ use valida_cpu::{
use valida_cpu::{CpuChip, MachineWithCpuChip};
use valida_derive::Machine;
use valida_machine::{
proof::{ChipProof, MachineProof},
AbstractExtensionField, AbstractField, AdviceProvider, BusArgument, Chip, ExtensionField,
Instruction, Machine, PrimeField64, ProgramROM, ValidaAirBuilder,
AbstractExtensionField, AbstractField, AdviceProvider, BusArgument, Chip, ChipProof,
ExtensionField, Instruction, Machine, MachineProof, PrimeField64, ProgramROM, ValidaAirBuilder,
};
use valida_memory::{MachineWithMemoryChip, MemoryChip};
use valida_output::{MachineWithOutputChip, OutputChip, WriteInstruction};
use valida_program::{MachineWithProgramChip, ProgramChip};
use valida_range::{MachineWithRangeChip, RangeCheckerChip};

use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;

#[derive(Machine, Default)]
#[machine_fields(F)]
Expand Down
2 changes: 1 addition & 1 deletion basic/tests/test_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use p3_merkle_tree::FieldMerkleTreeMmcs;
use p3_poseidon::Poseidon;
use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32};
use rand::thread_rng;
use valida_machine::StarkConfigImpl;
use valida_machine::__internal::p3_commit::ExtensionMmcs;
use valida_machine::config::StarkConfigImpl;

#[test]
fn prove_fibonacci() {
Expand Down
2 changes: 1 addition & 1 deletion cpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::batch_multiplicative_inverse_allowing_zero;

pub mod columns;
Expand Down
7 changes: 3 additions & 4 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,15 @@ fn prove_method(chips: &[&Field]) -> TokenStream2 {

quote! {
#[tracing::instrument(name = "prove machine execution", skip_all)]
fn prove<SC: StarkConfig<Val = F>>(&self, config: &SC) -> ::valida_machine::proof::MachineProof<SC>
fn prove<SC: StarkConfig<Val = F>>(&self, config: &SC) -> ::valida_machine::MachineProof<SC>
{
use ::valida_machine::__internal::*;
use ::valida_machine::__internal::p3_air::{BaseAir};
use ::valida_machine::__internal::p3_challenger::{CanObserve, FieldChallenger};
use ::valida_machine::__internal::p3_commit::{Pcs, UnivariatePcs, UnivariatePcsWithLde};
use ::valida_machine::__internal::p3_matrix::{Matrix, dense::RowMajorMatrix};
use ::valida_machine::__internal::p3_util::log2_strict_usize;
use ::valida_machine::generate_permutation_trace;
use ::valida_machine::proof::{MachineProof, ChipProof, Commitments};
use ::valida_machine::{generate_permutation_trace, MachineProof, ChipProof, Commitments};
use alloc::vec;
use alloc::vec::Vec;
use alloc::boxed::Box;
Expand Down Expand Up @@ -357,7 +356,7 @@ fn verify_method(_chips: &[&Field]) -> TokenStream2 {
quote! {
fn verify<SC: StarkConfig<Val = F>>(
config: &SC,
proof: &::valida_machine::proof::MachineProof<SC>,
proof: &::valida_machine::MachineProof<SC>,
) -> core::result::Result<(), ()>
{
Ok(()) // TODO
Expand Down
2 changes: 1 addition & 1 deletion machine/src/check_constraints.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::__internal::DebugConstraintBuilder;
use crate::chip::eval_permutation_constraints;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;

use crate::{Chip, Machine};
use p3_air::TwoRowMatrixView;
Expand Down
2 changes: 1 addition & 1 deletion machine/src/debug_builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{Machine, ValidaAirBuilder};
use p3_air::{AirBuilder, PairBuilder, PermutationAirBuilder, TwoRowMatrixView};
use p3_field::AbstractField;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
/// An `AirBuilder` which asserts that each constraint is zero, allowing any failed constraints to
/// be detected early.
pub struct DebugConstraintBuilder<'a, M: Machine<SC::Val>, SC: StarkConfig> {
Expand Down
2 changes: 1 addition & 1 deletion machine/src/folding_builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{Machine, ValidaAirBuilder};
use p3_air::{AirBuilder, PairBuilder, PermutationAirBuilder, TwoRowMatrixView};
use p3_field::AbstractField;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;

pub struct ProverConstraintFolder<'a, M: Machine<SC::Val>, SC: StarkConfig> {
pub(crate) machine: &'a M,
Expand Down
10 changes: 6 additions & 4 deletions machine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ pub use chip::{BusArgument, Chip, Interaction, InteractionType, ValidaAirBuilder
pub use p3_field::{
AbstractExtensionField, AbstractField, ExtensionField, Field, PrimeField, PrimeField64,
};
// TODO: some are also re-exported, so they shouldn't be pub?

pub mod __internal;
mod advice;
mod check_constraints;
mod chip;
pub mod config;
pub mod core;
mod config;
mod core;
mod debug_builder;
mod folding_builder;
mod machine;
mod program;
pub mod proof;
mod proof;
mod quotient;
mod symbolic;

pub use advice::*;
pub use chip::*;
pub use config::*;
pub use core::*;
pub use machine::*;
pub use program::*;
pub use proof::*;

pub const OPERAND_ELEMENTS: usize = 5;
pub const INSTRUCTION_ELEMENTS: usize = OPERAND_ELEMENTS + 1;
Expand Down
2 changes: 1 addition & 1 deletion memory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use p3_field::{Field, PrimeField};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_bus::MachineWithMemBus;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_machine::{BusArgument, Chip, Interaction, Machine, Word};
use valida_util::batch_multiplicative_inverse_allowing_zero;

Expand Down
2 changes: 1 addition & 1 deletion native_field/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field, PrimeField32};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;

pub mod columns;
pub mod stark;
Expand Down
2 changes: 1 addition & 1 deletion output/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field};
use p3_matrix::dense::RowMajorMatrix;
use p3_maybe_rayon::prelude::*;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;
use valida_util::pad_to_power_of_two;

pub mod columns;
Expand Down
2 changes: 1 addition & 1 deletion program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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::config::StarkConfig;
use valida_machine::StarkConfig;

pub mod columns;
pub mod stark;
Expand Down
2 changes: 1 addition & 1 deletion range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use valida_machine::{Chip, Machine, Word};
use p3_air::VirtualPairCol;
use p3_field::{AbstractField, Field};
use p3_matrix::dense::RowMajorMatrix;
use valida_machine::config::StarkConfig;
use valida_machine::StarkConfig;

pub mod columns;
pub mod stark;
Expand Down
2 changes: 1 addition & 1 deletion verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![no_std]

// use valida_machine::config::Config;
// use valida_machine::Config;
// use valida_machine::Machine;
//
// pub fn verify<C: Config, M: Machine<C>>() -> Result<(), ()> {
Expand Down

0 comments on commit 9018f01

Please sign in to comment.