From 1058c613a11dd653796a55a5a893cce394a3f0a6 Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Fri, 9 Oct 2026 18:32:57 +0530 Subject: [PATCH] ci(fuzz): drop the hashed copy of each seed after cmin (#387) cargo fuzz cmin names the inputs it keeps by the SHA-1 of their content, so after putting the committed seed_* files back every kept seed was in the corpus twice. The first run proposed 33 such copies and nothing else. Refs #387 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h --- .github/workflows/fuzz-corpus.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fuzz-corpus.yml b/.github/workflows/fuzz-corpus.yml index 98fe931365..9cbb6285ab 100644 --- a/.github/workflows/fuzz-corpus.yml +++ b/.github/workflows/fuzz-corpus.yml @@ -97,8 +97,14 @@ jobs: dir="fuzz/corpus/$TARGET" echo "Before: $(find "$dir" -type f | wc -l) files" cargo fuzz cmin -O "$TARGET" "$dir" - # Put back every committed seed cmin dropped. + # Put back every committed seed cmin dropped. cmin names the files + # it keeps by the SHA-1 of their content, so a seed it kept is also + # there under that name: drop that copy. git ls-files -z "$dir" | grep -z '/seed_' | xargs -0 -r git checkout -- + shopt -s nullglob + for seed in "$dir"/seed_*; do + rm -f "$dir/$(sha1sum < "$seed" | cut -c1-40)" + done echo "After: $(find "$dir" -type f | wc -l) files" - name: Save corpus