Add iteration_found field to track when best program was discovered#23
Merged
codelion merged 4 commits intoalgorithmicsuperintelligence:mainfrom May 23, 2025
hafeezhmha:feature/add-iteration-found
Merged
Add iteration_found field to track when best program was discovered#23codelion merged 4 commits intoalgorithmicsuperintelligence:mainfrom hafeezhmha:feature/add-iteration-found
codelion merged 4 commits intoalgorithmicsuperintelligence:mainfrom
hafeezhmha:feature/add-iteration-found
Conversation
Member
|
I don’t think we need to introduce another field for it? The iteration field in the best program info is supposed to track the iteration in which the best program was found. |
Contributor
Author
that makes sense, lemme change it |
Contributor
Author
|
I've updated the PR can you check now! |
Contributor
Author
|
I have applied Black formatting for consistency! |
Member
|
I think you ended up with commits from two different GH users, you will need to sign the CLA for both. |
Contributor
Author
okay done! i think it has no issues now |
codelion
approved these changes
May 23, 2025
shubham3-ucb
pushed a commit
to mert-cemri/autoevolve-dev
that referenced
this pull request
Nov 26, 2025
…ature/add-iteration-found Add iteration_found field to track when best program was discovered
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.
Currently, the best_program_info.json file contains the current iteration number, not the iteration when the best program was actually discovered. This makes it difficult to analyze how quickly the algorithm finds better solutions.
When monitoring the progress using a command like:
watch -n 10 'jq ".metrics.combined_score, .iteration" "$(ls -d checkpoint_* | sort -V | tail -n1)/best_program_info.json"'The iteration value shown is the checkpoint iteration, not when the best program was actually found.
Solution
Added iteration_found field to the Program class to track when a program was discovered during evolution
Updated the add method in ProgramDatabase to set this field when adding a new program
Modified the _save_checkpoint and _save_best_program methods to include the iteration_found field in the output JSON files
Updated initialization of the initial program to set its iteration_found value
Testing
Tested with the function_minimization example to confirm the field is correctly saved in best_program_info.json. The monitoring command can now be updated to:
watch -n 10 'jq ".metrics.combined_score, .iteration_found, .iteration" "$(ls -d checkpoint_* | sort -V | tail -n1)/best_program_info.json"'This now correctly shows:
The iteration when that best program was found
The current iteration (checkpoint iteration)