Skip to content

Fix reading of RVec branches written by RDataFrame::Snapshot - #438

Merged
linev merged 2 commits into
root-project:devfrom
Prafyl:fix-rdf-rvec-branch
Nov 19, 2026
Merged

linev merged 2 commits into
root-project:devfrom
Prafyl:fix-rdf-rvec-branch

Conversation

@Prafyl

@Prafyl Prafyl commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

When RDataFrame::Snapshot writes an RVec column, for example one defined as Jet_pt[Jet_pt > 15], it is stored as a ROOT::VecOps::RVec<T> branch. jsroot can't read these yet. It prints "Not found streamer for ROOT::VecOps::RVec<float>" and then treeProcess and treeDraw fail with "Fail to add branch". Plain C arrays from the input tree are still written as arrays, so they already work.

An RVec is stored on disk the same way as a std::vector, but the file has no streamer info for it. The fix just treats the ROOT::VecOps::RVec prefix as vector in createStreamerElement.

I added demo/node/tree_rvec_test.{cxx,js,root} with RVec of float, double, int, long, bool and std::string, plus one line in each CI job. The test fails on current dev and passes with the fix, and all 100 entries match what ROOT 6.40 reads from the same file.

this was assisted by ai

@linev linev self-assigned this Nov 18, 2026

@linev linev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for providing the fix

@linev
linev merged commit 429fc61 into root-project:dev Nov 19, 2026
33 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