Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Miri CI #61

Merged
merged 3 commits into from
Aug 23, 2020
Merged

add Miri CI #61

merged 3 commits into from
Aug 23, 2020

Conversation

RalfJung
Copy link
Contributor

@RalfJung RalfJung commented Aug 22, 2020

A long time ago, I think at RustFest Rome, we talked about using Miri to test bytecount. Back then Miri wasn't up for the task, but these days it is. :)

In the default settings, each quickcheck test takes around 50s in Miri on my machine, which seems okay. When running the tests locally, one can make things go faster with something like

QUICKCHECK_TESTS=10 cargo miri test -- -Zmiri-disable-isolation

("disable-isolation" is needed to forward the env var to the program)

Note that by default Miri makes all RNGs deterministic. We could add the -Zmiri-disable-isolation flag to allow seeing from the OS RNG.

Also fixes #53.

.travis.yml Outdated
@@ -39,6 +39,9 @@ matrix:
env:
- ARCH=x86_64
- FEATURES="--features generic-simd,runtime-dispatch-simd"
- name: Miri
rust: nightly
script: ci/miri.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of ordering it would probably be better to put Miri earlier as it will be one of the longer-running jobs I assume?

@RalfJung
Copy link
Contributor Author

(Not sure what's happening with Travis, it doesn't show up in the PR for some reason but a job is running.)

@RalfJung
Copy link
Contributor Author

RalfJung commented Aug 22, 2020

FWIW, Miri can also run code for other architectures, so this could help with #53. So far I only tested cross-OS interpretation (like using a Windows target on a Linux host and vice versa), but in principle using a different CPU as a target should also work.

EDIT: did that, it works great. :)


# Run tests
cargo miri test
cargo miri test --target=mips64-unknown-linux-gnuabi64 # big-endian architecture
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified locally that reverting db2b9ef makes this test fail.

@RalfJung
Copy link
Contributor Author

(CI fails for Rust 1.32 because criterion-0.3.3 does not seem compatible.)

@llogiq llogiq merged commit 5085205 into llogiq:master Aug 23, 2020
@llogiq
Copy link
Owner

llogiq commented Aug 23, 2020

Thank you!

@RalfJung RalfJung deleted the miri branch August 23, 2020 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Fancy new algorithm" doesn't work on big-endian machines
2 participants