Skip to content

Comments

Make RNG deterministic again in ssz_generic runner#4642

Merged
jtraglia merged 2 commits intoethereum:masterfrom
etan-status:bs-deterministicrng
Oct 7, 2025
Merged

Make RNG deterministic again in ssz_generic runner#4642
jtraglia merged 2 commits intoethereum:masterfrom
etan-status:bs-deterministicrng

Conversation

@etan-status
Copy link
Contributor

With #4574, the same RNG instance was captured by the various the_test functions. When they were subsequently executed in parallel, this led to non-deterministic tests. However, #4639 prefers reproducible tests.

Instead of running tests in parallel on a shared RNG instance, the RNG instance is now used during the single-threaded test collection stage to produce a deterministic order of seeds, which is then used to create a per-test RNG instance that is not shared with any other tests, hence not being subject to non-determinism from parallel execution.

With ethereum#4574, the same RNG instance was captured by the various `the_test`
functions. When they were subsequently executed in parallel, this led to
non-deterministic tests. However, ethereum#4639 prefers reproducible tests.

Instead of running tests in parallel on a shared RNG instance, the RNG
instance is now used during the single-threaded test collection stage
to produce a deterministic order of seeds, which is then used to create
a per-test RNG instance that is not shared with any other tests, hence
not being subject to non-determinism from parallel execution.
Copy link
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@jtraglia jtraglia merged commit 051b916 into ethereum:master Oct 7, 2025
15 checks passed
@etan-status etan-status deleted the bs-deterministicrng branch October 7, 2025 17:58
@jtraglia jtraglia added the testing CI, actions, tests, testing infra label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing CI, actions, tests, testing infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants