Skip to content

Add workflow to prime chanmon_consistency fuzz corpus#4578

Open
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:prime-cache
Open

Add workflow to prime chanmon_consistency fuzz corpus#4578
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:prime-cache

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

@joostjager joostjager commented Apr 29, 2026

Add a manual workflow for priming the persistent chanmon_consistency_target honggfuzz corpus with known interesting inputs.

The goal is to preserve failing or challenging fuzz strings discovered during larger offline runs and feed them back into regular CI, so current and future code keeps being exercised against those cases instead of letting the inputs get lost. The workflow restores the latest rolling main corpus, decodes comma-separated hex seeds from the dispatch input into the chanmon consistency corpus, and saves a fresh main-prefix cache entry for subsequent fuzz runs to restore.

The normal fuzz job still owns execution and minimization. Once the primed cache is picked up by a main fuzz run, honggfuzz minimization removes duplicate or non-contributing inputs, so only seeds that add useful coverage remain in the rolling corpus.

Tested on my fork.

image

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 29, 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.

@joostjager joostjager marked this pull request as ready for review April 29, 2026 13:30
@joostjager joostjager requested a review from TheBlueMatt April 29, 2026 13:30
Comment thread .github/workflows/prime-chanmon-consistency-fuzz-corpus.yml Outdated
@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

ldk-claude-review-bot commented Apr 29, 2026

I've thoroughly reviewed the entire diff, cross-referencing with the existing fuzz infrastructure in build.yml and my prior review notes. Let me verify there are no issues I may have missed.

Key areas checked:

  • Shell injection: ${{ inputs.seeds_hex }} is routed through env: (line 30), not interpolated in run:. Safe.
  • Hex validation: ^([[:xdigit:]]{2})+$ (line 51) correctly enforces even-length, non-empty hex.
  • Newline handling: Line 44 normalizes newlines to commas before read on line 45. Addressed prior review concern.
  • Cache key interaction: fuzz-corpus-refs/heads/main-prime-${{ github.run_id }} (line 70) is correctly discoverable by the main fuzz job's restore-keys: fuzz-corpus-refs/heads/main- prefix (build.yml:258). The prime workflow first restores the latest corpus, layers seeds on top, and saves — so the primed cache is a superset of the latest main corpus.
  • Permissions: Minimal (actions: write, contents: read) with refs/heads/main guard.
  • No checkout needed: Only manipulates the cached workspace directory; no repo files required.
  • Empty field handling: [ -n "$SEED_HEX" ] || continue (line 50) correctly skips empty fields from consecutive commas/newlines.
  • File uniqueness: primed-$GITHUB_RUN_ID-NNNN naming ensures no collisions across runs.

No issues found.

The prior review's inline comment about newline handling is correctly addressed in the current code (line 44). No new bugs, security vulnerabilities, or logic errors identified.

Add a manual workflow that primes the persistent chanmon
consistency honggfuzz corpus with comma-separated hex seeds.

This lets failing or challenging inputs from offline fuzzing be kept
in the rolling corpus so future CI continues exercising them.
Regular minimization drops duplicates and inputs that no longer
add value.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.17%. Comparing base (42e198c) to head (0c23530).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4578      +/-   ##
==========================================
+ Coverage   87.15%   87.17%   +0.02%     
==========================================
  Files         161      161              
  Lines      109251   109251              
  Branches   109251   109251              
==========================================
+ Hits        95215    95243      +28     
+ Misses      11560    11534      -26     
+ Partials     2476     2474       -2     
Flag Coverage Δ
fuzzing-fake-hashes 31.15% <ø> (+<0.01%) ⬆️
fuzzing-real-hashes 22.93% <ø> (+0.01%) ⬆️
tests 86.24% <ø> (+0.02%) ⬆️

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 self-assigned this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants