-
Notifications
You must be signed in to change notification settings - Fork 54
rustup: update to nightly-2025-05-09
(~1.88) and Rust 2024 edition.
#249
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
base: main
Are you sure you want to change the base?
Conversation
88fd99e
to
554d850
Compare
…allowing libcore to build.
Thanks for getting us up to the newest versions! 🎉 |
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.
Some minor comments. I liked how many of your changes are better than mine ha. Only rejecting so it doesn't merge and others can review.
@@ -276,6 +317,12 @@ mod maybe_pqp_cg_ssa; | |||
|
|||
println!("cargo::rustc-check-cfg=cfg(rustc_codegen_spirv_disable_pqp_cg_ssa)"); | |||
|
|||
// HACK(eddyb) `if cfg!(llvm_enzyme)` added upstream for autodiff support. | |||
println!("cargo::rustc-check-cfg=cfg(llvm_enzyme)"); |
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.
Oh cool, I didn't know you could put those here.
// --- Attempt GEP Merging Path --- | ||
|
||
// Check if the base pointer `ptr` itself was the result of a previous | ||
// AccessChain instruction. Merging is only attempted if the input type `ty` | ||
// matches the pointer's actual underlying pointee type `original_pointee_ty`. | ||
// If they differ, merging could be invalid. | ||
// HACK(eddyb) always attempted now, because we `pointercast` first, which: |
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.
Just update the comment rather than having a new comment modify...we have git 😄
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.
To be clear, when I do this it's because I'm already several steps deep and accurately rewording comments might not be the easiest/quickest thing at that moment (but I agree I could/should fix it before landing the PR).
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.
Or just delete the comment!
@@ -908,12 +910,21 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | |||
// 2. The *last* index of the original AccessChain is a constant. | |||
// 3. The *first* index (`ptr_base_index`) of the *current* GEP is a constant. | |||
// Merging usually involves adding these two constant indices. | |||
// | |||
// FIXME(eddyb) the above comment seems inaccurate, there is no reason |
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.
Again, just fix or delete the comment.
Did a quick test of this branch and get a ton of:
Also when you first update to this PR, cargo errors telling you that your rustc version is too old for edition 2024, cause it's still locked to the master nightly. I usually figure out what the new nightly is by running it, making updating a bit weird, as I first need to switch to eg. stable just to get the correct version displayed. Just something to watch out for, as other people updating may experience this over the next few months. (Except cargo gpu users, for them it should be flawless) |
Oh, that's cursed, I wish we could completely avoid
As for the pointer errors: if that's some straight-forward (If you have the patience, you could probably use some of the commits to bisect at least among the nightlies I had passing all tests, to narrow down the breakage - or I could try building your project myself, if that's simpler overall etc.) |
I don't think we have any users on 0.9 so I wouldn't worry about it. We can just document what is going on, and cargo-gpu will help eventually. |
Oh you wouldn't believe the amount of people that prefer to use a 2 year old outdated version over the master of a repo 😅 |
I can have a look at bisecting the error or making a minimal repo, though currently I'm slightly sneezy. But if you already want to take a look, changing the rev in the root workspace and |
bisected it for you:
|
cargo gpu: This is the first PR to update the target spec jsons, which causes cargo gpu to run into some trouble. The codegen backend verifies that these jsons match exactly what it expects, and there's no flag to skip that check, and adding one now wouldn't help since we want to keep compatible with at least 0.9.0. Cargo gpu was never designed to have multiple target-spec versions, it always just used the latest. Now we need to manage two different target spec json versions if we want to be compatible with before and after this change. We also can't easily extract the json from the |
cargo gpu solution: Could we move the target jsons from That would require merging this move of target jsons before this PR is merged, to not have a hole of unsupported commits on master. I'll have a look at implementing this tomorrow. |
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.
changing target jsons breaks cargo gpu, see #249 (comment)
(just to prevent this from merging)
This PR supersedes (and includes many of the changes from):
nightly-2025-04-28
#246This brings us 4 whole Rust releases ahead, to a 1.88-equivalent nightly.
(Rust 1.88.0 stable will be released on June 26th, 2025)
The many commits exist in part because of nightly bisection (to find
nightly-2024-12-16
, containing the GEP array change), but also because there have been several changes of note:unknown
unknown
component in e.g.spirv-unknown-vulkan1.1
is the vendor, whereas the OS isnone
and omitted in the "triple")maybe_inbounds_gep
had to be made more flexible, due to:Modifies the index instruction from
gep [0 x %Type]
togep %Type
rust-lang/rust#134117pointercast
first, which can itself produce a "first element of array" GEP that can then be merged with an "intra-array indexing GEP")f16
/f128
required some stubbing out (i.e. intrinsics)f16
, but I've not attempted that in this PRbool
(i.e. makingOption<bool>
byte-sized), due atransmute
(fromControlFlow<bool>
tou8
) added tocore::cmp
in:Use the chaining methods on PartialOrd for slices too rust-lang/rust#138881
Option<bool>
ever worked in Rust-GPU (the comments I found are confusing, I thought it had users and/or tests, but maybe not)rustc_codegen_ssa
patching)rustc_codegen_ssa
patching (akapqp_cg_ssa
). #182)rustc_codegen_spirv
had to be switched to the Rust 2024 edition (asrustc_codegen_ssa
had done the same upstream)#[repr(simd)]
(using individualstruct
fields) has had even more support ripped out upstreamrustc_codegen_ssa::back
(i.e.object
) required more patching to remove their use sitesobject
, breakingextern crate object;
(as it may load the wrong version)nightly-2025-04-28
#246(before all the other issues were discovered through testing)
While not necessary, this (just like #246) includes a full migration of the entire workspace to Rust 2024 (leading to lots of
unsafe {...}
inunsafe fn
s inspirv-std
, mainly) - we can split that out if it seems better, but I at least tried to keep it in its own commit.