pschanely / CrossHair

An analysis tool for Python that blurs the line between testing and type systems.
Other
1.03k stars 49 forks source link

Cover example differs #316

Open isidroas opened 2 weeks ago

isidroas commented 2 weeks ago

When doing the example of https://crosshair.readthedocs.io/en/latest/cover.html , I noticed that the result is different:

$ crosshair cover foo.py
average([0.0], default=float("inf"))

To get the same results I had to increase the iterations:

$ crosshair cover --max_uninteresting_iterations 15 foo.py
average([0.0], default=float("inf"))
average([], default=0.0)

$ crosshair cover --max_uninteresting_iterations 19 foo.py
average([0.0], default=float("inf"))
average([], default=0.0)
average([], default=None)

offtopic: Thank you for this very curious library!

pschanely commented 1 week ago

Ah, yes, as of recently, CrossHair attempts true floating point semantics. That's good, but it's made this example take longer. I'll update the example soon. (or maybe tweak the heuristics)

offtopic: Thank you for this very curious library!

😊 If you end up trying it out, I would love to hear more about what works well for you, and what doesn't!

pschanely commented 2 days ago

Update: I am delaying a documentation fix for this slightly, under the hope that one of my unrelated arcs of work makes it not necessary. 😄