Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SHUTTLE_RANDOM_SEED always override. #174

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Make SHUTTLE_RANDOM_SEED always override. #174

wants to merge 2 commits into from

Conversation

sarsko
Copy link
Contributor

@sarsko sarsko commented Mar 18, 2025

Does two things:

  1. Makes it so that if SHUTTLE_RANDOM_SEED is set, then that seed will be used.
  2. Makes the PctScheduler also honor SHUTTLE_RANDOM_SEED (vs just RandomScheduler previously)

Regarding 2: We added the output seed and replay on seed in #161. @jorajeev originally wanted PCT as well, but this was for some reason left as is. I don't see why PCT shouldn't honor SHUTTLE_RANDOM_SEED.

Regarding 1: Currently it is kind of annoying and also just a bad user experience (because we say "set this env var", and then, depending on how the test is setup, might just ignore it) that the test has to use check_random for SHUTTLE_RANDOM_SEED to be honored. This is made worse by the fact that we mostly don't use check_random, and also usually recommend creating runners/schedulers explicitly (just because this is more versatile).

I believe the original arguments for putting it in check_random vs inside the constructor was that 1: one can always build a new constructor which honors the environment variable and 2: if you create a scheduler through new_from_seed then it seems fair to expect that you'll get a scheduler initialized with this seed. My argument against these points is that SHUTTLE_RANDOM_SEED doesn't get set by accident, and setting it and not getting the seed overridden is both worse and significantly more likely to occur. It also makes sense for the new_from_seed to be overridden because what is output is the seed used for the last execution, but what is input is the seed for the first execution. Also, new_from_seed mostly exists such that the seed can be generated by something like proptest, in which case you for sure will want to override the seed if a failing one is found.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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