Open automainint opened 2 months ago
Is this really nondeterministic? Looking at this it looks like the chance of it rounding wrong is far lower than the chance of a hash collision. But someone should prove this.
I'm more concerned about performance. Is there perhaps a way to do what this is doing that is both faster and provably deterministic?
Is this really nondeterministic? Looking at this it looks like the chance of it rounding wrong is far lower than the chance of a hash collision. But someone should prove this.
I'm more concerned about performance. Is there perhaps a way to do what this is doing that is both faster and provably deterministic?
I did some research. Seems that basic float arithmetic and sqrt should be deterministic. RandomX uses those operations for it's hash algorithm as well. I think it's good enough to just add some tests to make sure it works as expected on current platform.
It would be also a good idea to make sure that compiler won't break determinism by rearranging something or using some different modes. I don't know how to do this is Rust (RandomX uses asm).
Is there perhaps a way to do what this is doing that is both faster and provably deterministic?
This will require more fundamental redesign of the algorithm. I myself don't understand it deep enough. Maybe authors of the original paper can come up with something that is both fast and don't use float calculations.
Coding doesn't seem to work if mapping is not deterministic. Corresponding tests code is available in the
determinism
branch.We have to ensure that the method
RandomMapping::next_index
is deterministic. It may not be deterministic since it has floating-point arithmetic andsqrt
function.