Skip to content

Commit

Permalink
Monitor for faulty CodeGenerators and ProgramTemplates
Browse files Browse the repository at this point in the history
This change adds some logic to periodically (currently every 5 minutes)
check for CodeGenerators and ProgramTemplates that have a very low
correctness rate, which might indicate that they are not working correctly.
  • Loading branch information
Samuel Groß committed Sep 11, 2024
1 parent 9161d13 commit fb79747
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/Fuzzilli/Fuzzer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,20 @@ public class Fuzzer {
}
}

// Install a timer to monitor for faulty code generators and program templates.
timers.scheduleTask(every: 5 * Minutes) {
for generator in self.codeGenerators {
if generator.totalSamples >= 100 && generator.correctnessRate < 0.05 {
self.logger.warning("Code generator \(generator.name) might be broken. Correctness rate is only \(generator.correctnessRate * 100)% after \(generator.totalSamples) generated samples")
}
}
for template in self.programTemplates {
if template.totalSamples >= 100 && template.correctnessRate < 0.05 {
self.logger.warning("Program template \(template.name) might be broken. Correctness rate is only \(template.correctnessRate * 100)% after \(template.totalSamples) generated samples")
}
}
}

// Determine our initial state if necessary.
assert(state == .uninitialized || state == .corpusImport)
if state == .uninitialized {
Expand Down

0 comments on commit fb79747

Please sign in to comment.