Repository navigation
Conversation
added 2 commits
November 11, 2026 09:04
A bounded type graph (primitives with the 128-bit integers, char[max N], char[N], T[], T[max N], T[N], optional fields, unit enums of up to 200 variants, structs, aliases, recursion under @max_depth) is frozen as comline-core's TypeRef and sized by it for packed@1, msgpack@1 and json@1. Values of the type (the simplest, a random one, one at the bounds) are encoded with the real formats through the conformance crate's Wire: their length must lie in core's [min, max] and encoded_len must agree, and core's min and max witnesses must encode to exactly min and max. tests/sizes.rs is the proptest twin, with the tiers too large for a vector: a msgpack array of 65536 items, 3- and 4-byte varint lengths, an enum of 200 variants, recursion to its limit, the longest JSON floats. The fuzz crate pins comline-core at an unmerged commit of ComlineProject/core#242, to be re-pinned at its merge commit.
An array of char in the IR is a string (char[N], char[max N]): the generator made tuples of chars, which core rightly sized as strings. And a run spent its time building large witnesses (a serde_json::Value a node), at 19 execs/s: one input in sixteen is big (the tiers that need 65536 items or 2^21 characters), the rest small.
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.
Step 4 of the per-format sizes work: the guarantee that core's ranges are proven against the real encoders, not trusted.
Pins an unmerged core commit.
runtime/fuzzdepends oncomline-coreat20c72f0566faa7dd8ebef54a03b916fcea196655, the head of ComlineProject/core#242 (sizes/per-format). It will be re-pinned at the merge commit once #242 lands. Only the fuzz crate depends on core (default features off: the IR alone); the runtime library never does. The fuzz crate's lockfile isn't tracked.What it checks
A random bounded type graph is frozen as core's
TypeRefs (with aLookup), sized by core forpacked@1,msgpack@1andjson@1, and values of it are encoded by the runtime's real formats through the conformance crate'sWire:[min, max], andencoded_lenequals it;minandmax(unlessupper_bound);The generator (
runtime/fuzz/src/sizes.rs): all primitives withu128/i128,char,char[max N],char[N],T[],T[max N],T[N]with bounds at the header tiers and past what a header says, optional fields, unit enums up to 200 variants with long names, nested structs and aliases, and recursion under@max_depth(or none). Values come in three styles: the simplest, random, and at the bounds (full strings of four-byte and JSON-escaped characters, longest counts, widest numbers and variants).Where
sizes_vs_corefuzz target (runtime/fuzz/fuzz_targets/), in the README's targets table, so the PR and nightly fuzz matrix picks it up.runtime/fuzz/tests/sizes.rs: the proptest twin, plus deterministic tests for the tiers a vector can't store (msgpack array of 65536 items, 3- and 4-byte varint lengths up to 2^21 characters, longestf32/f64JSON forms, 200-variant enum, recursion to its limit). A newsizesjob infuzz.ymlruns it on pull requests and nightly.