-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Fixed wrong division hack #2413
Conversation
The numerator can be negative, thus the bit-hack yields wrong results.
While hunting this bug I tried several things (although in hindsight it's quite obvious that the wrong use of the bit-hack is the bug), amongst others disabling SSE with this Line 2 in 0a1f05b
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<RunConfiguration>
<!--Used in conjunction with ActiveIssueAttribute to skip tests with known issues-->
<TestCaseFilter>category!=failing</TestCaseFilter>
<EnvironmentVariables>
<DOTNET_EnableSSE>0</DOTNET_EnableSSE>
</EnvironmentVariables>
</RunConfiguration>
</RunSettings> and more tests started to fail -- even when going back before #2401 (e.g. to 5283d77). To me it looks like there are latent bugs in the scalar code-pathes. Can anyone confirm? Should I open a separate issue to handle these (potential) failures? |
No need to be sorry here, it happens, no problem.
ARM CI runner only runs when the PR is tagged with ARM. That's a compromise we need to make, because it costs us money to run those ARM CI runner. I know that's not ideal, but usually changes to ARM code was very rare in the past.
Yes please open a issue for that, we should investigate that. We have a code coverage report, I will look into the report tomorrow and see if we would have known that its not covered. One thing I would like to have is a simple unit test for |
It's a private method
So for my PoV
I know, but my own quality standard shouldn't allow such a mistake 😁 |
Ah, yes your right, I overlooked that it's private. |
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.
@gfoidl thanks for looking into this issue and providing the fix.
Prerequisites
Description
In #2401 I introduced a bug (sorry for that) -- this PR fixes that.
The bit-hack for divison by powers of two is only valid for positive numerators, and in the failed testcase (cf. #2409 (comment)) it was negative. As showcase see this sharplab.
Note to maintainers: please run CI on ARM too (as I understand that's not on by default, so that bug even came into main-branch)