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
Inconsistent results of two equivalent programs #101
Comments
Ahh, this is a bit hard to debug. One thing though is that Don't worry about the program being too big. If it is indeed a bug, it needs fixing. The worst thing a database can do is to give wrong outputs. Meanwhile, there is a way to get more information:
|
FYI these are the values at the strata boundary:
It's a bit hard to read, but here When I have some larger chunk of time I will try to disable the semi-naive rewriting and see if the result is the same. Then we can get a focus on what the problem really is. On a side note, there is a new feature in the dev version of the Python client to generate query strings programmatically here. I think this might be of interest to you. |
I've found the root cause. It's a bit hard to explain, but the following is a truly minimal example:
The result should be Technically, this is due to the implemented semi-naïve algorithm failing to handle a corner case where a relation is used multiple times within. Regardless, a fix is on the way! Thanks so much for the finding, this bug is so convoluted that I don't think it will ever be noticed if one just casually looks at the results (but it will definitely produce wrong results in the real world when the queries become complicated enough). |
Hi @zh217
Thank you very much for your good advices, currently I am implementing a randomly Datalog generator, I will refer to your advice. So happy this report is useful to you, I will debug the test case before report next time. Thank you for fixing it! |
The method we used to find this bug has been published at OOPSLA2024, this is the preprint version of our paper https://arxiv.org/abs/2402.12863 |
Hi,
Consider the following program:
I got the following results on this program:
I also tried to get the values for
ijem
,sumu
, andmkfn
, which were the subgoals in the last rule, and got the following results:Then I use these values to construct an equivalent program, which only include the last rule:
But I got the following results, which were different from the original one:
As
cpoc
only appears once in the program, so I expect these two results should be the same.(So sorry that this program is too big. This is already a reduced version, but I am still working on a simpler one, but there are some recursive queries in this program, so it is a little hard to reduce it.)
The text was updated successfully, but these errors were encountered: