-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add thread for STM #88
Conversation
As noted in #66 for |
I'm happy to either add this refactoring onto this PR or do it in another. |
Great - thanks 🙏 - either is fine I think 👍 |
Thanks for this! 🙏 (note: we should do the same for Perhaps it can be confusing to a newcomer that
@naomi-spargo @OlivierNicole - what do you think? We are a bit inconsistent naming-wise ( I would love if something similar is possible for the |
I was going for making the distinction in the modules' name (less function's name to find...), but I'm totally ok with your proposition.
I agree. Also, the user shouldn't make use of
The |
I was also thinking of another convenience:
No, I agree with you.
Nice! No, I don't think this is an issue. |
So I've added an interface file for |
Excellent - looks good! 👍
Any thoughts on the above convenience? As to the functor/module names, this uses a mixture of underscores As to tests, it would be nice to include just one |
Thanks 😃
That's true, but does a user interested in e.g. As a user, I don't mind applying one more functor. And w.r.t design, it's not a strong opinion, but I like the clean "one functor per kind of test" 😃
I was waiting for the refactoring to settle a bit down before adding more Thread tests. I agree that a negative test is the bare minimum. |
I think the easiest for you would be to run |
Sorry I hadn't reacted to this, since I get notifications from all multicoretests activity I don't always go read the messages… I think the decision has been taken now? |
8dea0de
to
da5fc7e
Compare
We are still open to input to arrive at a nice interface. Your perspective is therefore welcome! |
lib/STM_Core.ml
Outdated
b,s' | ||
|
||
(* operate over arrays to avoid needless allocation underway *) | ||
let interp_sut_res sut cs = |
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.
A "default interpreter" feels a bit overkill when there are only two "backend interpreters" 🤔
The alternative to including a "default" interpreter targeting Domain
and overriding it in STM_Thread
would be to let each of STM_Domain
and STM_Thread
provide their own.
Can you share your thoughts on this choice? (I might be missing something)
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.
I agree this is not the best design. I was focusing on having agree_test_conc
finding the expected bugs (which still fail).
There is also the re-exportation of four functions in STM_Seq
(the reason is that they are needed in src/lockfree/ws_deque_test.ml
) which is not a great design and is related to this one.
The interface you have arrived at looks OK to me. |
03d9932
to
7d209f6
Compare
rebased on latest main with QCheck 0.19 |
The latest run starts by triggering an error in I suggest
|
7d209f6
to
18bbd1f
Compare
I've now restored the lost documentation and put it in the right places. This leads to spot again a few duplicated code. I also added documentation to function newly exposed (because of the splitting in different modules).
I think it is good. But I'll take another look with fresh eyes.
I completely agree and that was something that was bothering me. As |
The divergence that appeared in one (or more) of the rebasing is now corrected. The list of all the definition present in
|
I took @jmid’s last comment as a cue to have a fresh look at this PR ;-) First of all, I would have preferred to see it structured into at least the following steps (of one or more commits):
As it is not structured thus, I went on to review the global diff rather than the commits, trusting During that review I noticed another thing I’d rather see changed: some lines are really long; I’m not completely against using more than 80 columns since we seldom have so little screen space available and enforcing it can make code less legible, but I think more than, say, 140 is never legible anyway (and that’s what I see in full screen, pretty much). |
I have taken another pass over the PR, going over the differences between
The result is available here: https://github.com/jmid/multicoretests/tree/more-polish-stm-threads You should be able to see the (slightly smaller) difference against |
Thanks @jmid for this new this new polish. I'm totally ok for it to be merged on this PR. |
I continued by looking at the proposed STM interfaces:
val check_obs : (Spec.cmd * res) list -> (Spec.cmd * res) list -> (Spec.cmd * res) list -> Spec.state -> bool
val shrink_triple : (Spec.state -> Spec.cmd QCheck.arbitrary) -> (Spec.state -> Spec.cmd QCheck.arbitrary) -> (Spec.state -> Spec.cmd QCheck.arbitrary) -> (Spec.cmd list * Spec.cmd list * Spec.cmd list) QCheck.Shrink.t I also found val interp_sut_res : Spec.sut -> Spec.cmd list -> (Spec.cmd * res) list This is a bit of a historical artifact, since the sequential mode uses The above changes are available on the
|
I made a few more changes yesterday which I've now pushed to https://github.com/jmid/multicoretests/tree/revise-stm-thread-interfaces
Overall, I'm OK to merge this and then adjust it along the way. Questions I'm wondering about
I agree with @shym about squashing the commits down to a few key commits to clean up the history. |
Thanks ! I was not sure about the examples in
We can't, because among these users, there are
Dune was building this module anyway (IIRC), so we've (me and @shym) added it manually and included
but now I think it is a good idea to inline it rather that include it.
My part is particularly messy (tried some refactoring that didn't work w.r.t avoiding the unnecessarily load of |
OK, thanks I commit the latest changes to |
OK, I've now pushed my remaining commits from the other branch. Is it OK with you @shym to start rebasing and squashing commits? |
As I was the one suggesting rewriting history, I can do it indeed ;-) |
About the visibility of |
You are welcome to! |
…d STM_thread Split STM into sub-libraries STM_base, STM_sequential, STM_domain, and STM_thread exposed by the qcheck-stm package. This removes systhreads as a dependency for STM_domain leaving only STM_thread to depend on threads. Update src/ tests accordingly, splitting src/neg_tests/ref_stm_tests into three files Co-authored-by: Samuel Hym <samuel.hym@rustyne.lautre.net> Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk>
I've taken a stab at cleaning up the history and squashing this morning. I'll let the CI run and then plan to merge this afternoon. |
Note: One cannot simply inline |
The final CI tests hit weird behaviour:
|
In the interest of moving forward with the release I'll merge this PR.
|
should close #81 when finished