# `Imp.Optimizer.InstructionSearch`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/optimizer/instruction_search.ex#L1)

Search over candidate signature instructions and keep the best program.

`InstructionSearch` is the small, explicit optimizer underneath
instruction-only workflows such as `Imp.Optimizer.SignatureOptimizer` and
coordinate prompt optimization. It evaluates each proposed instruction on the
dev set, evaluates the original program as a baseline, and attaches an
optimizer report to the selected program. The original program wins
equal-score ties so a rewrite must demonstrate an actual validation gain.

Failed candidates are recorded in the report instead of aborting the whole
compile. If every evaluation fails, `compile/6` returns the original program
with a diagnostic report.

# `candidate_instructions`

# `compile`

# `current_instruction`

# `current_instruction`

Returns the instruction of one explicitly named optimizer predictor.

# `put_instruction`

# `put_instruction`

Replaces the instruction of one explicitly named optimizer predictor.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
