Skip to content
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

Reorganisation of the repo structure #4

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

Kerl13
Copy link
Member

@Kerl13 Kerl13 commented May 6, 2020

  • Reference C implementations of the different RNGs are moved inside their respective OCaml modules;
  • OCaml implementations are tested against the corresponding C reference.

@Kerl13 Kerl13 force-pushed the reorganisation branch from 638020f to 9abf7b7 Compare May 7, 2020 17:04
src/splitmix/tests.ml Outdated Show resolved Hide resolved
@Niols
Copy link
Member

Niols commented May 10, 2020

What is the status of this? Can I help? Review, maybe?

@Kerl13
Copy link
Member Author

Kerl13 commented May 11, 2020

What is the status of this? Can I help? Review, maybe?

Yep, review and tell if you think of a better organisation

@Niols
Copy link
Member

Niols commented May 12, 2020

Where would you put the TestU01 bindings?

I don't know so much what to think about the organisation, because this repository features very different things, namely:

  • Bindings for TestU01 (+ ProbDist + MyLib). They would probably deserve their own packaging, either as an independent repository, or at least an independent directory in this repo.

  • Implementation of several PRNGs, with testing against their C reference. This whole thing looks also like a quite independent library providing PRNGs for OCaml (as well as a way to reproduce the interface of Stdlib.Random) and would deserve imo an independent packaging.

  • Built on top of these two (and possibly PractRand soon-ish?), a "research" work to compare PRNGs, by benchmarking them and running test batteries on them. I think this is also an other part of the work, quite independent from the others.

So I guess I would expect these three aspects of this repository being separated in three directories at the root of this repo? testu01/ containing the definition of the whole testu01 library, prngs/ (or probably something better) containing the definition of the lib containing all the PRNGs and bench/ (or something better) containing the work about benchmarking and crushing PRNGs.

Those are simply ideas; and opinion on this?

prng/src/xoshiro/stubs.c Outdated Show resolved Hide resolved
prng/src/xoshiro/reference.c Outdated Show resolved Hide resolved
prng/src/splitmix/stubs.c Outdated Show resolved Hide resolved
Copy link
Member

@Niols Niols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a few comments, but their are just very random things and actually the PR can be merged whenever we want, from my point of view.

Oh, also, something that actually hasn't changed in this PR is the benchmarking tests. This is probably a job for an other PR, but shouldn't we seed the Random generators (on similar seeds) before testing? Like go from:

B.Test.create ~name:"Random.float" (fun () ->
Random.float 1.);

to something like:

B.Test.create_with_initialization ~name:"Random.float" (fun `init ->
    Random.init 4; (* please don't *)
    fun () -> Random.float 1.);

(untested; from memory; might not be exactly this)

@Kerl13
Copy link
Member Author

Kerl13 commented May 18, 2020

Oh, also, something that actually hasn't changed in this PR is the benchmarking tests. This is probably a job for an other PR, but shouldn't we seed the Random generators (on similar seeds) before testing?

Probably yes!

But I take the opportunity to postpone this to another PR ;)

@Niols
Copy link
Member

Niols commented May 18, 2020

OK, I moved this to #10!

prng/src/bench.ml Outdated Show resolved Hide resolved
Copy link
Member

@Niols Niols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That all looks good to me! I sent quite a few comments; most of them are just here because I felt like trolling.

prng/src/splitmix/tests/reference.c Show resolved Hide resolved
prng/src/splitmix/tests/reference.c Show resolved Hide resolved
prng/src/splitmix/tests/reference.c Show resolved Hide resolved
prng/src/splitmix/tests/sm64_c.c Show resolved Hide resolved
prng/src/splitmix/tests/sm64_ocaml.ml Show resolved Hide resolved
prng/src/testutils/dune Outdated Show resolved Hide resolved
prng/src/testutils/testutils.c Show resolved Hide resolved
prng/src/testutils/testutils.ml Outdated Show resolved Hide resolved
prng/src/xoshiro/tests/dune Outdated Show resolved Hide resolved
Copy link
Member

@Niols Niols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

testu01/testu01/bbattery_stubs.c Show resolved Hide resolved
testu01/testu01/bbattery_stubs.c Show resolved Hide resolved
@Niols
Copy link
Member

Niols commented May 28, 2020

Two conversations that I think can just be marked as resolved and then I have nothing else to say!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants