Skip to content

Commit f5f04b0

Browse files
committed
Propagate changes
1 parent e7e6e28 commit f5f04b0

File tree

156 files changed

+307643
-332621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+307643
-332621
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
- name: Rustfmt Check
4141
uses: actions-rust-lang/rustfmt@v1
4242

43-
isa_tests:
44-
name: ISA tests
43+
simulator_isa_tests:
44+
name: ISA tests for simulator
4545
runs-on: [matterlabs-ci-runner-highmem]
4646
steps:
4747
- uses: actions/checkout@v3
@@ -52,12 +52,30 @@ jobs:
5252
run: |
5353
rustup set profile minimal
5454
- name: tests
55-
working-directory: ./circuit_defs/opcode_tests
56-
run: cargo test --profile test-release --lib --package opcode_tests
55+
working-directory: ./risc_v_simulator
56+
run: cargo test --release --features=delegation
5757
# run: cargo test --release
5858
# - name: tests
5959
# run: cargo test --profile cli -- --nocapture
6060

61+
# isa_tests:
62+
# name: ISA tests
63+
# runs-on: [matterlabs-ci-runner-highmem]
64+
# steps:
65+
# - uses: actions/checkout@v3
66+
# - uses: actions-rust-lang/setup-rust-toolchain@v1
67+
# with:
68+
# rustflags: ""
69+
# - name: Setup
70+
# run: |
71+
# rustup set profile minimal
72+
# - name: tests
73+
# working-directory: ./circuit_defs/opcode_tests
74+
# run: cargo test --profile test-release --lib --package opcode_tests
75+
# # run: cargo test --release
76+
# # - name: tests
77+
# # run: cargo test --profile cli -- --nocapture
78+
6179
full_recursion_fast:
6280
# full recursion using a pre-compiled binaries.
6381
name: full_recursion_fast

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ members = [
1616
"circuit_defs/trace_and_split",
1717
"circuit_defs/setups",
1818
"circuit_defs/prover_examples",
19-
"circuit_defs/opcode_tests",
19+
# "circuit_defs/opcode_tests",
2020
"circuit_defs/prover_examples",
2121
"circuit_defs/reduced_risc_v_machine",
2222
"circuit_defs/final_reduced_risc_v_machine",
@@ -56,7 +56,7 @@ default-members = [
5656
"circuit_defs/bigint_with_control",
5757
"circuit_defs/blake2_with_compression",
5858
"circuit_defs/circuit_common",
59-
"circuit_defs/opcode_tests",
59+
# "circuit_defs/opcode_tests",
6060
"circuit_defs/prover_examples",
6161
"circuit_defs/reduced_risc_v_machine",
6262
"circuit_defs/final_reduced_risc_v_machine",
@@ -137,7 +137,7 @@ itertools = { version = "0.13" }
137137
opt-level = 3
138138
lto = "fat"
139139
codegen-units = 1
140-
debug = true
140+
debug = false
141141

142142

143143
# Special profile for compiling the cli tool.
@@ -146,6 +146,7 @@ debug = true
146146
[profile.cli]
147147
inherits = "dev"
148148
opt-level = 3
149+
debug = false # exponential in LLVM
149150
incremental = false
150151

151152
[profile.cli.package.verifier]

blake2s_u32/src/state_with_extended_control.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const COMPRESSION_MODE_LAST_ROUND_EXTRA_BITS: u32 = 0b001;
4848
const COMPRESSION_MODE_IS_RIGHT_EXTRA_BITS: u32 = 0b010;
4949

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

8884
// we will copy-over the initial state to avoid complications

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cargo test full_machine_with_delegation_get_witness_graph
1212
# Delegations
1313
cargo test compile_blake2_with_extended_control
1414
cargo test blake_delegation_get_witness_graph
15-
cargo test test_compile_u256_ops_extended_control
15+
cargo test compile_u256_ops_extended_control
1616
cargo test bigint_delegation_get_witness_graph
1717

1818
cd ../witness_eval_generator

circuit_defs/bigint_with_control/generated/circuit_layout.rs

Lines changed: 316 additions & 572 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)