#38
Keep forced coverage-guided corpus seeds in Pool after energy exhaustion
Summary
Fixes a bug in Pool::pick() where coverage-guided corpus seeds inserted via Pool::add_forced() are permanently evicted once their initial energy (16) runs out, and equal-score ties starve newer discoveries behind index 0.
Problem
Pool::add_forced()inserts inputs that discover new coverage into the targeted-phase pool with an initial energy of16.- Previously,
Pool::pick()calledswap_remove()on any seed whose energy hit0. After 16 mutations, a stepping-stone corpus seed was permanently deleted, losing deep multi-stage progress and forcing the search to start over. - When corpus seeds tied on score (e.g.
0.0when running coverage-guided search withouttarget()),Pool::pick()scanned from index0with strict>, repeatedly favoring the oldest seed instead of newly discovered deeper states.
Fix
- Track
corpus: boolonSeed(falseforPool::add(),trueforPool::add_forced()). - In
Pool::pick(), refill energy forcorpusseeds instead ofswap_remove-ing them, and break equal-score ties toward more recently discovered corpus seeds. - Preserve existing eviction and tie-break behavior for regular
target()-scored seeds added viaPool::add(). - Add unit tests covering corpus seed survival across energy refills and equal-score tie breaking.
Verification
cargo test --release -p ephyra(194 unit + doc tests pass)cargo clippy -p ephyra --all-targets -- -D warnings(clean)cargo +nightly fmt --check(clean)