Skip to content

Conversation

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented Jan 22, 2026

In order to show the total row we are summing intermediate values as they
are and eventually scaling them.

Now, while this provides a valid output, it also implies that the total value
that we show is not matching the sum of the previously listed values, since
the sum of scaled values may different from the sum of the original values that
gets eventually scaled.

To be consistent with the output:

  • Use a new BytesCell struct to track the bytes values
  • Keep a scaled value tracked
  • Show the sum of the scaled values as total

Closes: #10436

@3v1n0 3v1n0 force-pushed the df-sum-scaling-fix branch from 16494db to 4db7190 Compare January 22, 2026 16:43
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 22, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing 3v1n0:df-sum-scaling-fix (9e1ab7b) with main (d2bd2d3)

Summary

✅ 142 untouched benchmarks
⏩ 180 skipped benchmarks1

Footnotes

  1. 180 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Jan 22, 2026

Ah, I was also looking at the percentage but this seems fine since it's not summing percentages, but it computes it everytime

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

@3v1n0 3v1n0 force-pushed the df-sum-scaling-fix branch 3 times, most recently from 20ff83b to fa644ab Compare January 22, 2026 17:40
3v1n0 added 2 commits January 22, 2026 18:43
In order to show the total row we are summing intermediate values as they
are and eventually scaling them.

Now, while this provides a valid output, it also implies that the total value
that we show is not matching the sum of the previously listed values, since
the sum of scaled values may different from the sum of the original values that
gets eventually scaled.

To be consistent with the output:
 - Use a new BytesCell struct to track the bytes values
 - Keep a scaled value tracked
 - Show the sum of the scaled values as total

Closes: uutils#10436
It adds extra (tiny, but still...) computation for no reason
@3v1n0 3v1n0 force-pushed the df-sum-scaling-fix branch from fa644ab to 9e1ab7b Compare January 22, 2026 17:43
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?

@cakebaker cakebaker merged commit 28b52bb into uutils:main Jan 23, 2026
169 of 173 checks passed
@cakebaker
Copy link
Contributor

Thanks!

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.

df total row computation is wrong because of invalid sum of scaled and ceiled values

2 participants