Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic fuzzing support for planned FFT, split by instruction set #112

Closed
wants to merge 1 commit into from

Conversation

Shnatsel
Copy link

@Shnatsel Shnatsel commented Feb 4, 2023

This will only cover the combinations of the input and algorithm that the planner selects. It also doesn't perform correctness checks, only checking for memory safety issues.

On the upside this is easy and straightforward to implement, and doesn't result in any false positives due to float precision issues.

@Shnatsel Shnatsel mentioned this pull request Feb 4, 2023
@Shnatsel
Copy link
Author

Shnatsel commented Feb 4, 2023

The AVX fuzz target is slow if run with both debug assertions and address sanitizer. You have to use either cargo +nightly fuzz --release avx or cargo +nightly fuzz --sanitizer=none avx

--release is preferred because ASAN catches more severe issues, so it's best to keep it on.

@HEnquist
Copy link
Contributor

I had forgotten about this and just rediscovered it. I can't help wondering what this tests that isn't already covered by the existing tests. All algorithms already have tests that compare their output with the reference FFT.
The FFT algorithms also don't depend on the input values, the code path is the same no matter what values are in the input. The only important parameter is the length, which is used to select algorithm. Once that is done, the code path is completely fixed. As an example, a length-2 FFT is [a, b] ==> [a+b, a-b]. Longer lengths are of course use longer expressions, but they are equally fixed.

To me it would make a lot more sense to test what happens if you feed the FFT various combinations of invalid buffers. That should return errors, and never panic.

@Shnatsel
Copy link
Author

I wrote this before I actually dove into the implementations of FFT. I tend to agree that if the execution path isn't dependent on the data, there isn't a whole lot for the fuzzer to test. Running those tests under Address Sanitizer would probably achieve similar results. So I'm going to go ahead and close this.

@Shnatsel Shnatsel closed this May 25, 2024
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.

2 participants