Skip to content

Test that target feature mix up with homogeneous floats is sound - #101381

Merged
bors merged 1 commit into
rust-lang:masterfrom
Urgau:target-mixup-homogenous-floats
Nov 9, 2022
Merged

Test that target feature mix up with homogeneous floats is sound#101381
bors merged 1 commit into
rust-lang:masterfrom
Urgau:target-mixup-homogenous-floats

Conversation

@Urgau

@UrgauUrgau commented Sep 3, 2022

Copy link
Copy Markdown
Member

This pull-request adds a test in src/test/abi/ that test that target feature mix up with homogeneous floats is sound.

This is basically is ripoff of src/test/ui/simd/target-feature-mixup.rs but for floats and without #[repr(simd)].

Extracted from #97559 since I don't yet know what to do with that PR.

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 3, 2022
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2022
@Mark-Simulacrum

Copy link
Copy Markdown
Member

r? @Amanieu perhaps?

I'm not a huge fan of just running binaries without checking CPUID ahead of time for the relevant target features. I think our CI runs on fairly old CPUs (Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz, in one recent job), which don't have any AVX-512 features, so we'd not be testing this regularly either.

@Amanieu

Copy link
Copy Markdown
Member

Fundamentally this LGTM. If we absolutely want to make sure that the AVX512 path is tested then we may want to run the test under qemu-x86_64.

@Urgau

Copy link
Copy Markdown
MemberAuthor

Fundamentally this LGTM. If we absolutely want to make sure that the AVX512 path is tested then we may want to run the test under qemu-x86_64.

Is is required ? Personally I don't it should be, qemu is not perfect and most contributors will run those tests on their machines, so it will get tested as much but still enough to get me to want to integrate it. Having the test is better than not having it at all.

@Amanieu

Copy link
Copy Markdown
Member

No, I don't think this is strictly required. This test is fine as it is.

@bors r+

@bors

bors commented Sep 18, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 5c6caf3 has been approved by Amanieu

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 18, 2022
@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 5c6caf3 with merge 97c338f2fa6662ed23b3cd8d295a529a8a14487f...

@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 19, 2022
@rust-log-analyzer

This comment has been minimized.

notriddle added a commit to notriddle/rust that referenced this pull request Sep 20, 2022
…ts, r=Amanieu
Test that target feature mix up with homogeneous floats is sound
This pull-request adds a test in `src/test/abi/` that test that target feature mix up with homogeneous floats is sound.
This is basically is ripoff of [src/test/ui/simd/target-feature-mixup.rs](https://github.com/rust-lang/rust/blob/47d1cdb0bcac8e417071ce1929d261efe2399ae2/src/test/ui/simd/target-feature-mixup.rs) but for floats and without `#[repr(simd)]`.
*Extracted from rust-lang#97559 since I don't yet know what to do with that PR.*
@notriddle

Copy link
Copy Markdown
Contributor

Wait, never mind. This one failed in CI and wasn't fixed.

I wonder how it got back into the bors queue?

@notriddle

Copy link
Copy Markdown
Contributor

@bors r-

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 20, 2022
@Urgau

Copy link
Copy Markdown
MemberAuthor

Wait, never mind. This one failed in CI and wasn't fixed.

I wonder how it got back into the bors queue?

Not the first time. It sometimes happens that the queue gets de-synchronized.


Anyway, I looked a bit at the failure and it happen when testing the first sse2 assertion on i586-unknown-linux-gnu. I tried to replicate the failure but didn't yet succeed.

It's maybe related to sse not being available on CI but it would be weird to not get a SIGGILL in that case. Anyone know if the builder dist-i586-gnu-i586-i686-musl uses qemu or something else ?

@Amanieu

Copy link
Copy Markdown
Member

The i586-unknown-linux-gnu target specifically doesn't enable the sse target feature by default. This means that it passes floating-point arguments via the x87 registers instead of using SSE registers. I expect this might be what is causing the issue here.

@Urgau

Copy link
Copy Markdown
MemberAuthor

I tried pretty hard to reproduce the crash (with/without qemu, with/without mold, with/without native libs, ...) but I'm still unable to reproduce it. It always successfully pass.

I'm not sure what to do or try anymore. Does anyone have an idea?

@Amanieu

Copy link
Copy Markdown
Member

Can you reproduce the issue with ./x.py test src/test/ui --target=i586-unknown-linux-gnu?

@Urgau

Copy link
Copy Markdown
MemberAuthor

Can you reproduce the issue with ./x.py test src/test/ui --target=i586-unknown-linux-gnu?

Seems like yes, which does not really make sense to me. Anyway this is progress. I will try to investigate this week-end otherwise next week.

This is basically is ripoff of src/test/ui/simd/target-feature-mixup.rs
but for floats and without #[repr(simd)]
@Urgau
Urgauforce-pushed the target-mixup-homogenous-floats branch from 5c6caf3 to 66847ffCompareNovember 1, 2022 13:22
@Urgau

Urgau commented Nov 1, 2022

Copy link
Copy Markdown
MemberAuthor

I've been unable to find the exact cause of the problem but since src/test/ui/see2.rs manually disable any sse2 test on i586-unknown-linux-gnu, I've done the same and added the same check.

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 1, 2022
@UrgauUrgau closed this Nov 1, 2022
@UrgauUrgau reopened this Nov 1, 2022
@Amanieu

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Nov 9, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 66847ff has been approved by Amanieu

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 9, 2022
…earth
Rollup of 7 pull requests
Successful merges:
- rust-lang#100508 (avoid making substs of type aliases late bound when used as fn args)
- rust-lang#101381 (Test that target feature mix up with homogeneous floats is sound)
- rust-lang#103353 (Fix Access Violation when using lld & ThinLTO on windows-msvc)
- rust-lang#103521 (Avoid possible infinite loop when next_point reaching the end of file)
- rust-lang#103559 (first move on a nested span_label)
- rust-lang#103778 (Update several crates for improved support of the new targets)
- rust-lang#103827 (Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit bd4e608 into rust-lang:masterNov 9, 2022
@rustbotrustbot added this to the 1.67.0 milestone Nov 9, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@Urgau@rust-highfive@Mark-Simulacrum@Amanieu@bors@rust-log-analyzer@notriddle@rustbot