Code Monkey home page Code Monkey logo

Comments (4)

mgold avatar mgold commented on July 18, 2024 1

Oh I'd just change the API to accept an Int instead of a Random.Seed

Sure, just document why this is the case and that the integer should be 32 random bits, etc. Again in the short-term you can avoid an API change thanks to Random.Pcg.toJson. Wait this is the runner that hasn't been released yet, not elm-test itself, so let's make the breaking API change now.

from node-test-runner.

rtfeldman avatar rtfeldman commented on July 18, 2024

Also I feel like when picking one at random, we should start with the initial time and then do like Random.int 1000 9999 to generate a relatively concise int for a seed that you could quickly holler across a room at a coworker who wants to reproduce what you're seeing.

Four digits seems like a plenty large enough possibility space given that we're not doing crypto or anything, but @mgold would be the expert on that.

from node-test-runner.

mgold avatar mgold commented on July 18, 2024

As with anything involving reusing or seeds or generating seeds from randomized output, the answer is: theoretically you are compromising the validity of the RNG and you should feel bad; in practice it's probably fine (until you get a really obscure and difficult bug).

I don't think it's worth limiting the 4 billion-ish possibilities to 9000 just to make the seeds easier to shout across the room. I've done similar things with flaky rspecs and I just wind up copying and pasting the seed at one machine.

I'm totally on board with indicating and being able to specify the initial seed, but the opaque type is working against you. With Random.Pcg you can do it by abusing toJson. If that's not merged into core (as is likely), you might have to rely on toString.

from node-test-runner.

rtfeldman avatar rtfeldman commented on July 18, 2024

I just wind up copying and pasting the seed at one machine.

Yeah fair point.

the opaque type is working against you

Oh I'd just change the API to accept an Int instead of a Random.Seed

from node-test-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.