Skip to content

Move observe before truncate in FitnessEliminator#132

Merged
HyperCodec merged 2 commits intomainfrom
copilot/move-observe-before-truncate
Feb 23, 2026
Merged

Move observe before truncate in FitnessEliminator#132
HyperCodec merged 2 commits intomainfrom
copilot/move-observe-before-truncate

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Observers were only receiving the post-truncation (surviving) portion of the population, rather than the full sorted fitness list.

Changes

  • genetic-rs-common/src/builtin/eliminator.rs: In both the standard and rayon eliminate implementations, call self.observer.observe(&fitnesses) before fitnesses.truncate(...).
// Before
fitnesses.truncate(median_index as usize + 1);
self.observer.observe(&fitnesses);

// After
self.observer.observe(&fitnesses);
fitnesses.truncate(median_index as usize + 1);
Original prompt

This section details on the original issue you should resolve

<issue_title>move call to observe before truncate in FitnessEliminator</issue_title>
<issue_description>Observers shouldn't only see the upper half, but actually the full thing.</issue_description>

Comments on the Issue (you are @copilot in this section)

@HyperCodec not a super high-priority issue, but definitely something i should fix by the next update.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Copilot AI changed the title [WIP] Move call to observe before truncate in FitnessEliminator Move observe before truncate in FitnessEliminator Feb 23, 2026
Copilot AI requested a review from HyperCodec February 23, 2026 22:50
@HyperCodec HyperCodec marked this pull request as ready for review February 23, 2026 23:55
@HyperCodec HyperCodec merged commit 037bce5 into main Feb 23, 2026
3 checks passed
@HyperCodec HyperCodec deleted the copilot/move-observe-before-truncate branch February 23, 2026 23:55
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.

move call to observe before truncate in FitnessEliminator

2 participants