import { DEFAULT_REGEX_LIMITS } from "../execution/request-limits";
import type { CandidateGenerationSettings } from "./generation.types";

export const GENERATION_LIMITS = {
  maximumSeedUtf16: 128,
  maximumCandidateAttempts: 4_000,
  maximumAstNodes: 20_000,
  maximumAstDepth: 512,
  maximumQuantifierRepetitions: 1_024,
  maximumDiscardedDiagnostics: 250,
  maximumDiagnosticPreviewUtf16: 160,
  minimumPerCaseTimeoutMs: 25,
  maximumPerCaseTimeoutMs: DEFAULT_REGEX_LIMITS.advancedMaximumTimeoutMs,
  maximumWallTimeMs: DEFAULT_REGEX_LIMITS.maximumBenchmarkWallTimeMs,
  maximumTotalSubjectBytes: DEFAULT_REGEX_LIMITS.interactiveSubjectHardBytes,
  maximumSubjectBytes: DEFAULT_REGEX_LIMITS.interactiveSubjectHardBytes,
} as const;

export const DEFAULT_GENERATION_SETTINGS: CandidateGenerationSettings = {
  maximumCases: 48,
  maximumCandidateAttempts: 192,
  maximumTotalSubjectBytes: 1024 * 1024,
  maximumSubjectBytes: 64 * 1024,
  maximumAstNodes: GENERATION_LIMITS.maximumAstNodes,
  maximumAstDepth: GENERATION_LIMITS.maximumAstDepth,
  maximumQuantifierRepetitions: 32,
  randomVariantCount: 16,
  perCaseTimeoutMs: 500,
  maximumWallTimeMs: 15_000,
};
