Sieve-df: a Rust fuzzer for LLM structured-output engines (llguidance, outlines) A new open-source Rust tool called sieve-df fuzzes LLM structured-output engines by walking token masks against JSON Schemas without loading model weights, checking llguidance, outlines-core, XGrammar and optionally the llama.cpp grammar sampler. At each decoding step sieve-df flags four bug classes — contradictions, dead ends, cross-engine disagreements and invalid outputs — plus crashes and hangs, then shrinks each finding to a minimal schema and token path and writes a markdown issue draft. Disagreements are adjudicated by attempting to finish the output and validating it with jsonschema-rs: a valid finish means the blocking engine is too strict, and if none can be produced the allowing engine is too loose. At every decoding step sieve-df checks whether an engine's token mask allows exactly the right tokens for a JSON Schema. It needs no model weights : it loads an ungated tokenizer.json for example a Qwen tokenizer from Hugging Face and does random token walks over the mask, weighted toward boundary tokens such as ": , "},{" and leading-space tokens. | Engine | How it is driven | |---|---| | llguidance https://github.com/guidance-ai/llguidance | Rust crate, linked directly | | outlines-core https://github.com/dottxt-ai/outlines-core | Rust crate, linked directly | | XGrammar https://github.com/mlc-ai/xgrammar | Python, through a JSON-lines subprocess bridge | | llama.cpp https://github.com/ggml-org/llama.cpp grammar sampler optional | via llama-cpp-python and a vocab-only GGUF generated from tokenizer.json ; scripts/setup llamacpp.sh ; needs a real tokenizer | Everything is free and open source; nothing needs an account, API key or card. 1. Contradictions – the mask allows a token, but the engine rejects it when it is fed. 2. Dead ends – an allowed token leads to a state with an empty mask that cannot finish. 3. Disagreements – two engines differ on one token. To decide who is right sieve-df tries to finish the output and validates it with jsonschema-rs https://github.com/Stranger6667/jsonschema : a valid finish means the blocking engine is too strict; if none can be produced, the allowing engine is too loose. 4. Invalid outputs EOS allowed for a document that violates the schema , crashes engine panics, isolated and hangs compile blow-ups . Each bug is shrunk to a minimal schema plus token path, written as a markdown issue draft, and counted in an engine x JSON Schema feature x tokenizer table. cargo build --release examples/quickstart.sh built-in vocabulary, bundled schemas, no downloads With a real tokenizer and the other engines: php scripts/fetch tokenizer.sh Qwen2.5 tokenizer.json - data/tokenizers/qwen2.5.json scripts/setup xgrammar.sh optional: .venv with XGrammar no torch needed scripts/fetch corpora.sh optional: JSON Schema Test Suite + JSONSchemaBench target/release/sieve-df run \ --tokenizer data/tokenizers/qwen2.5.json \ --engines llguidance,outlines-core,xgrammar \ --builtin --mcp examples/mcp \ --suite data/corpora/json-schema-test-suite \ --bench data/corpora/jsonschemabench --bench-subsets Handwritten,Kubernetes \ --mutants 3 --walks 20 --out out/run | Command | Purpose | |---|---| | sieve-df run | fuzz: random walks --mode single\|differential\|both over the selected schemas; writes findings.jsonl , findings/ .json , stats.json | | sieve-df replay