-
Notifications
You must be signed in to change notification settings - Fork 15
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
When using shuffle, Holmes can't always find a solution #13
Comments
Yikes! My sample of 100 runs got 67 failures, which is definitely not good... So, every time a failure is encountered, the library "blames" a subset of the configuration, and knows that any future configuration involving that subset can be discarded. For example, if a failure occurs because variable Because we can't "inspect" functions*, we can't see the constraints in play, so we can't confidently discard every configuration in which Clearly, in this situation, our conservative strategy of eliminating candidate configurations hasn't been conservative enough! My guess is that the subset of configuration being "blamed" for a failure is too small - some variable is having an effect on a computation, but that isn't being recorded. In theory, we can write a pretty concise property test: if I take any random problem, and solve it with and without shuffled input, the set of solutions should always be equivalent. However, I suspect this will turn out to be a bit of a Heisenbug... I'll look into it this week, and hopefully get to the bottom of it. It definitely doesn't seem to be anything suspicious in your code (typically, a call to One question occurs, though the answer should definitely be "yes": when it does succeed, do the solutions satisfy your constraints? Sorry about this - I'll get back to you ASAP 😅 * While true, there are sneakier ways round this that I'm currently researching (https://github.com/conal/concat/) |
Thanks for looking into it. There is absolutely no need to be sorry by the way, I'm having fun trying to understand how this all works, thanks for enabling that! So far, the solutions that were found are indeed correct. |
AFAICS, the problem is that the shuffling (performed by holmes/src/Control/Monad/MoriarT.hs Lines 203 to 210 in 16e9acb
|
Just popping in to say that this library is undergoing a major (albeit very slow) rewrite - I haven't forgotten this 😅 @ju1m What you say makes sense, though - I'll try to take a look this week (emigrated to Spain last Wednesday, so life is a little hectic!) |
@i-am-tom, you should be able to observe that behavior as I did with a few |
I've put my debugging code here: ju1m@debfeac $ cabal run examples >shuffle-noguard.log
$ grep 'index=.*(20,' shuffle-noguard.log
index=[([(20,True)],[Water]),([(20,False)],[Air])]
index=[([(20,True)],[Water]),([(20,False)],[Air])]
index=[([(20,True)],[Water]),([(20,False)],[Air])]
index=[([(20,True)],[Water]),([(20,False)],[Air])]
index=[([(20,True)],[Air]),([(20,False)],[Water])] |
See https://github.com/olivierdeckers/holmes/blob/aquarium-example/examples/Aquarium.hs for an example
when running
solve example4
, it sometimes returns the solution, and sometimes returnsNothing
.The text was updated successfully, but these errors were encountered: