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§
Sourcefn state_checksum(&self) -> u64
fn state_checksum(&self) -> u64
Get a checksum of the current state for quick comparison.
Provided Methods§
Sourcefn verify_determinism(&self, other: &Self) -> bool
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.