Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Nov 28, 2025

Fixes two bugs affecting ESSOptimizer and SacessOptimizer:

  • The ranking of candidates for local optimization startpoints was wrong in many cases. Only relevant if a local optimizer was used.
  • In some cases, objective evaluations were counted twice. Resulting in incorrect reporting of the total number of evaluations and not fully exhausting the objective evaluations budget.

Fixes two bugs affecting `ESSOptimizer` and 'SacessOptimize`:

* The ranking of candidates for local optimization startpoints was wrong in many cases. Only relevant if a local optimizer was used.
* In some cases, objective evaluations were counted twice. Resulting in incorrect reporting of the total number of evaluations and not fully exhausting the objective evaluations budget.
@dweindl dweindl self-assigned this Nov 28, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.31%. Comparing base (a559537) to head (ea17bf1).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1644      +/-   ##
===========================================
+ Coverage    84.28%   84.31%   +0.03%     
===========================================
  Files          163      163              
  Lines        14136    14134       -2     
===========================================
+ Hits         11914    11917       +3     
+ Misses        2222     2217       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏🏼 I don't think I fully comprehended the error. Perhaps a test would be good to assess this also does not break in future versions? But not a must, as I am not sure on the exact benefit of such a test.

and self.n_iter - self.last_local_search_niter >= self.local_n2
):
quality_order = np.argsort(fx_best_children)
quality_order = np.argsort(fx_best_children).argsort()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it twice argsort? Seems counterintuitive to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get the ranking.

The objective function values in the same order as the inputs.
"""
res = np.fromiter(map(self.single, xs), dtype=float)
self.n_eval += len(xs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure on the usage, I guess it means in the non MT case, we actually would count too often and don't need to track it in this manner at all? Cause now it is not tracked unless we use FunctionEvaluatorMT

Copy link
Member Author

@dweindl dweindl Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's counted inside self.single on the line above. Thus, it was counted twice before, ẃhich is what I want to fix here.

@dweindl
Copy link
Member Author

dweindl commented Dec 4, 2025

Perhaps a test would be good

Tests are implemented elsewhere. This is the last scatter search thing I'll update here besides adding a deprecation warning soon (#1641 (comment)). Therefore, I didn't add additional tests.

@PaulJonasJost
Copy link
Collaborator

Perhaps a test would be good

Tests are implemented elsewhere. This is the last scatter search thing I'll update here besides adding a deprecation warning soon (#1641 (comment)). Therefore, I didn't add additional tests.

Great, happy to merge it then :)

@dweindl dweindl merged commit 264515c into ICB-DCM:develop Dec 8, 2025
18 checks passed
@dweindl dweindl deleted the sacess_fixes branch December 8, 2025 09:10
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.

3 participants