Fuzzer improvements and CondParen formatting fix#323
Merged
Conversation
_format_cond_body (Python) and _formatCondBody (JavaScript) referenced node.body for cond-paren nodes, but CondParen uses node.inner. This caused an AttributeError when formatting conditional expressions with parentheses inside command substitutions, e.g., echo $([[ ( -n x ) ]]).
Add a grammar-based generator that produces bash scripts with controlled complexity via 13 layers (literals through functions). Also add layer detection and --filter-layer option to all fuzzers for filtering discrepancies by complexity. Changes: - New generator.py with layered grammar-based generation - Unified CLI with subparsers (char, struct, gen, min aliases) - --minimize and --filter-layer flags for character/structural fuzzers - Shared post_process_discrepancies() in common.py - Enhanced minimizer CLI supporting stdin and @file input - Updated documentation
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.
Summary
--filter-layeroption to filter discrepancies by complexitychar,struct,gen,min)--minimizeflag to character and structural fuzzersCondParennodes inside command substitutionsDetails
Grammar-based generator
New
uv run fuzzer gencommand generates bash scripts with controlled complexity:Layer filtering
All fuzzers now support
--filter-layer Nto show only discrepancies at or below layer N, useful for focusing on simpler constructs first.Bug fix
_format_cond_bodyreferencednode.bodyfor cond-paren nodes, butCondParenusesnode.inner. This caused crashes on inputs likeecho $([[ ( -n x ) ]]).