Class FuzzRunner

java.lang.Object
org.ek9lang.compiler.fuzz.FuzzRunner

public final class FuzzRunner extends Object
Orchestrates the fuzz testing pipeline: generate, parse gate, compile, record statistics. Runs continuously for a specified duration using parallel virtual thread workers, producing comprehensive statistics about compiler behavior under randomly generated input. Each worker gets its own deserialized bootstrap context for total isolation.
  • Constructor Details

    • FuzzRunner

      public FuzzRunner(Duration maxDuration, Path crashDir, FuzzOutputFormat outputFormat, SharedThreadContext<CompilableProgram> bootstrapContext)
      Create a new fuzz runner using all available processors with no strand filter.
      Parameters:
      maxDuration - how long to run before stopping
      crashDir - directory to save crash-triggering source files
      outputFormat - the output format for fuzz results
      bootstrapContext - the bootstrapped compiler context with built-in modules
    • FuzzRunner

      public FuzzRunner(Duration maxDuration, Path crashDir, FuzzOutputFormat outputFormat, SharedThreadContext<CompilableProgram> bootstrapContext, int strandFilter)
      Create a new fuzz runner using all available processors with optional strand filter.
      Parameters:
      maxDuration - how long to run before stopping
      crashDir - directory to save crash-triggering source files
      outputFormat - the output format for fuzz results
      bootstrapContext - the bootstrapped compiler context with built-in modules
      strandFilter - strand to isolate (1-4), or 0 for normal mixed dispatch
    • FuzzRunner

      public FuzzRunner(Duration maxDuration, Path crashDir, FuzzOutputFormat outputFormat, SharedThreadContext<CompilableProgram> bootstrapContext, int strandFilter, int workerCount)
      Create a new fuzz runner with a specified number of worker threads.
      Parameters:
      maxDuration - how long to run before stopping
      crashDir - directory to save crash-triggering source files
      outputFormat - the output format for fuzz results
      bootstrapContext - the bootstrapped compiler context with built-in modules
      strandFilter - strand to isolate (1-4), or 0 for normal mixed dispatch
      workerCount - number of parallel virtual thread workers
  • Method Details

    • run

      public void run()
      Run the fuzzer with parallel virtual thread workers. Each worker gets its own deserialized bootstrap context for total isolation. Status reporting runs on the main thread.
    • stop

      public void stop()
      Signal the fuzzer to stop gracefully after the current iteration completes. Also writes the final report so SIGINT always produces output.
    • getStatistics

      public FuzzStatistics getStatistics()
      Get the statistics collector for external reporting.