Skip to content

cksum: Use clap's usize parser and default_value("0") #11478

Open
baa-ableton wants to merge 1 commit intouutils:mainfrom
baa-ableton:fix/issue-11315
Open

cksum: Use clap's usize parser and default_value("0") #11478
baa-ableton wants to merge 1 commit intouutils:mainfrom
baa-ableton:fix/issue-11315

Conversation

@baa-ableton
Copy link
Copy Markdown
Contributor

@baa-ableton baa-ableton commented Mar 24, 2026

Closes: #11315

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 24, 2026

Merging this PR will degrade performance by 5.33%

❌ 13 regressed benchmarks
✅ 289 untouched benchmarks
⏩ 46 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory cksum_crc 41.8 KB 44.1 KB -5.29%
Memory cksum_sm3 41.7 KB 44 KB -5.31%
Memory cksum_blake2b 41.9 KB 44.2 KB -5.29%
Memory cksum_md5 41.6 KB 44 KB -5.32%
Memory cksum_sysv 41.5 KB 43.8 KB -5.33%
Memory cksum_sha256 41.7 KB 44 KB -5.31%
Memory cksum_sha224 41.7 KB 44 KB -5.31%
Memory cksum_blake3 43.5 KB 45.8 KB -5.1%
Memory cksum_sha384 41.8 KB 44.2 KB -5.29%
Memory cksum_sha512 41.9 KB 44.2 KB -5.29%
Memory cksum_crc32b 41.8 KB 44.1 KB -5.3%
Memory cksum_sha1 41.6 KB 44 KB -5.31%
Memory cksum_bsd 41.5 KB 43.8 KB -5.33%

Comparing baa-ableton:fix/issue-11315 (ec152e4) with main (9397a9c)

Open in CodSpeed

Footnotes

  1. 46 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.

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Mar 25, 2026

Still many Some() are kept.

@cakebaker cakebaker changed the title Fix/issue 11315 cksum: Fix/issue 11315 Mar 25, 2026
@sylvestre sylvestre changed the title cksum: Fix/issue 11315 cksum: Use clap's usize parser and default_value("0") Mar 25, 2026
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/dd/no-allocate is now passing!

@baa-ableton
Copy link
Copy Markdown
Contributor Author

@oech3

Hey i think we can do another review. I'm a bit new to this so I could use a rather verbose review.

Just wanna touch on the Some()s:
maybe_sanitize_length return signature changed and now returns a UResult with no wrapping needed inside. The remaining Some() at the call sites of checksum_main is structural and unavoidable — checksum_main is shared with utilities that have no --length concept at all and genuinely pass None.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum. tests/cksum/cksum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-a. tests/cksum/cksum-a is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-base64. tests/cksum/cksum-base64 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-base64-untagged. tests/cksum/cksum-base64-untagged is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-c. tests/cksum/cksum-c is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-raw. tests/cksum/cksum-raw is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/sm3sum. tests/cksum/sm3sum is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/rm/isatty (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.

Signed-off-by: Babur Ayanlar <babur.ayanlar@ableton.com>
@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Mar 28, 2026

Is checksum_main(algo, 0, matches, format) not enough?

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Mar 28, 2026

Hyper perf gain #11478 (comment)

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cksum/b2sum. tests/cksum/b2sum is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cksum/cksum-sha3. tests/cksum/cksum-sha3 is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)

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.

cksum: Use clap's usize parser and default_value("0")

2 participants