Skip to content

Conversation

@fangyihao
Copy link

Net effect (what changes for users)

  • You can now choose between map-elites and threshold-elites archive insertion using DatabaseConfig.variant.

    • In threshold-elites, programs are:

    • filtered by novelty,

    • grouped into islands (with parent island inheritance),

  • and locally compared by embedding distance with a winner-takes-all rule inside a threshold radius.

  • The attention optimization evaluator becomes more portable (pathing) and its output schema shifts toward a combined_score field.

openevolve/database.py

This is the main functional change: introduces a “threshold-elites” variant alongside map-elites, and refactors add() accordingly.

Variant-based dispatch in add(...)

  • Database.add(...) now checks config.variant:

    • "map-elites" → add_map_elites_program(...)

    • "threshold-elites" → add_threshold_elites_program(...)

    • otherwise raises NotImplementedError.

New add_threshold_elites_program(...) behavior

When adding a program:

  • Stores program + iteration bookkeeping

    • Updates program.iteration_found and self.last_iteration.
  • Computes embedding + an elite score

    • Calls _calculate_feature_coords(program) and stores in program.embedding.

    • Computes a fitness-based score = get_fitness_score(...).

    • Stores program.metrics["elite_score"] = score.

  • Determines island placement

    • If target_island is not given and the program has a parent, it inherits the parent’s island from parent.metadata["island"] to keep island isolation.

    • Else falls back to self.current_island.

  • Novelty gating happens before insertion

    • If _is_novel(...) fails, the program is not added to the island.
  • Threshold-elites competition (within an island)

    • For existing programs in the island, computes Euclidean distance between embeddings.

    • If distance < elite_threshold, it keeps the higher elite_score and demotes the other by setting its elite_score to -inf (effectively marking it as dominated).

  • Finalization

    • Adds the program to the island, sets program.metadata["island"], updates archive/best tracking, enforces population limit, and optionally saves to disk.

Exploration parent sampling now preserves embeddings

  • In two places inside _sample_exploration_parent(...), when cloning the best program, it now does:

    • embedding=copy.deepcopy(best_program.embedding)
  • This prevents the clone from sharing the same embedding object reference.

Misc

  • copy, math, asdict/fields imports added (supporting new logic).

openevolve/config.py

  • Extends DatabaseConfig with parameters to support a new archive strategy:

    • variant: str = "threshold-elites" (strategy selector)

    • elite_threshold: int = 3 (distance threshold used by the new strategy)

examples/attention_optimization/evaluator.py

  • Makes MLIR path resolution robust:

    • Previously: Path("mlir/self_attn_with_consts_linalg_dialect.mlir") (relative to current working directory).

    • Now: builds an absolute path relative to the evaluator file’s directory using file. This prevents failures when running from a different working directory.

  • Renames/standardizes a scoring field:

    • In estimate_performance_from_ir(...), the returned dict changes from using optimization_score to combined_score.

    • In evaluate(...), result packaging similarly switches from optimization_score → combined_score.

@CLAassistant
Copy link

CLAassistant commented Feb 10, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ fangyihao
❌ Yihao Fang


Yihao Fang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@fangyihao fangyihao marked this pull request as draft February 10, 2026 22:33
@fangyihao
Copy link
Author

Converting this PR to Draft temporarily because the one of the commits isn't currently attributed to the correct GitHub account (author email not linked). Once the author email is updated/verified and the commits show proper attribution, we’ll move it back to Ready for review.

@fangyihao
Copy link
Author

Closing this PR for now because the one of the commits is not attributed to the correct GitHub account (author linking/email mismatch), which breaks ownership/traceability for review and auditing.

@fangyihao fangyihao closed this Feb 10, 2026
@fangyihao fangyihao deleted the Threshold-Elites-Island-based-Program-Selection branch February 10, 2026 22:41
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.

2 participants