Skip to content

fuzz: count symlinked fuzz corpus files#4626

Merged
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
joostjager:fuzz-corpus-symlink-count-fix
May 20, 2026
Merged

fuzz: count symlinked fuzz corpus files#4626
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
joostjager:fuzz-corpus-symlink-count-fix

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

The fuzz CI job links cloned corpus dirs into hfuzz_workspace, but plain find does not descend through those symlinked directories.

Count with find -L so the iteration budget reflects the real corpus size, and fail loudly if a linked corpus resolves to zero files.

The fuzz CI job links cloned corpus dirs into hfuzz_workspace, but
plain find does not descend through those symlinked directories.

Count with find -L so the iteration budget reflects the real corpus
size, and fail loudly if a linked corpus resolves to zero files.
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 20, 2026

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.62%. Comparing base (1060865) to head (04808cb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4626      +/-   ##
==========================================
+ Coverage   86.59%   86.62%   +0.02%     
==========================================
  Files         159      159              
  Lines      110420   110420              
  Branches   110420   110420              
==========================================
+ Hits        95619    95647      +28     
+ Misses      12267    12240      -27     
+ Partials     2534     2533       -1     
Flag Coverage Δ
fuzzing-fake-hashes 6.62% <ø> (+0.05%) ⬆️
fuzzing-real-hashes 23.17% <ø> (+0.01%) ⬆️
tests 86.23% <ø> (-0.01%) ⬇️

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.

@joostjager joostjager marked this pull request as ready for review May 20, 2026 10:07
@joostjager joostjager requested a review from TheBlueMatt May 20, 2026 10:07
@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

I've thoroughly reviewed the PR diff, the existing ci-fuzz.sh script, and the CI workflow in build.yml (which shows how symlinks are created at the input level via ln -sfn). The changes are minimal, focused, and correct:

  1. corpus_count() properly uses find -L to follow the symlinks created by CI
  2. check_linked_corpus() correctly checks [ -L "$CORPUS_DIR" ] at the input level — which matches where ln -sfn creates the symlink in .github/workflows/build.yml:251-252
  3. All three find call sites are updated consistently
  4. The check is correctly placed only before fuzzing starts (pre-condition), not after
  5. Variables are properly quoted, wc -l always returns a valid integer, and find -L handles symlink cycles gracefully (GNU find emits a warning to stderr, which is already suppressed)

No issues found.

Copy link
Copy Markdown
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

thanks

Comment thread fuzz/ci-fuzz.sh
local FILE=$2
local CORPUS_COUNT=$3

if [ -L "$CORPUS_DIR" ] && [ "$CORPUS_COUNT" -eq 0 ]; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Feel like this should warn even if the dir isn't a link, but whatever.

@ldk-reviews-bot
Copy link
Copy Markdown

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@TheBlueMatt TheBlueMatt merged commit 1743b99 into lightningdevkit:main May 20, 2026
24 checks passed
@joostjager joostjager self-assigned this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants