Auto merge of #3328 - RalfJung:many-seeds, r=RalfJung
./miri many-seeds: support MIRI_SEED_END to control the end of the seed range
This commit is contained in:
commit
c414c08da3
@ -356,11 +356,17 @@ impl Command {
|
||||
.unwrap_or_else(|_| "0".into())
|
||||
.parse()
|
||||
.context("failed to parse MIRI_SEED_START")?;
|
||||
let seed_count: u64 = env::var("MIRI_SEEDS")
|
||||
.unwrap_or_else(|_| "256".into())
|
||||
.parse()
|
||||
.context("failed to parse MIRI_SEEDS")?;
|
||||
let seed_end = seed_start + seed_count;
|
||||
let seed_end: u64 = match (env::var("MIRI_SEEDS"), env::var("MIRI_SEED_END")) {
|
||||
(Ok(_), Ok(_)) => bail!("Only one of MIRI_SEEDS and MIRI_SEED_END may be set"),
|
||||
(Ok(seeds), Err(_)) =>
|
||||
seed_start + seeds.parse::<u64>().context("failed to parse MIRI_SEEDS")?,
|
||||
(Err(_), Ok(seed_end)) => seed_end.parse().context("failed to parse MIRI_SEED_END")?,
|
||||
(Err(_), Err(_)) => seed_start + 256,
|
||||
};
|
||||
if seed_end <= seed_start {
|
||||
bail!("the end of the seed range must be larger than the start.");
|
||||
}
|
||||
|
||||
let Some((command_name, trailing_args)) = command.split_first() else {
|
||||
bail!("expected many-seeds command to be non-empty");
|
||||
};
|
||||
|
@ -113,8 +113,9 @@ sysroot, to prevent conflicts with other toolchains.
|
||||
./miri many-seeds <command>:
|
||||
Runs <command> over and over again with different seeds for Miri. The MIRIFLAGS
|
||||
variable is set to its original value appended with ` -Zmiri-seed=$SEED` for
|
||||
many different seeds. The MIRI_SEEDS variable controls how many seeds are being
|
||||
tried; MIRI_SEED_START controls the first seed to try.
|
||||
many different seeds. MIRI_SEED_START controls the first seed to try (default: 0).
|
||||
MIRI_SEEDS controls how many seeds are being tried (default: 256);
|
||||
alternatively, MIRI_SEED_END controls the end of the (exclusive) seed range to try.
|
||||
|
||||
./miri bench <benches>:
|
||||
Runs the benchmarks from bench-cargo-miri in hyperfine. hyperfine needs to be installed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user