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

Public Instance Data #172

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
182 changes: 95 additions & 87 deletions Cargo.lock

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ members = [
]

[workspace.dependencies]
p3-air = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-baby-bear = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-commit = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-challenger = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-dft = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-field = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-fri = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-goldilocks = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-keccak = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-matrix = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-maybe-rayon = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-mds = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-merkle-tree = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-poseidon = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-symmetric = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-uni-stark = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-util = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "valida-main" }
p3-air = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-baby-bear = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-commit = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-challenger = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-dft = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-field = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-fri = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-goldilocks = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-interpolation = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-keccak = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-matrix = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-maybe-rayon = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-mds = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-merkle-tree = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-poseidon = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-symmetric = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-uni-stark = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
p3-util = { git = "https://github.com/valida-xyz/Plonky3.git", branch = "dorebell-public" }
6 changes: 5 additions & 1 deletion alu_u32/src/add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use columns::{Add32Cols, ADD_COL_MAP, NUM_ADD_COLS};
use core::mem::transmute;
use valida_bus::{MachineWithGeneralBus, MachineWithRangeBus8};
use valida_cpu::MachineWithCpuChip;
use valida_machine::{instructions, Chip, Instruction, Interaction, Operands, Word};
use valida_machine::{
instructions, Chip, Instruction, Interaction, Operands, ValidaPublicValues, Word,
};
use valida_opcodes::ADD32;
use valida_range::MachineWithRangeChip;

Expand Down Expand Up @@ -35,6 +37,8 @@ where
M: MachineWithGeneralBus<SC::Val> + MachineWithRangeBus8<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
6 changes: 5 additions & 1 deletion alu_u32/src/bitwise/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use columns::{Bitwise32Cols, COL_MAP, NUM_BITWISE_COLS};
use core::mem::transmute;
use valida_bus::MachineWithGeneralBus;
use valida_cpu::MachineWithCpuChip;
use valida_machine::{instructions, Chip, Instruction, Interaction, Operands, Word};
use valida_machine::{
instructions, Chip, Instruction, Interaction, Operands, ValidaPublicValues, Word,
};
use valida_opcodes::{AND32, OR32, XOR32};

use p3_air::VirtualPairCol;
Expand Down Expand Up @@ -36,6 +38,8 @@ where
M: MachineWithGeneralBus<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
5 changes: 4 additions & 1 deletion alu_u32/src/com/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use valida_bus::MachineWithGeneralBus;
use valida_cpu::MachineWithCpuChip;
use valida_machine::StarkConfig;
use valida_machine::{
instructions, Chip, Instruction, Interaction, Operands, Word, MEMORY_CELL_BYTES,
instructions, Chip, Instruction, Interaction, Operands, ValidaPublicValues, Word,
MEMORY_CELL_BYTES,
};
use valida_opcodes::{EQ32, NE32};

Expand Down Expand Up @@ -38,6 +39,8 @@ where
M: MachineWithGeneralBus<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
3 changes: 3 additions & 0 deletions alu_u32/src/div/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use valida_bus::MachineWithGeneralBus;
use valida_cpu::MachineWithCpuChip;
use valida_machine::SDiv;
use valida_machine::StarkConfig;
use valida_machine::ValidaPublicValues;
use valida_machine::{instructions, Chip, Instruction, Interaction, Operands, Word};
use valida_opcodes::{DIV32, SDIV32};
use valida_range::MachineWithRangeChip;
Expand Down Expand Up @@ -37,6 +38,8 @@ where
M: MachineWithGeneralBus<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
5 changes: 4 additions & 1 deletion alu_u32/src/lt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use core::mem::transmute;
use valida_bus::MachineWithGeneralBus;
use valida_cpu::MachineWithCpuChip;
use valida_machine::{
instructions, Chip, Instruction, Interaction, Operands, Word, MEMORY_CELL_BYTES,
instructions, Chip, Instruction, Interaction, Operands, ValidaPublicValues, Word,
MEMORY_CELL_BYTES,
};
use valida_opcodes::{LT32, LTE32, SLE32, SLT32};

Expand Down Expand Up @@ -40,6 +41,8 @@ where
M: MachineWithGeneralBus<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
6 changes: 5 additions & 1 deletion alu_u32/src/mul/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use alloc::vec::Vec;
use columns::{Mul32Cols, MUL_COL_MAP, NUM_MUL_COLS};
use valida_bus::MachineWithGeneralBus;
use valida_cpu::MachineWithCpuChip;
use valida_machine::{instructions, Chip, Instruction, Interaction, Mulhs, Mulhu, Operands, Word};
use valida_machine::{
instructions, Chip, Instruction, Interaction, Mulhs, Mulhu, Operands, ValidaPublicValues, Word,
};
use valida_opcodes::{MUL32, MULHS32, MULHU32};
use valida_range::MachineWithRangeChip;

Expand Down Expand Up @@ -35,6 +37,8 @@ where
M: MachineWithGeneralBus<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
const MIN_LENGTH: usize = 1 << 10; // for the range check counter

Expand Down
6 changes: 5 additions & 1 deletion alu_u32/src/shift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use columns::{Shift32Cols, COL_MAP, NUM_SHIFT_COLS};
use core::mem::transmute;
use valida_bus::{MachineWithGeneralBus, MachineWithRangeBus8};
use valida_cpu::MachineWithCpuChip;
use valida_machine::{instructions, Chip, Instruction, Interaction, Operands, Sra, Word};
use valida_machine::{
instructions, Chip, Instruction, Interaction, Operands, Sra, ValidaPublicValues, Word,
};
use valida_opcodes::{DIV32, MUL32, SDIV32, SHL32, SHR32, SRA32};

use p3_air::VirtualPairCol;
Expand Down Expand Up @@ -38,6 +40,8 @@ where
M: MachineWithGeneralBus<SC::Val> + MachineWithRangeBus8<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
6 changes: 5 additions & 1 deletion alu_u32/src/sub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use columns::{Sub32Cols, NUM_SUB_COLS, SUB_COL_MAP};
use core::mem::transmute;
use valida_bus::{MachineWithGeneralBus, MachineWithRangeBus8};
use valida_cpu::MachineWithCpuChip;
use valida_machine::{instructions, Chip, Instruction, Interaction, Operands, Word};
use valida_machine::{
instructions, Chip, Instruction, Interaction, Operands, ValidaPublicValues, Word,
};
use valida_opcodes::SUB32;
use valida_range::MachineWithRangeChip;

Expand Down Expand Up @@ -35,6 +37,8 @@ where
M: MachineWithGeneralBus<SC::Val> + MachineWithRangeBus8<SC::Val>,
SC: StarkConfig,
{
type Public = ValidaPublicValues<SC::Val>;

fn generate_trace(&self, _machine: &M) -> RowMajorMatrix<SC::Val> {
let rows = self
.operations
Expand Down
Loading
Loading