Skip to content
Merged
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
10,178 changes: 2,970 additions & 7,208 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ members = [
"crates/toolchain/macros",
"crates/toolchain/platform",
"crates/toolchain/tests",
"crates/continuations",
# "crates/continuations",
"crates/continuations-v2",
"crates/recursion",
"crates/verify-stark",
Expand Down Expand Up @@ -68,7 +68,7 @@ members = [
"guest-libs/pairing/",
"guest-libs/ruint/",
"guest-libs/sha2/",
"guest-libs/verify_stark/",
# "guest-libs/verify_stark/",
"scripts",
]
exclude = ["crates/sdk/example", "benchmarks/guest/**"]
Expand Down
1 change: 1 addition & 0 deletions crates/sdk-v2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jemalloc = ["openvm-circuit/jemalloc", "openvm-sdk-config/jemalloc"]
jemalloc-prof = ["openvm-circuit/jemalloc-prof"]

cuda = [
"dep:openvm-cuda-backend",
"openvm-circuit/cuda",
"openvm-sdk-config/cuda",
"continuations-v2/cuda",
Expand Down
1 change: 0 additions & 1 deletion crates/vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ test-case.workspace = true
openvm-stark-backend = { workspace = true, features = ["test-utils"] }
openvm-stark-sdk.workspace = true
openvm-circuit = { workspace = true, features = ["test-utils"] }
openvm-native-compiler.workspace = true
openvm-rv32im-transpiler.workspace = true

[features]
Expand Down
14 changes: 6 additions & 8 deletions crates/vm/src/system/cuda/program.rs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized these tests could just use opcode enums without any meaning besides a placeholder number. will do that in a follow-up when I cleanup more to remove the dependency

Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ mod tests {
LocalOpcode,
SystemOpcode::*,
};
use openvm_native_compiler::{
FieldArithmeticOpcode::*, NativeBranchEqualOpcode, NativeJalOpcode::*,
NativeLoadStoreOpcode::*,
use openvm_rv32im_transpiler::{
BaseAluOpcode::*, BranchEqualOpcode::*, Rv32JalLuiOpcode::*, Rv32LoadStoreOpcode::*,
};
use openvm_rv32im_transpiler::BranchEqualOpcode::*;
use openvm_stark_backend::StarkEngine;

use super::ProgramChipGPU;
Expand Down Expand Up @@ -166,7 +164,7 @@ mod tests {
Instruction::large_from_isize(STOREW.global_opcode(), 2, 0, 0, 0, 1, 0, 1),
Instruction::large_from_isize(STOREW.global_opcode(), 1, 1, 0, 0, 1, 0, 1),
Instruction::from_isize(
NativeBranchEqualOpcode(BEQ).global_opcode(),
BEQ.global_opcode(),
0,
0,
3 * DEFAULT_PC_STEP as isize,
Expand All @@ -193,7 +191,7 @@ mod tests {
let instructions = vec![
Instruction::large_from_isize(STOREW.global_opcode(), 5, 0, 0, 0, 1, 0, 1),
Instruction::from_isize(
NativeBranchEqualOpcode(BNE).global_opcode(),
BNE.global_opcode(),
0,
4,
3 * DEFAULT_PC_STEP as isize,
Expand All @@ -210,7 +208,7 @@ mod tests {
),
Instruction::from_isize(TERMINATE.global_opcode(), 0, 0, 0, 0, 0),
Instruction::from_isize(
NativeBranchEqualOpcode(BEQ).global_opcode(),
BEQ.global_opcode(),
0,
5,
-(DEFAULT_PC_STEP as isize),
Expand Down Expand Up @@ -246,7 +244,7 @@ mod tests {
1,
)),
Some(Instruction::from_isize(
NativeBranchEqualOpcode(BEQ).global_opcode(),
BEQ.global_opcode(),
0,
2,
3 * DEFAULT_PC_STEP as isize,
Expand Down
13 changes: 6 additions & 7 deletions crates/vm/src/system/program/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ use openvm_instructions::{
program::{Program, DEFAULT_PC_STEP},
LocalOpcode,
};
use openvm_native_compiler::{
FieldArithmeticOpcode::*, NativeBranchEqualOpcode, NativeJalOpcode::*, NativeLoadStoreOpcode::*,
use openvm_rv32im_transpiler::{
BaseAluOpcode::*, BranchEqualOpcode::*, Rv32JalLuiOpcode::*, Rv32LoadStoreOpcode::*,
};
use openvm_rv32im_transpiler::BranchEqualOpcode::*;
use openvm_stark_backend::{
any_air_arc_vec,
p3_field::PrimeCharacteristicRing,
Expand Down Expand Up @@ -112,7 +111,7 @@ fn test_program_1() {
Instruction::large_from_isize(STOREW.global_opcode(), 1, 1, 0, 0, 1, 0, 1),
// if word[0]_1 == 0 then pc += 3*DEFAULT_PC_STEP
Instruction::from_isize(
NativeBranchEqualOpcode(BEQ).global_opcode(),
BEQ.global_opcode(),
0,
0,
3 * DEFAULT_PC_STEP as isize,
Expand Down Expand Up @@ -147,7 +146,7 @@ fn test_program_without_field_arithmetic() {
Instruction::large_from_isize(STOREW.global_opcode(), 5, 0, 0, 0, 1, 0, 1),
// if word[0]_1 != 4 then pc += 3*DEFAULT_PC_STEP
Instruction::from_isize(
NativeBranchEqualOpcode(BNE).global_opcode(),
BNE.global_opcode(),
0,
4,
3 * DEFAULT_PC_STEP as isize,
Expand All @@ -167,7 +166,7 @@ fn test_program_without_field_arithmetic() {
Instruction::from_isize(TERMINATE.global_opcode(), 0, 0, 0, 0, 0),
// if word[0]_1 == 5 then pc -= DEFAULT_PC_STEP
Instruction::from_isize(
NativeBranchEqualOpcode(BEQ).global_opcode(),
BEQ.global_opcode(),
0,
5,
-(DEFAULT_PC_STEP as isize),
Expand Down Expand Up @@ -265,7 +264,7 @@ fn test_program_with_undefined_instructions() {
)),
// if word[0]_1 == n then pc += 3*DEFAULT_PC_STEP
Some(Instruction::from_isize(
NativeBranchEqualOpcode(BEQ).global_opcode(),
BEQ.global_opcode(),
0,
n,
3 * DEFAULT_PC_STEP as isize,
Expand Down
7 changes: 4 additions & 3 deletions extensions/ecc/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ openvm-ecc-transpiler.workspace = true
openvm-ecc-circuit.workspace = true
openvm-rv32im-transpiler.workspace = true
openvm-toolchain-tests = { path = "../../../crates/toolchain/tests" }
openvm-sdk.workspace = true
sdk-v2.workspace = true
openvm-sdk-config.workspace = true
serde.workspace = true
serde_with.workspace = true
toml.workspace = true
Expand All @@ -29,6 +30,6 @@ halo2curves-axiom = { workspace = true }
default = ["parallel"]
parallel = ["openvm-circuit/parallel"]
tco = ["openvm-ecc-circuit/tco"]
aot = ["openvm-ecc-circuit/aot", "openvm-sdk/aot"]
cuda = ["openvm-ecc-circuit/cuda", "openvm-sdk/cuda"]
aot = ["openvm-ecc-circuit/aot", "sdk-v2/aot"]
cuda = ["openvm-ecc-circuit/cuda", "sdk-v2/cuda"]
touchemall = ["cuda", "openvm-ecc-circuit/touchemall"]
21 changes: 7 additions & 14 deletions extensions/ecc/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ mod tests {
use openvm_rv32im_transpiler::{
Rv32ITranspilerExtension, Rv32IoTranspilerExtension, Rv32MTranspilerExtension,
};
use openvm_sdk::{
config::{AppConfig, SdkVmBuilder, SdkVmConfig, TranspilerConfig},
StdIn,
};
use openvm_sdk_config::{SdkVmBuilder, SdkVmConfig, TranspilerConfig};
use sdk_v2::StdIn;
use openvm_stark_backend::p3_field::PrimeCharacteristicRing;
use openvm_stark_sdk::{openvm_stark_backend, p3_baby_bear::BabyBear};
use openvm_toolchain_tests::{
Expand Down Expand Up @@ -179,10 +177,9 @@ mod tests {

#[test]
fn test_ecdsa() -> Result<()> {
let config = toml::from_str::<AppConfig<SdkVmConfig>>(include_str!(
let config = SdkVmConfig::from_toml(include_str!(
"../programs/openvm_k256_keccak.toml"
))?
.app_vm_config;
))?;
let elf = build_example_program_at_path_with_features(
get_programs_dir!(),
"ecdsa",
Expand All @@ -196,9 +193,7 @@ mod tests {

#[test]
fn test_p256_ecdsa_recover() -> Result<()> {
let config =
toml::from_str::<AppConfig<SdkVmConfig>>(include_str!("../programs/openvm_p256.toml"))?
.app_vm_config;
let config = SdkVmConfig::from_toml(include_str!("../programs/openvm_p256.toml"))?;
let elf = build_example_program_at_path_with_features(
get_programs_dir!(),
"ecdsa_recover_p256",
Expand All @@ -215,8 +210,7 @@ mod tests {
#[test]
fn test_k256_ecdsa_recover() -> Result<()> {
let config =
toml::from_str::<AppConfig<SdkVmConfig>>(include_str!("../programs/openvm_k256.toml"))?
.app_vm_config;
SdkVmConfig::from_toml(include_str!("../programs/openvm_k256.toml"))?;
let elf = build_example_program_at_path_with_features(
get_programs_dir!(),
"ecdsa_recover_k256",
Expand All @@ -233,8 +227,7 @@ mod tests {
#[test]
fn test_k256_vk_from_sec1_bytes() -> Result<()> {
let config =
toml::from_str::<AppConfig<SdkVmConfig>>(include_str!("../programs/openvm_k256.toml"))?
.app_vm_config;
SdkVmConfig::from_toml(include_str!("../programs/openvm_k256.toml"))?;
let elf = build_example_program_at_path_with_features(
get_programs_dir!(),
"sec1_decode",
Expand Down
8 changes: 4 additions & 4 deletions guest-libs/pairing/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mod bn254 {
Rv32ITranspilerExtension, Rv32IoTranspilerExtension, Rv32MTranspilerExtension,
};
use openvm_stark_sdk::{
config::FriParameters, openvm_stark_backend::p3_field::PrimeCharacteristicRing,
openvm_stark_backend::{p3_field::PrimeCharacteristicRing, SystemParams},
p3_baby_bear::BabyBear,
};
use openvm_toolchain_tests::{build_example_program_at_path_with_features, get_programs_dir};
Expand Down Expand Up @@ -399,7 +399,7 @@ mod bn254 {
let io_all = io0.into_iter().chain(io1).collect::<Vec<_>>();
// Don't run debugger because it's slow
air_test_impl::<Engine, _>(
FriParameters::new_for_testing(1),
SystemParams::new_for_testing(22),
Rv32PairingBuilder,
get_testing_config(),
openvm_exe,
Expand Down Expand Up @@ -507,7 +507,7 @@ mod bls12_381 {
Rv32ITranspilerExtension, Rv32IoTranspilerExtension, Rv32MTranspilerExtension,
};
use openvm_stark_sdk::{
config::FriParameters, openvm_stark_backend::p3_field::PrimeCharacteristicRing,
openvm_stark_backend::{p3_field::PrimeCharacteristicRing, SystemParams},
p3_baby_bear::BabyBear,
};
use openvm_toolchain_tests::{build_example_program_at_path_with_features, get_programs_dir};
Expand Down Expand Up @@ -881,7 +881,7 @@ mod bls12_381 {
let io_all = io0.into_iter().chain(io1).collect::<Vec<_>>();
// Don't run debugger because it's slow
air_test_impl::<Engine, _>(
FriParameters::new_for_testing(1),
SystemParams::new_for_testing(22),
Rv32PairingBuilder,
get_testing_config(),
openvm_exe,
Expand Down
7 changes: 5 additions & 2 deletions guest-libs/ruint/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ mod tests {
use eyre::Result;
use openvm_bigint_circuit::{Int256Rv32Builder, Int256Rv32Config};
use openvm_bigint_transpiler::Int256TranspilerExtension;
use openvm_circuit::{arch::Streams, utils::air_test_impl};
use openvm_circuit::{
arch::Streams,
utils::{air_test_impl, TestStarkEngine},
};
use openvm_instructions::exe::VmExe;
use openvm_rv32im_transpiler::{
Rv32ITranspilerExtension, Rv32IoTranspilerExtension, Rv32MTranspilerExtension,
Expand Down Expand Up @@ -31,7 +34,7 @@ mod tests {
.with_extension(Int256TranspilerExtension),
)?;
let params = SystemParams::new_for_testing(22);
air_test_impl(
air_test_impl::<TestStarkEngine, _>(
params,
Int256Rv32Builder,
config,
Expand Down
Loading