Skip to content

Conversation

LegNeato
Copy link
Collaborator

@LegNeato LegNeato commented Oct 9, 2025

We assumed every array/vector/matrix element has a non-zero stride, but [()] inside BitSlice produced a zero stride which then divides by zero.

Fixes #424.

We assumed every array/vector/matrix element has a non-zero stride,
but `[()]` inside `BitSlice` produced a zero stride which is divide by zero.

Fixes Rust-GPU#424.
Copy link
Member

@Firestar99 Firestar99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goods good!

Maybe we should also add a difftest with bitvec to just test the common functionality? Like I did with #328 (but never fixed all the issues it presented)

@Firestar99 Firestar99 changed the title Fix divide by zero Fix divide by zero ICE Oct 9, 2025
@Firestar99 Firestar99 added this pull request to the merge queue Oct 9, 2025
Merged via the queue into Rust-GPU:main with commit 56cc132 Oct 9, 2025
13 checks passed
@Steveplays28
Copy link

Thank you for the fix!

@LegNeato LegNeato deleted the issue424 branch October 9, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrapping a bitvec::slice::BitSlice in a struct causes an ICE (attempt to divide by zero)

3 participants