I fixed it by xoring consecutive outputs. Python code:
import struct
import sys
x = 83866140117348733064738400095399246193
#seed
def PCGmixer(x):
count1 = x >> 122
x1 = (x ^ (x >> 64)) & 18446744073709551615
low64 = (x1 >> count1) | (x1 << (64 - count1)) & 18446744073709551615
x2 = (x >> 64) & 18446744073709551615
count2 = low64 & 63
high64 = (x2 >> count2) | (x2 << (64 - count2)) & 18446744073709551615
x = (high64 << 64) | low64
return x
def LCG(x):
x = (x * 47026247687942121848144207491837523525 + 83866140218348733064834828227924511723) & 340282366920938463463374607431768211455
return x
w=0
while 1 == 1:
w_1 = w
x=LCG(x)
w=PCGmixer(x)
w_2 = w_1 ^ w
split = [(w_2 >> x) & 0xFFFFFFFF for x in reversed(range(0, 128, 32))]
binary = struct.pack('IIII', split[0], split[1], split[2], split[3])
sys.stdout.buffer.write(binary)
#splitting required by PractRand
So we generate output_1, output_2, output_3, output_4, ... and our numbers are:
output_1 ^ output_2
output_2 ^ output_3
output_3 ^ output_4
and so on. For now it passes more tests:
RNG_test using PractRand version 0.95
RNG = RNG_stdin, seed = unknown
test set = core, folding = standard(unknown format)
rng=RNG_stdin, seed=unknown
length= 16 megabytes (2^24 bytes), time= 2.1 seconds
no anomalies in 153 test result(s)
rng=RNG_stdin, seed=unknown
length= 32 megabytes (2^25 bytes), time= 5.6 seconds
no anomalies in 169 test result(s)
rng=RNG_stdin, seed=unknown
length= 64 megabytes (2^26 bytes), time= 11.1 seconds
no anomalies in 182 test result(s)
rng=RNG_stdin, seed=unknown
length= 128 megabytes (2^27 bytes), time= 20.7 seconds
no anomalies in 199 test result(s)
rng=RNG_stdin, seed=unknown
length= 256 megabytes (2^28 bytes), time= 38.5 seconds
no anomalies in 217 test result(s)
rng=RNG_stdin, seed=unknown
length= 512 megabytes (2^29 bytes), time= 72.8 seconds
no anomalies in 232 test result(s)
rng=RNG_stdin, seed=unknown
length= 1 gigabyte (2^30 bytes), time= 141 seconds
no anomalies in 251 test result(s)
rng=RNG_stdin, seed=unknown
length= 2 gigabytes (2^31 bytes), time= 275 seconds
no anomalies in 269 test result(s)
rng=RNG_stdin, seed=unknown
length= 4 gigabytes (2^32 bytes), time= 560 seconds
no anomalies in 283 test result(s)
rng=RNG_stdin, seed=unknown
length= 8 gigabytes (2^33 bytes), time= 1096 seconds
Test Name Raw Processed Evaluation
[Low1/8]DC6-9x1Bytes-1 R= +5.8 p = 3.5e-3 unusual
...and 299 test result(s) without anomalies
rng=RNG_stdin, seed=unknown
length= 16 gigabytes (2^34 bytes), time= 2189 seconds
no anomalies in 315 test result(s)
rng=RNG_stdin, seed=unknown
length= 32 gigabytes (2^35 bytes), time= 4366 seconds
no anomalies in 328 test result(s)
rng=RNG_stdin, seed=unknown
length= 64 gigabytes (2^36 bytes), time= 8809 seconds
no anomalies in 344 test result(s)
rng=RNG_stdin, seed=unknown
length= 128 gigabytes (2^37 bytes), time= 17252 seconds
no anomalies in 359 test result(s)
rng=RNG_stdin, seed=unknown
length= 256 gigabytes (2^38 bytes), time= 34723 seconds
no anomalies in 372 test result(s)
rng=RNG_stdin, seed=unknown
length= 512 gigabytes (2^39 bytes), time= 69312 seconds
no anomalies in 387 test result(s)
I'll see if it fails.