-
Notifications
You must be signed in to change notification settings - Fork 22
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
Parallel composition of FixedStep clocks evaluates in unexpected order #365
Comments
Thanks for finding this! I can sort of reproduce, but I'm getting a different (yet still incorrect) scheduling:
|
I have an inkling that this might be an upstream issue in https://github.com/turion/monad-schedule. Let me investigate. |
The problem is not related to the clock structures, since it can be reproduced with automata:
|
Which versions of |
i have rhine ==1.4.0.1 and monad-schedule 0.2.0.1 and i just ran it again and had the same output like you
|
Yes, it unfortunately depends on how fast the GHC IO machine is running. Basically, if there is an IO delay that is too big then an action may fail to even start before the other finishes. In that case, the second one cannot judge whether it should have waited for the first one. |
I don't have a good solution for this other than deprecating the |
ok, thanks for the fast replies! |
I'm afraid this is a known and poorly documented issue in For example:
The issue is that the |
Hah I was mistaken luckily. There is a rare race condition in |
I had hoped that #343 had fixed this. @DISTEL100 What ghc version are you on? Can you clone the |
i am using ghc 9.4.8 and the tests are all passing |
See #377 for an in-depth discussion of the probable underlying issue. |
There seems to be a problem with the parallel clock when composing two pure clocks in
ScheduleT
. The merged output is not ordered by the timestamps.The following is a minimal example to reproduce the issue:
The output is:
ghci> f Left 300 Left 600 Right 500 Left 900 Left 1200 Right 1000 Left 1500 Left 1800 Right 1500 Left 2100 Left 2400 Right 2000 Left 2700 Right 2500 Left 3000 Left 3300 ^CInterrupted.
I would expect it to be
ghci> f Left 300 Right 500 Left 600 Left 900 Right 1000 Left 1200 Left 1500 Right 1500 Left 1800 Right 2000 Left 2100 Left 2400 Right 2500 Left 2700 Left 3000 Left 3300 ^CInterrupted.
The text was updated successfully, but these errors were encountered: