Commit Graph

815 Commits

Author SHA1 Message Date
Michael Walker
c1046268e8 Reduce code duplication in *Id types
Closes #137
2017-12-13 07:24:18 +00:00
Michael Walker
4ae16eab64 Make Test.DejaFu.STM an internal module 2017-12-12 14:07:22 +00:00
Michael Walker
81bcb5a351 Split up Test.DejaFu.Common 2017-12-12 14:07:22 +00:00
Michael Walker
5ee2590f0e Rework docs
Closes #146
Closes #147
Closes #156
2017-12-12 14:07:22 +00:00
Michael Walker
988032c9a2 Replace "alwaysTrue2" with "alwaysSameOn" and "alwaysSameBy" 2017-12-12 14:07:22 +00:00
Michael Walker
a30e1617b9 Do not wait for interference thread to terminate 2017-12-12 14:07:22 +00:00
Michael Walker
020e3967f7 Change order of arguments to test functions
1. Discard function (if present)
2. Way              (if present)
3. Memory type      (if present)
4. Name of test
5. Predicate
6. Action

For multi-predicate functions, 4 and 5 are replaced with a list.
2017-12-12 14:07:22 +00:00
Michael Walker
3a534f70fa Add helpers to lift Maybe functions to ProPredicates 2017-12-12 14:07:22 +00:00
Michael Walker
6644bf76ef Remove _casesChecked from Result
It's now almost meaningless how many cases were examined before
finding a failure given that, ideally, only failures will be returned
at all.
2017-12-12 14:07:22 +00:00
Michael Walker
db95dde7df Give predicates discard functions 2017-12-12 14:07:22 +00:00
Michael Walker
6eaae0a589 Wrap predicate functions in a newtype & separate ty params
Also adds a Functor and Profunctor instance for predicates.  The old
predicate type is kept as an alias for the (common) case where both
tyvars are the same.
2017-12-12 14:07:22 +00:00
Michael Walker
3348c4705c Add bound-thread async function variants 2017-12-12 14:06:59 +00:00
Michael Walker
45256193c0 Implement bound threads
This also adds forkOS(N) and isCurrentThreadBound to MonadConc, a
breaking change.

Note: forkOSWithUnmask(N) is NOT added to MonadConc, as it isn't
supported in base-4.8 (GHC 7.10).  See #132 for the action on this.

A bound thread under test gets a dedicated worker thread, which is
forked bound using the underlying MonadConc.  This worker is used for
all lifted actions, with execution as normal otherwise.
2017-12-12 14:06:59 +00:00
Michael Walker
31d29c11ea Require a 'MonadConc n' instance to run 'ConcT r n' expressions
This is preparation for adding bound threads.  The instance isn't used
in this commit, but the diff is large enough that I feel this should
be a separate commit for ease of review.

Fallout:

- The MonadBaseControl IO instance is gone, as I'm not sure how to do
  it generally.
- The pure/IO split is gone, everything is now monadic.
- The execution, SCT, and dejafu functions are of the form (MonadConc
  n, MonadRef r n) => ...
