rest-for-physics / rest-for-physics/framework
Output files lose event-class StreamerInfos (UPDATE session on close wipes them)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 19
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Every output file written by restManager is missing the StreamerInfos of the event classes it contains. Without them ROOT cannot apply schema evolution, so any change to an event class definition makes older files unreadable.
Mechanism
- Worker threads write events to temporary files;
TRestRun::MergeToOutputFilemerges them. The merged file at this point has all StreamerInfos. - The same method then reopens the output in UPDATE mode to write metadata.
- On close,
TFile::WriteStreamerInfo()(see ROOTTFile.cxx) frees the previous StreamerInfo record and writes only the classes streamed during the current session — i.e. only the metadata classes. The event-class infos are gone.
Verified with a minimal reproducer (write tree → infos present; TFileMerger → still present; reopen UPDATE + write a TNamed → event infos wiped). restG4 files are unaffected (single write session).
Consequences
- rest-for-physics/detectorlib#125: the
vector<Float_t>→vector<Double_t>change in TRestDetectorSignal (detectorlib#109) made all pre-v2.4.3 detector signal data unreadable (multi-GB allocations / OOM), because ROOT has no record of the on-disk layout. Recovery tool in #566. - Any future event-class change will have the same effect on files written before the fix.
Fix
PR #567 re-tags the existing infos after each UPDATE open so they are rewritten on close. Not covered there (lower risk, could be follow-ups): TFileMerger's own UPDATE path in MergeToOutputFile(outputfilename != ""), TRestAnalysisTree::AddChainFile, and the plot tools' UPDATE sessions (TRestMetadataPlot, TRestDataSetPlot). Read-only UPDATE sessions are safe (WriteStreamerInfo is a no-op unless something was streamed).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TRestRun::MergeToOutputFile and the ROOT TFile.cxx behavior described in the issue, then review PR #567 and the named follow-up paths: TFileMerger, TRestAnalysisTree::AddChainFile, TRestMetadataPlot, and TRestDataSetPlot. Done means UPDATE sessions retain the event-class StreamerInfos after closing, with the remaining affected paths assessed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100