Skip to content

fix(foundry): scale showmap replay timeout with fuzz budget#35

Open
grandizzy wants to merge 1 commit into
mainfrom
fix/showmap-timeout-scale-with-fuzz-budget
Open

fix(foundry): scale showmap replay timeout with fuzz budget#35
grandizzy wants to merge 1 commit into
mainfrom
fix/showmap-timeout-scale-with-fuzz-budget

Conversation

@grandizzy

Copy link
Copy Markdown

Summary

The foundry showmap replay (the post-fuzz coverage-capture pass) had its timeout capped at a fixed 1800s (30m), only ever lowered to the fuzz budget for short runs. The replay re-executes the persisted corpus, so its cost is O(corpus size) and the corpus grows with the fuzz budget.

On long campaigns with slow targets the replay was killed at 30m before writing any showmap output, and the timeout was silently mapped to a completed run. analyze.py then dropped those trials as "empty coverage", collapsing the target to too-few-samples and producing a bogus inconclusive verdict.

Evidence (4h matrix runs)

target corpus entries showmap replay result
aave-v4 612 ~20-32s captured, real verdict
superform-v2-periphery 7-143s captured, real verdict
liquity-v2-governance 12,681 all 12 rounds hit 1800s (killed) 0 coverage -> inconclusive (n_samples=1)

Change

fuzzers/foundry/run.sh: when no explicit override is set, the showmap replay budget now defaults to the fuzz budget instead of a fixed 30m cap. Replay is normally far faster than fuzzing (aave/superform finish in seconds regardless of cap), so this ceiling is only reached by genuinely slow targets and costs nothing for typical ones. SCFUZZBENCH_FOUNDRY_SHOWMAP_TIMEOUT_SECONDS still overrides explicitly.

fuzz budget old showmap cap new showmap budget
4h 1800s (killed liquity) 14400s
2h 1800s 7200s
60s 60s 60s (unchanged)
explicit override wins wins (unchanged)

Tests

  • Updated test_foundry_run_showmap_args.py (renamed ..._uses_bounded_default_timeout -> ..._scales_timeout_with_fuzz_budget); long-campaign now expects the full budget. All 5 tests in the file pass.

Notes / follow-ups (not in this PR)

  • This stops the silent data loss but does not bound replay cost. A more robust follow-up is to bound/sample the replayed corpus so capture is O(1) regardless of fuzz length.
  • Separately worth surfacing a timed-out/empty showmap as a real failure rather than a silent completed-run.

Replay cost grows with corpus size, so a fixed 30m cap silently truncated
coverage capture on slow targets for long campaigns. Scale the budget with
the fuzz budget instead; an explicit override still takes precedence.
@grandizzy grandizzy self-assigned this Jun 25, 2026

@mablr mablr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

makes sense

@stevencartavia stevencartavia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants