Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's the basic issue:
When using viewSeed, we need to put an initialSeed in the
Gen.Parameters used to evaluate the Prop, so we can recover
the seed later and display it. So far, so good.
In some cases, we need to "slide" the seed that's embedded
in the parameters, so we don't reuse it. Any time we need
to evaluate several properties and don't want identical
RNG state (which could lead to identical inputs) we need
to slide.
We were missing a "slide" in flatMap -- we were reusing
the same parameters in both cases. Since flatMap was used
to define && (via for-comprehension) that meant that when
you said p0 && p1, you'd use the same seed for both if
viewSeed was set.
Refined's property was unusual, but valid. Basically, one
property had (x >= 0) ==> and one had (x < 0) ==>. So no
single x value would satisfy both, but on average you'd
satisfy each 50% of the time, and together you'd get
a non-discarded case about 25% of the time.
Previously, this worked OK. But since 1.14.0 we started
always displaying seeds. This meant that the bug associated
with failing to slide manifested, and we always generated
the same x value for both sides of the property. This
meant we ended up discarding every x generated.
The fix was to slide correctly in this case. I also added
a toString to Gen.Parameters which was missing, since this
helped with debugging.