Adjust test_FI_div_zero_result_top
QCheck test property to account for the 0/0 case
#1778
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.
The forthcoming QCheck 0.26 release ocaml/opam-repository#28148 changes the distribution of the
float
generator to avoid blind spots: c-cube/qcheck#350. As a consequence, an existing goblint analyzer test now fails to hold, resulting in:This PR first patches the
arbitrary
generator to use the existingshow
function to print counterexamples:Second, it patches the property of the mentioned QCheck test to account for the [0.;0.] / [0.;0.] case.
Here, I was guided by the unit test above already exercising this corner case:
analyzer/tests/unit/cdomains/floatDomainTest.ml
Lines 103 to 109 in f2c4520
In retrospect, I can see the
arbitrary ()
generator produces random intervals by mappingconvert_arb
over a pair of randomfloat
s. The chance of producing a unit (const) interval with that strategy is close to zero. 🤔I believe the change of distribution (and the ability of emitting
nan
) is the reason why the failure started to trigger with QCheck 0.26:I therefore encourage you to investigate the distribution of the generator. I just adjusted the output of
collect
stats in QCheck 0.26 c-cube/qcheck#351 which lends itself to a nice "top", "bot", "const", "non-const" classification... 🤓 😅