BlockstreamResearch / simfony

Rust-like high-level language that compiles down to Simplicity bytecode. Work in progress.
26 stars 9 forks source link

Add fuzzing + CI #78

Closed uncomputable closed 2 months ago

uncomputable commented 2 months ago

Fixes #72

Implement fuzzing (Arbitrary) for the Simfony parse tree and write three fuzz targets:

  1. compile_text: try to compile random ASCII strings; slow because of parser (#79)
  2. compile_parse_tree: try to compile random parse trees; ~10x faster than compile_text and better coverage
  3. display_parse_tree: check that DisplayParseFromStr is the identity function

Write a simple CI that uses nix flakes and dev shells. This CI is not more reproducible than regular GitHub CI, but it saves me time because I already have nix infrastructure in place. I will switch the CI to something reproducible in the near future.

Run the linter, unit tests (stable + MSRV) and the fuzzer in CI. For now, coverage is ignored in CI.

apoelstra commented 2 months ago

Neat! I like this "budget" scheme for recursive types.

uncomputable commented 2 months ago

First I had an increasing depth that is checked against a fixed maximum, but then I figured that a budget would be more flexible.