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

Implement true floating point semantics #230

Closed
pschanely opened this issue Nov 16, 2023 · 2 comments
Closed

Implement true floating point semantics #230

pschanely opened this issue Nov 16, 2023 · 2 comments

Comments

@pschanely
Copy link
Owner

One big gotcha with CrossHair and floats: For performance reasons CrossHair approximates floating point behavior using true (arbitrary precision) real numbers.

Z3 is technically capable of doing floating-point-accurate symbolic execution. However, those capabilities are very slow; it might take O(minutes) to reason about a single floating point operation. In an ideal world, we might try both approaches.

Originally posted by @pschanely in #188 (comment)

@pschanely
Copy link
Owner Author

@Zac-HD and anyone else following along: I've been busy working on this recently. I can safely say that this mode will be quite slow, and suspect that the conversions between floats and unbounded integers (which are uniquely bountiful in Python) could turn even simple cases to impossible. Still, I think some use cases could benefit from it, and then we'll be prepared for advances on the solving side.

Hoping to have something by this weekend!

@pschanely
Copy link
Owner Author

pschanely commented Sep 23, 2024

I have an initial version shipped in 0.0.72; this version will, with a low probability, attempt executions down a parallel path tree that implements true-float semantics instead of the real-based ones. The main thing I'm still missing is something to validate real-based executions. In other words, this version attempts to find bugs that the previously implementation missed, but does not help with false positive reports. I'll address those in #309.

@Zac-HD Although this should fix a test or two, there's a good chance that I'll regress on a few, due to the shiny new surface area for bugs.

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

No branches or pull requests

1 participant