-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fp.rem is producing incorrect result #2381
Comments
Hi Christoph, Hate to bug you about this; any chance this might be addressed soon? |
Unlikely; I'm super busy with unrelated projects and I'm not 100% sure this is a bug yet. Is there an actual application that depends on this or are there just randomly generated testcases you'd like to fix? |
Hi Christoph. It's part of an extended test-suite; hard to tie it to any particular application, but rather making sure basic floating-point operations work correctly. Regarding whether it's a real bug; I'm pretty sure it is. In fact, z3 itself acknowledges that the generated model is invalid:
Perhaps the issue is somewhere else other than
This one also produces an invalid model. But if you directly substitute
it then produces a valid model. So, perhaps the issue is lying elsewhere other than |
The simplifier (concrete) and the bit-blaster (symbolic) have very different implementations. If it's a bug, it's definitely in That said, I don't get any model validation errors, neither on the original benchmark nor on the other ones, with |
I'm running with z3 compiled from github sources on August 10; which does produce the model-validation errors. (I also have a higher-level model-validator which agrees with it.) I'm curious if your version of z3 is not latest from the master, perchance? |
It was the latest from my-fork master, but not from public-fork master. |
@LeventErkok I see very strange behavior on your initial test case when I print all the variables:
It looks like |
@wintersteiger Yes; I see exactly the same. In particular |
Yeah, something's seriously wrong here! |
Fix pushed, thanks for the report! |
Hi Christoph. Thanks for looking into this! I'm afraid the fix didn't quite handle the problem. Here's another case where it is still failing:
I get:
The benchmark is pretty much the same as before; just with different values. Value of |
Doesn't look like a corner-case to me as |
Yes; I can confirm that
This is indeed the correct result that |
No it isn't - it's masked by all the
|
Ah, I see. This must make debugging simplification vs. actual solving hard to debug. I appreciate you taking the time and looking into this. |
Another corner-case. If you have any more regressions, can you please send all of them to me in one go? Thanks! |
Here's another one that's still failing in exactly the same way.
The difference from the previous example here is that I'll try to collect these all and send in one batch later today. |
It also appears the handling of
z3 says |
Isn't |
Ah you're right. It always trips me up. But the negative-value example is still problematic, I think. I'm trying to collect all test cases into one bundle, but it is proving to be surprisingly tricky to do so. |
Yeah, the negation is likely the core of the problem. |
Attached is my entire test-suite for Note that some of these benchmarks run really slow; so you probably want to run them with some sort of a time-out to make sure they don't hog your machine. z3 successfully produces Let me know if you'd like me to prepare another bundle that only produces |
@wintersteiger Should this ticket be re-opened? I understand a fix may not be immediate (or anytime soon!), but at least an open-ticket can help keep track. |
Oh yes, absolutely, thanks for reminding me! |
Here are two additional different instances that may be caused by the same underlying issue. As suggested by Nikolaj, appending them to this thread, rather than opening new issues (and hope they are of use):
|
Progress has been made! @LeventErkok I think yours are all fine now. I didn't wait for it to finish on about 20 of your set, but all the others are unsat. The problem was indeed with that bonus subtraction that I suspected initially. @zhendongsu Your last one has a completely different root cause, likely not related to the bit-blasting of fp.rem. This will take a separate debugging session. |
@wintersteiger Yes! I can confirm my test-suite for |
@wintersteiger
This is most likely downfall from #2369
For this benchmark:
Z3 (compiled about 2 weeks ago) used to produce:
Now it says:
The benchmark is asking for the result of:
where the arguments are single-precision floats. Z3 was previously computing the correct answer:
But now it's simply returning the first argument.
The text was updated successfully, but these errors were encountered: