multicoretests icon indicating copy to clipboard operation
multicoretests copied to clipboard

Lin2/STM2: Port Lin and STM to QCheck2

Open jmid opened this issue 1 year ago • 9 comments

Lin and STM are both based on the battle-tested QCheck module from qcheck-core.

The QCheck2 module however offers integrated shrinking, which should simplify the interface a bit, e.g.,

  • by removing the need for a shrink_cmd function and
  • by building on only one generator type QCheck2.Gen.t (as opposed to the current QCheck.arbitrary and QCheck.Gen.t mix)

For this reason, we should experiment with porting the libraries to QCheck2.

Note: This may hit and involve improvements to QCheck2's shrinkers, such as c-cube/qcheck#157.

jmid avatar Dec 19 '24 11:12 jmid

Can i work on this issue?

SitaGanesh avatar Dec 19 '24 11:12 SitaGanesh

You are welcome to give it a stab - this is open source after all! :slightly_smiling_face:

What's your experience with OCaml. the QCheck library, and the Lin and STM libraries? I'm thinking this may be a bit of a mouthful for a first-time contributor, depending on your experience with the above.

jmid avatar Dec 19 '24 12:12 jmid

I am a bit familiar with the syntax of OCaml, and I know some concepts related to software testing. The Lin and STM libraries are among the tools I remember

SitaGanesh avatar Dec 19 '24 12:12 SitaGanesh

I am a bit familiar with the syntax of OCaml, and I know some concepts related to software testing.

OK. In that case I would suggest

  • starting by contributing to QCheck first as Lin and STM build on it - and this porting project requires knowing both QCheck and QCheck2 well -- see https://github.com/c-cube/qcheck/issues
  • writing some tests that utilize the Lin and STM libraries first - to get working experience with the interfaces they expose before taking on a project of changing them -- see, e.g., #64

The Lin and STM libraries are among the tools I remember

Oh? I'm curious to learn where you have heard of these two libraries before? :thinking:

jmid avatar Dec 19 '24 13:12 jmid

Thanks for the suggestions! I'll begin by contributing to QCheck and learning about the libraries. This will help me understand things better before working on the task.

I came across these libraries while exploring tools for testing, I just read the abbreviation and remembered it as STM for my academic.

SitaGanesh avatar Dec 19 '24 13:12 SitaGanesh

Hm. Despite the same acronym, the OCaml qcheck-stm package (STM for short) is a state-machine testing library and has nothing to do with https://en.wikipedia.org/wiki/Software_transactional_memory

There's a description here: https://github.com/ocaml-multicore/multicoretests?tab=readme-ov-file#a-parallel-state-machine-testing-library and a short paper here: https://github.com/ocaml-multicore/multicoretests/blob/main/doc/paper.pdf

jmid avatar Dec 19 '24 13:12 jmid

I will definitely refer to them, thankyou for the clarification Sir!

SitaGanesh avatar Dec 19 '24 13:12 SitaGanesh

Sir @jmid, after going through the codebase and resources, I see there’s a lot to explore in this tech stack. It’s really interesting! I’ve started a tutorial on OCaml and the libraries. A small suggestion: could you provide a step-by-step guide for beginners on where to start contributing to this organization? What would that be?

And from the above discussion, I just wanted to clarify that my knowledge of these libraries is mostly theoretical. I’ve never implemented them in practice, so it’s taking me some time to understand these concepts fully.

SitaGanesh avatar Dec 19 '24 15:12 SitaGanesh

Thanks! For this repository my recommendation in https://github.com/ocaml-multicore/multicoretests/issues/497#issuecomment-2553910942 still stands. I don't have the resources to provide a step-by-step guide unfortunately. :shrug:

As for the other ocaml-multicore repositories, I recommend asking on the ones that you would like to help out on.

jmid avatar Dec 19 '24 15:12 jmid