Skip to content

Commit 8e49add

Browse files
committed
[util] Pin sparse-fsm-encode random seed version
This hasn't changed since Python 3.2, but we really should be pinning the random seed version to ensure deterministic and reproducible output across different Python versions. This way, even if a new seed version is introduced, we should be using the same seeding logic and so deterministically generating the same numbers, even on later Python versions. Signed-off-by: Alex Jones <[email protected]>
1 parent d3c34e2 commit 8e49add

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util/design/sparse-fsm-encode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def generate(self) -> None:
129129
num_restarts = 0
130130

131131
rand = random.Random()
132-
rand.seed(self.seed)
132+
rand.seed(self.seed, version=2)
133133
rnd = rand.getrandbits(self.encoding_len)
134134

135135
while len(self.encodings) < self.num_states:

0 commit comments

Comments
 (0)