File tree 4 files changed +12
-8
lines changed
bench-cargo-miri/big-allocs/src
4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ fn main() {
7
7
// We can't use too big of an allocation or this code will encounter an allocation failure in
8
8
// CI. Since the allocation can't be huge, we need to do a few iterations so that the effect
9
9
// we're trying to measure is clearly visible above the interpreter's startup time.
10
- for _ in 0 ..10 {
10
+ // FIXME (https://github.com/rust-lang/miri/issues/4253): On 32bit targets, we can run out of
11
+ // usable addresses if we don't reuse, leading to random test failures.
12
+ let count = if cfg ! ( target_pointer_width = "32" ) { 8 } else { 12 } ;
13
+ for _ in 0 ..count {
11
14
drop ( Vec :: < u8 > :: with_capacity ( 512 * 1024 * 1024 ) ) ;
12
15
}
13
16
}
Original file line number Diff line number Diff line change 1
- d5b4c2e4f19b6d7037371cdaecc3cc2c701c68df
1
+ 25a615bf829b9f6d6f22da537e3851043f92e5f2
Original file line number Diff line number Diff line change @@ -411,9 +411,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
411
411
} ;
412
412
let res = this. binary_op ( op, & a, & b) ?;
413
413
// `binary_op` already called `generate_nan` if needed.
414
- // Apply a relative error of 16ULP to simulate non-deterministic precision loss
414
+ // Apply a relative error of 4ULP to simulate non-deterministic precision loss
415
415
// due to optimizations.
416
- let res = apply_random_float_error_to_imm ( this, res, 4 /* log2(16 ) */ ) ?;
416
+ let res = apply_random_float_error_to_imm ( this, res, 2 /* log2(4 ) */ ) ?;
417
417
this. write_immediate ( * res, dest) ?;
418
418
}
419
419
@@ -464,9 +464,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
464
464
if !float_finite ( & res) ? {
465
465
throw_ub_format ! ( "`{intrinsic_name}` intrinsic produced non-finite value as result" ) ;
466
466
}
467
- // Apply a relative error of 16ULP to simulate non-deterministic precision loss
467
+ // Apply a relative error of 4ULP to simulate non-deterministic precision loss
468
468
// due to optimizations.
469
- let res = apply_random_float_error_to_imm ( this, res, 4 /* log2(16 ) */ ) ?;
469
+ let res = apply_random_float_error_to_imm ( this, res, 2 /* log2(4 ) */ ) ?;
470
470
this. write_immediate ( * res, dest) ?;
471
471
}
472
472
Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ macro_rules! assert_approx_eq {
38
38
} } ;
39
39
40
40
( $a: expr, $b: expr) => {
41
- // accept up to 64ULP (16ULP for host floats and 16ULP for miri artificial error and 32 for any rounding errors)
42
- assert_approx_eq!( $a, $b, 64 ) ;
41
+ // accept up to 12ULP (4ULP for host floats and 4ULP for miri artificial error and 4 for any additional effects
42
+ // due to having multiple error sources.
43
+ assert_approx_eq!( $a, $b, 12 ) ;
43
44
} ;
44
45
}
45
46
You can’t perform that action at this time.
0 commit comments