Closed
Make the walkthrough seed opt-in: unseeded FrotzEnv is now stochastic (v4.0)#86
Conversation
Co-authored-by: MarcCote <660004+MarcCote@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add warning for silent fixed-seed default in Jericho
Make the walkthrough seed opt-in: unseeded FrotzEnv is now stochastic (v4.0)
Jul 29, 2026
MarcCote
marked this pull request as ready for review
July 29, 2026 13:35
This was referenced Jul 29, 2026
Open
Collaborator
|
Superseded by #88 |
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.
FrotzEnv(rom)without a seed silently applied the walkthrough seed (e.g.12for Zork I) for any game with bindings, i.e. the whole benchmark suite. Callers who reasonably assumed "no seed → stochastic" were unknowingly running deterministic episodes, applying the fixed-seed handicap the Jericho paper asks researchers to disclose.reset()'s docstring already advertised ause_walkthrough_seedparameter that was never implemented.This is a breaking change; version bumped to
4.0.0.API changes (
jericho/jericho.py)seed(None)now resolves to-1(time-dependent) instead ofbindings['seed']. As a side effect, an explicitseed=0is now honored — the previousseed or bindings.get(...)treated it as unset.reset(use_walkthrough_seed=False)implements the documented toggle;Trueseeds the emulator with the walkthrough seed for that episode, and warns (UnsupportedGameWarning) if the game has none.FrotzEnv.walkthrough_seedproperty exposing the game's walkthrough seed, orNone.ImplicitRandomSeedWarningraised onreset()when the game has a walkthrough seed and the caller supplied neither an explicit seed noruse_walkthrough_seed— silent for anyone who made the choice explicit.Callers and docs
tools/test_games.py,tools/find_walkthrough.pyandtests/test_jericho.py::test_copyreplay walkthroughs, so they now reset withuse_walkthrough_seed=True.tests/test_seed.pycovers seed resolution, the new property, warning behavior, and walkthrough reproducibility.