2017-12-12 14:06:59 +00:00
Michael Walker
99cae72b42 Pick version numbers for next-supermajor release 2017-12-12 14:06:59 +00:00
Michael Walker
0c8e387339 dejafu-0.9.1.2 release 2017-12-12 13:51:34 +00:00
Michael Walker
94dfe4b61a Update leancheck dependency 2017-12-12 13:50:35 +00:00
Michael Walker
8c2bf9d784 dejafu-0.9.1.1 release 2017-12-08 14:25:10 +00:00
Michael Walker
4791333dc0 Reduce default number of quickcheck tests in dejafu-tests 2017-12-08 14:21:51 +00:00
Michael Walker
455a0f4ba7 Fix depstate being one step out of sync in backtracking
Fixes #161
2017-12-08 14:21:51 +00:00
Michael Walker
be64ba90ab Add weeder exclude rules for optional dependencies 2017-12-08 14:20:39 +00:00
Michael Walker
d750342c77 hunit-dejafu-0.7.1.1 and tasty-dejafu-0.7.1.1 releases 2017-11-30 22:08:56 +00:00
Michael Walker
fa1836c3a8 Add missing haddock @since annotations 2017-11-30 22:08:38 +00:00
Michael Walker
82966c43f3 hunit-dejafu-0.7.1.0 and tasty-dejafu-0.7.1.0 releases 2017-11-30 21:43:12 +00:00
Michael Walker
417415937a Add testPropertyFor to {hunit,tasty}-dejafu
Closes #159
2017-11-30 21:40:25 +00:00
Michael Walker
e2a8882764 concurrency-1.2.3.0 release 2017-11-30 21:25:51 +00:00
Michael Walker
e408dcb40b Add named-thread variants of the 'withAsync*' functions
Closes #148
2017-11-30 21:22:46 +00:00
Michael Walker
2fa165ac6f dejafu-0.9.1.0 release 2017-11-26 22:41:54 +00:00
Michael Walker
c88ec04ec2 Display pre-emptions following a yield with a lower-case "p"
Fixes #109
2017-11-26 22:24:13 +00:00
Michael Walker
e9a64a1f8d Add missing MonadFail instances (when base >=4.9) for ConcT/STM
Closes #136
2017-11-25 23:40:08 +00:00
Michael Walker
a0801d65eb Fix new hlint warnings 2017-11-20 19:25:48 +00:00
Michael Walker
7aa407df47 Remove accidentally committed file 2017-11-20 19:25:48 +00:00
Michael Walker
743dcad20d Travis improvements
- separate build matrix entry for style checks
- run stylish-haskell
- use `stack --no-terminal`
- improve folding

Closes #151
Closes #152
2017-11-20 19:25:48 +00:00
Michael Walker
9354282ee5 Fix some incorrect "@since" haddock comments 2017-11-07 14:21:23 +00:00
Michael Walker
b0fb55a50e dejafu-0.9.0.3 release 2017-11-06 01:10:52 +00:00
Michael Walker
4437baf672 concurrency-1.2.2.0 release 2017-11-05 01:53:22 +00:00
Michael Walker
77c708014d Add IsConc and IsSTM types 2017-11-05 01:47:30 +00:00
Michael Walker
74b1c2c996 Use underlying monad for modifyCRefCAS_ transformer instances 2017-11-05 01:33:43 +00:00
Michael Walker
7d5df170e7 Do not pass memory model to dependency functions
This is sane because buffered writes can only happen if the MemType
isn't sequential consistency anyway.
2017-11-02 22:15:11 +00:00
Michael Walker
e780c69f80 Impose a dependency between commits and memory barriers
The previous behaviour was unsound.

Fixes #138
2017-11-02 21:37:11 +00:00
Michael Walker
c41734f251 Make write/commit dependency avoidance less widely applicable
It was probably unsound before.
2017-11-02 21:34:34 +00:00
Michael Walker
5a8d6c965b dejafu-0.9.0.2 release 2017-11-02 18:12:04 +00:00
Michael Walker
e7b18ffd50 tasty-dejafu-0.7.0.3 release 2017-11-02 18:08:43 +00:00
Michael Walker
42ea4ca2f2 tasty-dejafu: bump upper bound of tasty to 0.13 2017-11-02 18:07:26 +00:00
Michael Walker
bc72c9904b Make a fair bound of 0 meaningful 2017-11-01 20:06:31 +00:00
Michael Walker
424bdd2a6b Try alternative decisions if runnable prior is excluded by the bound 2017-11-01 14:52:42 +00:00
Michael Walker
30ab912210 Don't consider TVar reads dependent 2017-11-01 14:46:18 +00:00
Michael Walker
eb73600b39 Add property tests for memory ops 2017-10-31 17:17:27 +00:00
Michael Walker
29b1f28546 Add some property tests
Goes some way to solving #142, but it would be nice to have some for
the memory stuff.
2017-10-30 20:32:00 +00:00
Michael Walker
5bc3eb2773 Move isBlock/isBarrier optimisation into findBacktrackSteps
This makes dependent ==> dependent'
2017-10-30 19:24:24 +00:00