-
Notifications
You must be signed in to change notification settings - Fork 579
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
Various core and test changes #3835
Conversation
…void multiple draws
Looks like |
Hmm, good question! IIRC we used 2**24 as a special value because it ensured that unicode characters were chosen without (additional) bias. I'd probably leave it alone for now, but we should do an audit of this kind of heuristic once we're using the IR everywhere - there are probably a bunch we'll be able to clean up then. General thoughts on this PR: looks good to me. Two approaches you can take to this kind of pulled-out stage are to (1) defer anything that we can't merge ~immediately to a future PR, or (2) keep working on it here until it passes to make future PRs easier. I generally favor a bit of (2) followed by (1) if I'm feeling stuck or just slowed down; it's basically the same question as pulling out part in the first place 😁 |
that approach makes sense 👍. In this case I didn't get stuck for too long on The solution? Make the property even harder to shrink to a normalized value. |
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.
🎉
while data.draw_bits(2) == 3: | ||
# TODO this test fails with data.draw_boolean(0.25). Does the hill | ||
# climbing optimizer just not like the bit representation of boolean | ||
# draws, or do we have a deeper bug here? | ||
while data.draw_integer(0, 3) == 3: |
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.
I'm trusting you to track this; I'd probably link to this code from a comment on the IR issue after merging.
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.
left a task in the pr description 👍 (less likely for me to lose it than a comment, and github doesn't easily let me leave reviews on unrelated files.)
Split from #3818. I could split this further if desired, with all the
draw_bits
changes in a single PR.Changes:
draw_bits
in various test files in preparation for its removal. Or at least, taking a back seat relative to the ir.There were some test changes where the extra boolean draw from > 24 bit integers caused the test to fail.
hypothesis/hypothesis-python/src/hypothesis/internal/conjecture/data.py
Lines 1260 to 1262 in 980042e
I mostly remedied this by reducing the bit size down to 20 for these tests. It does make me wonder if we're doing the appropriate thing by biasing the distribution in this way at the ir level, rather than at the strategy level (
integers()
).