[Minuit2] Fallback to full Hessian in AnalyticalGradientCalculator if no G2 #20957
Conversation
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 root-project#20913.
… HasG2 is false
Different code branches for limits and no limits are redundant in the AnalyticalGradientCalculator, because `DInt2Ext` already does that internally. It's better to simplify the code to reduce the margin for error.
|
@AdrianDBS, to which release branches do you need this backported? And does this also fix #20665? |
Test Results 22 files 22 suites 3d 12h 0m 46s ⏱️ For more details on these failures, see this check. Results for commit ec3de2a. |
Would be great if this could be backported to 6.36.
I will test this today. Yet, while it will most certainly fix the inconsistency described in the first comment in the ticket, I don't think it will solve the main issue described there. |
|
the mac26 failure seems spurious. |
Indeed it's a sporadic failure that we have suppressed in the past (with #19043), but in commit 50ae29d I have re-enabled such sporadically failing tests again so that we see if they are still there and if yes address them. The problem with disabling these tests is that we won't know if we regress with the cppyy upgrade. |
|
@AdrianDBS, thanks for trying it out, I'm looking forward to your report! The backport to 6.36 won't be a problem. |
If the user function doesn't claim to implement the diagonal of the
Hessian in an efficient way by overriding
HasG2()to returntrue,the AnalyticalGradientCalculator should not call
G2(), but insteadfall back to extract the diagonal from the full Hessian.
Closes #20913.
A test is implemented in a separate commit, and there is also a third commit with some code simplification.