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

Ensure independence in QCheck2's monadic combinators #317

Closed
jmid opened this issue Jan 22, 2025 · 0 comments · Fixed by #318
Closed

Ensure independence in QCheck2's monadic combinators #317

jmid opened this issue Jan 22, 2025 · 0 comments · Fixed by #318
Labels

Comments

@jmid
Copy link
Collaborator

jmid commented Jan 22, 2025

On https://discuss.ocaml.org/t/ann-bam-a-property-based-testing-with-internal-shrinking/14661/3
there was a bug report about QCheck2's monadic operators, mistakingly filed as a Discuss comment: 😏

This makes the writing of generators easier, the shrinking is internal ensuring the shrinking won’t new random values. If you use the mondic operator of QCheck2, last time I checked it was not the case. This is why to create a generator for a pair, it is recommended to use tup2 instead of monadic operators.

I believe the problem is that QCheck2 fails to use split on the underlying RNG, so that both sides of, e.g., >>= / bind can operate on the RNG state independently without RNG queries on one side affecting the RNG state of the other side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant