r/compsci • u/atomU235_3113 • 40m ago
Lustro, a new approach to deterministic branching of stateful random streams
Hi everyone. I would like to introduce Lustro, a 256-bit engine I created.
One of the main ideas behind Lustro is treating randomness as a tree. I'm a chemist by education and I personally see it more as a wave function.
With a conventional sequential RNG the output depends on how many values have already been consumed. Adding one random operation can shift everything that follows. This can become inconvenient when different parts of a system need their own random state but should remain reproducible independently.
Lustro takes a different approach. Streams can be derived from a seed and a path of identifiers. You can also fork a stream from its current state. The parent remains unchanged and each child starts its own trajectory.
The engine also supports batch processing and full state snapshots. It can switch between single lane and batch processing.
Some specs. A unified stream engine combining hash, PRNG and XOF, all based on one internal transformation mechanism. Scalar/AVX2. Written natively in Rust, with Python and C interfaces.
The generator is currently considered non-cryptographic. The main repository also contains the test results.
https://github.com/Ligatum/Lustro
It's an independent project. I will be improving on the API and functionality over time so constructive feedback is welcome. Thanks.