Expand description
Iteration driver. The high-level entry point is Executor;
Stepper exposes one-iteration-at-a-time control, and run_loop_with_control
is the borrowed-problem variant used by composed solvers.
§Canonical iteration ordering
Executor::run (and the equivalent Stepper/run_loop_with_control
paths) drive the solver through this exact sequence, and every
contract elsewhere in the framework cross-links here:
- Convergence history resets, then
Solver::initis called once. The returned state is what iter-0 sees. - Then, repeatedly, before each
Solver::next_itercall (including the first):- An executor-attached
CancellationTokenis checked, when configured. Cancellation stops the run withTermination::Cancelled. The borrowedrun_loop_with_controlpath has no attached token and skips this step. - Execution controls check iteration, legacy cost and gradient budgets,
raw evaluation budgets, elapsed time, target cost, improvement stall,
and acceptance stall, followed by application hooks in insertion
order. See
RunControl. Solver::check_convergenceevaluates solver-owned convergence. Its default delegates to the legacySolver::terminatehook. The first stop ends the run.
- An executor-attached
- If nothing fired,
Solver::next_iterreturns aSolverStep. The executor publishes counts and coherent progress, increments the iteration counter whencompletedis true, and updates the incumbent. - A step with
terminationstops with a report taggedTerminationStage::Step. Otherwise execution returns to step 2.
Because checks happen before iter 0, an already-optimal initial point exits immediately with the corresponding reason rather than taking one redundant step.
With Executor::require_evaluated_state, each successful init or
next_iter return is checked for a complete record before bookkeeping or
observation, including clean mid-step stops. Restored checkpoints are also
validated before observation. Missing records panic as solver contract
violations; hard problem errors bypass publication and validation.
Executor::resume restores state-carried evolution data and evaluation
counters, while Executor::resume_from_checkpoint restores the solver,
state, and counters from an ExactCheckpoint and skips init.
Consume a paused stepper with Stepper::into_checkpoint, or retain the
final solver and raw counters with Executor::run_with_solver.
Structs§
- Cancellation
Token - Shared, one-shot signal for stopping an
Executorbetween iterations. - Executor
- User-facing driver. Owns the problem, solver, initial state, and the
execution controls;
rundrives the iteration loop to completion. See the module docs for the canonical ordering andinto_stepperfor one-step-at-a- time control. - Optimization
Result - Outcome of an optimization run.
- Optimization
Result With Solver - Outcome of an optimization run that retains the final solver by ownership.
- Stepper
- Drive a solver one iteration at a time.
Enums§
- Step
Outcome - Outcome of a single
Stepper::stepcall.
Functions§
- run_
loop_ with_ control - Drive a borrowed solver using execution budgets and application stops.