Enable secret seeds#228
Merged
Merged
Conversation
21adeed to
7e5943c
Compare
7e5943c to
880414c
Compare
Merged
S1ro1
approved these changes
Apr 3, 2025
|
|
||
| mode = sys.argv[1] | ||
| tests = get_test_cases(sys.argv[2]) | ||
| seed = os.getenv("POPCORN_SEED") |
Member
There was a problem hiding this comment.
A small nit (have highligted just one line, but should replace 2 below as well):
Suggested change
| seed = os.getenv("POPCORN_SEED") | |
| seed = int(os.getenv("POPCORN_SEED", 42)) | |
| set_seed(seed) | |
| tests = get_test_cases(sys.argv[2], seed) |
Collaborator
Author
There was a problem hiding this comment.
not sure about these changes:
- I really dislike set_seed, it adjusts global state, and if you were to actually use it you couldn't run a subset of the tests; you would have to run them all, and in the same order.
- I explicitly want to have the None value here, which tells
get_test_casesto use the seeds from theymlfile as-is.
We could put an unconditional set_seed(42) call here, as an insurance policy in case a test unintentionally relies on a source of randomness not controlled by the explcitly-passed seed argument.
Maybe we should actually add a new bot commend "check-task", that runs the test case generators in randomized order an checks that they're reproducible?
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable (and use) secret seeds in the default python runner (
examples/eval.py).Secret seeds are not used in
eval.cuyet.Requires a modal redeploy.
Because
eval.pyis baked into the task definitions, none of the existing tasks will benefit from this. We'll need to figure out how to update existing tasks separately.