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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### Fixes

- `FastProcessor` now correctly returns an error if the maximum number of cycles was exceeded during execution ([#2537](https://github.com/0xMiden/miden-vm/pull/2537))
- `FastProcessor` now correctly only executes `trace` decorators when tracing is enabled (with `ExecutionOptions`) ([#2539](https://github.com/0xMiden/miden-vm/pull/2539))

#### Changes

Expand Down
2 changes: 0 additions & 2 deletions miden-vm/tests/integration/operations/decorators/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ fn test_event_handling() {
}

#[test]
#[ignore = "issue #2479"]
fn test_trace_handling() {
let source = "\
begin
Expand Down Expand Up @@ -76,7 +75,6 @@ fn test_trace_handling() {
}

#[test]
#[ignore = "issue #2479"]
fn test_debug_with_debugging() {
let source: &str = "\
begin
Expand Down
14 changes: 8 additions & 6 deletions processor/src/fast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,12 +782,14 @@ impl FastProcessor {
// do nothing
},
Decorator::Trace(id) => {
let clk = self.clk;
let process = &mut self.state();
if let Err(err) = host.on_trace(process, *id) {
return ControlFlow::Break(BreakReason::Err(
ExecutionError::TraceHandlerError { clk, trace_id: *id, err },
));
if self.options.enable_tracing() {
let clk = self.clk;
let process = &mut self.state();
if let Err(err) = host.on_trace(process, *id) {
return ControlFlow::Break(BreakReason::Err(
ExecutionError::TraceHandlerError { clk, trace_id: *id, err },
));
}
}
},
};
Expand Down
7 changes: 2 additions & 5 deletions processor/src/tests/debug_mode_decorator_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ fn create_debug_test_program() -> Program {

/// Test that verifies decorators only execute in debug mode
#[test]
#[ignore = "issue #2479"]
fn test_decorators_only_execute_in_debug_mode() {
// Test implementation to verify decorators only execute in debug mode

Expand Down Expand Up @@ -107,7 +106,8 @@ fn test_decorators_only_execute_in_debug_mode() {
&mut self,
process: &ProcessState<'_>,
) -> impl FutureMaybeSend<Result<Vec<AdviceMutation>, EventError>> {
async { <Self as SyncHost>::on_event(self, process) }
let result = <Self as SyncHost>::on_event(self, process);
async { result }
}
}

Expand Down Expand Up @@ -136,7 +136,6 @@ fn test_decorators_only_execute_in_debug_mode() {

/// Test that verifies decorators do NOT execute when debug mode is OFF
#[test]
#[ignore = "issue #2479"]
fn test_decorators_only_execute_in_debug_mode_off() {
// Create a test program with a Trace decorator
let program = create_debug_test_program();
Expand Down Expand Up @@ -165,7 +164,6 @@ fn test_decorators_only_execute_in_debug_mode_off() {

/// Test that verifies decorators DO execute when debug mode is ON
#[test]
#[ignore = "issue #2479"]
fn test_decorators_only_execute_in_debug_mode_on() {
// Create a test program with a Trace decorator
let program = create_debug_test_program();
Expand Down Expand Up @@ -196,7 +194,6 @@ fn test_decorators_only_execute_in_debug_mode_on() {
/// Test that demonstrates the zero overhead principle by comparing execution
/// with debug mode on vs off for a more complex program
#[test]
#[ignore = "issue #2479"]
fn test_zero_overhead_when_debug_off() {
// Create a more complex program with multiple decorators
let mut mast_forest = MastForest::new();
Expand Down
1 change: 1 addition & 0 deletions processor/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use super::*;
use crate::fast::FastProcessor;

mod debug;
mod debug_mode_decorator_tests;

// AdviceMap inlined in the script
// ------------------------------------------------------------------------------------------------
Expand Down