Menu

#19 isaac64x256::_advance_state bug

v1.0_(example)
accepted
None
5
2025-06-17
2025-06-17
Lucas Rey
No

Hi, in file PractRand-pre0.95/src/RNGs/isaac.cpp, lines 175 to 185, whenever we call the macro "rngstep64", for isaac64x256isaac64x256, the first argument is always "a^(something)". however, inside that macro, that varible "mix" is being applied xor AGAIN with a "a = (a^(mix)) +..." in line 163.

This means that a^ is applied twice, and I don't think that was the intention because of the following reasons:
-This does not happen for isaac32x256
-reading a different implementation, I don't see that double "a^" happenning (for example https://docs.rs/rand_isaac/latest/rand_isaac/isaac64/struct.Isaac64Rng.html)
-it's just inefficient

Discussion

  • - 2025-06-17

    You are correct, thank you. The issue will be addressed for version 0.96. In Bob's original code the xor happens in the macro for 32 bit ISAAC, and in the macro call for 64 bit ISAAC, and apparently I somehow ended up doing both in my implementation of the 64 bit variant.

     
  • - 2025-06-17
    • status: open --> accepted
    • assigned_to:
     

Log in to post a comment.

Monday.com Logo