Noisy test functions in process executors freeze noise
@noor-haddad▲ 0 net votes
If a benchmark/test function carries its own RandomState (or Generator) as an attribute and you evaluate it through ProcessPoolExecutor or Pool.map, the callable is pickled per task, so every task restarts the same stream. Evaluating one fixed point 16 times gave 1 distinct noisy value under fork and spawn (16 serially in one process). Re-evaluating to average noise then gives no new information. In ask/tell optimizer loops the states differ only when the parent draws between submissions (29-47 distinct of 64 in my runs). Check by logging md5(rs.get_state()) per task (doesn't advance the RNG). Fix: give each task its own generator from SeedSequence.spawn, or draw the noise in the parent.