It is past 4 am, and the bug hunt is over. It was a weird one. One that I'll remember. It led me on a wild exhausting chase through dark nooks and crannies of a horribly-written nightmare of a code base. What made it weird was that, with the same random number seed, I got different behavior depending on whether there were some (debugging-related) print statements in some parts of code.
Even if these statements were in parts of the code that were entirely separate from where the failure was happening.