-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
is_x86_feature_detected!("avx512f")
fails to build on beta and nightly
#68905
Comments
cc @gnzlbg |
Here's the output of searched nightlies: from nightly-2020-01-02 to nightly-2020-02-10 That points to #68755, which is a large merge of stdarch. When I bisect stdarch, I find the error was introduced in rust-lang/stdarch@cb6fa68, possibly intentionally. Is it the case that AVX-512 feature detection was never intended to be stabilized? Or maybe it got caught up in a larger group of unstable features? Prior to this regression, it did in fact work :) |
…bled rust-lang/rust#68905 is currently causing nightly builds to fail, unless `--no-default-features` is used. This change means that the default build will succeed, and the failure will only happen when the "c_avx512" is enabled. The `b3sum` crate will still fail to build on nightly, because it enables that feature, but most callers should start succeeding on nightly.
…bled rust-lang/rust#68905 is currently causing nightly builds to fail, unless `--no-default-features` is used. This change means that the default build will succeed, and the failure will only happen when the "c_avx512" is enabled. The `b3sum` crate will still fail to build on nightly, because it enables that feature, but most callers should start succeeding on nightly.
Changes since 0.1.4: - Remove all AVX-512 code from builds with the default feature set. This works around rust-lang/rust#68905 and fixes the nightly build as long as the "c_avx512" feature is not activated. This release is a backport of a single commit, e43a7d6. The master branch contains backwards-incompatible changes (fc219f4), and the next release of master will be version 0.2.0. Note that the `b3sum` crate activates the "c_avx512" feature by default, and it will continue to fail to build on nightly until the upstream bug is fixed.
A quick search through https://github.com/search?q=is_x86_feature_detected%21%28%22avx512f%22%29&type=Code turns up at least one other crate besides BLAKE3 that fails to build on nightly for this reason:
|
@Mark-Simulacrum, this might be a hi-pri regression. (Though of course I'm biased cause it affects my crate.) If @gnzlbg isn't available to evaluate it, could we pull in someone else? |
cc @rust-lang/libs To be honest I'm not even entirely sure where this macro is implemented... |
Caused by rust-lang/stdarch#739, which started enforcing stability on individual features. |
It looks like a crater run was done in September, but the |
Seems like there was no discussion done of whether this would break folks (or at least I can't find it). Clearly this is "permitted" under a strict interpretation of our stability rules, though is not documented on the macro at all; the docs list avx512f with no warning that it is unstable. That at least sounds like a bug. I guess someone (libs team?) needs to make a call on whether this is a bug, and whether we should fix it. |
Considering that this broke two crates on stable, I think we should just go ahead and stabilize the avx512 features. I don't think there is any particular reason for holding back on them. |
(nominating to try to ensure T-libs resolves this in some manner before this hits stable.) |
Even if we don't want to stabilize the intrinsics themselves for whatever reason, it seems fine to allow detection of avx512 support via the macro. |
Could someone on T-libs fcp a stabilization for the following x86 features, which have been destabilized in nightly:
https://doc.rust-lang.org/nightly/std/macro.is_x86_feature_detected.html#supported-arguments Once we get the ball rolling on that, I can work on trying to fix whatever the root cause of this destabilization is. |
(Or, if we don't want to stabilize all of them, and want to say "oh well breaking change", then that would be helpful too). |
Also see #60109: there was an approved FCP to stabilize adx, tbm and sse4a but it got closed because the PR author was inactive. |
According to rust-lang/stdarch#310, it seems that a lot of AVX512 intrinsics are missing from I think the best approach would be to stabilize avx512 only for Any thoughts @rust-lang/libs @gnzlbg? I will write up a PR for stdarch if there are no objections. |
It seems to me that stabilizing I'd be more skeptical of blanket stabilizing a bunch of parameters to
Definitely agree here. |
triage: After spending a while explaining this bug to @spastorino , I figured I should take the plunge and mark this as P-high. (I'm not 100% sure if it is a release blocker per se, but my interpretation of the comments above is that we would prefer to either land a fix for this before beta is cut or, failing that, prioritize a backport to the beta branch, so that the bug itself never hits stable.) |
OK, let's try to make some progress on this. I'd like to propose stabilizing the following features for feature detection only:
The SSE4a and TBM features were already scheduled to be stabilized in #60109, but the PR got abandoned. Only a subset of the AVX512 features are listed here because there is some uncertainty with the newer ones as to whether they should contain an underscore: @rfcbot fcp merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rust-lang/stdarch#842 is now up to speed with @Amanieu's proposal above. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
As of the 1.42 release today, |
is_x86_feature_detected!("avx512f")
fails to build on nightlyis_x86_feature_detected!("avx512f")
fails to build on beta and nightly
…#842) * re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 #739 added per-feature stabilization of runtime CPU feature detection. In so doing, it de-stabilized some detection features that had been stable since Rust 1.27.0, breaking some published crates (on nightly). This commit re-stabilizes the subset of AVX-512 detection features that were included in 1.27.0 (that is, the pre-Ice-Lake subset). Other instruction sets (MMX in particular) remain de-stabilized, pending a decision about whether should ever stabilize them. See rust-lang/rust#68905. * add a comment explaining feature detection stability * adjust stabilizations to match most recent proposal rust-lang/rust#68905 (comment)
PR to update the submodule is here: #70151 It will need to be backported to beta. |
rust-lang/rust#68905 is fixed as of rustc 1.44.0-nightly (38114ff16 2020-03-21). Closes #3.
The following program builds and runs on stable but fails to build on nightly:
Here's the build error on
rustc 1.43.0-nightly (58b834344 2020-02-05)
:But note that if I replace
"avx512f"
with"avx2"
, the error goes away.The text was updated successfully, but these errors were encountered: