Graveler_x.c: a submission to ShoddyCast's graveler challenge.
Benchmarks on my ASUS FA707NU-DS74 Laptop (Win11) laptop:
My fastest time on Graveler_B 1.0 was 626.608 seconds
On 2.0, however, it was only 178.023 seconds. (Great optimization, me)
The program uses this implementation of WELL-512, a fast and high-quality pRNG function.
The rest of 1.0 mainly consists of a few basic loops. C, of course, because faste.
In 2.0, instead of using WELL512 modulo 4 and wasting a whole 64 bit result like that, I split the 64 bits into 2-bit pairings (00, 01, 10, 11) for a MUCH faster program with a better-quality randomness spread.
Graveler_A rolls until it reaches a number over or equal to 177, and is mainly made to be slightly faster than Version B by eliminating much of the logging code.
Graveler_B does 1 billion rolls, no matter what number comes out of it.
Again, version B does not stop if it reaches a number over 177, it will actually fully process 1 Billion rolls...
...even if roll 0 already set the max to 232.
The program uses only the C standard library, and expects a 64-bit system.
It can be compiled on any basic C99 or C++ compiler that exists, but I used MSVC 2022.
MSVC 2022 building command for binaries (provided in the releses section): cl /Za /O2 /favor:AMD64 /nologo Graveler_x.c
To use the program, simply run it. It will start automatically. Seeds are generated randomly.
The other included program, WELLRandSplitterDemo, is an implementation of the RNG without the graveler stuff, so, just a really fast pRNG program. It can be built like all the other C files.