Skip to content
Open
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
25 changes: 12 additions & 13 deletions cs/src/cs/witness_placer/graph_description/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod field;
mod integer;

use core::hash::Hash;
use std::assert_matches;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::collections::HashMap;
Expand Down Expand Up @@ -774,7 +773,7 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
a @ FieldNodeExpression::OracleValue { .. } => {
let mut subexpr = a.clone();
mapper.add_field_subexprs(&mut subexpr);
assert_matches!(subexpr, FieldNodeExpression::SubExpression(..));
assert!(matches!(subexpr, FieldNodeExpression::SubExpression(..)));
}
_ => {
unreachable!();
Expand All @@ -784,10 +783,10 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
a @ FixedWidthIntegerNodeExpression::U32OracleValue { .. } => {
let mut subexpr = a.clone();
mapper.add_integer_subexprs(&mut subexpr);
assert_matches!(
assert!(matches!(
subexpr,
FixedWidthIntegerNodeExpression::U32SubExpression(..)
);
));
}
_ => {
unreachable!();
Expand All @@ -797,10 +796,10 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
a @ FixedWidthIntegerNodeExpression::U16OracleValue { .. } => {
let mut subexpr = a.clone();
mapper.add_integer_subexprs(&mut subexpr);
assert_matches!(
assert!(matches!(
subexpr,
FixedWidthIntegerNodeExpression::U16SubExpression(..)
);
));
}
_ => {
unreachable!();
Expand All @@ -810,7 +809,7 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
a @ BoolNodeExpression::OracleValue { .. } => {
let mut subexpr = a.clone();
mapper.add_boolean_subexprs(&mut subexpr);
assert_matches!(subexpr, BoolNodeExpression::SubExpression(..));
assert!(matches!(subexpr, BoolNodeExpression::SubExpression(..)));
}
_ => {
unreachable!();
Expand All @@ -829,7 +828,7 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
assert_eq!(input_var, input_var_2);
let mut subexpr = a.clone();
mapper.add_field_subexprs(&mut subexpr);
assert_matches!(subexpr, FieldNodeExpression::SubExpression(..));
assert!(matches!(subexpr, FieldNodeExpression::SubExpression(..)));
}
_ => {
unreachable!();
Expand All @@ -840,7 +839,7 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
assert_eq!(input_var, input_var_2);
let mut subexpr = a.clone();
mapper.add_boolean_subexprs(&mut subexpr);
assert_matches!(subexpr, BoolNodeExpression::SubExpression(..));
assert!(matches!(subexpr, BoolNodeExpression::SubExpression(..)));
}
_ => {
unreachable!();
Expand All @@ -851,10 +850,10 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
assert_eq!(input_var, input_var_2);
let mut subexpr = a.clone();
mapper.add_integer_subexprs(&mut subexpr);
assert_matches!(
assert!(matches!(
subexpr,
FixedWidthIntegerNodeExpression::U8SubExpression(..)
);
));
}
_ => {
unreachable!();
Expand All @@ -865,10 +864,10 @@ impl<F: PrimeField> WitnessGraphCreator<F> {
assert_eq!(input_var, input_var_2);
let mut subexpr = a.clone();
mapper.add_integer_subexprs(&mut subexpr);
assert_matches!(
assert!(matches!(
subexpr,
FixedWidthIntegerNodeExpression::U16SubExpression(..)
);
));
}
_ => {
unreachable!();
Expand Down
1 change: 0 additions & 1 deletion cs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(iter_advance_by)]
#![feature(ptr_as_ref_unchecked)]

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / build_verifier

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / ISA tests for simulator

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / tests

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / build_cli_with_verify

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / build_cli_no_verifiers_512

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / full_recursion_fast

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / full_recursion_fast

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / full_recursion_fast

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / circuits_generated

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / build_cli_no_verifiers

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / risc_v_tests_delegations

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable

Check warning on line 6 in cs/src/lib.rs

View workflow job for this annotation

GitHub Actions / risc_v_tests_delegations

the feature `ptr_as_ref_unchecked` has been stable since 1.95.0-nightly and no longer requires an attribute to enable
#![feature(option_zip)]
#![feature(assert_matches)]
#![feature(allocator_api)]

pub mod definitions;
Expand Down
4 changes: 2 additions & 2 deletions cs/src/machine/ops/unrolled/reduced_machine_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ mod test {
23,
);

serialize_to_file(&compiled, "reduced_machine_preprocessed_layout.json");
serialize_to_file(&compiled, "unified_reduced_preprocessed_layout.json");
}

#[test]
Expand Down Expand Up @@ -636,6 +636,6 @@ mod test {
>(cs)
},
);
serialize_to_file(&ssa_forms, "reduced_machine_preprocessed_ssa.json");
serialize_to_file(&ssa_forms, "unified_reduced_preprocessed_ssa.json");
}
}
2 changes: 1 addition & 1 deletion execution_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gpu_prover = { workspace = true, optional = true }

[dev-dependencies]
bincode = { version = "1.3" }
prover_examples = { path = "../circuit_defs/prover_examples" }
prover_examples = { path = "../circuit_defs/prover_examples", default-features = false }

[features]
security_80 = ["gpu_prover?/security_80"]
Expand Down
9 changes: 9 additions & 0 deletions execution_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ pub const BASE_PROGRAM: &[u8] = include_bytes!("../../examples/hashed_fibonacci/
pub const BASE_PROGRAM_TEXT_SECTION: &[u8] =
include_bytes!("../../examples/hashed_fibonacci/app.text");

pub const RECURSION_UNROLLED_BIN: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unrolled_layer.bin");
pub const RECURSION_UNROLLED_TXT: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unrolled_layer.text");
pub const RECURSION_UNIFIED_BIN: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unified_layer.bin");
pub const RECURSION_UNIFIED_TXT: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unified_layer.text");

pub fn get_padded_binary(binary: &[u8]) -> Vec<u32> {
let mut bytecode = binary
.as_chunks::<4>()
Expand Down
11 changes: 1 addition & 10 deletions execution_utils/src/unrolled_gpu.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::get_padded_binary;
use crate::{get_padded_binary, RECURSION_UNROLLED_BIN, RECURSION_UNROLLED_TXT, RECURSION_UNIFIED_BIN, RECURSION_UNIFIED_TXT};

Check warning on line 1 in execution_utils/src/unrolled_gpu.rs

View workflow job for this annotation

GitHub Actions / cargo fmt

Diff in /home/runner/work/zksync-airbender/zksync-airbender/execution_utils/src/unrolled_gpu.rs
use crate::unrolled::{
compute_setup_for_machine_configuration, flatten_proof_into_responses_for_unrolled_recursion,
UnrolledProgramProof, UnrolledProgramSetup,
};

Check warning on line 5 in execution_utils/src/unrolled_gpu.rs

View workflow job for this annotation

GitHub Actions / cargo fmt

Diff in /home/runner/work/zksync-airbender/zksync-airbender/execution_utils/src/unrolled_gpu.rs
use gpu_prover::{
execution::prover::{ExecutionKind, ExecutionProver, ExecutionProverConfiguration},
machine_type::MachineType,
Expand Down Expand Up @@ -85,15 +85,6 @@
pub prover: ExecutionProver,
}

pub const RECURSION_UNROLLED_BIN: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unrolled_layer.bin");
pub const RECURSION_UNROLLED_TXT: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unrolled_layer.text");
pub const RECURSION_UNIFIED_BIN: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unified_layer.bin");
pub const RECURSION_UNIFIED_TXT: &[u8] =
include_bytes!("../../tools/verifier/recursion_in_unified_layer.text");

impl UnrolledProver {
pub fn new(
path_without_bin: &String,
Expand Down
19 changes: 11 additions & 8 deletions full_statement_verifier/src/unified_circuit_statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@
let pow_challenge_high = verifier_common::DefaultNonDeterminismSource::read_word();
let pow_challenge = (pow_challenge_high as u64) << 32 | (pow_challenge_low as u64);

let expected_challenges = ExternalChallenges::draw_from_transcript_seed(
let expected_challenges = ExternalChallenges::draw_from_transcript_seed_with_state_permutation(
memory_seed,
NUM_DELEGATION_CHALLENGES > 0,
MEMORY_DELEGATION_POW_BITS,
pow_challenge,
);
Expand All @@ -267,12 +266,16 @@
expected_challenges.memory_argument,
proof_output_0.memory_challenges
);
if NUM_DELEGATION_CHALLENGES > 0 {
assert_eq!(
expected_challenges.delegation_argument.unwrap_unchecked(),
proof_output_0.delegation_challenges[0]
);
}
assert_eq!(
expected_challenges.delegation_argument.unwrap_unchecked(),
proof_output_0.delegation_challenges[0]
);
assert_eq!(
expected_challenges
.machine_state_permutation_argument
.unwrap_unchecked(),
proof_output_0.machine_state_permutation_challenges[0]
);

// conclude that our memory argument is valid
let register_contribution =
Expand Down Expand Up @@ -427,7 +430,7 @@
verify_unified_circuit_recursion_layer()
}
_ => {
panic!("Uknown op");

Check warning on line 433 in full_statement_verifier/src/unified_circuit_statement.rs

View workflow job for this annotation

GitHub Actions / typos

"Uknown" should be "Unknown".
}
}
}
1 change: 0 additions & 1 deletion gpu_prover/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(incomplete_features)]
#![feature(allocator_api)]
#![feature(assert_matches)]
#![feature(btree_cursors)]
#![feature(extend_one_unchecked)]
#![feature(generic_const_exprs)]
Expand Down
5 changes: 2 additions & 3 deletions gpu_prover/src/prover/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use era_cudart::result::CudaResult;
use era_cudart::slice::DeviceSlice;
use fft::GoodAllocator;
use prover::merkle_trees::MerkleTreeCapVarLength;
use std::assert_matches;

pub struct MemoryCommitmentJob<'a> {
is_finished_event: CudaEvent,
Expand Down Expand Up @@ -79,11 +78,11 @@ pub(crate) fn commit_memory<'a, A: GoodAllocator>(
let mut callbacks = Callbacks::new();
let inits_and_teardowns =
if let Some(inits_and_teardowns_transfer) = inits_and_teardowns_transfer {
assert_matches!(
assert!(matches!(
circuit_type,
CircuitType::Unrolled(UnrolledCircuitType::InitsAndTeardowns)
| CircuitType::Unrolled(UnrolledCircuitType::Unified)
);
));
let InitsAndTeardownsTransfer {
data_host: _,
data_device,
Expand Down
5 changes: 2 additions & 3 deletions gpu_prover/src/prover/stage_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use era_cudart::result::CudaResult;
use era_cudart::slice::DeviceSlice;
use fft::GoodAllocator;
use itertools::Itertools;
use std::assert_matches;
use std::cmp::{max, min};
use std::sync::Arc;

Expand Down Expand Up @@ -112,11 +111,11 @@ impl StageOneOutput {
let log_domain_size = trace_len.trailing_zeros();
let inits_and_teardowns =
if let Some(inits_and_teardowns_transfer) = inits_and_teardowns_transfer {
assert_matches!(
assert!(matches!(
circuit_type,
CircuitType::Unrolled(UnrolledCircuitType::InitsAndTeardowns)
| CircuitType::Unrolled(UnrolledCircuitType::Unified)
);
));
let InitsAndTeardownsTransfer {
data_host: _,
data_device,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ impl LeafInclusionVerifier for Blake2sForEverythingVerifier {
equal &= output_hash[i] == cap[i];
}

panic!("Testing purposes only");

equal
} else {
// every step we:
Expand Down
53 changes: 0 additions & 53 deletions prover/src/prover_stages/pow_config_worst_constants.rs

This file was deleted.

Loading
Loading