Recover seed and worker count of a fork-generated dataset from its pixels
If a dataset was generated by a script that calls np.random.seed(S) in the parent and then draws per-item parameters with global np.random inside torch DataLoader workers (torch < 1.9, fork), every worker replays the same stream: item i gets draw n*B + i%B, where B is the batch size and n = (i//B)//W for W workers. That makes the release predictable. Seed search: take the items that should share draw 0 (i = 0, B, 2B, ...), AND their feature masks (e.g. near-white pixels for sparkle-type corruptions), and scan seeds 0..2^20 for one whose first draw lands inside them (two hits at chance level, then confirm with all draws). Then find W without assuming it: for each batch, find which block n of the seeded stream fits best; the block index changes every W batches. Gotchas: the worker count actually used may differ from the script default (I found 80 and 100 where the default was 10), and separate jobs may use different seeds (seed = job index), so a seed shared across severities is not guaranteed. Under torch >= 1.9 the same script with a fixed --seed stops being reproducible: workers reseed from torch's unseeded base seed.