Skip to content

fix: invalid chromosome query pollutes fRefVec (issue #23)#36

Closed
ZaGrayWolf wants to merge 12 commits intocompiler-research:developfrom
ZaGrayWolf:fix/build-compatibility-root638
Closed

fix: invalid chromosome query pollutes fRefVec (issue #23)#36
ZaGrayWolf wants to merge 12 commits intocompiler-research:developfrom
ZaGrayWolf:fix/build-compatibility-root638

Conversation

@ZaGrayWolf
Copy link
Copy Markdown

Problem

ramntupleview() called GetRefId() during region queries. Since
GetRefId() always inserts unknown names into fRefVec, querying a
non-existent chromosome silently corrupted the reference name table.

Fix

Added FindRefId() to RAMNTupleRefs — a const lookup-only method
that returns -1 for unknown chromosomes without inserting them.
ramntupleview() now calls FindRefId() and exits early with a clear
error message for unknown chromosomes.

Test

Added InvalidChromosomeDoesNotPolluteFRefVec to ramcoretests.cxx.
All 3 tests pass:

  • ConversionProducesEqualEntries ✓
  • RNTupleView ✓
  • InvalidChromosomeDoesNotPolluteFRefVec ✓

Additional fixes

  • Replace ROOT::Experimental::RNTupleParallelWriter with
    ROOT::RNTupleParallelWriter for ROOT 6.38 compatibility
  • Add PRIVATE keyword to benchmark::benchmark link libraries

Fixes #23

@mvassilev
Copy link
Copy Markdown
Collaborator

@ZaGrayWolf please fix the conflicts

…ch#23)

- Add FindRefId() to RAMNTupleRefs: lookup-only, returns -1 for unknown
  chromosomes without inserting them into fRefVec
- Use FindRefId() in ramntupleview() instead of GetRefId() to prevent
  silent corruption of the reference name table during queries
- Add early exit in ramntupleview() with clear error message for unknown
  chromosomes
- Add test InvalidChromosomeDoesNotPolluteFRefVec to verify the fix
- Fix ROOT::Experimental::RNTupleParallelWriter namespace for ROOT 6.38
- Add PRIVATE keyword to benchmark target_link_libraries (CMake best practice)

Fixes compiler-research#23
@ZaGrayWolf ZaGrayWolf force-pushed the fix/build-compatibility-root638 branch from 099a89e to b83eef3 Compare March 20, 2026 10:39
@ZaGrayWolf
Copy link
Copy Markdown
Author

Conflicts resolved

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/ramcore/RAMNTupleView.cxx
Comment thread src/ramcore/RAMNTupleView.cxx Outdated
Comment thread src/ramcore/RAMNTupleView.cxx Outdated
Comment thread src/ramcore/RAMNTupleView.cxx Outdated
Comment thread src/ramcore/RAMNTupleView.cxx
Comment thread src/ramcore/RAMNTupleView.cxx
Comment thread test/ramcoretests.cxx
Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
Copy link
Copy Markdown

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Please make sure your pull request is minimal and touches only the parts that it needs to.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
ZaGrayWolf and others added 7 commits March 25, 2026 18:09
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ZaGrayWolf ZaGrayWolf requested a review from vgvassilev March 25, 2026 12:50
Copy link
Copy Markdown
Author

@ZaGrayWolf ZaGrayWolf left a comment

Choose a reason for hiding this comment

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

Fixed CI issues raised by clang-tidy:

  • Corrected include path for RAMNTupleView.h
  • Added missing include for std::stoi
  • Cleaned up unused headers as suggested

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/ramcore/RAMNTupleView.cxx Outdated
Comment thread test/ramcoretests.cxx
Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
ZaGrayWolf and others added 3 commits March 26, 2026 11:41
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ZaGrayWolf
Copy link
Copy Markdown
Author

Superseding with #53, that PR accumulated merge commits and unrelated clang-tidy changes over time. The new one is a clean single commit touching only the 4 files needed for this fix. Closing this one.

@ZaGrayWolf ZaGrayWolf closed this Apr 13, 2026
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.

[Bug] Querying an invalid chromosome using ramntupleview adds it to fRefVec

3 participants