Skip to content

feat(fuzz): use minset corpus culling#15368

Open
decofe wants to merge 4 commits into
masterfrom
centaur/cached-corpus-memory-reduction-1782358491
Open

feat(fuzz): use minset corpus culling#15368
decofe wants to merge 4 commits into
masterfrom
centaur/cached-corpus-memory-reduction-1782358491

Conversation

@decofe

@decofe decofe commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace mutation-count favorability with top-rated minset culling for coverage-guided corpora
  • track coverage indices contributed by corpus entries and favor the cheapest representative per covered edge
  • add a bounded per-worker CachedDiskCorpus so evicted non-favored entries leave the hot in-memory corpus but remain available as cached/on-disk mutation donors
  • remove the obsolete corpus_min_mutations config and snapshot entries

Prompted by: @0xalpharush

Tests

  • cargo check -p foundry-evm
  • cargo test -p foundry-evm executors::corpus::tests:: --lib
  • cargo test -p forge config::can_show_config --test cli
  • cargo test -p forge config::can_set_config_values --test cli
  • cargo test -p forge config::test_default_config --test cli

Note: cargo test -p forge config was also attempted, but that broad filter includes unrelated inline/live-log tests that failed locally due solc install snapshot output and a missing local RPC at 127.0.0.1:8545.

@decofe decofe force-pushed the centaur/cached-corpus-memory-reduction-1782358491 branch from cc13c9f to e9c4bb6 Compare June 25, 2026 03:48
@decofe decofe changed the title feat(fuzz): cache on-disk corpus donors feat(fuzz): use minset corpus culling Jun 25, 2026
@decofe decofe force-pushed the centaur/cached-corpus-memory-reduction-1782358491 branch from e9c4bb6 to 15a79ec Compare June 25, 2026 03:52
Comment thread crates/evm/evm/src/executors/corpus.rs Outdated
@0xalpharush

Copy link
Copy Markdown
Collaborator

derek bench invariant

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

cc @0xalpharush

bench (invariant) event published. Results will be reported separately. View publisher run

Config: subcommand: invariant, PR SHA: 29b43f365cf4, compare-ref: master, timeout: 3600s, workers: default, benchmark-type: property

let new_call_coverage = corpus_manager.merge_edge_coverage(&mut call_result);
let new_call_coverage = corpus_manager.merge_edge_coverage_with_edges_into(
&mut call_result,
&mut current_run.corpus_edges,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A call's coverage edges are added to current_run.corpus_edges before the pop decision, but (unlike cmp_seq) corpus_edges isn't trimmed when the call is popped (vm.assume discard / reverted-and-dropped calls).

So a popped call's edges end up on the surviving sequence's CorpusEntry and in top_rated, which can then favor a sequence that can't actually reproduce that edge.

I reproduced this with a coverage-guided invariant test (call hits a branch then vm.assume discards it; another call survives) — no pops → clean. It seems to self-heal on restart, so not a blocker, but should we trim corpus_edges on pop to keep minset accuracy correct during a live run?

figtracer
figtracer previously approved these changes Jun 26, 2026

@figtracer figtracer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mablr mablr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be re-benchmarked (once infra is ready), and de-conflicted.

@grandizzy

Copy link
Copy Markdown
Collaborator

derek bench invariant timeout=300

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

cc @grandizzy

bench (invariant) event published. Results will be reported separately. View publisher run

Config: subcommand: invariant, PR SHA: cf3222f2067b, compare-ref: master, timeout: 300s, workers: default, benchmark-type: property

@grandizzy

Copy link
Copy Markdown
Collaborator

derek bench invariant timeout=300

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

cc @grandizzy

bench (invariant) event published. Results will be reported separately. View publisher run

Config: subcommand: invariant, PR SHA: cf3222f2067b, compare-ref: master, timeout: 300s, workers: default, benchmark-type: property

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.

6 participants