Skip to content

Irace callback feature - #98

Open
rmartinsanta wants to merge 1 commit into
MLopez-Ibanez:masterfrom
mork-optimization:feat/callback
Open

Irace callback feature#98
rmartinsanta wants to merge 1 commit into
MLopez-Ibanez:masterfrom
mork-optimization:feat/callback

Conversation

@rmartinsanta

Copy link
Copy Markdown

Summary

Add an optional iterationCallback scenario function that is invoked after each completed irace iteration.

This allows users to monitor tuning progress or collect intermediate results without modifying irace internals.

Callback interface

The callback receives the following named arguments:

  • iteration: current iteration number.
  • elites: elite configurations ordered from best to worst.
  • progress: budget and timing information for the tuning run.

Callbacks should include ... as their final argument to remain compatible with additional arguments introduced by future irace versions. Example iteration_callback:

iteration_callback <- function(iteration, elites, progress, ...)
{
  message(
    "Iteration ", iteration,
    ": best configuration is ", elites[[".ID."]][1L]
  )
}

Arguments are passed by name, and a copy of the elite configurations is provided so callback mutations cannot affect the tuning run. Random-number generation inside the callback also
does not alter irace's RNG sequence.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.43%. Comparing base (7308aca) to head (bec759c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
+ Coverage   75.30%   75.43%   +0.12%     
==========================================
  Files          30       30              
  Lines        5087     5113      +26     
==========================================
+ Hits         3831     3857      +26     
  Misses       1256     1256              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MLopez-Ibanez

Copy link
Copy Markdown
Owner

Looks very good. Could you also add an entry to the NEWS.md file? I am in the middle of releasing the next version of irace, so this will go into irace 4.5. I will commit it as soon as irace 4.4.4 is released.

@MLopez-Ibanez

Copy link
Copy Markdown
Owner

I will also squash the multiple commits into a single one, so feel free to do that already.

@rmartinsanta

Copy link
Copy Markdown
Author

Updated NEWS.md and squashed the commits, thanks for the fast response!

@MLopez-Ibanez

Copy link
Copy Markdown
Owner

@rmartinsanta Now that irace 4.4.4 has been released, could you rebase on top of the main branch and resolve the conflicts? They are probably due to updates to NEWS.md in main. I will then merge the PR.

(cherry picked from commit bec759c)
@rmartinsanta

Copy link
Copy Markdown
Author

Done!

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