Skip to content
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

floating_dtypes(sizes=(16, 32, 64)) spins endlessly without drawing a value #1982

Closed
rsokl opened this issue May 16, 2019 · 4 comments
Closed
Labels
bug something is clearly wrong here

Comments

@rsokl
Copy link
Contributor

rsokl commented May 16, 2019

The following test appears to run endlessly:

@given(dtype=hnp.floating_dtypes(sizes=(16, 32, 64)))
def test_dtype(dtype):
    assert True

Strangely, any tuple-pair of sizes ((16, 32), (16, 64), etc.) runs without issue.

The brief amount of time I had to step through this with a debugger did not reveal the culprit.

@rsokl rsokl added the bug something is clearly wrong here label May 16, 2019
@DRMacIver
Copy link
Member

I'm prettty sure what's happening is that this is hitting #1864.

@rsokl
Copy link
Contributor Author

rsokl commented May 16, 2019

Is there a reason why specifying only two sizes, versus three, has no issue?

@DRMacIver
Copy link
Member

Is there a reason why specifying only two sizes, versus three, has no issue?

Yeah, it'll happen for any non-power of two sizes, but 3 is the worst. Basically what happens is that there's a rejection sampling loop when that happens and the process for trying to get unique values will get increasingly slow the more iterations the loop has.

That's what made me think it was this (and trying it out makes it look even more likely - it does produce values it just gets progressively slower with each value produced)

@Zac-HD
Copy link
Member

Zac-HD commented May 27, 2019

Closing as duplicate of #1864, to tidy up the issue tracker a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants