-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Portable SIMD subtree update #135701
base: master
Are you sure you want to change the base?
Portable SIMD subtree update #135701
Conversation
Signed-off-by: cui fliter <[email protected]>
…table-simd-2023-11-19
stdarch no longer provide SIMD on big-endian ARM due to rust-lang/stdarch#1484
…table-simd-2024-02-18
…table-simd-2024-03-22
add without_provenance to pointer types
Add loongarch64 vendor conversions
…r=Amanieu rename ptr::from_exposed_addr -> ptr::with_exposed_provenance As discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/To.20expose.20or.20not.20to.20expose/near/427757066). The old name, `from_exposed_addr`, makes little sense as it's not the address that is exposed, it's the provenance. (`ptr.expose_addr()` stays unchanged as we haven't found a better option yet. The intended interpretation is "expose the provenance and return the address".) The new name nicely matches `ptr::without_provenance`.
run Miri tests on CI
Avoid migration pitfall from packed_simd as described in rust-lang#402.
document PartialOrd difference to simd_min and simd_max
Sync 2024-04-09
Sync upstream
Add script for syncing subtree
…m-portable-simd-2025-01-18
rustbot has assigned @Mark-Simulacrum. Use |
Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead. |
Could not assign reviewer from: |
This comment has been minimized.
This comment has been minimized.
that shouldn't happen from a merge conflict since all that does is change the tree you end up with in the merge commit. you'd get duplicate commits if you did any rebasing (which it sounds like is what happened before). duplicate commits may also be fine and expected (I'm not 100% sure since I last researched subtrees a while ago...) |
Ah, so rebasing subtree pushes in the past (not the most recent one) was a mistake because it rewrote that commit. That makes sense. I wonder if there's a fix now |
I think the fix is probably to say oh well, we messed up before, we'll just end up with some duplicates but if the final repo contents is as expected then it's mostly ok since that's what matters most rather than having perfect git history |
The Miri subtree was changed cc @rust-lang/miri |
Ready to merge this as long as @rust-lang/miri is ok with removing those test cases. We now only provide bitmasks to u64 and expect users to use lane shifting + bitmask to get beyond the first 64 lanes. |
portable-simd doesn't use The |
But why would there have been rebasing? You didn't recently change the subtree workflow, did you? Are you sure this will not keep causing issues for future syncs? Better test what happens when you merge this PR into the main repo and then sync that back, and vice versa. This subtree sync looks rather strange so something odd might be going on. The duplicated commits go all the way back to 2023! I assume there have been other syncs since 2023. So why were they not affected? Clippy used
The question is, will the next syncs in both directions actually work, or will there be more duplication? This should be tested. With |
// This used to cause an ICE. It exercises simd_select_bitmask with an array as input. | ||
let bitmask = u8x4::from_array([0b00001101, 0, 0, 0]); | ||
assert_eq!( | ||
mask32x4::from_bitmask_vector(bitmask), | ||
mask32x4::from_array([true, false, true, true]), | ||
); | ||
let bitmask = u8x8::from_array([0b01000101, 0, 0, 0, 0, 0, 0, 0]); | ||
assert_eq!( | ||
mask32x8::from_bitmask_vector(bitmask), | ||
mask32x8::from_array([true, false, true, false, false, false, true, false]), | ||
); | ||
let bitmask = | ||
u8x16::from_array([0b01000101, 0b11110000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); | ||
assert_eq!( | ||
mask32x16::from_bitmask_vector(bitmask), | ||
mask32x16::from_array([ | ||
true, false, true, false, false, false, true, false, false, false, false, false, true, | ||
true, true, true, | ||
]), | ||
); |
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.
As far as I can tell, this just tests from_bitmask_vector
, so yeah if that API is gone we can remove the test. We still also directly test the intrinsic.
Does this mean simd_select_bitmask on an array is no longer used? What about simd_bitmask with an array?
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.
Neither intrinsic is used with arrays anymore. The limitation was const generics on the API so I could see it coming back at some point in the future, though
No problem, I just searched zulip for subtrees and it seemed you discussed it a lot, but admittedly in the context of josh. (Once we get this all fixed, switching to josh would be nice...) The rebasing was mostly a mistake, @workingjubilee and I have manually done subtree syncs and I know I have rebased a couple times. I only just added a sync script to ensure we get this right in the future and that's how I discovered it. I think this won't be a problem in the future. I know if I do a subtree push now (rust -> portable-simd) the branch it creates is identical to master. Using josh to rewrite bad commit history sounds like a good idea, but I think we would need to at least merge this PR because the portable-simd changes would need to be part of that, right? |
I didn't suggest that so I don't know what you are referring to here. I have no idea how josh will react to these odd duplicated commits if you want to migrate to josh in the future. They will definitely also be duplicated in the portable-simd repo then, and maybe that's it, or maybe it causes more problems -- hard to say without trying.
But then why is this the first time we see duplicated commits? Or is it not the first time? |
Sorry I was referring to rewriting portable-simd's history:
I think we ultimately want portable-simd's history to look like this repo's, whether that includes these duplicate commits or not. I don't remember seeing this kind of duplicate commit in the past, but if there were any, they're part of this repo already. I'm guessing we just got lucky, because we try to avoid pushing changes to this repo instead of portable-simd. My main concern is I don't feel confident that I could fix the portable-simd repo (my limited git ability got us in this mess 🙂). I would like to merge this as-is (and accept these duplicate commits), and then make sure we either use the sync script or preferably switch to josh to avoid it in the future. I'm just not ready to merge this without getting some more input. |
That would be a manually constructed force-push to before the rebased PR got merged. Josh isn't used for the rewriting, the rewriting is done to make Josh work again. ;) |
Here's the complete list of duplicated commits in portable-simd:
A bunch of them are in this PR, but some of them predate this PR as well and are already in this repo somewhere.
So, do I try to fix everything from around July 2023 for this PR? |
Spot-checking two of them, I found clippy and cranelift. So seems like other |
r? @workingjubilee