Skip to content

fix(hyfuzz): handle non-UTF-8 output/seeds, validate executable --hyb, and report executed cases - #1425

Closed
umpireboulianne-design wants to merge 1 commit into
limitlessprojects:mainfrom
umpireboulianne-design:fix/issue-1327
Closed

umpireboulianne-design wants to merge 1 commit into
limitlessprojects:mainfrom
umpireboulianne-design:fix/issue-1327

Conversation

@umpireboulianne-design

Copy link
Copy Markdown
Contributor

Fixes #1327

Summary

  • Decode subprocess output with replacement (check_one): Pass encoding="utf-8", errors="replace" to subprocess.run in check_one so non-UTF-8 bytes in compiler diagnostics do not raise UnicodeDecodeError and abort the fuzz campaign.
  • Resilient corpus loading (load_corpus): Filter os.listdir(corpus_dir) with os.path.isfile(...) so .hy directories do not raise IsADirectoryError, and read corpus seed files with encoding="utf-8", errors="replace" so byte-mutated seeds do not crash startup.
  • Fail closed on non-executable --hyb (main): Validate os.access(args.hyb, os.X_OK) during CLI startup and exit immediately with code 2 and a diagnostic on stderr instead of running 10 doomed cases.
  • Accurate executed case count on early stop (main): Track actual executed cases in the fuzz loop and print {executed} cases in the summary line rather than the requested args.cases when aborting early after 10 failures.

Testing

  • Added regression tests in tools/fuzz/test_hyfuzz.py covering non-UTF-8 subprocess output (normal reject and ICE detection), .hy directories and non-UTF-8 corpus seeds in load_corpus, non-executable --hyb startup rejection, and accurate case count reporting on early abort.

@github-actions github-actions Bot added the bot:stale-base Shepherd: behind main beyond threshold label Oct 24, 2026
@limitlessprojects

Copy link
Copy Markdown
Owner

Queue-reset sweep: this repo now runs a rolling conveyor, and open PRs
outside the active review window are being closed as not planned to keep the
queue honest — a stale queue wastes every contributor's time, including yours.

This is not a verdict on the work. If this change still matters:

  1. rebase against current main (main has landed a lot since this PR opened),
  2. confirm the diff still applies and the affected verdicts still hold,
  3. reopen — the triage board picks reopened PRs up as fresh arrivals.

Wildcard holds (verdict window 2026-11-01) and Pareto land candidates are
unaffected. Thanks for the effort — high-volume repos only stay reviewable
with a queue that actually drains.

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

Labels

bot:stale-base Shepherd: behind main beyond threshold

Projects

None yet

2 participants