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 fuzzing tests #83

Open
pca006132 opened this issue Jan 21, 2024 · 2 comments
Open

Add fuzzing tests #83

pca006132 opened this issue Jan 21, 2024 · 2 comments

Comments

@pca006132
Copy link

Outline

Add more fuzzing tests for both 2D and 3D operations.

Details

Fuzzing is an effective technique to expose bugs in software. Fuzzing tests randomly generate structured inputs (according to specification), and test if the program crashes/failed assertions.

This project aims to test 2D and 3D CSG operations on geometrically valid polygons/meshes. To do this, we will define a very simple AST for our CSG operations, and use the recursive domain feature of fuzztest for the tests.

We will also randomly apply slight perturbation to make the valid geometry only epsilon-valid, to test for robustness of the algorithm.

Expected Outcome

Fuzz tests that test for union, intersection, difference, 2D extrude/revolve, etc.

Project Properties

Skills

  • C++
  • Basic understanding of graph data structure.

Difficulty

  • Medium

Size

  • Medium

Additional Information

@dasoya
Copy link

dasoya commented Mar 20, 2024

Hi, @pca006132 I am a senior college student in EWHA. I am interested in this project. I am new in using fuzz test but I implemented some graphics feature like ray tracing in OpenGL using C++.

I looked up your fuzz test implementations for the triangulator here
https://github.com/elalish/manifold/blob/master/test/polygon_fuzz.cpp

In this case, you've implemented tests for segfault/ memory corruption and infinite loops. I'm wondering if the CSG test is also designed to check whether the process of creating the AST can cause segmentation faults.

Additionally, I want to know if you've implemented any other fuzz test modules that I could use as a reference. I'm also interested in learning how CSG operations work. Thank you in advance for your suggestions.

@pca006132
Copy link
Author

Creating the AST should not cause segfault, but converting the AST to actual CSG operations, i.e. interpreting the AST, can cause segfault. And no, polygon_fuzz.cpp is the only fuzz test module we have for now, but feel free to ask us anything about the underlying CSG operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants