Skip to content

[tree] Fix long64 tree index losing precision on 64-bit long double platforms and enable forgotten test#19741

Merged
guitargeek merged 2 commits into
root-project:masterfrom
ferdymercury:indexl64
Jun 15, 2026
Merged

[tree] Fix long64 tree index losing precision on 64-bit long double platforms and enable forgotten test#19741
guitargeek merged 2 commits into
root-project:masterfrom
ferdymercury:indexl64

Conversation

@ferdymercury

@ferdymercury ferdymercury commented Aug 25, 2025

Copy link
Copy Markdown
Collaborator

This is a fixup of #19561 that was supposed to fix #19560

A test was created there, but it was forgotten to add it to the CMakeLists. As a consequence, the CI looked green but the test was not running at all, and it was actually broken.

This PR reenables the test as well as fixes the TTree code to unbreak the test.

@ferdymercury

ferdymercury commented Aug 25, 2025

Copy link
Copy Markdown
Collaborator Author

It seems Windows/MacOS still do not like big long64 values... :s

@ferdymercury ferdymercury marked this pull request as draft August 25, 2025 15:02
@github-actions

github-actions Bot commented Aug 25, 2025

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 14h 52m 56s ⏱️
 3 865 tests  3 858 ✅   0 💤 7 ❌
77 251 runs  77 138 ✅ 106 💤 7 ❌

For more details on these failures, see this check.

Results for commit 4626182.

♻️ This comment has been updated with latest results.

@ferdymercury

Copy link
Copy Markdown
Collaborator Author

@guitargeek since your last PRs touch some tree code, could you maybe check if Claude can also help with reenabling this broken test?

@ferdymercury ferdymercury requested a review from guitargeek June 13, 2026 10:52
@guitargeek guitargeek closed this Jun 13, 2026
@guitargeek guitargeek reopened this Jun 13, 2026
@guitargeek

guitargeek commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@guitargeek since your last PRs touch some tree code, could you maybe check if Claude can also help with reenabling this broken test?

The agentic Claude Code workflow that I set up runs in a sandboxed Linux VM (I want to use it in auto mode without risking the files on my workstation), but I asked it to attempt to fix it anyway by providing the CI logs. The change it suggests looks harmless, let's see if it works!

@ferdymercury ferdymercury marked this pull request as ready for review June 13, 2026 16:27
@ferdymercury ferdymercury requested a review from jblomer as a code owner June 13, 2026 16:27
@ferdymercury

Copy link
Copy Markdown
Collaborator Author

Thanks a lot !!

@ferdymercury ferdymercury changed the title [test] fix TTreeIndex long64 test was not running [tree] Fix long64 tree index losing precision on 64-bit long double platforms and enable forgotten test Jun 13, 2026
Comment thread tree/treeplayer/src/TTreeIndex.cxx Outdated
Comment thread tree/treeplayer/src/TTreeIndex.cxx
…latforms

The conditional `long64major ? GetLong64() : GetAndRangeCheck()` mixes
Long64_t and LongDouble_t, so the exact value was promoted through long
double regardless of branch. This rounded large values where long double
is 64-bit (macOS arm64, Windows), making
roottest-root-tree-index-indexl64 fail there while passing on Linux. Fix
this with an explicit `static_cast<Long64_t>(ret)`.

🤖 Done with the help of [Claude Code](https://claude.com/claude-code) (Claude Opus 4.8)

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for re-adding the test! The fix that I needed to apply was just to add the static_cast<Long64_t>(ret) to ensure the ternary expression has the right type.

@guitargeek guitargeek merged commit d9fae25 into root-project:master Jun 15, 2026
77 of 83 checks passed
@ferdymercury ferdymercury deleted the indexl64 branch June 15, 2026 05:34
@ferdymercury

Copy link
Copy Markdown
Collaborator Author

Thaanks a lot @guitargeek , could you backport to 6.40?

Fyi @amete

@guitargeek

Copy link
Copy Markdown
Contributor

/backport to 6.40

@root-project-bot

Copy link
Copy Markdown

Preparing to backport PR #19741 to branch 6.40 requested by guitargeek

@root-project-bot

Copy link
Copy Markdown

This PR has been backported to branch 6.40: #22607

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.

TTreeIndex fails under Valgrind due to long double emulation

4 participants