Skip to content

Comments

Speed up test generation bootstrap#4574

Merged
jtraglia merged 1 commit intoethereum:masterfrom
leolara:leolara/speed-up_ssz_container
Sep 10, 2025
Merged

Speed up test generation bootstrap#4574
jtraglia merged 1 commit intoethereum:masterfrom
leolara:leolara/speed-up_ssz_container

Conversation

@leolara
Copy link
Member

@leolara leolara commented Sep 9, 2025

By making the test run at test time instead of collection time in SSZ generic container.

This was first introduced here: https://github.com/ethereum/consensus-specs/pull/4541/files but that PR has more complications with other things

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.

Nice, thank you for finding/fixing this!

@jtraglia jtraglia added the testing CI, actions, tests, testing infra label Sep 10, 2025
@jtraglia jtraglia merged commit 8cb65f5 into ethereum:master Sep 10, 2025
14 checks passed
_ = deserialize(typ, serialized)
except Exception:
return serialized
assert False # should throw
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily, it's not guaranteed that the modification triggers an exception in all circumstances.

Copy link
Contributor

Choose a reason for hiding this comment

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

i.e., if it would be statically known that it triggers an exception, the entire check is pointless.

Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure this is why reference test generation is failing now too.

https://github.com/ethereum/consensus-specs/actions/runs/17632183499

@leolara did you test this before making the PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've replaced it with a Skip in #4529

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer a separate/small PR with just that fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

etan-status added a commit to etan-status/consensus-specs that referenced this pull request Sep 11, 2025
SSZ tests are scheduled asynchronously since ethereum#4574, but those that are
later determined to be inapplicable should be properly cancelled by
raising SkippedTest instead of aborting test generation.

Notably, this is about tests where a valid object is serialized, the
serialized data is subsequently modified and parsed again. As the
modified data may still be valid depending on the structure, such
tests have to be skipped as they do not denote invalid data.
jtraglia pushed a commit that referenced this pull request Sep 11, 2025
SSZ tests are scheduled asynchronously since #4574, but those that are
later determined to be inapplicable should be properly cancelled by
raising SkippedTest instead of aborting test generation.

Notably, this is about tests where a valid object is serialized, the
serialized data is subsequently modified and parsed again. As the
modified data may still be valid depending on the structure, such tests
have to be skipped as they do not denote invalid data.
etan-status added a commit to etan-status/consensus-specs that referenced this pull request Oct 7, 2025
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.
jtraglia pushed a commit that referenced this pull request Oct 7, 2025
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.
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.

3 participants