Skip to content

run Miri on CI (allowed to fail) #255

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

Merged
merged 2 commits into from
Mar 9, 2022
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Mar 6, 2022

With this (and an upcoming Miri PR), a number of tests are actually passing under Miri :D

cargo miri test --test i32_ops -- --skip cast --skip max --skip min --skip is_
cargo miri test --test f32_ops -- --skip cast --skip max --skip min --skip is_

bors added a commit to rust-lang/miri that referenced this pull request Mar 6, 2022
add more simd_reduce intrinsics

This makes large parts of the portable-simd test suite work. :D
Cc rust-lang/portable-simd#255
@RalfJung
Copy link
Member Author

RalfJung commented Mar 7, 2022

I could also add a Miri job to CI? We probably want it to be 'allowed to fail' so that new intrinsics that Miri does not support yet can still easily be added, but it would be nice to somehow track whether the Miri state becomes worse.

@calebzulawski
Copy link
Member

How long does it take to run? Sounds like a good idea to me.

@RalfJung
Copy link
Member Author

RalfJung commented Mar 7, 2022

Not sure, I would guess around 20-30min for the entire test suite -- but I can't say yet because not all of it passes yet. ;)

@RalfJung RalfJung changed the title reduce number of tests being run under Miri run Miri on CI (allowed to fail) Mar 7, 2022
@RalfJung RalfJung force-pushed the miri branch 2 times, most recently from c4e8a43 to 302048f Compare March 7, 2022 16:17
bors added a commit to rust-lang/miri that referenced this pull request Mar 8, 2022
update recommended CI snippet, add GHA example

If this snippet works as expected in rust-lang/portable-simd#255 (which we can test tomorrow), then this adjusts our README to that nicer script.
@workingjubilee workingjubilee reopened this Mar 8, 2022
@RalfJung
Copy link
Member Author

RalfJung commented Mar 8, 2022

Ah, now Miri fails since it is still a day old and hence requires const_fn_trait_bound. ;) That should fix itself tomorrow though.

@RalfJung RalfJung force-pushed the miri branch 3 times, most recently from 85e2a69 to 6401dba Compare March 9, 2022 15:58
@RalfJung
Copy link
Member Author

RalfJung commented Mar 9, 2022

error: unsupported operation: unimplemented intrinsic: simd_ceil
  --> /home/runner/work/portable-simd/portable-simd/crates/std_float/src/lib.rs:91:18
   |
91 |         unsafe { simd_ceil(self) }
   |                  ^^^^^^^^^^^^^^^ unimplemented intrinsic: simd_ceil
   |

Interesting, that intrinsic is not even declared in https://github.com/rust-lang/portable-simd/blob/master/crates/core_simd/src/intrinsics.rs. 🤔

@RalfJung
Copy link
Member Author

RalfJung commented Mar 9, 2022

But the tests that are now in there should work. It's a bit annoying to check this since "ignoring failures" means getting green checkmarks everywhere (with GHA there is no way to get a red checkmark for the job but still get a green checkmark for the PR as a whole) -- one has to look at the log to check if it actually failed. But that's the best we can do I guess.

@workingjubilee
Copy link
Member

Yes, that intrinsic is listed with the other "might libcall" floating point intrinsics.

// "platform intrinsics" are essentially "codegen intrinsics"
// each of these may be scalarized and lowered to a libm call
extern "platform-intrinsic" {
// ceil
fn simd_ceil<T>(x: T) -> T;
// floor
fn simd_floor<T>(x: T) -> T;
// round
fn simd_round<T>(x: T) -> T;
// trunc
fn simd_trunc<T>(x: T) -> T;
// fsqrt
fn simd_fsqrt<T>(x: T) -> T;
// fma
fn simd_fma<T>(x: T, y: T, z: T) -> T;
}

@workingjubilee workingjubilee merged commit e9aeea3 into rust-lang:master Mar 9, 2022
workingjubilee added a commit that referenced this pull request Mar 9, 2022
This is allowed to fail, but might produce useful results to check on.
@RalfJung RalfJung deleted the miri branch March 9, 2022 20:18
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.

5 participants