candy
candy copied to clipboard
Add fuzzing to the CI
Depends on #245
This makes the exit code of the candy fuzz command match whether errors were found during fuzzing. It also adds fuzzing to the CI and fixes some errors that were discovered.
In the logs, you may have noticed that the functions in Core are fuzzed several times. That's because the tree of modules created from Core/_.candy contains the outer leaf files many times. For example, the core.bool module is imported by many other modules in the core package, causing it to be instantiated and evaluated many times. All the created closures are separate and fuzzed independently.
I guess I'll start working on some basic optimizations such as function inlining, duplicate subtree elimination, and compile-time evaluation soon to fix the problem described above. LLVM would also do those optimizations, but we'd have to turn the entire tree (including expanded uses, thus an exponential amount of code) into LLVM-IR for it to do its magic, so that's too late in the pipeline and it makes sense to do these optimizations in Candy itself.
Fuzzing works fine locally. Seems like this is an issue of nightly cargo: https://github.com/rust-lang/cargo/issues/8557
Fair enough, I'll just disable the fuzzing for now