Skip to content

Fix bugs with analytical Hessian#71

Merged
AdrianDBS merged 6 commits intomainfrom
feature/extend_benchmarks_and_tests
Jan 22, 2026
Merged

Fix bugs with analytical Hessian#71
AdrianDBS merged 6 commits intomainfrom
feature/extend_benchmarks_and_tests

Conversation

@AdrianDBS
Copy link
Collaborator

No description provided.

Relevant ROOT patches:

1.  84cca5ef770e677f88955a83759158a4db3fd0dd
    [Minuit2] Fix external index usage in analytical Hessian

    Fix external index usage in analytical Hessian and also add a
    unit test to cover this former bug.

    This problem exists since the introduction of external Hessians to
    Minuit2 in 888a7677f7b4e7a in the ROOT 6.28 development cycle.

    This bug was discovered while investigating #20913.

2.  4ffe39c8d3baeb1476316ac50ccfe822758388b3
    [Minuit2] Fallback to full Hessian in AnalyticalGradientCalc. if
    no G2

    If the user function doesn't claim to implement the diagonal of the
    Hessian in an efficient way by overriding `HasG2()` to return
    `true`, the AnalyticalGradientCalculator should not call `G2()`,
    but instead fall back to extract the diagonal from the full Hessian.

    Closes #20913.
… evaluated when only full model Hessian is provided

This was a workaround for the "G2 bug" in Minuit2 that is fixed now
(see commit a516d01).
When no model Hessian diagonal is provided, the Minuit2 code now has
the expected behavior: The cost function's G2 (= Hessian diagonal),
when needed, is extracted from the full Hessian, so there is no need
to duplicate that logic in the C# code.
In the end, the issue was not the seeding/regularization of the
Hessian per se, but (primarily) a Hessian indexing error that occured
when some parameters were fixed and/or limit-constrained
(see fix commit a516d01).
false is the default for Exec tasks, so there is no need to specify it.
@AdrianDBS AdrianDBS merged commit 9a30630 into main Jan 22, 2026
5 checks passed
@AdrianDBS AdrianDBS deleted the feature/extend_benchmarks_and_tests branch January 22, 2026 20:43
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.

1 participant