FSobol RNG strange behaviour

I found there is implmenetation of Sobol RNG in UE_5.4\Engine\Source\Runtime\Core\Public\Math\Sobol.h
I tried to use it, but simple code returns strange results (copied below post):

	int sobolSeed = 123234;
	int sobolIndex = 0;

	for (int i = 0; i < 100; i++)
	{
		float rnd = FSobol::Evaluate(sobolIndex++, 0, sobolSeed);

		UE_LOG(LogTemp, Log, TEXT("r=%f i=%d s=%d"), rnd, sobolIndex, sobolSeed);
	}

Code generates values very similar to each other - doesn’t seems very random :wink:

I tried also to use ::Next function, but with very similar result.

	float rnd = FSobol::Evaluate(sobolIndex++, 0, sobolSeed);

	for (int i = 0; i < 100; i++)
	{
		rnd = FSobol::Next(sobolIndex++, 0, rnd);

		UE_LOG(LogTemp, Log, TEXT("r=%f i=%d s=%d"), rnd, sobolIndex, sobolSeed);
	}

Any Idea how should I use it?
I don’t found any documentation for it - maybe it is not yet implemented/tested etc?

Anyway it resembles one of Dilbert cartoons :wink:

returned values are:
LogTemp: r=0.007345 i=1 s=123234
LogTemp: r=0.007345 i=2 s=123234
LogTemp: r=0.007345 i=3 s=123234
LogTemp: r=0.007345 i=4 s=123234
LogTemp: r=0.007346 i=5 s=123234
LogTemp: r=0.007346 i=6 s=123234
LogTemp: r=0.007345 i=7 s=123234
LogTemp: r=0.007345 i=8 s=123234
LogTemp: r=0.007346 i=9 s=123234
LogTemp: r=0.007346 i=10 s=123234
LogTemp: r=0.007346 i=11 s=123234
LogTemp: r=0.007346 i=12 s=123234
LogTemp: r=0.007346 i=13 s=123234
LogTemp: r=0.007346 i=14 s=123234
LogTemp: r=0.007346 i=15 s=123234
LogTemp: r=0.007346 i=16 s=123234
LogTemp: r=0.007346 i=17 s=123234
LogTemp: r=0.007346 i=18 s=123234
LogTemp: r=0.007346 i=19 s=123234
LogTemp: r=0.007346 i=20 s=123234
LogTemp: r=0.007347 i=21 s=123234
LogTemp: r=0.007347 i=22 s=123234
LogTemp: r=0.007346 i=23 s=123234
LogTemp: r=0.007346 i=24 s=123234
LogTemp: r=0.007347 i=25 s=123234
LogTemp: r=0.007347 i=26 s=123234
LogTemp: r=0.007347 i=27 s=123234
LogTemp: r=0.007347 i=28 s=123234
LogTemp: r=0.007347 i=29 s=123234
LogTemp: r=0.007347 i=30 s=123234
LogTemp: r=0.007347 i=31 s=123234
LogTemp: r=0.007347 i=32 s=123234
LogTemp: r=0.007343 i=33 s=123234
LogTemp: r=0.007343 i=34 s=123234
LogTemp: r=0.007343 i=35 s=123234
LogTemp: r=0.007343 i=36 s=123234
LogTemp: r=0.007344 i=37 s=123234
LogTemp: r=0.007344 i=38 s=123234
LogTemp: r=0.007344 i=39 s=123234
LogTemp: r=0.007344 i=40 s=123234
LogTemp: r=0.007344 i=41 s=123234
LogTemp: r=0.007344 i=42 s=123234
LogTemp: r=0.007344 i=43 s=123234
LogTemp: r=0.007344 i=44 s=123234
LogTemp: r=0.007344 i=45 s=123234
LogTemp: r=0.007344 i=46 s=123234
LogTemp: r=0.007344 i=47 s=123234
LogTemp: r=0.007344 i=48 s=123234
LogTemp: r=0.007344 i=49 s=123234

I found that problem occurs only for dim=0.
At least dim=1 and dim=2 looks way better.

Strange, because header file says:

* @param Dim - The Sobol dimension to use (0-15).

Looks like not true, and correct range is rather 1-15.

Also is should be pointed that “seed” is not what we used to.
Values from strem seeded by value 1234 and 4567 would be very similar (within 1% difference).

When someone want something different, then 24 bit seed need to be very different.
So do not seed it with rand(), because RAND_MAX is often 32768 and different streams are seeded very closely.