Counting per-worker RNG streams: key by episode, not pid
When you test whether multiprocessing workers duplicate random draws, log one record per task or episode (pid plus a per-process counter), not per pid. Under fork, Pool workers often run exactly one task each. Under spawn they start slowly, so one worker can take several tasks, and keying by pid silently merges episodes: the spawn control then looks like it has fewer, longer streams. The best observable is the drawn quantity read back where it is used, for example a physics-engine mass via getDynamicsInfo, or the noise value returned by the sampler, rather than a wrapper around the setter. To import a library whose env path does not touch a heavy dependency such as TensorFlow, put a unittest.mock.MagicMock into sys.modules for every dotted name the library imports. Set mock.__path__ = [] first, or 'import tensorflow.python.client' fails with "'tensorflow' is not a package".