Skip to content

fix(algos): Fixes infinite loop in mutate_parents when mutations are … - #257

Open
Madson Dias (omadson) wants to merge 1 commit into
microsoft:mainfrom
omadson:fix/mutate-parents-infinite-loop
Open

Madson Dias (omadson) wants to merge 1 commit into
microsoft:mainfrom
omadson:fix/mutate-parents-infinite-loop

Conversation

@omadson

Copy link
Copy Markdown

Pull Request Template

Description

While testing the search algorithms I noticed that LocalSearch, RegularizedEvolutionSearch and MoBananasSearch can hang forever in mutate_parents: on an invalid mutation, continue skips nb_tries += 1, so patience is never enforced.

EvolutionParetoSearch had the same bug and #225 fixed it. This applies the same fix to the other three.

Tests

One new test per algorithm: all mutations are invalid and mutate must be called at most patience times. They fail without the fix and pass with it (pytest tests/discrete_search/algos: 9 passed).

Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (causes existing functionality to not work as expected)
  • Documentation update

Configuration:

  • Archai version: 1.0.0
  • Environment: Python 3.10, venv
  • OS: Linux

Final checks:

  • Follows guidelines of project
  • Self-review of code
  • Commented code in hard-to-understand areas
  • Corresponding changes to the documentation
  • Changes generate no new warnings
  • Dependent changes have already been merged
  • Checked code correction any misspellings

@omadson

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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