Skip to content

fix(map-elites): isolate seeded evolutionary search randomness - #289

Open
liuzhengyang699 wants to merge 1 commit into
ANative-Lab:mainfrom
liuzhengyang699:fix/map-elites-local-rng
Open

liuzhengyang699 wants to merge 1 commit into
ANative-Lab:mainfrom
liuzhengyang699:fix/map-elites-local-rng

Conversation

@liuzhengyang699

Copy link
Copy Markdown

MapElitesOptimizer(random_seed=...) reseeds Python's global generator, and every exploration, parent-selection and mutation draw uses that same generator. Constructing another optimizer or consuming randomness in the evaluator therefore changes the candidate sequence despite the fixed seed; constructing the optimizer also changes randomness for unrelated callers.

Keep a random.Random(random_seed) instance on the optimizer and use it for all search draws. The search remains stochastic when no seed is supplied.

Validation: python -m pytest tests/src/optimizers/test_map_elites_optimizer.py tests/src/optimizers/test_optimizer_package_imports.py -q — 4 passed. Both new regressions fail on upstream: global RNG state changes, and identical seeded optimizers produce different candidate histories when the evaluator consumes random numbers. Focused Ruff correctness checks (E4,E7,E9,F) and git diff --check passed. Full Ruff still reports pre-existing typing/import-style findings in these files. No model calls.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T16:13:36.014328Z 13769f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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.

1 participant