Skip to content

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Mar 7, 2023

In the ROOT 6.26 development cycle, the RooProdPdf was partially rewritten in moden C++ with less manual memory allocation to improve performance (PR #7907).

In that PR, a unit test that verifies the RooProdPdf can correctly deal with factorizing PDFs was implemented. However, that test used an arbitrary PDF where the correct factorization was checked in a rather crude way: check by hashing the content of the RooProdPdf cache element for a given normalization set that said PR doesn't change any behavior (the reference hash was hardcoded in the unit test).

This commit suggests a better alternative for the unit test, checking for a multidimensional product pdf of factorizing uniform pdfs that the pdf values for differenc normalization sets is as expected. This should cover the same functionality and is less fragile and implementation dependend than hashing the cache elements.

This closes GitHub issue #12430, as the rewritten test is not affected anymore by the problem reported in that issue.

The commit also removed the RooProdPdf::writeCacheToStream() function that was an implementation detail of the old unit test.

In the ROOT 6.26 development cycle, the RooProdPdf was partially
rewritten in moden C++ with less manual memory allocation to improve
performance (PR root-project#7907).

In that PR, a unit test that verifies the RooProdPdf can correctly deal
with factorizing PDFs was implemented. However, that test used an
arbitrary PDF where the correct factorization was checked in a rather
crude way: check by hashing the content of the RooProdPdf cache element
for a given normalization set that said PR doesn't change any behavior
(the reference hash was hardcoded in the unit test).

This commit suggests a better alternative for the unit test, checking
for a multidimensional product pdf of factorizing uniform pdfs that the
pdf values for differenc normalization sets is as expected. This should
cover the same functionality and is less fragile and implementation
dependend than hashing the cache elements.

This closes GitHub issue root-project#12430, as the rewritten test is not affected
anymore by the problem reported in that issue.
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@guitargeek guitargeek linked an issue Mar 7, 2023 that may be closed by this pull request
1 task
Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

LGTM!
Thank you Jonas for improving the test!

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.

[RF] RooProdPdf test failure on s390x

3 participants