ravel
Deterministic simulation testing for C++. Seed a bug, replay it exact.
Loading...
Searching...
No Matches
runner.hpp
1#pragma once
2
3#include <cstdint>
4#include <functional>
5#include <optional>
6#include <vector>
7
8#include "ravel/shrink.hpp"
9#include "ravel/simulation.hpp"
10
11namespace ravel {
12
16 std::uint64_t first_seed = 0;
18 std::uint64_t seed_count = 1000;
19
22 unsigned threads = 0;
23
26
31
33};
34
39 std::uint64_t seeds_run = 0;
40
41 std::vector<Result> failures;
42
45 std::optional<ShrinkResult> shrunk;
46
48 bool ok() const noexcept { return failures.empty(); }
49};
50
57RunnerReport run_seeds(const SimulationSetup& setup, const RunnerOptions& options = {});
58
59} // namespace ravel
How run_seeds runs.
Definition runner.hpp:14
std::uint64_t max_shrink_attempts
Replay budget for shrinking; see ShrinkOptions::max_attempts.
Definition runner.hpp:30
bool shrink_first_failure
Shrink the lowest failing seed once the sweep is done (see shrink()).
Definition runner.hpp:28
std::uint64_t seed_count
How many seeds to run, starting at first_seed.
Definition runner.hpp:18
SimulationOptions simulation
Applied to every run.
Definition runner.hpp:32
unsigned threads
Worker threads; 0 means one per hardware thread.
Definition runner.hpp:22
bool stop_at_first_failure
Report only the lowest failing seed and skip seeds beyond it.
Definition runner.hpp:25
std::uint64_t first_seed
The first seed to run.
Definition runner.hpp:16
What run_seeds found.
Definition runner.hpp:36
std::vector< Result > failures
In ascending seed order.
Definition runner.hpp:41
std::uint64_t seeds_run
Seeds covered.
Definition runner.hpp:39
bool ok() const noexcept
True if no seed failed.
Definition runner.hpp:48
std::optional< ShrinkResult > shrunk
The lowest failing seed, minimized.
Definition runner.hpp:45
How shrink() searches.
Definition shrink.hpp:31
std::uint64_t max_attempts
Replays allowed while shrinking.
Definition shrink.hpp:34
Options for one run. Every field has a sensible default.
Definition simulation.hpp:36