Skip to content

[RF] Support analytical Hessians with Clad#21416

Open
guitargeek wants to merge 2 commits intoroot-project:masterfrom
guitargeek:roofit_hessians
Open

[RF] Support analytical Hessians with Clad#21416
guitargeek wants to merge 2 commits intoroot-project:masterfrom
guitargeek:roofit_hessians

Conversation

@guitargeek
Copy link
Contributor

Implement all the necessary infrastructure to optionally generate Hessians with Clad via RooFit "codegen", and forward them to Minuit 2, including also validation code in the debug macro that can be printed out for RooFit functions that support "codegen".

This addresses an Item from the ROOT 2026 plan of work.

It doesn't work yet, because a new Clad release is required, where this issue is fixed:
vgvassilev/clad#1736

However, it's already good to have all the necessary changes in ROOT so we can test and validate Clad developments for Hessian support more easily.

@guitargeek guitargeek self-assigned this Feb 27, 2026
@guitargeek guitargeek force-pushed the roofit_hessians branch 2 times, most recently from 05426d7 to 8b83639 Compare February 27, 2026 23:57
@guitargeek guitargeek requested a review from lmoneta as a code owner February 27, 2026 23:57
@guitargeek guitargeek force-pushed the roofit_hessians branch 2 times, most recently from ad4c51b to ab5c8cc Compare February 28, 2026 00:10
Implement all the necessary infrastructure to optionally generate
Hessians with Clad via RooFit "codegen", and forward them to Minuit 2,
including also validation code in the debug macro that can be printed
out for RooFit functions that support "codegen".

This addresses an Item from the ROOT 2026 plan of work.

It doesn't work yet, because a new Clad release is required, where this
issue is fixed:
vgvassilev/clad#1736

However, it's already good to have all the necessary changes in ROOT so
we can test and validate Clad developments for Hessian support more
easily.
Differentiating through Cling runtime checks in pointer dereferncing can
result in errors:
```txt
warning: attempted differentiation of function 'cling_runtime_internal_throwIfInvalidPointer' without definition and no suitable overload was found in namespace 'custom_derivatives'
note: numerical differentiation is not viable for 'cling_runtime_internal_throwIfInvalidPointer'; considering 'cling_runtime_internal_throwIfInvalidPointer' as 0
<<< cling interactive line includer >>>:1:1: error: read-only variable is not assignable

^
```
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 5h 26m 21s ⏱️
 3 804 tests  3 803 ✅ 1 💤 0 ❌
76 555 runs  76 546 ✅ 9 💤 0 ❌

Results for commit cedcb15.

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