Skip to main content

DeterministicReplay

Trait DeterministicReplay 

Source
pub trait DeterministicReplay: DemoEngine {
    // Required method
    fn state_checksum(&self) -> u64;

    // Provided method
    fn verify_determinism(&self, other: &Self) -> bool { ... }
}
Expand description

Helper trait for demos that support deterministic replay.

Per Lavoie & Hendren (2015): Given identical configuration and seed, two independent runs must produce bit-identical state sequences.

Required Methods§

Source

fn state_checksum(&self) -> u64

Get a checksum of the current state for quick comparison.

Provided Methods§

Source

fn verify_determinism(&self, other: &Self) -> bool

Verify that two runs with same config produce identical results.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§