Skip to main content

assert_deterministic

Macro assert_deterministic 

Source
macro_rules! assert_deterministic {
    ($seed:expr, $sim_fn:expr) => { ... };
}
Expand description

Assert that a simulation is deterministic (same seed produces identical trace).

This is the recommended way to enforce R-11 in CI. Call this macro in your test functions to automatically run the simulation twice and assert trace identity.

use vortex_trace::assert_deterministic;

#[test]
fn test_my_simulation_is_deterministic() {
    assert_deterministic!(42, |seed| {
        let mut trace = vortex_trace::SimTrace::new();
        // ... run your simulation ...
        trace
    });
}