Repository navigation
[RF][HF] Experimental storage efficient HistFactory rewrite - #24218
Draft
guitargeek wants to merge 5 commits into
Draft
guitargeek wants to merge 5 commits into
guitargeek wants to merge 5 commits into
Conversation
Test Results 21 files 21 suites 3d 8h 59m 48s ⏱️ Results for commit 5e58d6b. ♻️ This comment has been updated with latest results. |
guitargeek
force-pushed
the
histfactory-pdf
branch
from
November 18, 2026 12:05
0d0dd6e to
5e58d6b
Compare
A RooHistFactorySample is one sample of a HistFactory channel: the nominal histogram with all its modifiers, in a single object. Its histogram data is shared between clones. A RooHistFactoryPdf is the channel, a RooRealSumPdf of its samples, and corresponds to the HS3 histfactory_dist. The arithmetic is in RooFit::Detail::MathFuncs, so that the evaluation and code generation use the same functions, in the order of operations of the HistFactory models so far. Assisted-by: claude-code:claude-opus-5-5
HistFactory and the HS3 importer now create one RooHistFactorySample per sample instead of several RooFit objects per histogram. The previous structure is still available with HistoToWorkspaceFactoryFast::Configuration::useHistFactoryPdf, `hist2workspace -legacy_model_structure`, and RooJSONFactoryWSTool::config().useHistFactoryPdf. The HS3 exporter writes RooHistFactoryPdf directly, keeping the names of the modifiers. The tests that inspect the RooFit objects of the models are adapted, and the ones about exporting the previous structure use it explicitly. Assisted-by: claude-code:claude-opus-5-5
RooWorkspace::Write() and the reading in RooWorkspace::Streamer() open a WorkspaceStreamingContext, in which the streamers of the workspace objects can share state. With it, they can write large payloads to the file after the workspace, which is limited to 1 GB like all objects in ROOT files. Assisted-by: claude-code:claude-opus-5-5
When a workspace is written with RooWorkspace::Write(), the data of all its RooHistFactorySamples goes to the RNTuple `<workspace>_histfactory_arrays`, committed after the workspace itself. HistFactory workspaces are then no longer limited to 1 GB. hist2workspace writes its workspaces like this. Assisted-by: claude-code:claude-opus-5-5
With HistoToWorkspaceFactoryFast::Configuration::writeMeasurement set to false, MakeModelAndMeasurementFast() writes only the workspaces to the files of the channels and of the combined model, without the Measurement and the directories with copies of its histograms. The Measurement holds all histograms, so it is subject to the 1 GB limit of single objects in ROOT files like the workspace was before its histograms could go to an RNTuple, and the workspaces don't need it. Assisted-by: claude-code:claude-opus-5-5
guitargeek
force-pushed
the
histfactory-pdf
branch
from
November 21, 2026 14:30
5e58d6b to
c361943
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an experiment on making HistFactory models up to 20x smaller in memory and never be bothered by the 1GB limit on disk, by using an RNTuple to store array data from the model.