qcheck icon indicating copy to clipboard operation
qcheck copied to clipboard

Revise default sizes for list, array, string, bytes, ... generators

Open jmid opened this issue 3 months ago • 0 comments

As part of discussing "The Great Renaming" :tm: offline, @c-cube and I agreed to revise the default sizes used in our list, array, string, bytes, ... generators.

Currently, these tend to use nat which has a terrible distribution: https://github.com/c-cube/qcheck/blob/1aa167f6320890f0ee29dc8a6112f1ae076939bc/test/core/QCheck_expect_test.expected.ocaml5.64#L1513-L1536

Before the 1.0.0 release we should revise these to have a nicely curved (and more predictable) distribution, e.g., based on exponential/float_exp with a reasonable mean parameter: https://github.com/c-cube/qcheck/blob/1aa167f6320890f0ee29dc8a6112f1ae076939bc/test/core/QCheck_expect_test.expected.ocaml5.64#L1828-L1851

In the qcheck-STM library we already do so (adding a bit of skew to avoid generating too many identical 0-length lists): https://github.com/ocaml-multicore/multicoretests/blob/b5be1fe48bef28a1bbe604d59b322918624f987f/lib/STM.ml#L175-L180

jmid avatar Nov 05 '25 15:11 jmid