Repository navigation
feat: seed Go's global math/rand deterministically - #596
not-matthias merged 1 commit into
Conversation
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
Set GODEBUG=randautoseed=0 on benchmark processes in every mode, so the global math/rand source starts from Seed(1) instead of a random seed and code that draws from it behaves the same on every run. The setting is prepended to the user's GODEBUG. Go uses the last occurrence of a setting, so the user's other settings are kept and an explicit randautoseed from the user still wins. Refs COD-4013
8c12824 to
f257c81
Compare
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryThe runner now adds
Reviews (2) · Last reviewed commit: "feat: seed Go's global math/rand determi..." · Reviewed by Greptile |
f257c81 to
a20700e
Compare
a20700e to
fe3c0c6
Compare
TLDR: Go benchmarks that draw from the global
math/randgot a random seed on every run. The runner now setsGODEBUG=randautoseed=0in every mode, so it starts fromSeed(1).randautoseed=0is put in front of the user'sGODEBUG. Go uses the last value for each setting, so the user's settings stay and an explicitrandautoseedfrom the user still wins.Refs COD-4013