-
Notifications
You must be signed in to change notification settings - Fork 13.4k
check-aux: test core, alloc, std in Miri #123506
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
Conversation
r? @onur-ozkan rustbot has assigned @onur-ozkan. Use |
Oh...
This runs some benchmarks it seems. That will ~never terminate under Miri.^^ |
49acb75
to
ff3fccd
Compare
This comment has been minimized.
This comment has been minimized.
ff3fccd
to
4a36dfb
Compare
This comment has been minimized.
This comment has been minimized.
139edf9
to
b2801f7
Compare
This comment has been minimized.
This comment has been minimized.
Oh, interesting... the macOS build of compiler-builtins is trying to run a C compiler. For now let's just run tests on Linux only, then. |
3776b53
to
18955b2
Compare
Strangely the macos tests work fine locally. Not sure what is different on CI... |
All right, tests are passing!
On std we're unfortunately only testing one target as somehow the compiler-builtins build script fails for other targets. I'll extend the std tests a bit (we need some filters here as not all of std is supported by Miri). There are likely some testcases that are unproportionally slow. They are somewhat hard to identify. For doctests we get the "has been running for a long time" warning, which points at this test that creates a 100k element linked list. For libtests, the test harness runs inside Miri where it disables timing in Miri to make sure it can run with isolation enabled. Now that we have the fake clock in isolation mode, maybe we can fix that. Whether that gives useful results is a different question... |
18955b2
to
e72edf3
Compare
/// for i in 0..100000 { | ||
/// let size = 100000; | ||
/// # let size = if cfg!(miri) { 100 } else { size }; | ||
/// for i in 0..size { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that an okay approach to make the test shorter in Miri? The alternative would be more convoluted but would let the code look as before on the web view:
# let size = if cfg!(miri) { 100 } else { 100000 };
# for i in 0..size {
# /*
for i in 0..100000 {
# */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, especially given it's relatively isolated. Realistically I'm not convinced this example needs a huge length (100 elements or 100,000 is about equally bad if you're pushing a new stack frame per element, IMO, given that you might already be close to the end of the allowed stack when starting to execute).
e72edf3
to
31fa4b3
Compare
This comment has been minimized.
This comment has been minimized.
It's actually a bit surprising that these take so long, since the out-of-tree test tests alloc and core in 45 minutes total and it runs all tests on 2 targets. So the test here should have been about twice as fast. Do we have debug assertions enabled on the gnu-aux runner, or something like that? |
presumably the |
Yes: Line 91 in 01f7f3a
Yes: Lines 125 to 140 in 01f7f3a
|
be4aa35
to
7e33fd3
Compare
# In `std` we cannot test everything. | ||
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \ | ||
$(BOOTSTRAP) miri --stage 2 library/std \ | ||
--no-doc -- \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't add mips-unknown-linux-gnu here as I think std has much less code that depends on bitwidth or endianess, so the extra 10min CI time does not seem worth it. Instead we have the macOS and Windows checks below, as std does contain a lot of OS-specific code. (And it's a 32bit Windows so at least that kind of architecture is covered.)
7e33fd3
to
596908b
Compare
Ah, that's more like it. Now even when testing two targets for core and alloc we get
The total duration of the gnu-aux job is around 104min. That is just 2min above the anticipated 1h. I can remove some of the extra targets if that is desired. Testing core and alloc only on one target brings it down by about 15min. |
Some data from #123560: enabling just overflow checks add around 10min to total CI time, enabling just debug assertions adds around 30min. |
@rustbot ready |
@bors r+ I think this is good to land. We can always tweak it further in future PRs (e.g., get rid of the Makefile, maybe try to enable benchmarks running once or something like that). |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a2c72ce): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.322s -> 668.882s (0.08%) |
I think benchmarks are already only run once in test mode? This is based on a vague memory, nothing more.
However some benchmarks create large data structures in the preparation phase of the benchmark and I think that is what makes them slow on Miri.
|
This PR had nothing to do with our benchmarking infrastructure :) So this has to be pure noise. |
Let's see if this works, and how long it takes.