Skip to content

Add roundtrip fuzzing for LogReader #152

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

Merged
merged 1 commit into from
Mar 16, 2025
Merged

Conversation

elliotgoodrich
Copy link
Owner

Add fuzzing for LogReader by roundtripping a corpus twice through LogWriter and checking that the first and second outputs are identical.

We have to roundtrip twice and not compare against the original since there are numerous inputs that map to the same LogEntry, e.g. all integers can have any number of leading zeros. Perhaps in the future we can tighten up the format so there is a 1-1 mapping, but this should be fine for the moment.

LogReader is by no means optimal in terms of performance. But there is little reason to start optimizing now before proper benchmarks exist.

@elliotgoodrich elliotgoodrich force-pushed the logreader-extra-fuzzing branch from 52d271a to abb71dc Compare March 16, 2025 10:47
Add fuzzing for `LogReader` by roundtripping a corpus twice through
`LogWriter` and checking that the first and second outputs are
identical.

We have to roundtrip twice and not compare against the original since
there are numerous inputs that map to the same `LogEntry`, e.g. all
integers can have any number of leading zeros.  Perhaps in the future we
can tighten up the format so there is a 1-1 mapping, but this should be
fine for the moment.

`LogReader` is by no means optimal in terms of performance.  But there
is little reason to start optimizing now before proper benchmarks exist.
@elliotgoodrich elliotgoodrich force-pushed the logreader-extra-fuzzing branch from abb71dc to 2eed50a Compare March 16, 2025 10:48
@elliotgoodrich elliotgoodrich merged commit 84ebdf4 into main Mar 16, 2025
10 checks passed
@elliotgoodrich elliotgoodrich deleted the logreader-extra-fuzzing branch March 16, 2025 11:11
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.

1 participant