ravel
Deterministic simulation testing for C++. Seed a bug, replay it exact.
Loading...
Searching...
No Matches
determinism.hpp
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6
7#include "ravel/simulation.hpp"
8
9namespace ravel {
10
14 std::uint64_t first_seed = 0;
16 std::uint64_t seed_count = 100;
17
20 unsigned threads = 0;
21
23};
24
28 std::uint64_t seed = 0;
29 std::string description;
30};
31
35 std::uint64_t seeds_checked = 0;
36 std::vector<DeterminismProblem> problems;
37
39 bool ok() const noexcept { return problems.empty(); }
40};
41
58DeterminismReport check_determinism(const SimulationSetup& setup,
59 const DeterminismOptions& options = {});
60
61} // namespace ravel
What check_determinism runs over.
Definition determinism.hpp:12
SimulationOptions simulation
Applied to every run.
Definition determinism.hpp:22
std::uint64_t first_seed
The first seed to check.
Definition determinism.hpp:14
unsigned threads
Worker threads; 0 means one per hardware thread.
Definition determinism.hpp:20
std::uint64_t seed_count
How many seeds to check, starting at first_seed.
Definition determinism.hpp:16
A seed whose runs were not identical.
Definition determinism.hpp:26
std::string description
What differed, and where.
Definition determinism.hpp:29
std::uint64_t seed
The seed.
Definition determinism.hpp:28
What check_determinism found.
Definition determinism.hpp:33
std::vector< DeterminismProblem > problems
In ascending seed order.
Definition determinism.hpp:36
std::uint64_t seeds_checked
How many seeds were checked.
Definition determinism.hpp:35
bool ok() const noexcept
True if every checked seed behaved identically each time.
Definition determinism.hpp:39
Options for one run. Every field has a sensible default.
Definition simulation.hpp:36