rigor

Shared libraries for measured work: seeded generators, statistics, gates, test generation, chaos and load. Each engine moves to them one function at a time, and its records stay byte-equal.

Try the generator

The same seed gives the same numbers each time, in Node and in each browser. Type a seed, or a label for a named stream, and the page draws again.

    draws in each binexpected count

    Packages

    PackageStateWhat it gives
    @mark1russell7/rigor-generators0.1.0A seeded generator and its draws: integers, picks, weights, shuffles, samples, normal values and named streams. Next: input families, stratified and Latin hypercube designs, Saltelli designs, shrinking.
    @mark1russell7/rigor-statistics0.1.0Quantiles, bootstrap intervals (also of clusters), the sign test, the paired permutation test, Wilson intervals, the Holm correction, rank correlation, the comparison with a baseline beyond the noise (the 5-seed rule), and Brier scores. Next: Sobol indices.
    rigor-gatesplannedThe determinism gate (one input gives one hash), the promotion test and the performance evidence of a release.
    rigor-testgenplannedProperty tests on fast-check, pairwise and covering arrays, and metamorphic relations.
    rigor-chaosplannedFault injection, schedules of latency and failure, and load profiles, with their measures.

    Why

    The duplication atlas (codeatlas) found the same seeded generator written by hand approximately 40 times, in more than 10 repositories. No repository imported it from a package. The copies use different forms of mulberry32, but each one gives the same numbers as random(seed).next. Thus a repository moves to the package with no change to its records, and its tests prove it.

    npm install @mark1russell7/rigor-generators
    
    import { random, seedsFrom } from "@mark1russell7/rigor-generators";
    
    for (const seed of seedsFrom(process.env.SEED, [1, 2, 3, 4, 5])) {
      const r = random(seed);
      const lanes = r.fork("lanes");       // an independent stream for one part of the work
      const n = r.int(10, 1000);           // 10 to 1000, both included
      const order = lanes.shuffle(items);  // a new list in a random order
    }