Skip to content

[hist] Fix TFormula Hessian result sizing - #22877

Merged
guitargeek merged 1 commit into
root-project:masterfrom
shuv-amp:fix-tformula-hessian-size
Jul 28, 2026
Merged

[hist] Fix TFormula Hessian result sizing#22877
guitargeek merged 1 commit into
root-project:masterfrom
shuv-amp:fix-tformula-hessian-size

Conversation

@shuv-amp

Copy link
Copy Markdown
Contributor

TFormula::HessianPar returns a flattened matrix with fNpar * fNpar
elements, but the CladStorage overload only resized results smaller
than fNpar. With two parameters, a two-element result passed the old
check even though the Hessian needs four elements.

Use the full Hessian size for the check and update the existing
ResultUpsize test to cover this case.

HessianPar writes fNpar * fNpar entries, but its CladStorage overload
only resized results smaller than fNpar. For two or more parameters, a
partially sized result could pass the check and leave Clad writing
past the vector's size.

Check for the full flattened Hessian size and cover the missed case in
ResultUpsize.
@guitargeek

Copy link
Copy Markdown
Contributor

Hi! Thanks for the PR! How did you get interested in fixing this? Are you a user of ROOT, TFormula, or Clad?

@shuv-amp

Copy link
Copy Markdown
Contributor Author

Hi @guitargeek, I’m not a user yet. I’d been reading about CERN, and ROOT kept coming up, so I started exploring the code. In HessianPar, I noticed the size check used fNpar even though the Hessian result needs fNpar * fNpar entries. A two-parameter case exposed the mismatch.

@github-actions

Copy link
Copy Markdown

Test Results

    18 files      18 suites   3d 10h 22m 25s ⏱️
 3 848 tests  3 847 ✅ 0 💤 1 ❌
67 283 runs  67 281 ✅ 1 💤 1 ❌

For more details on these failures, see this check.

Results for commit b0fe66b.

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

@guitargeek
guitargeek merged commit 6178e53 into root-project:master Jul 28, 2026
28 of 35 checks passed
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.

2 participants