Skip to content

Fuzz lib/v3 against lib - #171

Open
17krishna8 wants to merge 1 commit into
ia0:mainfrom
17krishna8:fuzz-v3-differential
Open

17krishna8 wants to merge 1 commit into
ia0:mainfrom
17krishna8:fuzz-v3-differential

Conversation

@17krishna8

Copy link
Copy Markdown
Contributor

Adds impl_v3_encode and impl_v3_decode fuzz targets that differentially test lib/v3 against lib, as listed in #106 ("Update OSS-Fuzz to also fuzz lib/v3").

Both targets generate an encoding from the fuzz input with the existing gen module, then check that v3 behaves like v2:

  • impl_v3_encode: v3.encode(input) == v2.encode(input)
  • impl_v3_decode: v3.decode(input) == v2.decode(input), including error kinds and positions

Since v3 must preserve v2 behavior for simple usages, and encodings like #163 (encode by the greatest multiple of blocks that fits 128 bits) are internal rewrites, continuous differential fuzzing should catch behavioral regressions early.

No divergence was found while preparing this change:

  • a few hundred thousand libFuzzer executions of both targets with coverage feedback
  • an offline differential of about one million generated specifications and inputs (all bit widths, bit orders, paddings, ignored characters, wrappings, and translations)

Note: this does not change the OSS-Fuzz project configuration in google/oss-fuzz, which builds all targets of lib/fuzz and should pick up the new targets automatically.

@ia0 ia0 mentioned this pull request Oct 6, 2026
5 of 26 tasks
@ia0

ia0 commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Thanks a lot for the PR but I think this is too early to merge. I'm still designing v3 with major changes to come and I don't think it's anywhere ready for fuzzing yet. Once I'm satisfied with v3 design, I'll probably refresh this PR to make sure v3 covers all use-cases of v2.

@17krishna8

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look! That makes sense - I'll leave the PR open for whenever you are happy with the v3 design, and I'm happy to rebase or rework it however is useful at that point.

This branch has not been deployed

No deployments
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