#38

Keep forced coverage-guided corpus seeds in Pool after energy exhaustion

OpenJacobHayeswants to merge intofrom

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 of 16.
  • Previously, Pool::pick() called swap_remove() on any seed whose energy hit 0. 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.0 when running coverage-guided search without target()), Pool::pick() scanned from index 0 with strict >, repeatedly favoring the oldest seed instead of newly discovered deeper states.

Fix

  • Track corpus: bool on Seed (false for Pool::add(), true for Pool::add_forced()).
  • In Pool::pick(), refill energy for corpus seeds instead of swap_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 via Pool::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)