Skip to content

[RF] Remove the legacy evaluation backend - #23265

Merged
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:remove-legacy-eval-backend
Nov 12, 2026
Merged

guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:remove-legacy-eval-backend

Conversation

@guitargeek

@guitargeek guitargeek commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

The legacy evaluation backend was deprecated in ROOT 6.42 and is now removed, as announced in the 6.42 release notes. It was superseded by the vectorized "cpu" backend, the default since ROOT 6.32, and has had no performance relevant feature left since the constant term optimization was removed.

Removed

  • RooFit::EvalBackend::Legacy(). EvalBackend("legacy") now throws. The leftover BatchMode() definitions are removed too.
  • The legacy test statistics RooNLLVar, RooChi2Var, RooAbsOptTestStatistic and RooAbsTestStatistic, and their multiprocessing via RooRealMPFE and BidirMMapPipe (~7k lines).
  • The nll::name[pdf,data] and chi2::name[pdf,data] factory expressions.

Behaviour changes

  • NumCPU() no longer forks processes. It only sets the number of threads for RooBatchCompute and ignores the interleaving strategy. For multi-process fits, use RooFit::Parallelize().
  • RooFormulaVar::defaultErrorLevel() now recognizes the test statistics of the new backends. A RooFormulaVar that wraps a "cpu" likelihood now gets error level 0.5 instead of 1.
  • RooFit::TestStatistics::RooUnbinnedL and the NLLFactory now default to the "cpu" backend.

Preparatory fixes

  • Tests that used the legacy backend as their reference now compare against "cpu".
  • Re-enable test that never ran: LikelihoodGradientJobTest.GaussianND, which had a misspelled guard macro.

The 6.44 release notes are updated accordingly.

@guitargeek guitargeek self-assigned this Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Test Results

    20 files      20 suites   3d 3h 22m 50s ⏱️
 3 879 tests  3 878 ✅ 0 💤 1 ❌
69 822 runs  69 821 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 72d5587.

♻️ This comment has been updated with latest results.

@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch 3 times, most recently from 7820e08 to 0075fa0 Compare September 10, 2026 16:49
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 0075fa0 to 5dd456a Compare September 14, 2026 19:28
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 5dd456a to 554e8c1 Compare October 19, 2026 07:30
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 554e8c1 to d20e739 Compare October 29, 2026 23:21
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch 3 times, most recently from 7aeb573 to fab4e8e Compare November 9, 2026 13:02
@guitargeek
guitargeek marked this pull request as ready for review November 9, 2026 15:08
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch 2 times, most recently from f15d7bf to aa721a1 Compare November 9, 2026 21:51
@guitargeek guitargeek added the clean build Ask CI to do non-incremental build on PR label Nov 9, 2026
@guitargeek guitargeek closed this Nov 9, 2026
@guitargeek guitargeek reopened this Nov 9, 2026
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from aa721a1 to 912285b Compare November 10, 2026 14:34
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 912285b to 30b9fca Compare November 10, 2026 16:10
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 30b9fca to 585b553 Compare November 11, 2026 07:59
@guitargeek

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Final push to resolve merge merge conflicts in header includes.

Keep the coverage of the remaining code when the legacy backend goes:

  * Tests that used the legacy backend as the reference compare with
    the "cpu" backend now: the chi2 backend cross-checks, the HS3 test
    suite, the TestStatistics likelihood tests, RooNLLVar.CopyRangedNLL,
    RooRealL.setVal and the binned LikelihoodSerial test. Tests that
    were only enabled with the legacy backend run unconditionally.

  * Vectorized pdf fixtures with a disabled fit test ran their "cpu" fit
    only in the comparison with the legacy fit. Their fit tests are
    enabled now, except for the two "Gauss + Gauss + Exp" fixtures that
    miss the 1 % yield tolerance; a new test checks their convergence.

  * The HistFactory evaluation test checked the scalar getVal() only
    with the legacy backend. Now it compares it to the vectorized
    evaluation.

  * LikelihoodGradientJobTest.GaussianND never ran because of a
    misspelled guard macro. It runs now, with relative tolerances.

Assisted-by: claude-code:claude-opus-5-5
The legacy backend for likelihood and chi-square fits was superseded by
the vectorized "cpu" backend, the default since ROOT 6.32, and had no
performance-relevant feature left since the removal of the constant
term optimization.

  * RooFit::EvalBackend::Legacy() and its enum value are removed;
    EvalBackend("legacy") throws, saying that the backend was removed.
    The BatchMode() definitions, undeclared since 42e4cdc, go too.

  * The legacy test statistics RooNLLVar, RooChi2Var,
    RooAbsOptTestStatistic and RooAbsTestStatistic are removed, and so
    is their multiprocessing with RooRealMPFE and BidirMMapPipe.
    NumCPU() no longer forks processes: it only sets the number of
    threads for the batch evaluation in RooBatchCompute and ignores its
    interleaving strategy. The multi-process alternative remains
    RooFit::Parallelize(), based on RooFit::MultiProcess.

  * The factory expressions nll::name[pdf,data] and chi2::name[pdf,data]
    are removed with the classes they instantiated.

  * RooFormulaVar::defaultErrorLevel() recognizes the test statistics of
    the new backends, like RooAddition. It only recognized the legacy
    classes before, so a RooFormulaVar wrapping a "cpu" likelihood had
    the error level 1 instead of 0.5.

  * RooFit::TestStatistics::RooUnbinnedL always uses the
    RooFit::Evaluator now, and RooUnbinnedL and the NLLFactory default
    to the "cpu" backend instead of "legacy". RooAbsL::GetInfo() reports
    the name of the pdf compiled for the normalization set.

  * The roofit_legacy_eval_backend CMake option is gone, and xroofit is
    built unconditionally on non-MSVC platforms.

Legacy-only tests and the legacy instances of tests that run with every
backend are removed; the previous commit made the other tests
independent of the legacy backend. New tests cover the error level of
wrapped test statistics and the error for the removed backend.

Assisted-by: claude-code:claude-opus-5-5
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 585b553 to 72d5587 Compare November 11, 2026 11:15
@guitargeek
guitargeek merged commit 858acbf into root-project:master Nov 12, 2026
29 of 34 checks passed
@guitargeek
guitargeek deleted the remove-legacy-eval-backend branch November 12, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Assisted clean build Ask CI to do non-incremental build on PR in:RooFit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants