lac/fuzz/dict/roundtrip_arbitrary.dict
Kamal Tufekcic 7862cb1d9d
All checks were successful
CI / lint (push) Successful in 5s
CI / fuzz-regression (push) Successful in 14s
CI / build (push) Successful in 4s
CI / test (push) Successful in 6m54s
CI / publish (push) Successful in 8s
initial commit
Signed-off-by: Kamal Tufekcic <kamal@lo.sh>
2026-04-23 14:58:32 +03:00

42 lines
2.1 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# libFuzzer dictionary for roundtrip_arbitrary.
#
# roundtrip_arbitrary reads little-endian i32 chunks as PCM samples.
# The interesting values are the boundary magnitudes the codec has
# explicit handling for: zero, ±1 (sign-flip test), the 8/16/20/24-bit
# ceilings, and the full 24-bit contract limits. Seeding these as
# 4-byte LE words lets libFuzzer splice them directly into sample
# positions without having to discover the bit patterns by luck.
#
# Pass via:
#
# cargo +nightly fuzz run roundtrip_arbitrary -- -dict=dict/roundtrip_arbitrary.dict
# ─── Zero and unit samples ──────────────────────────────────────────
sample_zero="\x00\x00\x00\x00"
sample_pos_one="\x01\x00\x00\x00"
sample_neg_one="\xff\xff\xff\xff"
# ─── 8-bit PCM ceilings ──────────────────────────────────────────────
sample_pos_127="\x7f\x00\x00\x00"
sample_neg_128="\x80\xff\xff\xff"
# ─── 16-bit PCM ceilings ─────────────────────────────────────────────
sample_pos_32767="\xff\x7f\x00\x00"
sample_neg_32768="\x00\x80\xff\xff"
# ─── 20-bit ceilings (studio-mastered material) ──────────────────────
sample_pos_524287="\xff\xff\x07\x00"
sample_neg_524288="\x00\x00\xf8\xff"
# ─── 24-bit ceilings — LAC's contract limit ─────────────────────────
# |sample| ≤ 2^23 1. Values at exactly +8388607 and 8388607 exercise
# the autocorrelation accumulator's worst case.
sample_pos_8388607="\xff\xff\x7f\x00"
sample_neg_8388607="\x01\x00\x80\xff"
# ─── Out-of-contract values (clamped by the fuzz target) ─────────────
# Included so libFuzzer has the bit patterns handy if the encoder's
# magnitude guard ever regresses; the clamp in the harness keeps these
# from reaching encode_frame in steady state.
sample_i32_max="\xff\xff\xff\x7f"
sample_i32_min="\x00\x00\x00\x80"