Skip to content

Commit bb81f59

Browse files
committed
Document trace build inputs test helpers
1 parent 8122cbc commit bb81f59

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

processor/src/execution/operations/crypto_ops/tests.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use miden_core::{
66
crypto::merkle::{MerkleStore, MerkleTree, NodeIndex},
77
field::{BasedVectorSpace, QuadFelt},
88
mast::MastForest,
9-
program::{MIN_STACK_DEPTH, StackInputs},
9+
program::StackInputs,
1010
};
1111
use proptest::prelude::*;
1212

@@ -807,18 +807,3 @@ fn test_op_mrupdate_merge_subtree() {
807807
fn init_node(value: u64) -> Word {
808808
[Felt::new(value), ZERO, ZERO, ZERO].into()
809809
}
810-
811-
/// Builds an expected stack state from the given values.
812-
///
813-
/// The values are provided in "stack order" (top of stack first), and the result is a Vec<Felt>
814-
/// that can be compared with `processor.stack_top()`, where the top of the stack is at the
815-
/// **last** index.
816-
#[allow(dead_code)]
817-
fn build_expected(values: &[u64]) -> Vec<Felt> {
818-
let mut expected = vec![ZERO; MIN_STACK_DEPTH];
819-
for (i, &value) in values.iter().enumerate() {
820-
// In the result, top of stack is at index 15, second at 14, etc.
821-
expected[15 - i] = Felt::new(value);
822-
}
823-
expected
824-
}

processor/src/trace/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ impl TraceBuildInputs {
105105
}
106106
}
107107

108+
/// Returns the stack outputs captured for the execution being replayed.
108109
pub fn stack_outputs(&self) -> &StackOutputs {
109110
&self.trace_output.stack_outputs
110111
}
@@ -124,17 +125,20 @@ impl TraceBuildInputs {
124125
&self.program_info
125126
}
126127

128+
// Kept for mismatch and edge-case tests that mutate replay inputs directly.
127129
#[cfg(any(test, feature = "testing"))]
128130
#[allow(dead_code)]
129131
pub(crate) fn into_parts(self) -> (TraceBuildOutput, TraceGenerationContext, ProgramInfo) {
130132
(self.trace_output, self.trace_generation_context, self.program_info)
131133
}
132134

133135
#[cfg(any(test, feature = "testing"))]
136+
/// Returns the trace replay context captured during execution.
134137
pub fn trace_generation_context(&self) -> &TraceGenerationContext {
135138
&self.trace_generation_context
136139
}
137140

141+
// Kept for tests that force invalid replay contexts without widening the public API.
138142
#[cfg(any(test, feature = "testing"))]
139143
#[allow(dead_code)]
140144
pub(crate) fn trace_generation_context_mut(&mut self) -> &mut TraceGenerationContext {

0 commit comments

Comments
 (0)