RocksDB development finds a CPU bug
23 points by eatonphil
23 points by eatonphil
AMD was notified of a bug in “Zen 5” processors that may cause the RDSEED instruction to return 0 at a rate inconsistent with randomness [...] AMD has determined that the 16-bit and 32-bit forms of the RDSEED instruction on “Zen 5” processors are affected. The 64-bit form of RDSEED is not affected.
I'm really curious what's going on there! I would naively expect generating 32 random bits would be the same as generating 64 and masking off half of them. It's surprising that asking for less would increase the chance of failure.
Maybe because it's RDSEED and not RDRAND, they're trying to conserve entropy? And that makes the microcode for the 16/32-bit instructions more complex because they can't discard the unused bits?
I would naively expect generating 32 random bits would be the same as generating 64 and masking off half of them
I haven't checked, but my gut feeling is that this would actually lead to more zeroes than you'd expect, due to the cases where all ones from wider representation are getting masked off.
Exit: yeah no, that's obviously nonsense