Skip to content

[RF] Remove the legacy evaluation backend - #23265

Draft
guitargeek wants to merge 3 commits into
root-project:masterfrom
guitargeek:remove-legacy-eval-backend
Draft

[RF] Remove the legacy evaluation backend#23265
guitargeek wants to merge 3 commits into
root-project:masterfrom
guitargeek:remove-legacy-eval-backend

Conversation

@guitargeek

@guitargeek guitargeek commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This is meant to be merged only in the 6.44 development cycle, following a deprecation that will be done in 6.42

The PR is already opened now so we can check possible blind spots with the new evaluation backends.

The probabilities returned by the RooFit::Evaluator are indexed by the
original event indices, aligned with the weights that are obtained from
RooAbsData::getWeightBatch(). Skipping zero-weight events when creating
the data spans misaligns the two arrays, resulting in NaNs when
evaluating the likelihood of a binned dataset with empty bins.

Zero-weight events are already skipped in the summation loop, so don't
skip them when creating the data spans.

🤖 Done with the help of AI
Remove the legacy evaluation backend for likelihood and chi-square fits.
It was superseded by the vectorized "cpu" backend, which is the default
since ROOT 6.32. After the removal of the constant term optimization,
the legacy backend also had no performance-relevant feature left that
would justify its continued maintenance.

Concretely, this means:

  * RooFit::EvalBackend::Legacy() and the corresponding enum value are
    removed. Passing RooFit::EvalBackend("legacy") to fitTo(),
    createNLL(), chi2FitTo() or createChi2() now throws an exception,
    and so does the deprecated RooFit::BatchMode("off").

  * The implementation classes of the legacy test statistics are
    removed: RooNLLVar, RooChi2Var, RooAbsOptTestStatistic and
    RooAbsTestStatistic.

  * The old multiprocessing mechanism of the legacy backend is removed
    as well, consisting of the RooRealMPFE class and the underlying
    BidirMMapPipe. The RooFit::NumCPU() command argument is now ignored
    in fits; RooFit::Parallelize() based on RooFit::MultiProcess is the
    replacement.

  * The nll::name[pdf,data] and chi2::name[pdf,data] expressions in the
    RooWorkspace::factory() language are removed, since they
    instantiated the removed classes directly.

  * RooFit::TestStatistics::RooUnbinnedL now always evaluates with the
    RooFit::Evaluator, and its evalBackend constructor parameter
    defaults to the "cpu" backend, like the NLLFactory.

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

The tests that cross-checked the new backends against the legacy one
either compare against the "cpu" backend as the reference now (the chi2
cross-checks, which also probe for a usable CUDA device instead of
failing wholesale on machines without one), or are removed where their
only purpose was validating bit-by-bit agreement with the legacy
classes.

🤖 Done with the help of AI
@guitargeek guitargeek self-assigned this Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Test Results

    2 files      2 suites   5h 21m 14s ⏱️
2 610 tests 2 610 ✅ 0 💤 0 ❌
4 905 runs  4 905 ✅ 0 💤 0 ❌

Results for commit 462342d.

The HS3 test suite has not updated its reference results to the new
evaluation backend yet.
@guitargeek
guitargeek force-pushed the remove-legacy-eval-backend branch from 462342d to 7de1f04 Compare September 5, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant