Repository navigation
test(graph-rs): add the fuzz input decoder and the Cypher and JSON fuzz targets - #3442
Conversation
This comment has been minimized.
This comment has been minimized.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Shared fuzz input support rust/cgr_graph_rs/fuzz/src/lib.rs, rust/cgr_graph_rs/fuzz/.gitignore |
Adds the require! macro and Input methods for reading and decoding fuzz input. Adds ignore rules for generated fuzz data. |
Cypher lexing and parsing checks rust/cgr_graph_rs/fuzz/fuzz_targets/cypher_parse.rs |
Adds checks for lexer and parser errors, token spans and values, and error positions. |
JSON string encoding checks rust/cgr_graph_rs/fuzz/fuzz_targets/json_string.rs |
Adds checks for output prefix preservation, printable-ASCII output, and canonical escape decoding. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other
Possibly related PRs
- vitali87/code-graph-rag#3445: Adds the fuzz package manifest and declares the binaries implemented by these targets.
Merge Risk: 
Minimal · up to 7a817
-
No actionable issue remains in this PR’s fuzz targets; the change is ready to merge after normal checks.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description provides a clear summary, explains the lack of user-visible changes, identifies the change type, states related issues, and gives detailed test results. The checklist section from the template is missing, but the description is otherwise complete.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
[Low impact] Appears safe to merge in the stated stack order, with PR #3445 supplying the fuzz package manifest. SummaryAdds shared fuzz input helpers and targets for Cypher parsing and JSON string escaping.
Reviews (1) · Last reviewed commit: "test(graph-rs): add the fuzz input decod..." · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVdycfDFvbqaoyHWVWHJ1N
|



Summary
rust/cgr_graph_rs.src/lib.rsis the shared input decoder, total over every byte string, andrequire!, which aborts when a property is false.cypher_parse: the lexer's tokens cover the query in order, and each span holds what its kind says. Lexer errors and deferrals point at the character that caused them.parsereturns the lexer's error unchanged, and otherwise only grammar errors within the query.json_string:push_stringwrites printable ASCII that a JSON parser reads back to the same string, with exactly the escapesjson.dumpswrites (lowercase hex, surrogate pairs above the BMP).Cargo.tomlcomes last in this stack, so nothing builds a partial package.Demo
No user-visible change: fuzz targets only. Nothing in the package, CI or the wheel builds
rust/cgr_graph_rs/fuzz.Type of Change
Related Issues
None.
Test plan
Run on the whole stack, since the package builds once its manifest lands in the last PR:
cargo fuzz coverage).cargo +nightly-2025-07-16 check --binspasses, as well as the current nightly.Files changed
rust/cgr_graph_rs/fuzz/.gitignorerust/cgr_graph_rs/fuzz/src/lib.rsrust/cgr_graph_rs/fuzz/fuzz_targets/json_string.rsrust/cgr_graph_rs/fuzz/fuzz_targets/cypher_parse.rsDiff stats
+398 additions, -0 deletions (398 LOC)
Dependency graph
Merge in this order:
Summary by CodeRabbit