Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Integer divsion might panic if null values in array: unchecked division #437

Closed
ritchie46 opened this issue Sep 22, 2021 · 0 comments · Fixed by #438
Closed

Integer divsion might panic if null values in array: unchecked division #437

ritchie46 opened this issue Sep 22, 2021 · 0 comments · Fixed by #438
Labels
bug Something isn't working no-changelog Issues whose changes are covered by a PR and thus should not be shown in the changelog

Comments

@ritchie46
Copy link
Collaborator

ritchie46 commented Sep 22, 2021

The null values are often ignore in a division operation. This allows for less branching and thus more performant vectorized execution.

However the values behind the null mask often are zero. If we do integer division, this panics, even though the values are "masked out/invalid". I wanted to add https://doc.rust-lang.org/nightly/std/intrinsics/fn.unchecked_div.html but that is nightly only. :(

I don't know if there is a stable way to do unchecked division.

_edit:
Another option might be a more expensive division implementation where we take slices of valid values and only impelment the division on those.
_

@ritchie46 ritchie46 changed the title unchecked division Integer divsion might panic if null values in array: unchecked division Sep 22, 2021
@jorgecarleitao jorgecarleitao added the bug Something isn't working label Sep 22, 2021
@jorgecarleitao jorgecarleitao added the no-changelog Issues whose changes are covered by a PR and thus should not be shown in the changelog label Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working no-changelog Issues whose changes are covered by a PR and thus should not be shown in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants