-
Notifications
You must be signed in to change notification settings - Fork 152
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 VS2019 to CI #294
Add VS2019 to CI #294
Conversation
Hi @amyspark! Since you seem to be pretty knowledgeable on SIMD programming and the MSVC toolchain, you may have an idea what breaks the Visual Studio 2019 builds here. There are only two failures:
If you have any clue on what is happening here, I would be super happy! Thank you very much! |
@bernhardmgruber Vc::exp's |
@bernhardmgruber, re the
I'll continue later with the utils error. |
@bernhardmgruber codegen bug, please insert |
@bernhardmgruber, can you trigger a CI check again? I've been able to confirm Microsoft's assertion that the SSE bug is fixed in 16.10.4. |
23991ed
to
77534a2
Compare
77534a2
to
c31de87
Compare
I see we now have a clean fail on MSVC, I'll check on those during the week. |
c31de87
to
10a36a5
Compare
AVX failures are confirmed and already marked as "under investigation" by MS. With the same compiler version, I cannot reproduce the SSE failures here. I can only think it may be down to the runner's CPU vendor -- @bernhardmgruber, do you have an Intel box to test with, since mine is a Ryzen 1st gen? |
Note that the AppVeyor runs do complete successfully, although with a slightly older MSVC; it's another inconsistency to tally... |
AppVeyor completes successfully, because it builds with VS2017. Btw.: I removed AppVeyor (and travis) from the CI in #293. |
10a36a5
to
95341f3
Compare
I am starting to wonder if the failing unit tests can ever be correct. There is no requirement on the precision of Maybe we should just declare that Vc tries to reproduce the results of libstdc++ and set much higher epsilons in the unit tests when a different standard library is used. |
If any precision issues arise with MSVC (especially in the presence of /fp:precise and lower), those should be reported ASAP. I know they've been running into many bugs with their SSA optimizer in 2019. |
As I said, |
If you can share the Godbolt, I can download and run it here. I've got 2017, 2019, the 2022 preview in my box, and also various MinGW flavors for further comparison. |
I reached the point where I really start to believe this can be a compiler bug now. I tried printing the constants where the tests would fail and ended up here: int main() {
const auto v = 0x1.26f8f4p+3f; // 9.2178897857666015625f
const auto r = std::exp(v);
printf("%f %a", r, r);
// gcc 10075.780273
// VS2019 10075.780273
const auto vv = Vc::Vector<float, Vc::VectorAbi::Avx>(v);
const auto rr = Vc::exp(vv);
printf("%f %a", static_cast<float>(rr[0]), static_cast<float>(rr[0]));
// gcc 10075.780273
// VS2019 10075.780273
} That is all correct. But if the float value for (size_t i = 0; i < 100000 / V::Size; ++i) {
V x = (V::Random() - T(0.5)) * T(20);
V reference = x.apply([&b](T _x) { return std::exp(_x); });
FUZZY_COMPARE(Vc::exp(x), reference) << ", x = " << x << ", i = " << i;
}
// VS2019 unit tests Vc::exp = 10075.77539, reference = 10075.78027 the result is wrong. While playing around, I introduced the following side effect: for (size_t i = 0; i < 100000 / V::Size; ++i) {
V x = (V::Random() - T(0.5)) * T(20);
V reference = x.apply([](T _x) {
if (std::abs(_x - 9.21789) < std::numeric_limits<T>::epsilon() * 10)
printf("");
return std::exp(_x);
});
FUZZY_COMPARE(Vc::exp(x), reference) << ", x = " << x << ", i = " << i;
}
// VS2019 test passes This should not change the result, but it somehow makes the test pass. So I guess the call to I don't know how to continue from here. @amyspark if you want you can try to reproduce this even better and file a bug report to MS. Otherwise, I am also fine to just live with the issue and increase the error margins for MSVC in the unit tests. We can revisit this in the future and see if a future version of VS fixes this. |
@bernhardmgruber I'll certainly work on a test case for MS. Did you check with the |
I just tried that and indeed, the tests pass successfully then. |
95341f3
to
81c2bed
Compare
LGTM 🎉 |
@bernhardmgruber, Karen Huang from Microsoft needs further information as to the processor's specs you are using. |
@amyspark I commented on the bug report. Thx raising my awareness! |
This PR adds Visual Studio 2019 to the CI.