Skip to content

fuzz: add differential fuzzer against GNU grep#7

Open
sylvestre wants to merge 1 commit into
mainfrom
add-differential-fuzzer
Open

fuzz: add differential fuzzer against GNU grep#7
sylvestre wants to merge 1 commit into
mainfrom
add-differential-fuzzer

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

Add a cargo-fuzz harness (fuzz_grep) that runs uu_grep and GNU grep on the same generated args/input and panics on any divergence, using the vendored uufuzz crate (adapted from uutils/coreutils to depend on crates.io uucore rather than a path).

A CI workflow (.github/workflows/fuzzing.yml) builds the uufuzz examples, builds the fuzzer, and runs it for 60s. fuzz_grep is marked should_pass: false / continue-on-error since it currently surfaces real GNU-compatibility gaps (e.g. uu_grep rejects a repeated -m, GNU accepts).

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.28%. Comparing base (c614a57) to head (9598faf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #7   +/-   ##
=======================================
  Coverage   95.28%   95.28%           
=======================================
  Files           6        6           
  Lines        1422     1422           
  Branches      140      140           
=======================================
  Hits         1355     1355           
  Misses         66       66           
  Partials        1        1           
Flag Coverage Δ
macOS_latest 96.09% <ø> (ø)
ubuntu_latest 96.09% <ø> (ø)
windows_latest 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvestre sylvestre force-pushed the add-differential-fuzzer branch from 096a6f8 to 8037f67 Compare May 29, 2026 19:44
Copy link
Copy Markdown
Collaborator

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

I believe most of this is adopted from the coreutils repo, right? I saw similar code there as well.

Personally speaking, I think some of the text feels somewhat verbose. And as a Windows Terminal maintainer, I also always get a bit squirmish when I see crates like console being used. Their Windows implementation is usually not great and somewhat bodgy.

Add a cargo-fuzz harness (fuzz_grep) that runs uu_grep and GNU grep on
the same generated args/input and panics on any divergence, using the
vendored uufuzz crate (adapted from uutils/coreutils to depend on
crates.io uucore rather than a path).

A CI workflow (.github/workflows/fuzzing.yml) builds the uufuzz
examples, builds the fuzzer, and runs it for 60s. fuzz_grep is marked
should_pass: false / continue-on-error since it currently surfaces real
GNU-compatibility gaps (e.g. uu_grep rejects a repeated -m, GNU accepts).
@sylvestre sylvestre force-pushed the add-differential-fuzzer branch from 8037f67 to 9598faf Compare June 2, 2026 08:13
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 2, 2026

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 17 skipped benchmarks1


Comparing add-differential-fuzzer (9598faf) with main (c614a57)

Open in CodSpeed

Footnotes

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

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.

2 participants