Skip to content

Implement PartialEq/Eq on PRNG Generators where possible #964

@rickvanprim

Description

@rickvanprim

It would be nice if the various PRNG Generators implemented PartialEq/Eq (where possible) so that it's possible to validate determinism in a simulation.

Example

let rng = SomePrng::new();
let mut initial_state = State::new(rng);
let mut determinism_check_state = initial_state.clone();
simulate(&mut initial_state);
simulate(&mut determinism_check_state);
assert_eq!(&initial_state, &determinism_check_state);

Currently this has to be worked around by introducing a wrapper type that inappropriately peers into the implementation details of the PRNG Generator to do a memory compare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions