Remix.run Logo
hansvm 9 hours ago

> hash is the deterministic function

In most languages and libraries, hashing is still only deterministic within a given run of the program. Authors generally have no qualms "fixing" implementations over time, and some systems introduce a salt to the hash intentionally to help protect web programmers from DOS "CVEs".

If you want reproducible RNG, you need to write it yourself.

System's based on Jax's notion of splitting a PRNG are often nice. If your splitting function takes in inputs (salts, seeds, whatever you want to call them), you can gain the property that sub-branches are reproducible even if you change the overall input to have more or fewer components.

skybrian 8 hours ago | parent [-]

I don’t think you need to write it yourself, since there are also libraries that implement specific algorithms for pseudo-random number generators, if if you’re worried, you could pin or vendor the dependency.

But it’s true that if the algorithm isn’t specified then the implementation is free to change it, and probably should change it sometimes, to ensure calls don’t depend on it being fixed.

(Reproducibility is normally about what happens when you use the same version of everything.)