ProgramEvolutionOptions

Options & Configuration · AiDotNet.Configuration

The single configuration surface for evolving source code: seeds, bounds, prompting, sandbox, and search.

For Beginners

This is the control panel for evolving source code rather than numbers. Set Language to the language you are evolving, put your starting program in SeedPrograms, describe the goal in TaskDescription, and give the search a way to score a candidate — either a list of input/output TestCases or an EvaluatorScript. Everything else has a working default. The character limit stops a runaway model from producing a megabyte of code, and EnforceEvolveBlocks is worth turning on once your files have start and end markers, because it stops the model from editing the parts you wanted left alone.

How It Works

These options gather every knob a program-evolution run needs. The first group describes the program text itself — which comment markers fence the editable region, whether edits outside that region are refused, how large a program may grow, and how SEARCH/REPLACE edits are parsed and applied. The second group ties the rest of the run together: SeedPrograms and TaskDescription say what is being improved and why, TestCases and EvaluatorScript say how a candidate is scored, Descriptors says which behaviour axes the archive maps, and Prompt, Variation, Sandbox, and Engine configure the four subsystems that do the work.

Nothing here activates an LLM, a sandbox, a Python interpreter, or a network call. Every subsystem stays inert until a caller supplies a chat client or an execution engine of its own, so a program that merely constructs these options acquires no new dependency. The nested subsystem options are created on first use, which keeps the common case — a bare instance handed to ProgramDiff just to read its markers — as cheap as it was before the aggregate members existed.

EvolveBlockStartMarker and EvolveBlockEndMarker are null by default, which means “use the comment syntax that is valid in Language”; set them to override that choice. The reference OpenEvolve implementation hard-codes Python-style markers regardless of language and caps program text at 10,000 characters, whereas MaxProgramChars is explicit and applies to every language.

Constructors

Constructor Summary
ProgramEvolutionOptions()

Properties

Property Summary
EmbeddingNoveltyOptions Novelty { get; set; } Gets or sets duplicate rejection by structural distance and optionally by embedding; null disables it.
EvolutionEngineOptions Engine { get; set; } Gets or sets the generic search settings: budgets, islands, parallelism, and checkpointing.
IList<IProgramDescriptor> Descriptors { get; set; } Gets or sets the behaviour axes the archive maps candidates onto.
IList<ProgramInputOutputExample> TestCases { get; set; } Gets or sets the input/output examples a candidate is scored against.
IList<string> SeedPrograms { get; set; } Gets or sets the program sources the run starts from.
LlmFeedbackOptions LlmFeedback { get; set; } Gets or sets how a language model’s judgement of a candidate is blended into its measured score.
LlmProgramVariationOptions Variation { get; set; } Gets or sets how the language model is asked for a change and how unusable answers are retried.
ProgramArtifactStoreOptions ArtifactStore { get; set; } Gets or sets on-disk retention of evaluation artifacts; null keeps artifacts in memory only.
ProgramDiffOptions Diff { get; set; } Gets or sets how SEARCH/REPLACE edit blocks are parsed and applied.
ProgramEvolutionPromptOptions Prompt { get; set; } Gets or sets how prompts are templated, bounded, and varied.
ProgramLanguage EvaluatorScriptLanguage { get; set; } Gets or sets the language EvaluatorScript is written in.
ProgramLanguage Language { get; set; } Gets or sets the language of the programs being evolved.
ProgramMetricAggregationOptions Metrics { get; set; } Gets or sets how an evaluator’s metric dictionary is reduced to the single quality the archive ranks.
ProgramRunOutputOptions RunOutput { get; set; } Gets or sets writing of the best program to disk; null writes no program files.
ProgramSandboxOptions Sandbox { get; set; } Gets or sets the execution boundary and resource limits applied to untrusted program text.
ProposalProvenanceOptions Provenance { get; set; } Gets or sets whether each proposal’s prompt, answer, and parse outcome are recorded for later audit.
ScriptProgramEvaluationOptions Script { get; set; } Gets or sets how a caller-supplied evaluator script is run and how its metrics are read.
bool EnforceEvolveBlocks { get; set; } Gets or sets whether edits that fall outside every evolve block are refused.
int IncludeEliteSourceCount { get; set; } Gets or sets how many elites a run summary retains, best first.
int MaxEliteSourceChars { get; set; } Gets or sets the per-elite source bound applied when building a run summary, in characters.
int MaxProgramChars { get; set; } Gets or sets the maximum number of characters a candidate program may contain.
string EvaluatorScript { get; set; } Gets or sets the evaluator source that scores candidates inside the sandbox, or null for none.
string EvolveBlockEndMarker { get; set; } Gets or sets the end marker that closes the editable region, or null to use the language default.
string EvolveBlockStartMarker { get; set; } Gets or sets the start marker that opens the editable region, or null to use the language default.
string TaskDescription { get; set; } Gets or sets the plain-language statement of what the evolved program must achieve.

Methods

Method Summary
EvolveBlockMarkers ResolveEvolveBlockMarkers() Resolves the marker pair implied by the explicit markers and the configured language.
IReadOnlyList<ProgramGenome> CreateSeedGenomes() Creates one seed genome per entry in SeedPrograms.
ProgramDescriptorSet CreateDescriptorSet() Creates the descriptor set the task merges into every completed evaluation.
ProgramEvolutionOptions Clone() Creates an independent copy so a running component is unaffected by later mutation.
void Validate() Validates the language, marker pair, program bound, and every nested subsystem that was configured.

Fields

Field Summary
int DefaultIncludeEliteSourceCount The default number of elites whose bounded source appears in a run summary.
int DefaultMaxEliteSourceChars The default per-elite source bound in a run summary, in characters.