Commit Graph

388 Commits

Author SHA1 Message Date
Michael Walker
4cc5f5c921 Tidy up stepWrite/stepCommit 2015-10-05 16:16:43 +01:00
Michael Walker
0c94c16d16 Move dejafus{,IO}' into different documentation section 2015-10-02 11:27:15 +01:00
Michael Walker
9ce7f51b92 Document default memory model 2015-10-01 16:40:31 +01:00
Michael Walker
a272a0199b Update documentation 2015-10-01 15:46:50 +01:00
Michael Walker
eb7c663993 Bit of refactoring in Test.DejaFu.Deterministic 2015-10-01 15:11:49 +01:00
Michael Walker
415e238f20 Nicely display commits in traces to users 2015-10-01 15:10:48 +01:00
Michael Walker
615535b49b Remove _concNoTest
It's not clear how it can be safely implemented with the possibility
for relaxed memory effects to occur.
2015-10-01 14:32:36 +01:00
Michael Walker
10a8c5f559 Remove old TODO 2015-10-01 14:23:11 +01:00
Michael Walker
842460daf8 Fix phantom thread numbering at 0 2015-10-01 12:11:33 +01:00
Michael Walker
2529a9e95c Expose memory model choice in testing functions 2015-10-01 01:23:51 +01:00
Michael Walker
de75c17c0f Implement phantom threads. 2015-09-30 21:48:18 +01:00
Michael Walker
39ff237422 Expose non-synchronised write primitive 2015-09-30 20:58:52 +01:00
Michael Walker
c51ed65f69 Implement separate write and commit primitives 2015-09-30 20:52:15 +01:00
Michael Walker
24b7cd00c1 Separate writing and committing CRef modifications.
This is NOT yet exposed in any interesting way to the user. A separate
commit primitive is needed for that.
2015-09-30 18:09:23 +01:00
Michael Walker
20a54e95da Suppress some more hlint warnings 2015-09-30 16:55:34 +01:00
Michael Walker
dbc1126466 Parameterise conc runner with memory model to use.
Three memory models will eventually be supported:

 - SequentialConsistency, which is the current behaviour.
 - TotalStoreOrder, where each thread has a write buffer.
 - PartialStoreOrder, where each CRef has a write buffer.

The parameter is currently ignored.
2015-09-30 16:51:36 +01:00
Michael Walker
c107f2e6b1 Redefine writeCRef to suffer from relaxed memory issues, add atomicWriteCRef 2015-09-28 15:39:18 +01:00
Michael Walker
c55e0249b3 Release 0.1.0.0 2015-08-27 13:37:20 +01:00
Michael Walker
819cbaebf6 Add Thief of Time quote 2015-08-27 13:33:48 +01:00
Michael Walker
e767326660 Clean up warnings in 7.10 2015-08-27 01:05:59 +01:00
Michael Walker
4779ac07e5 Improve documentation and instances 2015-08-27 00:41:53 +01:00
Michael Walker
f8056f13b9 Add efficient Foldable.toList for NonEmpty when GHC >= 7.10 2015-08-27 00:18:48 +01:00
Michael Walker
5ff263d96f Rename ThreadAction' to Lookahead 2015-08-26 22:48:38 +01:00
Michael Walker
a1144610b2 General tidying ahead of release 2015-08-26 11:56:26 +01:00
Michael Walker
55a6239503 Update build status link in README 2015-08-16 00:19:05 +01:00
Michael Walker
046847c714 Upgrade to Stackage LTS 3.0 2015-08-15 23:45:22 +01:00
Michael Walker
3544ad08c3 Fix compiler warnings 2015-08-14 15:50:11 +01:00
Michael Walker
15fb0c391b Drop the default implementations of putCVar and takeCVar 2015-08-14 15:27:50 +01:00
Michael Walker
faa0febdba Fix some inconsistencies in class docs 2015-08-14 15:26:43 +01:00
Michael Walker
4a76ecedcc Add Applicative constraint to classes for pre-AMP GHC 2015-08-14 15:25:06 +01:00
Michael Walker
0e558b271f Handle exceptions in CVar functions as in MVar functions 2015-08-14 15:06:03 +01:00
Michael Walker
dea286a582 Add Functor context to sctBoundedM for pre-AMP GHC 2015-08-10 10:37:42 +01:00
Michael Walker
d32ee150bd Reduce code duplication with Identity monad 2015-08-09 21:00:11 +01:00
Michael Walker
a9f25fbb71 Update README 2015-08-01 15:20:20 +01:00
Michael Walker
79ed016dda Build with LTS by default 2015-08-01 15:20:20 +01:00
Michael Walker
ac12036bad Use Sequence for backtracking points, rather than ++ a lot 2015-07-24 19:57:46 +01:00
Michael Walker
37d25048d3 Improve memory usage of pbBacktrack 2015-07-24 17:44:48 +01:00
Michael Walker
7aa7f5cc80 Use 'maximumBy' rather than 'sortBy' in 'next'.
Also swap the order of the append in 'prefixes'. For some reason this makes it
work much better in the test cases. No idea why.
2015-07-24 17:25:28 +01:00
Michael Walker
929eceab95 Inline ThreadId information into BacktrackStep 2015-07-24 16:35:23 +01:00
Michael Walker
a6055a30a0 Use strict IntMaps where possible. 2015-07-24 15:47:24 +01:00
Michael Walker
9d2c3cd42e Comment the tricky bits in Test.DejaFu.SCT more 2015-07-21 17:28:28 +01:00
Michael Walker
5649c4d2a7 Use Set instead of [] where it makes sense.
A lot of the places where lists were used, there was an assumed invariant that
there would be no duplicate entries, for some criteria of equality. In some
cases this was enforced by `nub`, in others not. Sets are a much better choice
here, as they actually enforce the invariant, with better complexity for some
operations.
2015-07-21 16:09:47 +01:00
Michael Walker
112a7cd138 Add some instances for NonEmpty 2015-07-21 16:09:11 +01:00
Michael Walker
c786a30448 Fix accidentally recursive binding 2015-07-21 15:30:29 +01:00
Michael Walker
3c1dadffa6 Take advantage of the fact that tagged is sorted 2015-07-21 14:38:00 +01:00
Michael Walker
d4b1ea8bc5 Slightly simplify dependent/dependent' defns 2015-07-21 14:37:36 +01:00
Michael Walker
15f79088c9 Correctly sort prefixes in next 2015-07-21 14:17:16 +01:00
Michael Walker
148cd0a351 Gradually accumulate allThreads in findBacktrack.
Recomputing it every single time is a waste of effort.
2015-07-21 14:16:34 +01:00
Michael Walker
d498ebd355 Extend blocking lookahead.
Adds more information to traces with a new Trace' type, which includes the
*sequence* of actions a thread will perform next, and use that for blocking
lookahead. This allows skipping over things like `_concKnowsAbout`, and so
brings the analysis behaviour of `spawn` in-line with `fork`.

For the test cases, this further reduces the average number of runs to 23.
2015-07-20 18:43:37 +01:00
Michael Walker
338c98b617 Add function to unsafely convert a list to a NonEmpty 2015-07-20 18:42:19 +01:00