Fix deterministic reset on all reset paths and broken density FAB actions#1
Open
Sidem wants to merge 1 commit into
Open
Fix deterministic reset on all reset paths and broken density FAB actions#1Sidem wants to merge 1 commit into
Sidem wants to merge 1 commit into
Conversation
Clone & mutate (and other ruleset ops) reseeded each world with Date.now()+idx, ignoring the deterministic flag, so the post-op reset was never deterministic. Added a _getResetSeed helper and routed all six reset paths through it. Also fixed two FAB density actions that dispatched undefined event constants (no-op), and disabled EVENT_BUS_LOGGING in committed config. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Date.now() + idx, ignoring thedeterministicflag - so the reset that follows those ops was never deterministic, even though plain world resets were. Added a_getResetSeed(baseSeed, worldIndex)helper onWorldManager(shared base seed in deterministic mode,baseSeed + idxotherwise) and routed all six reset paths through it.WorldsController) dispatchedCOMMAND_RESET_DENSITIES_TO_DEFAULT/COMMAND_APPLY_SELECTED_DENSITY_TO_ALL, which are not defined inEventBus.js- so the dispatches resolved toundefinedand silently no-op'd. Repointed to the real constantsCOMMAND_RESET_INITIAL_STATES_TO_DEFAULT/COMMAND_APPLY_SELECTED_INITIAL_STATE_TO_ALL.EVENT_BUS_LOGGINGin committedconfig.jsso production builds don't log every UI event.Why
The deterministic toggle is meant to make resets reproducible across worlds; clone/mutate skipped it entirely. The density actions were fully dead due to a constant-name mismatch - the kind of bug an untyped event bus hides.
Reviewer notes
LOAD_STATEand clear paths were intentionally left alone - they don't reseed from RNG, so determinism does not apply._getResetSeed; verified via grep.Test plan
npm run lint- 0 errorsnpm run build- succeeds