[RDF] Fix the events/s figure in the progress bar's final line - #23065
Open
kutsibalci wants to merge 1 commit into
Open
[RDF] Fix the events/s figure in the progress bar's final line#23065kutsibalci wants to merge 1 commit into
kutsibalci wants to merge 1 commit into
Conversation
PrintStatsFinal divided the event count by an elapsed time that had already been truncated to whole seconds, so an event loop shorter than one second divided by zero and printed `inf evt/s`, and a longer one reported a rate quantised upwards by the truncation. Keep the truncated value for the h:mm display and divide by the full-precision duration instead. The in-run line is unaffected: it already computes its rate from a duration<double> in RecordEvtCountAndTime. Adds a regression test that fails on the current code with `inf evt/s` and passes with this change.
1 task
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 Pull request:
Changes or fixes:
ProgressHelper::PrintStatsFinalcomputes the events/s figure from a duration that has already been truncated to whole seconds:duration_casttruncates toward zero, soelapsedSeconds.count()is an integer. Two consequences:inf evt/s;Measured on this branch's parent, one 400-entry tree with a
Filterthat spins for a fixed time per entry, so the real rate is known:masterprintsinf evt/s8.94e+02 evt/s2.00e+02 evt/s(+20%)1.66e+02 evt/s8.00e+01 evt/s(+12%)7.13e+01 evt/sThe fix keeps the truncated value for the
h:mmdisplay, which wants whole seconds, and divides by the full-precision duration:prettyPrint(elapsedSeconds)is unchanged, so the elapsed-time field prints exactly as before.The in-run line is not affected and is not touched.
PrintProgressAndStatstakes its rate fromEvtPerSec(), which averages the per-interval rates recorded inRecordEvtCountAndTimeusing aduration<double>. Only the final line had the integer division.This is independent of #15323. That issue is about the numerator on the same line —
ComputeTotalEvents()reports the size of the input dataset rather than what was processed. This PR deliberately does not touch the numerator; whichever way #15323 is decided, the denominator has to be a real duration.Reproducer used for the table
The counts go to a file because the progress bar clears the terminal line with
\rplus padding and swallows anything printed beside it.Checklist:
Built from source at
6b57f8fc(ninja, gcc 13,-O3) and exercised throughtree/dataframe/test/dataframe_helpers:RDFHelpers.ProgressBarFinalRateIsFinitefails:33 tests from 2 test suites ran. [ PASSED ] 33 tests.— includingProgressBarRestorePrecision, which is the other test that inspects this stream.This PR fixes # — no issue filed; happy to open one if you would rather track it that way.
AI disclosure
AI-assisted (Claude Code). The tool found the truncation while I was reading
PrintStatsFinalfor #15323, wrote the reproducer and the regression test, and drafted this description. I built ROOT from source, ran the reproducer and the test suite myself, and checked the before/after numbers in the table against the measured wall-clock rates. I have reviewed and understood the change and take responsibility for it.