Skip to content

Seed all random number generators in testing - #773

Merged
tommyod merged 1 commit into
equinor:mainfrom
tommyod:seed_rng
Oct 8, 2025
Merged

Seed all random number generators in testing#773
tommyod merged 1 commit into
equinor:mainfrom
tommyod:seed_rng

Conversation

@tommyod

@tommyod tommyod commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Using RNG without seeds causes tests to fail every now and then. To test statistical properties, it is better to see the rng and test on many seeds. That way we can replicate across machines and we don't have to be stopped by false positives (what looks like test failures are just a bad rng).

@tommyod
tommyod marked this pull request as draft October 7, 2025 12:01
@tommyod
tommyod marked this pull request as ready for review October 8, 2025 10:25
@lucaeg
lucaeg self-requested a review October 8, 2025 12:29

@lucaeg lucaeg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me :) I only have two questions:

  • Why use only one seed in some tests and a collection of seeds in others?
  • How does using seeds exclude bad RNGs (that lead to test failures), do you mean that if a test fails for a particular seed then we will exclude that seed?

@tommyod

tommyod commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author
  • depends on the test and its purpose!
  • nope! in that case I would tweak tolerances!

@tommyod
tommyod merged commit 0499550 into equinor:main Oct 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants