Repository navigation
fuzz: cover template and tool parsers and fix Unicode tag scanning - #64
Merged
midagedev merged 1 commit intoOct 12, 2026
Merged
Conversation
Owner
|
Thank you. The 0.3.1 release is being cut now, so I will review this after the tag today. |
6 of 7 tasks
Owner
|
The
|
Owner
|
Update: you do not need to change anything. We will make these changes on your branch ourselves and then merge it:
|
midagedev
added a commit
that referenced
this pull request
Oct 12, 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.
What and why
Jinja tag scanning can panic when a byte offset lands inside a multibyte character, for example in an unclosed Unicode tag. Compare ASCII closers as bytes and add a FAIL-first regression. Add a standalone, workspace-excluded
fuzz/crate covering Jinja parse/render and the GLM, Qwen, DSML and Hermes streaming scanners, with curated seeds, a dictionary and reproducible instructions.Closes #8.
The scanner targets check chunk-invariant content/calls, acceptance of malformed streams, dense call indices and JSON object arguments. They collect parsed calls without executing tools. The render target varies contexts over six bounded programs and both float styles. Corpus attributes retain intentional CRLF, control bytes and whitespace.
Code shape
cargo fmtandcargo clippyare clean on the Jinja crate and standalone fuzz crate.Duplication found or removed: none.
What I ran
find_closebefore the byte comparison; after the fix, all 23 Jinja unit tests pass.cargo test -p bloomery-serve: 206 unit tests pass; hardware/integration gates marked ignored remain for the maintainer.cargo test --manifest-path fuzz/Cargo.toml: 2 harness unit tests pass.cargo clippy -p bloomery-jinja --all-targets -- -D warningsand the corresponding standalone fuzz command pass; workspace and fuzz formatting checks pass.-max_total_time=60 -max_len=4096 -dict=fuzz/parsers.dict. Jinja render and all four tool scanners completed 61-second campaigns without a finding. Jinja parse found the nesting failure below after approximately 43 seconds. Its curated seeds, including the Unicode regression, pass a separate 100-run smoke check.cargo fuzz run glmxml fuzz/corpus/glmxml -- -seed=20261012 -runs=100 -max_len=4096 -dict=fuzz/parsers.dictexits 1 withcharacter chunks changed the parse. The defect is absent from this branch.DONE tier=t0 total=9 red=0 wall=17s.cargo metadata --no-depskeeps 25 engine workspace members and excludesbloomery-fuzz.Known unresolved finding:
fuzz/findings/jinja-deep-expression.txt(1630 bytes) exhausts the Jinja parser stack under AddressSanitizer. It is retained outside the routine seed corpus, with a direct command infuzz/README.md. This PR does not invent a nesting limit or suppress the failure. A maintainer should decide the parser resource contract and follow-up fix.This is scoped contributor validation, not a claim that all T0/T1 units or the workstation's selected GPU gates ran. The root manifest changes only the workspace exclusion; the Jinja host behavior changes as described. Maintainer verification and the known nesting finding are why this PR is a draft.
Hardware
Linux 7.0.0-38-generic x86_64, Intel Core i5-12600K, approximately 64 GB RAM; pinned nightly-2026-08-28,
RUSTFLAGS=-C target-cpu=native. No NVIDIA GPU or model inference was used.