opencax / GSoC

Google Summer of Code Projects
30 stars 14 forks source link

Add fuzzing tests #83

Open pca006132 opened 5 months ago

pca006132 commented 5 months ago

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

Difficulty

Size

Additional Information

dasoya commented 3 months ago

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 commented 3 months ago

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.