-
Notifications
You must be signed in to change notification settings - Fork 589
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
Migrate generate_novel_prefix
to the typed choice sequence
#4172
Conversation
6fa49d3
to
1c32ba9
Compare
OK, I think I clearly need to split this out into (1) implement |
1c32ba9
to
22624e1
Compare
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.
Exciting times!
hypothesis-python/src/hypothesis/internal/conjecture/datatree.py
Outdated
Show resolved
Hide resolved
# TODO_IR the shrinker gets stuck when the first failure is math.inf, because | ||
# downcasting inf to a float32 overflows, triggering rejection sampling which | ||
# is then immediately not a shrink (specifically it overruns the attempt data). | ||
# | ||
# this should be resolved by adding float widths to the ir. | ||
assert xp.sum(smallest) in (1, 50) or all(math.isinf(v) for v in smallest) |
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.
Ouch! Makes sense, but it's going to be pretty annoying especially with #3959 on the wishlist...
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.
yeah...I can take a look at that issue ~next. It will either be relatively simple (downcast at the ir layer and float_to_int "just works") or very annoying because of solved-by-ir interactions.
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.
If it doesn't turn out to be simple, I'd leave it for later - finishing off the IR migrations is higher priority.
TIME_INCREMENT = 0.001 | ||
TIME_INCREMENT = 0.0001 |
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.
Say more about what prompted this?
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.
NodeTemplate("simplest", ...)
uses buffer_to_ir
which instantiates ConjectureData
which calls time.time()
, invoking _consistently_increment_time
even though little work is actually happening. post-IR we should be able to revert this.
Depends on #4173. Uses
NodeTemplate
to implement "please give me the simplest possible node".Changing the randomness interpretation in the prefix flushed out a few (likely latent?) issues with our deterministic
with deterministic_PRNG
tests. I've marked these, and plan to return to them when the ir settles, but can bump them up in priority if you think they're important.