Skip to content

Commit ee37d43

Browse files
committed
fix(bench): force concurrent trace build for synthetic kernel
1 parent c988a09 commit ee37d43

9 files changed

Lines changed: 31 additions & 20 deletions

File tree

benches/synthetic-tx-kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license.workspace = true
77
[dependencies]
88
miden-vm = { path = "../../miden-vm" }
99
miden-core = { path = "../../core" }
10-
miden-processor = { path = "../../processor" }
10+
miden-processor = { path = "../../processor", default-features = false, features = ["concurrent"] }
1111
miden-core-lib = { path = "../../crates/lib/core" }
1212
serde = { version = "1.0", features = ["derive"] }
1313
serde_json = "1.0"

benches/synthetic-tx-kernel/benches/component_benchmarks.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion};
44
use miden_core::{Felt, Word};
55
use miden_core_lib::{dsa::falcon512_poseidon2, CoreLibrary};
6-
use miden_processor::{advice::AdviceInputs, fast::FastProcessor};
6+
use miden_processor::{advice::AdviceInputs, fast::FastProcessor, ExecutionOptions};
77
use miden_vm::{Assembler, DefaultHost, StackInputs};
88

99
/// Helper function to execute a benchmark with the given program
@@ -22,8 +22,11 @@ fn bench_program(
2222
host.load_library(&CoreLibrary::default())
2323
.expect("Failed to load core library");
2424
}
25-
let processor =
26-
FastProcessor::new_with_advice_inputs(stack_inputs, advice_inputs.clone());
25+
let processor = FastProcessor::new_with_options(
26+
stack_inputs,
27+
advice_inputs.clone(),
28+
ExecutionOptions::default(),
29+
);
2730
(host, processor)
2831
},
2932
|(mut host, processor)| async move {

benches/synthetic-tx-kernel/benches/synthetic_kernel.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use std::time::Duration;
1212

1313
use criterion::{black_box, criterion_group, criterion_main, Criterion, SamplingMode};
1414
use miden_core_lib::CoreLibrary;
15-
use miden_processor::{fast::FastProcessor, parallel::build_trace, ExecutionOptions};
15+
use miden_processor::parallel::build_trace;
16+
use miden_processor::{fast::FastProcessor, ExecutionOptions};
1617
use miden_vm::{prove_sync, Assembler, DefaultHost, ProvingOptions, StackInputs};
1718
use synthetic_tx_kernel::{generator::MasmGenerator, load_profile};
1819

@@ -111,9 +112,10 @@ fn synthetic_transaction_kernel(c: &mut Criterion) {
111112
let mut test_host = DefaultHost::default()
112113
.with_library(&core_lib)
113114
.expect("Failed to initialize test host");
114-
let test_processor = FastProcessor::new_with_advice_inputs(
115+
let test_processor = FastProcessor::new_with_options(
115116
StackInputs::default(),
116117
miden_processor::advice::AdviceInputs::default(),
118+
ExecutionOptions::default(),
117119
);
118120
let test_result = tokio::runtime::Runtime::new()
119121
.expect("Failed to create runtime for smoke test")
@@ -135,9 +137,10 @@ fn synthetic_transaction_kernel(c: &mut Criterion) {
135137
let host = DefaultHost::default()
136138
.with_library(&core_lib)
137139
.expect("Failed to initialize host with core library");
138-
let processor = FastProcessor::new_with_advice_inputs(
140+
let processor = FastProcessor::new_with_options(
139141
StackInputs::default(),
140142
miden_processor::advice::AdviceInputs::default(),
143+
ExecutionOptions::default(),
141144
);
142145
(host, program.clone(), processor)
143146
},

benches/synthetic-tx-kernel/src/generator.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ mod tests {
440440
use std::collections::BTreeMap;
441441

442442
use miden_core_lib::CoreLibrary;
443-
use miden_processor::{advice::AdviceInputs, fast::FastProcessor};
443+
use miden_processor::{advice::AdviceInputs, fast::FastProcessor, ExecutionOptions};
444444
use miden_vm::{Assembler, DefaultHost, StackInputs};
445445

446446
use super::*;
@@ -528,9 +528,10 @@ mod tests {
528528
.expect("failed to assemble benchmark");
529529

530530
let mut host = DefaultHost::default();
531-
let processor = FastProcessor::new_with_advice_inputs(
531+
let processor = FastProcessor::new_with_options(
532532
StackInputs::default(),
533533
AdviceInputs::default(),
534+
ExecutionOptions::default(),
534535
);
535536
let runtime = tokio::runtime::Runtime::new().expect("failed to create runtime");
536537

@@ -559,7 +560,11 @@ mod tests {
559560

560561
let mut host = DefaultHost::default();
561562
host.load_library(&CoreLibrary::default()).expect("failed to load core library");
562-
let processor = FastProcessor::new_with_advice_inputs(stack_inputs, advice_inputs);
563+
let processor = FastProcessor::new_with_options(
564+
stack_inputs,
565+
advice_inputs,
566+
ExecutionOptions::default(),
567+
);
563568
let runtime = tokio::runtime::Runtime::new().expect("failed to create runtime");
564569

565570
runtime

core/src/mast/node/call_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use miden_formatting::{
99
use serde::{Deserialize, Serialize};
1010

1111
use super::{MastForestContributor, MastNodeExt};
12+
#[cfg(debug_assertions)]
13+
use crate::mast::MastNode;
1214
use crate::{
1315
Felt, Word,
1416
chiplets::hasher,
@@ -18,8 +20,6 @@ use crate::{
1820
operations::{OPCODE_CALL, OPCODE_SYSCALL},
1921
utils::{Idx, LookupByIdx},
2022
};
21-
#[cfg(debug_assertions)]
22-
use crate::mast::MastNode;
2323

2424
// CALL NODE
2525
// ================================================================================================

core/src/mast/node/dyn_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use core::fmt;
55
use serde::{Deserialize, Serialize};
66

77
use super::{MastForestContributor, MastNodeExt};
8+
#[cfg(debug_assertions)]
9+
use crate::mast::MastNode;
810
use crate::{
911
Felt, Word,
1012
mast::{
@@ -14,8 +16,6 @@ use crate::{
1416
prettier::{Document, PrettyPrint, const_text, nl},
1517
utils::LookupByIdx,
1618
};
17-
#[cfg(debug_assertions)]
18-
use crate::mast::MastNode;
1919

2020
// DYN NODE
2121
// ================================================================================================

core/src/mast/node/join_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use core::fmt;
55
use serde::{Deserialize, Serialize};
66

77
use super::{MastForestContributor, MastNodeExt};
8+
#[cfg(debug_assertions)]
9+
use crate::mast::MastNode;
810
use crate::{
911
Felt, Word,
1012
chiplets::hasher,
@@ -15,8 +17,6 @@ use crate::{
1517
prettier::PrettyPrint,
1618
utils::{Idx, LookupByIdx},
1719
};
18-
#[cfg(debug_assertions)]
19-
use crate::mast::MastNode;
2020

2121
// JOIN NODE
2222
// ================================================================================================

core/src/mast/node/loop_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use core::fmt;
55
use serde::{Deserialize, Serialize};
66

77
use super::{MastForestContributor, MastNodeExt};
8+
#[cfg(debug_assertions)]
9+
use crate::mast::MastNode;
810
use crate::{
911
Felt, Word,
1012
chiplets::hasher,
@@ -15,8 +17,6 @@ use crate::{
1517
prettier::PrettyPrint,
1618
utils::{Idx, LookupByIdx},
1719
};
18-
#[cfg(debug_assertions)]
19-
use crate::mast::MastNode;
2020

2121
// LOOP NODE
2222
// ================================================================================================

core/src/mast/node/split_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use core::fmt;
55
use serde::{Deserialize, Serialize};
66

77
use super::{MastForestContributor, MastNodeExt};
8+
#[cfg(debug_assertions)]
9+
use crate::mast::MastNode;
810
use crate::{
911
Felt, Word,
1012
chiplets::hasher,
@@ -15,8 +17,6 @@ use crate::{
1517
prettier::PrettyPrint,
1618
utils::{Idx, LookupByIdx},
1719
};
18-
#[cfg(debug_assertions)]
19-
use crate::mast::MastNode;
2020

2121
// SPLIT NODE
2222
// ================================================================================================

0 commit comments

Comments
 (0)