-
Notifications
You must be signed in to change notification settings - Fork 17
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
Refactor IOSimPOR #114
Refactor IOSimPOR #114
Conversation
This allows us to use `tasty-1.5`.
a71aef7
to
135e42a
Compare
With unsafeInterleaveSTconjoinParST :: TestableNoCatch prop => [ST s prop] -> ST s Property
conjoinParST sts = do
ps <- sequence (unsafeInterleaveST <$> sts)
return $ conjoinPar ps
Note: on a machine ith 12 physical cores, 24 CPU threads. Without unsafeInterleaveSTconjoinParST :: TestableNoCatch prop => [ST s prop] -> ST s Property
conjoinParST sts = do
ps <- sequence sts
return $ conjoinPar ps
|
135e42a
to
5aec9e9
Compare
Any idea why the with/without |
5aec9e9
to
5bd2d80
Compare
No, it's a bit surprising. When I run it now I get similar results. Different test case, and previously I was running with Par
Seq
|
27c6367
to
a976591
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Just a couple of comments
Added `BlockedOnDelay` and `BlockedOnThrowTo` instead of `BlockedOnOther`.
Instead of using `forkIO` & `threadDelay` it's more robust to test with `async` and `wait`.
This allows to show more compact information about execution. It's useful for debugging IOSimPOR.
We report `EventTxWakup` in the thread that waken up the thread, but we report the `ThreadId` of the awaken thread. Including step of the executed thread is misleading.
This is only useful for debugging `IOSimPOR` issues.
The original type clashes with `ThreadId` type class from `io-classes` which is in particular annoying when pasting `ControlSchedules` in `ghci` or counterexamples.
Consider the following sequence of events x ⋮ y ⋮ z If x is racing with z, we will reverse x and z (e.g. postpone x after z). If y is also racing with x, then we should not include in the schedule any event which happens after it. Originally we used a policy to remove y's thread from the list of racing threads with the x's thread. But this turns out to be too week. While we are visiting new events we need to remove their threads as soon as the event happens after any of the so far discovered races. Otherwise we can end with a schedule which contains events that can only happen after the racing event was executed, and thus likely will block and violate internal invariant: all steps which we follow should be in the runqueue (e.g. should not be blocked).
Note: `deschedule` is traced by the caller, not by itself.
This makes it much easier to debug ones. In the future we might turn more assertion failures into `FailureInternal`.
Unlike `exploreSimTrace` it allows to run an `ST` action in the context of each schedule, and thus allows to share state between schedules. For this reason it evaluates each schedule sequentially, while `exploreSimTrace` evaluates each schedule in parallel. This patch also makes the API more uniform by exposing: * `exploreSimTrace` & `exploreSimTraceST` * `controlSimTrace` & `controlSimTraceST` This patch also removes parallel evaluation of different schedules. Furthermore the tests are updated and they no longer use `unsafePerformIO` as well. The `traceCounter` property was removed as it wasn't used and doesn't make much sense, since `IOSimPOR` is forcing to evaluate each schedule only once by using a cache.
This should be exposed as part of the `newTimeout` API.
This can be added to `.hlint.yaml` file (we do not checkout it to the git repo, but one can add it to one of the `.gitignore` files).
a976591
to
5d15651
Compare
@bolt12 I addressed your review. I accepted most of your comments, the one that I challenged I left opened. |
A long list of self contained patches. See
CHANGELOG.md
for a short description of all the changes.