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
26 changes: 22 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1

isa_tests:
name: ISA tests
simulator_isa_tests:
name: ISA tests for simulator
runs-on: [matterlabs-ci-runner-highmem]
steps:
- uses: actions/checkout@v3
Expand All @@ -52,12 +52,30 @@ jobs:
run: |
rustup set profile minimal
- name: tests
working-directory: ./circuit_defs/opcode_tests
run: cargo test --profile test-release --lib --package opcode_tests
working-directory: ./risc_v_simulator
run: cargo test --release --features=delegation
# run: cargo test --release
# - name: tests
# run: cargo test --profile cli -- --nocapture

# isa_tests:
# name: ISA tests
# runs-on: [matterlabs-ci-runner-highmem]
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# rustflags: ""
# - name: Setup
# run: |
# rustup set profile minimal
# - name: tests
# working-directory: ./circuit_defs/opcode_tests
# run: cargo test --profile test-release --lib --package opcode_tests
# # run: cargo test --release
# # - name: tests
# # run: cargo test --profile cli -- --nocapture

full_recursion_fast:
# full recursion using a pre-compiled binaries.
name: full_recursion_fast
Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ members = [
"circuit_defs/trace_and_split",
"circuit_defs/setups",
"circuit_defs/prover_examples",
"circuit_defs/opcode_tests",
# "circuit_defs/opcode_tests",
"circuit_defs/prover_examples",
"circuit_defs/reduced_risc_v_machine",
"circuit_defs/final_reduced_risc_v_machine",
Expand Down Expand Up @@ -56,7 +56,7 @@ default-members = [
"circuit_defs/bigint_with_control",
"circuit_defs/blake2_with_compression",
"circuit_defs/circuit_common",
"circuit_defs/opcode_tests",
# "circuit_defs/opcode_tests",
"circuit_defs/prover_examples",
"circuit_defs/reduced_risc_v_machine",
"circuit_defs/final_reduced_risc_v_machine",
Expand Down Expand Up @@ -137,7 +137,7 @@ itertools = { version = "0.13" }
opt-level = 3
lto = "fat"
codegen-units = 1
debug = true
debug = false


# Special profile for compiling the cli tool.
Expand All @@ -146,6 +146,7 @@ debug = true
[profile.cli]
inherits = "dev"
opt-level = 3
debug = false # exponential in LLVM
incremental = false

[profile.cli.package.verifier]
Expand Down
10 changes: 3 additions & 7 deletions blake2s_u32/src/state_with_extended_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const COMPRESSION_MODE_LAST_ROUND_EXTRA_BITS: u32 = 0b001;
const COMPRESSION_MODE_IS_RIGHT_EXTRA_BITS: u32 = 0b010;

#[derive(Clone, Copy, Debug)]
#[repr(C)]
#[repr(C, align(128))]
pub struct Blake2RoundFunctionEvaluator {
pub state: [u32; BLAKE2S_STATE_WIDTH_IN_U32_WORDS], // represents current state
extended_state: [u32; BLAKE2S_EXTENDED_STATE_WIDTH_IN_U32_WORDS], // represents scratch space for evaluation
Expand Down Expand Up @@ -76,13 +76,9 @@ impl Blake2RoundFunctionEvaluator {
#[allow(invalid_value)]
pub fn new() -> Self {
unsafe {
// NOTE: it would only be used in RISC-V simulated machine with zero-by-default state,
// where all memory is initialized and physical, so "touching" memory slots is not required
let mut new: Self = MaybeUninit::uninit().assume_init();
// NOTE: for the convergence of the delegation argument in the circuit
// we have to "touch" all RAM slots before executing any delegation.
crate::spec_memzero_u32(
new.state.as_mut_ptr().cast::<u32>(),
new.input_buffer.as_mut_ptr_range().end.cast::<u32>(),
);
new.t = 0;

// we will copy-over the initial state to avoid complications
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cargo test full_machine_with_delegation_get_witness_graph
# Delegations
cargo test compile_blake2_with_extended_control
cargo test blake_delegation_get_witness_graph
cargo test test_compile_u256_ops_extended_control
cargo test compile_u256_ops_extended_control
cargo test bigint_delegation_get_witness_graph

cd ../witness_eval_generator
Expand Down
3,482 changes: 1,613 additions & 1,869 deletions circuit_defs/bigint_with_control/generated/circuit_layout.rs

Large diffs are not rendered by default.

Loading
Loading