Skip to content

fuzzer for constructCell#1074

Merged
isaacbrodsky merged 5 commits intouber:masterfrom
isaacbrodsky:constructcell-fuzzers
Nov 3, 2025
Merged

fuzzer for constructCell#1074
isaacbrodsky merged 5 commits intouber:masterfrom
isaacbrodsky:constructcell-fuzzers

Conversation

@isaacbrodsky
Copy link
Copy Markdown
Collaborator

Fixes #1067

@isaacbrodsky isaacbrodsky force-pushed the constructcell-fuzzers branch from 960fad5 to 1b7c5fe Compare October 30, 2025 22:54
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 30, 2025

Coverage Status

coverage: 98.946%. remained the same
when pulling d9967ff on isaacbrodsky:constructcell-fuzzers
into 0ac92fb on uber:master.

Comment on lines +39 to +44
H3_EXPORT(constructCell)
(args->res, args->baseCellNumber, args->digits, &out);
if (args->res == 0) {
H3_EXPORT(constructCell)
(args->res, args->baseCellNumber, NULL, &out);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a (probably naive) question to improve my understanding of how to set up the fuzzers: I'm surprised we run an additional test if res == 0, as opposed to branching to a separate test on the value of res.

How does that work / why do we want to run both?

How would this compare to code like:

if (args->res == 0) {
    H3_EXPORT(constructCell)
    (args->res, args->baseCellNumber, NULL, &out);
} else {
    H3_EXPORT(constructCell)
    (args->res, args->baseCellNumber, args->digits, &out);
}

Or, is the idea that the res == 0 branch provides a more targeted test that's more likely to find issues quickly because it is reducing the search space?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if res is 0 and a non-NULL pointer is passed for digits it should still be accepted. The inverse is not true however, since the caller must provide an array of length res.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm updating this to be clearer about why we are testing different digits lengths.

@ajfriend ajfriend added this to the v4.4 milestone Nov 1, 2025
@ajfriend
Copy link
Copy Markdown
Collaborator

ajfriend commented Nov 1, 2025

Makes sense, and this example helped me understand fuzzing a bit better :)

Comment on lines +48 to +49
H3_EXPORT(constructCell)
(args->res, args->baseCellNumber, args->digits, &out);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is just auto-formatting, but I find this hard to read compared with opening the parens on the previous line

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately how the auto-formatter wants to do it

@isaacbrodsky isaacbrodsky merged commit 576d8e3 into uber:master Nov 3, 2025
45 checks passed
@isaacbrodsky isaacbrodsky deleted the constructcell-fuzzers branch November 3, 2025 18:50
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.

fuzz constructCell

6 participants