Repository navigation
Fuzz the .ids and .idp parsers and the schema compiler - #215
Merged
Merged
Conversation
Three cargo-fuzz targets in core/fuzz (its own crate, outside the workspace): ids_parse, ids_compile and idp_parse. Each checks that any text never panics, and that a refusal comes back as diagnostics whose spans point inside the input. ids_compile also sends what it compiles through the store's CBOR and back, comparing the units and the IR hash. The Fuzz workflow runs each target for 60 s on a pull request that touches the compiler, and for 10 min nightly on every core (fork mode) from a cached corpus, opening an issue on a failure. Seeds are the repo's own schemas and configs; dictionaries hold each grammar's tokens. Refs #9
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the last item on #9: fuzz the
.idsand.idpparsers. Any input must not panic, and every refusal must come back as a diagnostic with a span.Targets (
core/fuzz, its own crate, nightly)ids_parseparse_schemaids_compileparse_schema, thencheck_and_from_declarationsschema_ir_hash(core#172 was a schema that built and then couldn't be read back)idp_parseconfig.idpgrammar, theninterpret_contextfrom_config_sourcereports has a span, and interpreting never panics.idsand.idpfiles, copied byseed-corpus.sh.ids.dictandidp.dict.-max_len=1024. Under the address sanitizer the tree-sitter parser costs about 1 ms per KiB, and parser bugs show up in short inputs.CI (
.github/workflows/fuzz.yml)It follows runtime's fuzz workflow:
-fork=$(nproc), from a cached corpus.Local results
Run on 6 cores:
ids_parseandidp_parse: 5 min each.ids_compile: 5 min, then another 3 min with the CBOR round trip.That's about 100,000 inputs per target, with no findings. The two panics in #175 aren't reachable from these entry points, as that issue already says.
Not included: publishing a
core.fuzz.jsonto the observatory. runtime'sfuzz-report.pywould first have to become a shared action.Refs #9