Skip to content

fix(encoder): make encode() total under fuzzing + seed corpus (#186) - #189

Merged
avrabe merged 2 commits into
mainfrom
fix/encoder-fuzz-total-186
May 30, 2026
Merged

fix(encoder): make encode() total under fuzzing + seed corpus (#186)#189
avrabe merged 2 commits into
mainfrom
fix/encoder-fuzz-total-186

Conversation

@avrabe

@avrabe avrabe commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #186 — the encoder_no_panic fuzz target (empty corpus) intermittently found pre-existing panics, making Fuzz Smoke flaky on every PR.

Two roots, both now closed:

  1. PC/R15 operandverify_reg_bits debug_assert — fixed in v0.11.4 (arm encoder: panics (debug_assert) on PC/R15 operand instead of returning Err — fuzz-found, pre-existing #185).
  2. Arithmetic overflow in the ARM32 branch encoders: *offset - 2 overflow-panics at i32::MIN under -Cdebug-assertions. Now wrapping_sub (total; identical for any real branch offset — synth never emits an i32::MIN branch displacement).

Verification

Scope

The i64_lowering_doesnt_clobber_params target has a separate finding — a Mov R0,R8 return-placement flagged as an AAPCS clobber, which is either a real i64-lowering bug or a harness false-positive (the protected LocalGet may be dead). Pre-existing in select_with_stack (untouched here). Filed with full reproducer as #188 rather than rushed into this release.

Closes #186.

🤖 Generated with Claude Code

avrabe and others added 2 commits May 30, 2026 12:23
…sets (#186)

The `encoder_no_panic` fuzz target (empty corpus) intermittently found
pre-existing panics, making Fuzz Smoke flaky. Two roots, both now closed:
the PC/R15-operand debug_assert (#185, fixed in v0.11.4) and arithmetic
overflow in the ARM32 branch encoders — `*offset - 2` overflow-panics at
i32::MIN under `-Cdebug-assertions`. Use `wrapping_sub` (total, identical for
any real branch offset). After this, a 180s sweep ran 8.8M executions with
zero panics.

Also adds a committed `fuzz/seed_corpus/encoder_no_panic/` (61 inputs promoted
from the clean sweep + the #185 PC-reg regression) so CI's 60s run starts with
coverage instead of exploring cold — the empty-corpus flakiness root.

The i64_lowering_doesnt_clobber_params target has a separate finding (real
clobber vs harness false-positive) tracked in #188.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@avrabe
avrabe merged commit 54edb04 into main May 30, 2026
10 of 12 checks passed
@avrabe
avrabe deleted the fix/encoder-fuzz-total-186 branch May 30, 2026 10:45
@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/synth-backend/src/arm_encoder.rs 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

arm encoder: not fuzz-total — arithmetic underflows + empty seed corpus make encoder_no_panic flaky

1 participant