Stream: general

Topic: miri speed


Jake Goulding (May 30 2019 at 23:05, on Zulip):

@oli @RalfJ is there a rough estimate of miri's slowdown factor that I can use as a rule of thumb?

RalfJ (May 31 2019 at 07:45, on Zulip):

other than "a lot"?^^
in https://github.com/rust-lang/miri/issues/638 someone reported "100x slower than python". I didn't verify that.

oli (May 31 2019 at 12:01, on Zulip):

I once benchmarked against plain execution, and I think these benchmarks are even still around in our repo, so you can test how bad it is today, but it used to be quite a few orders of magnitude

oli (May 31 2019 at 12:01, on Zulip):

with stacked borrows that probably got even worse :D

Jake Goulding (May 31 2019 at 12:33, on Zulip):

I hold out hope of running Miri on a testsuite driven by a property-based test suite

oli (May 31 2019 at 12:45, on Zulip):

have you tried running miri on a quickcheck test suite?

oli (May 31 2019 at 12:45, on Zulip):

we do have random number generators nowadays

RalfJ (May 31 2019 at 13:44, on Zulip):

to give you an idea: the libcore test suite takes 0.4s when running "for real" and 6:20 min when running in Miri

RalfJ (May 31 2019 at 13:45, on Zulip):

that's roughly 1000x slowdown

RalfJ (May 31 2019 at 13:45, on Zulip):

which is in the same ballpark as "100x slower than python" I guess ;)

RalfJ (May 31 2019 at 13:46, on Zulip):

uh, I wanted to test that with validation disabled but then in ICEs...^^

Jake Goulding (May 31 2019 at 14:35, on Zulip):

@oli quickcheck is old and busted. proptest is where it's at.

Jake Goulding (May 31 2019 at 14:36, on Zulip):

What's annoying is that the places I want to use it are probably the most Miri-difficult: FFI and SIMD

RalfJ (May 31 2019 at 14:36, on Zulip):

disabling validity is a roughly 2x speedup... as in, still 500x slower than "real"^^

RalfJ (May 31 2019 at 14:37, on Zulip):

yeah, SIMD needs someone to implement 5k intrinsics and FFI... I doubt will ever happen^^

Jake Goulding (May 31 2019 at 14:41, on Zulip):

For examples...

I have twox-hash which uses proptest to validate the pure-Rust output against the C implementation. That's an "easy" property. Coming up with self contained properties is much harder.

I also have jetscii, which uses proptest to validate the SIMD output against the non-SIMD output.

Jake Goulding (May 31 2019 at 14:41, on Zulip):

In the first case, I don't want to run Miri on the FFI code.

Jake Goulding (May 31 2019 at 14:42, on Zulip):

Is there a way to annotate a function to have Miri not inspect within it?

RalfJ (May 31 2019 at 14:43, on Zulip):

"inspect within it"?

RalfJ (May 31 2019 at 14:43, on Zulip):

miri doesnt inspect anything, it evaluates

RalfJ (May 31 2019 at 14:44, on Zulip):

so it doesnt matter if there is FFI that is not used. but if your code runs FFI, there's nothing we can do.

RalfJ (May 31 2019 at 14:44, on Zulip):

cant you do the comparison "externally"? like, have the evaluation in Miri dump the results to a file and then compare that

RalfJ (May 31 2019 at 14:44, on Zulip):

that just requires disk I/O which is much more realistic than FFI ;)

Jake Goulding (May 31 2019 at 14:45, on Zulip):

I'm trying to think what the speed tradeoff would be there

Jake Goulding (May 31 2019 at 14:45, on Zulip):

Can I call std::cmd::Process under Miri?

Jake Goulding (May 31 2019 at 14:46, on Zulip):

then I could run the FFI in another non-Miri process.

Jake Goulding (May 31 2019 at 14:47, on Zulip):

Realistically, I can just run the tests 2x: once with comparing against FFI and once with the comparison replaced by true. Find bugs in the first run, UB in the second.

RalfJ (May 31 2019 at 14:48, on Zulip):

no. but that is possible in principle...

RalfJ (May 31 2019 at 14:48, on Zulip):

lots of work but not impossible

RalfJ (May 31 2019 at 14:48, on Zulip):

someone would have to add a shim for popen I guess

Last update: Nov 20 2019 at 11:25UTC