How banditfuzz/banditfuzz_public works
Main components
• CLI Layer
– bin/smtfuzz (SMT input generator)
– bin/banditfuzz (performance fuzzer)
• Parser
– banditfuzz/parser/parser.py
– banditfuzz/parser/settings.py
• Fuzzing Engine
– banditfuzz/fuzzers (the generic Fuzzer base class and per‐theory modules)
– banditfuzz/fuzzers/core, int, bv, fp, real, str, array_test
• Bandit Agents
– banditfuzz/agents (ε‐greedy, UCB, Thompson, Random)
• Solver Runner & Killer
– banditfuzz/solvers/runner.py
– banditfuzz/solvers/killer.sh
• Utilities
– banditfuzz/util (logger, coverage JSON parser, generic utilities)
• External SMT Solvers
– e.g. Z3, CVC4, MathSAT
• Packaging
– setup.py
Relationships & data flows
1. User invokes CLI (smtfuzz or banditfuzz).
2. CLI parses arguments & settings (parser module).
3. For each test iteration:
a. Fuzzing Engine selects a theory‐specific fuzzer.
b. Agent module picks a generation strategy (bandit choice).
c. Fuzzer module (literal, variable, constructs) emits an SMT script.
d. Solver Runner invokes an external SMT solver on the script.
e. Solver Runner captures performance metrics, pass/fail, timeouts.
f. Results feed back to Agent (update rewards) and Utilities (log, coverage).
4. Loop until budget or stopping condition.
5. Produce report (logger output, coverage.json).
Architectural patterns
• Modular plugin pattern for theory fuzzers (one folder per logic).
• Strategy pattern for bandit agents.
• Layered CLI → Parser → Core Engine → Agent → Solver
• Separation of concerns: generation, decision‐making, execution, reporting.